/* Hollen PC, styled after Høl|dex's own screens (bots/Holdex/src/ui):
   drawn on a 2px pixel grid, Pixel Operator text with a 1-pixel shadow,
   cream windows with a dark border and a pale inner ring, slate title bars,
   FireRed party cards. Light by default; dark is Discord's #2B2D31. */

/* FireRed's own text font (Assets/tools/rom_font.py), 16px a glyph and drawn
   at 2× (32px); Pixel Operator, shrunk to match, for characters FireRed
   doesn't have. Text is never faux-bolded: FireRed has no bold. */
@font-face { font-family: "FRLG"; src: url("/fonts/HollenFRLG.ttf"); }
@font-face { font-family: "Pixel"; src: url("/fonts/PixelOperator8.ttf"); size-adjust: 50%; }

:root {
  --page: #E8E8E0;
  --page-2: #E0E0D8;
  --bar: #2C3C5C;
  --bar-edge: #5878A8;
  --bar-dark: #18223A;
  --paper: #F8F8F0;
  --paper-dim: #E8E8E0;
  --border: #505870;
  --ring: #B8C8D8;
  --ink: #404048;
  --ink-shadow: #D0D0C8;
  --muted: #8C8C98;
  --muted-shadow: #E0E0D8;
  --light: #F8F8F8;
  --hl: #F8E8B0;
  --cursor: #E84838;
  --up: #E04030;
  --down: #3060D8;
  --gold: #F8D048;
  --gold-dark: #B88818;
  --note: #304870;
  --note-border: #182040;
  --note-ring: #6888C8;
  --track: #D8D8D0;
  --track-edge: #C8C8C0;
  --fill: #58A8E8;
  --sprite-a: #E4DEF0;
  --sprite-b: #DAD2EA;
  --slot-line: rgba(255, 255, 255, .32);
  --slot-fill: rgba(0, 0, 0, .06);
  --pc-a: #3C7060; --pc-b: #346454;
  --bag-a: #E8A858; --bag-b: #E09C4C;
  --trade-a: #8878B8; --trade-b: #8070B0;
  --dex-a: #E05848; --dex-b: #D84C3C;
  --p: 2px;
  --corners: polygon(0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px));
}

:root[data-theme="dark"] {
  --page: #2B2D31;
  --page-2: #2F3136;
  --bar: #1E1F22;
  --bar-edge: #3F4147;
  --bar-dark: #111214;
  --paper: #383A40;
  --paper-dim: #313338;
  --border: #1E1F22;
  --ring: #4E5058;
  --ink: #F2F3F5;
  --ink-shadow: #1E1F22;
  --muted: #B5BAC1;
  --muted-shadow: #1E1F22;
  --hl: #4D4636;
  --track: #2B2D31;
  --track-edge: #1E1F22;
  --up: #F07060;
  --down: #7AA2F8;
  --sprite-a: #3B3650;
  --sprite-b: #36314B;
  --pc-a: #2C4A42; --pc-b: #28433C;
  --bag-a: #6A4E30; --bag-b: #62482C;
  --trade-a: #3E3858; --trade-b: #3A3452;
  --dex-a: #5A2E2A; --dex-b: #542A26;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: conic-gradient(at 2px 2px, transparent 75%, var(--page-2) 0) 0 0 / 8px 8px, var(--page);
  color: var(--ink);
  font: 32px/32px "FRLG", "Pixel", ui-monospace, monospace;
  font-synthesis: none;
  text-shadow: var(--p) var(--p) 0 var(--ink-shadow);
  min-height: 100vh;
  -webkit-font-smoothing: none;
}
img { image-rendering: pixelated; }
button { font: inherit; color: inherit; text-shadow: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
[hidden] { display: none !important; }
b { font-weight: bold; }
.light { color: var(--light); text-shadow: var(--p) var(--p) 0 var(--bar-dark); }
.muted { color: var(--muted); text-shadow: var(--p) var(--p) 0 var(--muted-shadow); }
img.gender { width: 14px; height: 18px; margin-left: 4px; vertical-align: -2px; }
img.star { width: 14px; height: 14px; vertical-align: 0; }
.gold { color: var(--gold); text-shadow: var(--p) var(--p) 0 var(--bar-dark); }

/* ---- title bars (top bar, window headers) ---- */
.titlebar {
  background: var(--bar);
  box-shadow: inset 0 -2px 0 var(--bar-edge);
  border-bottom: 2px solid var(--bar-dark);
  color: var(--light); text-shadow: var(--p) var(--p) 0 var(--bar-dark);
}
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 20px 10px; position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: bold; color: var(--light); text-decoration: none; }
.brand img { width: 20px; height: 20px; }
.tabs { display: flex; gap: 6px; align-items: flex-start; }
.group { position: relative; }
.group .menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 140px;
  flex-direction: column; gap: 4px; padding: 6px; background: var(--bar); border: 2px solid var(--bar-dark);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25); clip-path: var(--corners);
}
.group.open .menu { display: flex; }
@media (hover: hover) { .group:hover .menu { display: flex; } .group:hover { padding-bottom: 6px; margin-bottom: -6px; } }
.group .menu .pill { text-align: left; }
.achievements { list-style: none; margin: 0; padding: 6px 12px 12px; display: grid; gap: 6px; }
.achievements li { display: grid; gap: 2px; color: var(--muted, #909098); }
.achievements li.earned { color: var(--ink); }
.achievements small { font-size: 16px; line-height: 16px; opacity: .8; }
.trainerlink { display: block; text-align: right; margin: -2px 12px 4px; font-size: 16px; color: var(--muted, #808088); }
.pill {
  background: #4A5A84; border: 2px solid var(--bar-dark); padding: 2px 10px 4px;
  color: var(--light); text-shadow: var(--p) var(--p) 0 var(--bar-dark);
  clip-path: var(--corners);
}
.pill:hover { background: #5A6C98; }
.pill.on { background: var(--gold); color: var(--ink); text-shadow: var(--p) var(--p) 0 #F8F0C0; }
:root[data-theme="dark"] .pill.on { color: #404048; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who .avatar { width: 28px; height: 28px; clip-path: var(--corners); }
select {
  font: 32px/28px "FRLG", "Pixel", monospace; color: var(--light); background: #4A5A84;
  border: 2px solid var(--bar-dark); padding: 2px 6px; clip-path: var(--corners);
}

.banner { padding: 8px 20px; }

main { padding: 20px; max-width: 1320px; margin: 0 auto; }
.loading { text-align: center; margin-top: 20vh; }
.loading::after { content: " ▶"; color: #E04040; animation: blink 0.8s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* ---- windows ---- */
.win {
  background: var(--paper); border: 2px solid var(--border);
  box-shadow: inset 0 0 0 2px var(--ring);
  clip-path: var(--corners);
}
.win > .head {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 8px;
  font-weight: bold; text-transform: uppercase;
}
.win > .head img { width: 20px; height: 20px; }
.win > .head .right { margin-left: auto; font-weight: normal; text-transform: none; }
.note {
  background: var(--note); border: 2px solid var(--note-border); box-shadow: inset 0 0 0 2px var(--note-ring);
  color: var(--light); text-shadow: var(--p) var(--p) 0 var(--note-border);
  clip-path: var(--corners); padding: 10px 14px;
}

/* screen backgrounds, as on the Discord screens */
/* Each tab's pattern fills the whole page behind its windows. */
.screen { padding: 0; }
body:has(.screen.pc) { background: conic-gradient(at 4px 4px, transparent 75%, var(--pc-b) 0) 0 0 / 12px 12px, var(--pc-a); }
body:has(.screen.bag) { background: repeating-linear-gradient(45deg, var(--bag-a) 0 8px, var(--bag-b) 8px 16px); }
body:has(.screen.house) { background: repeating-linear-gradient(90deg, var(--bag-a) 0 12px, var(--bag-b) 12px 24px); }
.house .cols { grid-template-columns: minmax(0, 1fr) 320px 320px; }
.house .garden { display: block; width: calc(100% - 24px); margin: 12px; image-rendering: pixelated; border: 2px solid var(--bar-dark); }
.house .items .q small { font-size: 16px; line-height: 16px; margin-right: 2px; }
.infobtn {
  width: 24px; height: 24px; padding: 0; margin-left: 6px; vertical-align: middle; line-height: 20px; font-size: 16px;
  background: var(--paper); color: var(--ink); text-shadow: none; border: 2px solid var(--bar-dark); border-radius: 50%;
}
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.swatches button {
  aspect-ratio: 1; background: 0 0 / 64px 64px repeat; image-rendering: pixelated; border: 2px solid var(--border); padding: 0;
  display: flex; align-items: flex-end;
}
.swatches.walls-sw button { aspect-ratio: 1; background-size: 32px 64px; background-repeat: repeat-x; background-color: var(--paper-dim); }
.swatches button span { width: 100%; background: rgba(0, 0, 0, .55); color: var(--light); text-shadow: none; font-size: 16px; line-height: 16px; }
.swatches button.on { outline: 4px solid var(--cursor); outline-offset: -2px; }
dialog:has(.swatches) { width: min(560px, calc(100vw - 32px)); }
.house .pickselect { width: 100%; max-width: 100%; min-width: 0; }
.house .qty { min-width: 0; }
.house-room .room { display: block; width: calc(100% - 24px); margin: 12px; image-rendering: pixelated; border: 2px solid var(--bar-dark); }
@media (max-width: 1150px) { .house .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .house .cols > .house-room { grid-column: 1 / -1; } }
@media (max-width: 720px) { .house .cols { grid-template-columns: minmax(0, 1fr); } }
body:has(.screen.gts) { background: conic-gradient(at 4px 4px, transparent 75%, var(--trade-b) 0) 0 0 / 12px 12px, var(--trade-a); }
body:has(.screen.svc) { background: repeating-linear-gradient(-45deg, var(--trade-a) 0 8px, var(--trade-b) 8px 16px); }
.stack { display: grid; gap: 16px; align-content: start; }
.daycare-mon { margin: 8px 12px; }
.daycare-mon .btn { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
.eggs { list-style: none; margin: 0 12px 10px; padding: 0; display: grid; gap: 4px; }
.qty { display: flex; gap: 8px; align-items: center; margin: 8px 12px; }
.qty input[type="number"] { width: 120px; }
.qty input:not([type]) { flex: 1; }
.screen.trade { display: grid; gap: 16px; }
body:has(.screen.trade) { background: repeating-linear-gradient(-45deg, var(--trade-a) 0 8px, var(--trade-b) 8px 16px); }
body:has(.screen.dex) { background: conic-gradient(at 4px 4px, transparent 75%, var(--dex-b) 0) 0 0 / 12px 12px, var(--dex-a); }
.dex .cols { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 900px) { .dex .cols { grid-template-columns: minmax(0, 1fr); } }
.dexbar { display: flex; gap: 8px; padding: 6px 10px; flex-wrap: wrap; }
.dexbar input { flex: 1; min-width: 140px; text-align: left; font-weight: normal; }
.dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 4px; padding: 6px 10px 12px; max-height: 70vh; overflow-y: auto; }
.dexgrid .slot { border-color: var(--ring); background: var(--paper-dim); padding: 0; cursor: pointer; }
.dexgrid .slot .n { color: var(--muted); text-shadow: none; }
.dexgrid .slot.unseen img { filter: brightness(0) opacity(.35); }
.dexgrid .slot:hover { background: var(--hl); }
.dex .spritebox { position: relative; }
.dexcell { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .8; }
.item-hero { position: relative; }
.bagcell { position: absolute; left: 50px; top: 2px; width: 20px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .85; z-index: 1; }
.bagcell img { width: 20px; height: 20px; image-rendering: pixelated; animation: dexcell 2.4s ease-in-out infinite; }
.bagcell:hover { opacity: 1; }
.spritebox .dexcell img { width: 18px; height: 18px; image-rendering: pixelated; animation: dexcell 2.4s ease-in-out infinite; }
.dexcell:hover { opacity: 1; }
@keyframes dexcell { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.tcols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tlist { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 720px) { .tcols, .tlist { grid-template-columns: minmax(0, 1fr); } }
.tradebar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.tradebar .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; padding: 8px 10px 12px; }
.pickgrid .slot { border-color: var(--ring); background: var(--paper-dim); padding: 0; }
.pickgrid .slot.off { opacity: .35; cursor: not-allowed; }
.pickgrid .slot:hover:not(.off) { background: var(--hl); }
.pickselect { color: var(--ink); background: var(--paper); border: 2px solid var(--border); text-shadow: none; }

.cols { display: grid; gap: 16px; align-items: start; }
.pc .cols { grid-template-columns: 250px minmax(0, 1fr) 360px; }
.bag .cols { grid-template-columns: 200px minmax(0, 1fr) 360px; }
.shop .cols, .svc .cols, .gts .cols { grid-template-columns: 240px minmax(0, 1fr) 360px; }
.gts .cols:has(> :nth-child(2):last-child) { grid-template-columns: 240px minmax(0, 520px); }
.svc .cols:has(> :nth-child(2):last-child) { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 1150px) {
  .pc .cols { grid-template-columns: 240px minmax(0, 1fr); }
  .pc .cols > .detail { grid-column: 1 / -1; }
  .bag .cols { grid-template-columns: 200px minmax(0, 1fr); }
  .bag .cols > .detail { grid-column: 1 / -1; }
  .shop .cols, .svc .cols, .gts .cols { grid-template-columns: 220px minmax(0, 1fr); }
  .shop .cols > .detail, .svc .cols > .detail, .gts .cols > .detail:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  main { padding: 10px 0; }
  .screen { padding: 10px 16px; border-left: 0; border-right: 0; }
  .pc .cols, .bag .cols, .shop .cols, .svc .cols, .gts .cols { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 8px 16px 10px; }
  .who { width: 100%; margin-left: 0; }
}

/* ---- party cards ---- */
.party-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 4px 8px 10px; }
.card {
  --top: #5890D8; --bottom: #4478C0; --edge: #1C3060; --rim: #90B8F0; --shade: #203868;
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 0 6px; align-items: center;
  min-height: 60px; padding: 4px 8px 8px 4px;
  background: linear-gradient(var(--top) 50%, var(--bottom) 50%);
  border: 2px solid var(--edge); box-shadow: inset 0 0 0 2px var(--rim), inset 0 -4px 0 var(--shade);
  clip-path: var(--corners);
  color: var(--light); text-shadow: var(--p) var(--p) 0 var(--shade);
  touch-action: none; user-select: none;
}
button.card { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.card.sel { --top: #F89850; --bottom: #E07830; --edge: #782810; --rim: #F8D098; --shade: #883818; }
.card.empty { background: var(--paper-dim); border: 2px solid var(--ring); box-shadow: none; min-height: 60px; }
.card .icon { width: 40px; height: 30px; grid-row: span 2; }
.card .nm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card .lv { text-align: right; white-space: nowrap; }
/* A small "Lv", as FireRed's party screen draws it, so names have room. */
.card .lv small { font-size: 16px; line-height: 16px; margin-right: 2px; }
.card .pills { display: flex; gap: 2px; grid-column: 2 / -1; }
.card .pills img { width: 72px; height: 22px; }
.card .held { position: absolute; left: 30px; top: 30px; width: 18px; height: 18px; }
.card .shiny, .slot .shiny { position: absolute; line-height: 0; }
.card .shiny { left: 6px; top: 2px; }

/* ---- box ---- */
.boxwin { padding: 0 0 10px; }
/* A FireRed box: the wallpaper (160×144) drawn whole, the name and arrows
   on its strip (the top 24 rows), the grid inside the body's frame. */
.pcbox {
  aspect-ratio: 160 / 144; margin: 10px 10px 0; display: flex; flex-direction: column;
  background: 0 0 / 100% 100% no-repeat; image-rendering: pixelated;
}
.boxhead { display: flex; align-items: center; gap: 8px; height: calc(100% * 24 / 144); padding: 0 11%; }
.boxhead .name { flex: 1; text-align: center; }
.boxhead .boxname { color: #383840; text-shadow: 2px 2px 0 rgba(255, 255, 255, .7); background: none; border: 0; padding: 0; text-transform: uppercase; }
.pcbox .arrow { border-top-width: 16px; border-bottom-width: 16px; filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff); }
.pcbox .arrow.prev { border-right-width: 22px; }
.pcbox .arrow.next { border-left-width: 22px; }
.boxtools { display: flex; gap: 8px; padding: 10px 10px 0; flex-wrap: wrap; }
.boxof { text-align: center; margin: 6px 0 10px; }
.jumpgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-height: 60vh; overflow: auto; }
.jumpgrid button {
  aspect-ratio: 160 / 144; background: 0 0 / 100% 100%; image-rendering: pixelated; border: 2px solid var(--border); padding: 0;
  display: flex; flex-direction: column; justify-content: flex-end; color: var(--light); text-shadow: 2px 2px 0 #000;
}
.jumpgrid button span, .jumpgrid button small { background: rgba(0, 0, 0, .5); font-size: 16px; line-height: 16px; }
.jumpgrid button.on { outline: 4px solid var(--cursor); outline-offset: -2px; }
.jumpgrid .buybox { background: var(--paper-dim); color: var(--ink); text-shadow: none; justify-content: center; border-style: dashed; }
.jumpgrid .buybox b { font-size: 64px; line-height: 64px; font-weight: normal; }
.jumpgrid .buybox small { background: none; }
dialog:has(.jumpgrid) { width: min(760px, calc(100vw - 32px)); }
.boxname { background: none; border: 0; padding: 2px 10px; font-weight: bold; text-transform: uppercase; }
.boxname:hover { background: var(--hl); }
.boxname-edit { font: 32px/28px "FRLG", "Pixel", monospace; text-align: center; width: 220px; color: var(--ink); background: var(--paper); border: 2px solid var(--border); padding: 2px 6px; }
.arrow {
  width: 0; height: 0; padding: 0; background: none; border: 0;
  border-top: 10px solid transparent; border-bottom: 10px solid transparent; margin: 0 6px;
}
.arrow.prev { border-right: 12px solid var(--cursor); }
.arrow.next { border-left: 12px solid var(--cursor); }
.arrow:hover { filter: brightness(1.15); }
.grid {
  flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(5, 1fr);
  gap: 2px; padding: 4.5% 5.5%;
}
.pcbox .slot { aspect-ratio: auto; min-height: 0; }
.slot {
  aspect-ratio: 4 / 3; position: relative; display: grid; place-items: center;
  border: 2px solid var(--slot-line); background: var(--slot-fill);
  touch-action: none; user-select: none;
}
.slot .n { position: absolute; left: 3px; top: 1px; font-size: 16px; line-height: 16px; color: var(--light); text-shadow: 1px 1px 0 rgba(0,0,0,.6); opacity: .85; }
.slot img.icon { width: 80px; max-width: 100%; }
.slot .shiny { right: 3px; top: 0; }
.mon { cursor: grab; }
.slot.mon:hover { background: rgba(255, 255, 255, .22); }
.slot.sel { border-color: var(--gold); background: rgba(248, 208, 72, .28); }
.drop { outline: 2px solid var(--cursor) !important; outline-offset: -2px; background: rgba(232, 72, 56, .22) !important; }
.boxstrip { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 10px 0; }
.boxstrip button {
  width: 44px; padding: 2px 0 4px; background: var(--paper-dim); border: 2px solid var(--border);
  clip-path: var(--corners); line-height: 16px;
}
.boxstrip button small { display: block; font-size: 16px; line-height: 16px; color: var(--muted); text-shadow: none; }
.boxstrip button:hover { background: var(--hl); }
.boxstrip button.on { background: var(--gold); color: #404048; text-shadow: var(--p) var(--p) 0 #F8F0C0; }
.boxstrip button.on small { color: #6A5A20; }
.walls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.walls button { aspect-ratio: 6 / 5; background-size: cover; border: 2px solid var(--border); padding: 0; display: flex; align-items: flex-end; }
.walls button.on { outline: 2px solid var(--cursor); outline-offset: 0; }
.walls span { width: 100%; background: rgba(0, 0, 0, .55); font-size: 16px; line-height: 16px; color: var(--light); text-shadow: none; text-transform: uppercase; }
.ghostdrag { position: fixed; pointer-events: none; z-index: 50; width: 80px; transform: translate(-50%, -60%); }

/* ---- summary ---- */
.detail .empty-note { padding: 24px 16px 28px; text-align: center; }
.hero-mon { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 6px 12px 4px; align-items: center; }
.spritebox {
  width: 112px; height: 112px; display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, var(--sprite-a) 0 6px, var(--sprite-b) 6px 12px);
  border: 2px solid var(--border); box-shadow: inset 0 0 0 2px var(--ring);
}
.spritebox img { width: 96px; height: 96px; }
.hero-mon .nm { font-weight: bold; word-break: break-word; }
.types { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.types img { width: 72px; height: 22px; }
.rows { margin: 6px 12px; border-top: 2px solid var(--paper-dim); }
.rows > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px 0; border-bottom: 2px solid var(--paper-dim); }
.rows dd { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; }
.rows img { width: 24px; height: 24px; }
.sub { margin: 10px 12px 4px; font-weight: bold; text-transform: uppercase; }
.moves { margin: 0 12px; }
.moves div { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 2px solid var(--paper-dim); }
.moves img { width: 72px; height: 22px; flex: none; }
.stats { margin: 0 12px; }
.stat { display: grid; grid-template-columns: 40px 36px minmax(0, 1fr) 64px; gap: 8px; align-items: center; padding: 2px 0; }
.stat .v { text-align: right; }
.stat .iv { text-align: right; }
.bar { height: 8px; background: var(--track); box-shadow: inset 0 -2px 0 var(--track-edge); }
.bar i { display: block; height: 100%; background: var(--fill); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), inset 0 -2px 0 rgba(0,0,0,.25); }
.up { color: var(--up); } .down { color: var(--down); }

/* ---- buttons ---- */
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 12px 12px; }
.btn {
  background: var(--paper); border: 2px solid var(--border); box-shadow: inset 0 0 0 2px var(--ring), inset 0 -4px 0 var(--paper-dim);
  padding: 4px 12px 8px; clip-path: var(--corners);
}
.btn:hover:not(:disabled) { background: var(--hl); }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn.go { background: var(--gold); border-color: var(--gold-dark); box-shadow: inset 0 0 0 2px #F8E890, inset 0 -4px 0 #E0B030; color: #404048; text-shadow: var(--p) var(--p) 0 #F8F0C0; }
.btn.danger { color: var(--up); }
.linkbtn { background: none; border: 0; padding: 0 2px; color: var(--down); text-decoration: underline; text-underline-offset: 3px; }

/* ---- bag ---- */
.pockets { display: grid; gap: 2px; padding: 2px 8px 10px; }
@media (max-width: 720px) { .pockets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.list button {
  position: relative; width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  background: none; border: 0; padding: 4px 8px 4px 22px;
}
.list button:hover { background: var(--paper-dim); }
.list button.on { background: var(--hl); }
.list button.on::before {
  content: ""; position: absolute; left: 6px; top: 50%; width: 8px; height: 12px; margin-top: -6px;
  background: var(--cursor); clip-path: polygon(0 0, 2px 0, 2px 2px, 4px 2px, 4px 4px, 6px 4px, 6px 6px, 8px 6px, 8px 6px, 6px 6px, 6px 8px, 4px 8px, 4px 10px, 2px 10px, 2px 12px, 0 12px);
}
.list .q { margin-left: auto; }
.items { list-style: none; margin: 0; padding: 2px 8px 10px; }
.items img { width: 24px; height: 24px; }
.item-hero { display: flex; gap: 12px; align-items: center; padding: 6px 12px; }
.iconbox { width: 56px; height: 56px; display: grid; place-items: center; background: #E8EEF4; border: 2px solid #C8D4E0; clip-path: var(--corners); }
:root[data-theme="dark"] .iconbox { background: var(--paper-dim); border-color: var(--ring); }
.iconbox img { width: 48px; height: 48px; }
.detail .note { margin: 6px 12px; }
.when { margin: 8px 12px 0; padding: 6px 10px; border-left: 4px solid var(--cursor); background: var(--paper-dim); }
.none { padding: 10px 14px 14px; }

/* ---- dialog & toasts ---- */
dialog {
  background: var(--paper); color: var(--ink); border: 2px solid var(--border); box-shadow: inset 0 0 0 2px var(--ring);
  padding: 16px; width: min(440px, calc(100vw - 32px)); clip-path: var(--corners);
}
dialog:has(.cardimg) { width: min(680px, calc(100vw - 32px)); }
.cardimg { display: block; width: 100%; image-rendering: pixelated; }
dialog::backdrop { background: rgba(10, 12, 20, .55); }
dialog h3 { font-size: 32px; margin: 0 0 10px; }
dialog p { margin: 0 0 8px; }
dialog .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.pick { display: grid; gap: 6px; }
.pick .card { cursor: pointer; text-align: left; width: 100%; }
.toasts { position: fixed; bottom: 16px; right: 16px; display: grid; gap: 8px; z-index: 60; width: min(420px, calc(100vw - 32px)); }
.toast { white-space: pre-line; }
/* Toasts read like the dialogue box: cream paper, a teal frame. */
.toast:not(.err) { background: var(--paper); color: var(--ink); border-color: #406878; box-shadow: inset 0 0 0 2px #88C0C8; text-shadow: var(--p) var(--p) 0 #D8D8D0; }
:root[data-theme="dark"] .toast:not(.err) { background: #303440; color: #E8E8E0; text-shadow: none; }
.toast.err { background: #702820; border-color: #381010; box-shadow: inset 0 0 0 2px #C86050; text-shadow: var(--p) var(--p) 0 #381010; }

/* ---- login ---- */
.hero { max-width: 480px; margin: 12vh auto; text-align: center; padding: 0 16px; }
.hero .win { padding: 0 0 18px; }
.hero p { padding: 0 18px; }
.discord {
  display: inline-block; margin-top: 8px; padding: 6px 16px 10px; text-decoration: none;
  background: #5865F2; border: 2px solid #2A318C; box-shadow: inset 0 0 0 2px #8C95F8, inset 0 -4px 0 #3C45C8;
  color: #fff; text-shadow: var(--p) var(--p) 0 #2A318C; clip-path: var(--corners);
}

dialog .found { display: flex; gap: 12px; align-items: center; max-width: 420px; }
dialog .found img { width: 60px; height: 60px; image-rendering: pixelated; flex: none; }

/* ---- movable windows (grip, minimize) ---- */
.screen .win { position: relative; transition: transform .15s ease-out; }
.screen .win.dragging { transition: none; z-index: 30; box-shadow: inset 0 0 0 2px var(--ring), 0 8px 0 rgba(0, 0, 0, .25); }
.screen .win.moved { z-index: 10; }
.grip {
  width: 12px; height: 20px; flex: none; cursor: grab; touch-action: none; opacity: .7;
  background: radial-gradient(circle, var(--light) 1.5px, transparent 2px) 0 0 / 6px 6px;
}
.grip:hover { opacity: 1; }
.win.dragging .grip { cursor: grabbing; }
.minbtn {
  width: 24px; height: 24px; flex: none; padding: 0; background: #4A5A84;
  border: 2px solid var(--bar-dark); clip-path: var(--corners); position: relative;
}
.win > .head .minbtn { margin-left: auto; }
.win > .head .right ~ .minbtn { margin-left: 8px; }
.minbtn::before { content: ""; position: absolute; left: 5px; right: 5px; bottom: 5px; height: 3px; background: var(--light); }
.minbtn.up::before { bottom: auto; top: 6px; height: 0; left: 4px; right: 4px; background: none; border: 6px solid transparent; border-bottom: 7px solid var(--light); border-top: 0; }
.minbtn:hover { background: #5A6C98; }
.win.min > :not(.head) { display: none !important; }
