/* ---------------------------------------------------------------------------
   A playmat, not a dashboard.

   The whole surface is felt; zones are silkscreened onto it with dashed rules
   and corner ticks, the way a real mat marks out where cards go. Everything
   numeric is monospaced, because in a card game the numbers are the argument.
   Brass is reserved for exactly one thing: what is yours to act on right now.
--------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Archivo:wght@400;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* Interface size, set from the header. See initScale() in app.js. */
  --ui-scale: 1;
  --felt:        #1b3a34;
  --felt-deep:   #142b26;
  --felt-lift:   #234a42;
  --silk:        #6e9c8b;
  --silk-dim:    #47705f;
  --bone:        #f2ede1;
  --bone-dim:    #cfc7b6;
  --ink:         #10201c;
  --brass:       #d9a441;
  --brass-dim:   #8c6b2c;
  --alert:       #c8503f;
  --ok:          #6fae7c;

  --display: 'Archivo Black', system-ui, sans-serif;
  --label:   'Archivo', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;

  --gap: 14px;
  --radius: 7px;
  --card-w: 78px;
  --card-h: 109px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--felt-deep);
  color: var(--bone);
  font-family: var(--label);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 50% 0%, #23483f 0%, var(--felt-deep) 70%);
}

button, input, select, textarea { font: inherit; color: inherit; }

/* --- shared bits ---------------------------------------------------------- */

.eyebrow {
  font-family: var(--label);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--silk);
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: 30px; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.btn {
  font-family: var(--label);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--silk-dim);
  background: var(--felt-lift);
  color: var(--bone);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.btn:hover:not(:disabled) { background: #2c5b51; border-color: var(--silk); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.btn.primary {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--ink);
}
.btn.primary:hover:not(:disabled) { background: #ecb95a; border-color: #ecb95a; }
.btn.danger { border-color: var(--alert); color: #f0a99e; }
.btn.tiny { padding: 5px 9px; font-size: 10px; }

.field {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--silk-dim);
  background: rgba(0,0,0,.22);
  color: var(--bone);
}
.field:focus { outline: 2px solid var(--brass); outline-offset: 0; border-color: transparent; }
.field::placeholder { color: var(--silk-dim); }

.panel {
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(110,156,139,.24);
  border-radius: 10px;
  padding: 16px;
}

.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--silk); }
.hidden { display: none !important; }

/* --- app shell ------------------------------------------------------------ */

#app { display: flex; flex-direction: column; min-height: 100%; }

header.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(110,156,139,.22);
  background: rgba(0,0,0,.24);
  position: sticky;
  top: 0;
  z-index: 40;
}
header.bar .brand { font-family: var(--display); font-size: 16px; letter-spacing: .02em; }
header.bar .brand span { color: var(--brass); }

.tabs { display: flex; gap: 4px; }
.tab {
  border: none;
  background: none;
  padding: 7px 13px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--silk);
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--felt-lift); color: var(--bone); }

main { flex: 1; padding: 22px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* --- lobby ---------------------------------------------------------------- */

.lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
  align-items: start;
}

.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0,0,0,.2);
  border: 1px solid transparent;
}
.list-item:hover { border-color: rgba(110,156,139,.35); }
.list-item.selected { border-color: var(--brass); background: rgba(217,164,65,.1); }

.rules-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px 18px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 6px;
}
.rules-editor label { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
.rules-editor input[type=number] { width: 74px; text-align: right; }
.rules-group-title { grid-column: 1 / -1; margin-top: 6px; }

/* --- cards ---------------------------------------------------------------- */

.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--radius);
  background: var(--bone);
  color: var(--ink);
  border: 1px solid rgba(0,0,0,.4);
  box-shadow: 0 2px 5px rgba(0,0,0,.4);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .fallback {
  padding: 6px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9px;
  line-height: 1.15;
}
.card .fallback strong { font-size: 10px; }
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0,0,0,.5); z-index: 5; }
.card.selected { outline: 2px solid var(--brass); outline-offset: 1px; }
.card.back {
  background: repeating-linear-gradient(45deg, #2a4f6d 0 6px, #24455f 6px 12px);
  border-color: #14273a;
}

.card-badge {
  position: absolute;
  bottom: 3px; right: 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(16,32,28,.86);
  color: var(--bone);
}

/* --- the mat -------------------------------------------------------------- */

.table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--gap);
  align-items: start;
}

.mat {
  background:
    linear-gradient(rgba(255,255,255,.02), rgba(0,0,0,.12)),
    var(--felt);
  border: 1px solid var(--silk-dim);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

/* the centre line of a real mat */
.mat .centerline {
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--silk-dim) 0 10px, transparent 10px 20px);
  margin: 2px 0;
  position: relative;
}
.mat .centerline span {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  background: var(--felt);
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--silk-dim);
}

.side { display: flex; gap: 14px; align-items: flex-start; }
.side.flip { flex-direction: row-reverse; }

/* silkscreened zone outlines with corner ticks */
.zone {
  border: 1px dashed rgba(110,156,139,.4);
  border-radius: 8px;
  padding: 8px;
  position: relative;
  min-height: calc(var(--card-h) + 30px);
}
.zone::before, .zone::after {
  content: '';
  position: absolute;
  width: 9px; height: 9px;
  border-color: var(--silk-dim);
  border-style: solid;
}
.zone::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-top-left-radius: 8px; }
.zone::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-bottom-right-radius: 8px; }
.zone > .eyebrow { position: absolute; top: -7px; left: 10px; background: var(--felt); padding: 0 6px; }
.zone.bench { flex: 1; }
.zone-body { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; min-height: var(--card-h); }
.zone-body.empty::after {
  content: attr(data-empty);
  color: var(--silk-dim);
  font-size: 12px;
  align-self: center;
}

.active-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* the one place brass appears on the mat */
.card.is-active-target { outline: 2px solid var(--brass); outline-offset: 2px; }

.pokemon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hpbar {
  width: var(--card-w);
  height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,.45);
  overflow: hidden;
}
.hpbar i { display: block; height: 100%; background: var(--ok); transition: width .25s ease; }
.hpbar.hurt i { background: var(--brass); }
.hpbar.critical i { background: var(--alert); }
.hptext { font-family: var(--mono); font-size: 10px; color: var(--bone-dim); }

.attached { display: flex; gap: 2px; margin-top: 2px; }
.pip {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.5);
  background: var(--bone-dim);
  font-size: 8px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: var(--mono);
}

.status-tags { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.status-tag {
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--alert);
  color: var(--bone);
}
.status-tag.asleep { background: #5a6f9c; }
.status-tag.paralyzed { background: var(--brass-dim); }
.status-tag.confused { background: #7d5a9c; }
.status-tag.poisoned { background: #5f8c4a; }

/* prizes: a stack of brass-edged face-down cards */
.prizes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; align-content: start; }
.prize {
  width: 26px; height: 36px;
  border-radius: 4px;
  background: repeating-linear-gradient(45deg, #2a4f6d 0 4px, #24455f 4px 8px);
  border: 1px solid var(--brass-dim);
  box-shadow: inset 0 0 0 1px rgba(217,164,65,.25);
}
.prize.taken { background: none; border-style: dotted; border-color: var(--silk-dim); box-shadow: none; }

.pile { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pile .count { font-family: var(--mono); font-size: 12px; }
.pile .stub {
  width: 44px; height: 62px;
  border-radius: 5px;
  border: 1px dashed var(--silk-dim);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
}
.pile .stub.deck { background: repeating-linear-gradient(45deg,#2a4f6d 0 5px,#24455f 5px 10px); border-style: solid; border-color: #14273a; }

/* --- hand ----------------------------------------------------------------- */

.hand-rail {
  border-top: 1px solid rgba(110,156,139,.22);
  background: rgba(0,0,0,.3);
  padding: 12px 16px;
  border-radius: 12px;
}
.hand { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px 10px; }
.hand .card { transition: transform .14s ease; }
.hand .card:hover { transform: translateY(-10px); }

/* --- side rail ------------------------------------------------------------ */

.rail { display: flex; flex-direction: column; gap: var(--gap); position: sticky; top: 78px; }

.turn-flag {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--silk-dim);
  background: rgba(0,0,0,.24);
}
.turn-flag.yours { border-color: var(--brass); background: rgba(217,164,65,.12); }
.turn-flag .who { font-family: var(--display); font-size: 17px; }

/* scorekeeper's tape */
.tape {
  background: rgba(0,0,0,.32);
  border: 1px solid rgba(110,156,139,.22);
  border-radius: 10px;
  padding: 10px 12px;
  height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
}
.tape-line {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  padding: 2px 0;
  color: var(--bone-dim);
  border-bottom: 1px dotted rgba(110,156,139,.16);
}
.tape-line .t { color: var(--silk-dim); margin-right: 6px; }
.tape-line.k-damage { color: #f0a99e; }
.tape-line.k-ko { color: var(--alert); font-weight: 600; }
.tape-line.k-prize, .tape-line.k-win { color: var(--brass); font-weight: 600; }
.tape-line.k-turn { color: var(--bone); font-weight: 600; border-bottom-color: var(--silk-dim); }
.tape-line.k-flip { color: #c9dcd2; }
.tape-line.k-manual { color: #d9b9e0; }

.attack-list { display: flex; flex-direction: column; gap: 8px; }
.attack {
  text-align: left;
  border: 1px solid var(--silk-dim);
  background: rgba(0,0,0,.2);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  width: 100%;
}
.attack:hover:not(:disabled) { border-color: var(--brass); }
.attack:disabled { opacity: .45; cursor: not-allowed; }
.attack .name { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.attack .dmg { font-family: var(--mono); color: var(--brass); }
.attack .cost { font-family: var(--mono); font-size: 10px; color: var(--silk); }
.attack .why { font-size: 11px; color: var(--alert); }
.attack .hand-flag { font-size: 10px; color: #d9b9e0; }

/* --- modal / prompt ------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(8,18,16,.78);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--felt);
  border: 1px solid var(--silk);
  border-radius: 12px;
  padding: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 84vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.modal.prompt { border-color: var(--brass); }

.option-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.option {
  border: 1px solid var(--silk-dim);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(0,0,0,.2);
  cursor: pointer;
  text-align: left;
}
.option:hover { border-color: var(--brass); }

/* --- deck builder --------------------------------------------------------- */

.builder { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: var(--gap); align-items: start; }
.card-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  max-height: 66vh;
  overflow-y: auto;
  padding: 4px;
}
.result { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.result .cap { font-size: 10px; text-align: center; color: var(--bone-dim); line-height: 1.2; }

/* No inner scrollbar. A sixty-card list is thirty-odd lines, and scrolling
   the page is what the wheel does anyway wherever the cursor happens to be. */
.deck-lines { display: flex; flex-direction: column; gap: 3px; }
.deck-line { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 5px; }
.deck-line:hover { background: rgba(0,0,0,.24); }
.deck-line .n { font-family: var(--mono); color: var(--brass); width: 22px; }
.deck-line .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.verdict { font-size: 12.5px; line-height: 1.5; }
.verdict .err { color: #f0a99e; }
.verdict .warn { color: var(--brass); }
.verdict .good { color: var(--ok); }

.toast {
  position: fixed;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  background: var(--felt-lift);
  border: 1px solid var(--brass);
  color: var(--bone);
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 200;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 1100px) {
  .table, .builder { grid-template-columns: minmax(0,1fr); }
  .rail { position: static; }
}
@media (max-width: 700px) {
  :root { --card-w: 58px; --card-h: 81px; }
  main { padding: 12px; }
  .side { gap: 8px; }
  header.bar { gap: 10px; padding: 10px 12px; }
  header.bar .brand { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Card art sits on top of a readable text face. If the image 404s or the
   machine is offline, app.js removes the <img> and the text shows through —
   so a card is always identifiable, never a blank rectangle. */
.card .fallback { position: absolute; inset: 0; }
.card img { position: relative; z-index: 1; }
.card.no-art img { display: none; }


/* --- readability ---------------------------------------------------------
   Card art at 150px is unreadable, which defeats the point of showing the
   real card. The detail view goes large and pulls the hi-res image; the rail
   carries a preview so you can read a card without opening anything. */

.card-hero { --card-w: 330px; --card-h: 462px; flex: 0 0 auto; }
.card-hero .card { box-shadow: 0 10px 30px rgba(0,0,0,.5); cursor: default; }
.card-hero .card:hover { transform: none; }
.card-hero .fallback { font-size: 15px; padding: 18px; }
.card-hero .fallback strong { font-size: 20px; }

.card-preview { --card-w: 100%; --card-h: auto; }
.card-preview .card { width: 100%; height: auto; aspect-ratio: 5 / 7; cursor: default; }
.card-preview .card:hover { transform: none; }

#preview { max-height: 70vh; overflow-y: auto; }
#preview .muted { font-size: 12.5px; }

.result { position: relative; }
.result .btn.tiny { padding: 2px 7px; font-size: 9px; }

@media (max-width: 800px) {
  /* A 330px card is most of a phone screen; step it down but keep it legible. */
  .card-hero { --card-w: min(78vw, 300px); --card-h: auto; }
  .card-hero .card { width: var(--card-w); height: auto; aspect-ratio: 5 / 7; }
  #preview { display: none; }
}


/* The Stadium belongs to neither player, so it lives on the centre line —
   the one part of the mat that is shared. */
.mat .centerline span { max-width: 70%; white-space: nowrap; overflow: hidden;
                        text-overflow: ellipsis; }
.mat .centerline span:hover { color: var(--brass); }


/* Build badge: small, quiet, always visible. Knowing which build is running
   turns "is that fixed?" into something you can answer. */
.build-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--silk-dim);
  background: rgba(0,0,0,.25);
  color: var(--silk);
  cursor: pointer;
}
.build-badge:hover { color: var(--brass); border-color: var(--brass); }


/* A card mid-resolution. You reach Board tools from its prompt, so without
   this there is nothing on screen saying what you were in the middle of. */
.resolving {
  border: 1px solid var(--brass);
  background: rgba(217,164,65,.1);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.5;
}
.resolving strong { display: block; margin-bottom: 4px; }


/* The plan a scripted card will follow, shown before you commit to it. */
.plan {
  border: 1px solid var(--silk-dim);
  border-left: 3px solid var(--brass);
  border-radius: 0 8px 8px 0;
  background: rgba(0,0,0,.2);
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 13px;
}
.plan ol { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; }
.plan.manual { border-left-color: var(--silk); color: var(--bone-dim); }


/* --- attached Energy ------------------------------------------------------
   Colour carries the type and a superscript carries the count, so a glance
   tells you whether an attack is payable without opening the card. */
.pip { font-weight: 600; position: relative; }
.pip i { font-style: normal; font-size: 7px; position: absolute; top: -3px; right: -4px;
         background: var(--ink); color: var(--bone); border-radius: 50%;
         width: 10px; height: 10px; display: grid; place-items: center; }
.pip.e-grass     { background: #7fb069; }
.pip.e-fire      { background: #e0654a; }
.pip.e-water     { background: #6aa9d8; }
.pip.e-lightning { background: #e8c547; }
.pip.e-psychic   { background: #a97fc4; }
.pip.e-fighting  { background: #c98a4b; }
.pip.e-darkness  { background: #4a5568; color: var(--bone); }
.pip.e-metal     { background: #9aa5b1; }
.pip.e-fairy     { background: #e6a0c4; }
.pip.e-dragon    { background: #b8a145; }
.pip.e-colorless, .pip.e-special { background: #e4dfd2; }
.pip.tool { background: var(--brass); }
.energy-count { font-size: 9px; color: var(--silk); }

/* --- Stadium --------------------------------------------------------------
   It belongs to neither player, so it sits on the centre line — but as an
   actual card you can read, not a caption. */
.stadium-zone {
  border: 1px dashed rgba(110,156,139,.45);
  border-radius: 8px;
  padding: 10px 12px 8px;
  margin: 4px auto 6px;
  max-width: 460px;
  position: relative;
  cursor: pointer;
}
.stadium-zone:hover { border-color: var(--brass); }
.stadium-zone > .eyebrow { position: absolute; top: -7px; left: 12px;
                           background: var(--felt); padding: 0 6px; }
.stadium-body { display: flex; gap: 12px; align-items: center; }
.stadium-body .card { --card-w: 52px; --card-h: 73px; }
.stadium-text { font-size: 12.5px; line-height: 1.45; }
.stadium-text .muted { font-size: 11.5px; }

@media (max-width: 700px) {
  .stadium-text .muted { display: none; }
}


/* A card you cannot legally play yet. Dimmed rather than hidden — you still
   need to see it is there, and hovering says why. */
.hand .unplayable .card { opacity: .42; filter: grayscale(.5); }
.hand .unplayable .card:hover { opacity: .75; }


/* Static modifiers, shown on the Pokemon they change. A Tool that silently
   alters a number is worse than no Tool at all. */
.buffs { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.buff {
  font-family: var(--mono);
  font-size: 8.5px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(217,164,65,.22);
  border: 1px solid var(--brass-dim);
  color: var(--bone);
}

/* What an attack would actually do, once Tools and Weakness are counted. */
.attack .dmg b { color: var(--ok); font-weight: 700; }
.attack .dmg b.lethal { color: var(--alert); }
.preview-steps {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--silk);
  margin-top: 3px;
}


/* A selected branch on a modal card. */
.option.selected { border-color: var(--brass); background: rgba(217,164,65,.12); }


/* A once-per-game power, and whether it is still available. */
.attack .cost b.once {
  color: var(--brass);
  font-size: 9px;
  border: 1px solid var(--brass-dim);
  border-radius: 3px;
  padding: 0 3px;
}


/* --- interface size ------------------------------------------------------
   `zoom` scales layout and text together and, unlike transform, keeps the
   document flow and scrollbars correct. Applied to the app shell rather than
   the root so overlays scale with it. */
#app, #overlay { zoom: var(--ui-scale); }

.scale-picker { display: flex; gap: 2px; margin-left: 6px; }
.scale-picker button {
  font-family: var(--mono);
  font-size: 10px;
  width: 20px;
  padding: 3px 0;
  border-radius: 4px;
  border: 1px solid var(--silk-dim);
  background: rgba(0,0,0,.25);
  color: var(--silk);
  cursor: pointer;
}
.scale-picker button:hover { color: var(--brass); border-color: var(--brass); }
.scale-picker button.on { color: var(--ink); background: var(--brass); border-color: var(--brass); }

@media (max-width: 700px) { .scale-picker { display: none; } }


/* --- board layout --------------------------------------------------------
   Active centred, Bench centred beneath it. Prizes and piles sit at the outer
   edges so they never push the Pokemon off-centre. The flipped side mirrors
   vertically so both players read from their own edge inward. */
.side {
  display: grid;
  grid-template-columns: minmax(64px, auto) 1fr minmax(64px, auto);
  align-items: start;
  gap: 14px;
}
.side-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.side.flip .side-centre { flex-direction: column-reverse; }

.side-centre .zone { width: 100%; }
.side-centre .zone-body { justify-content: center; flex-wrap: wrap; }
.side-centre .active-zone .zone-body { justify-content: center; }
.side-centre .bench .zone-body { gap: 8px; }

.side-edge { display: flex; flex-direction: column; gap: 4px; }
.side-edge.right { align-items: flex-end; }
.side-edge .piles { display: flex; gap: 10px; padding-top: 6px; }
.side-edge .prizes { padding-top: 6px; }

@media (max-width: 900px) {
  .side { grid-template-columns: auto 1fr auto; gap: 8px; }
  .side-edge .eyebrow { display: none; }
}


/* Splitting a pool of damage counters across several Pokemon. */
.spread { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.spread-row {
  display: grid;
  grid-template-columns: 1fr auto 28px auto 70px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--silk-dim);
  border-radius: 6px;
  background: rgba(0,0,0,.18);
}
.spread-name { display: flex; flex-direction: column; min-width: 0; }
.spread-name strong { font-size: 13px; }
.spread-name .muted { font-size: 11px; }
.spread-count { text-align: center; font-size: 15px; color: var(--brass); }


/* Special Conditions, named on the Pokemon rather than left to a coloured dot. */
.status-notes { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.cond {
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
  padding: 0 3px;
  border-radius: 3px;
  color: var(--ink);
}
.cond.c-asleep    { background: #9aa5b1; }
.cond.c-burned    { background: #e0654a; }
.cond.c-confused  { background: #c9a0dc; }
.cond.c-paralyzed { background: #e8c547; }
.cond.c-poisoned  { background: #7fb069; }


/* The handover step: deliberately prominent, because it is the last point at
   which a mistake can still be fixed. */
.btn.wide { width: 100%; padding: 10px; font-size: 15px; }


/* Something being prevented is why an attack did less than you expected, so
   it stands out rather than reading as an aside. */
.log .prevent { color: var(--brass); border-left: 2px solid var(--brass); padding-left: 6px; }


/* Search results say how many printings a card has, so a stack is obvious
   before you open it. */
.result .cap .arts {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--brass);
  letter-spacing: .04em;
}
.card-detail .hand > div { cursor: pointer; }
.card-detail .card.selected { outline: 2px solid var(--brass); }


/* The build this tab is actually running, so a cached script is visible
   rather than something you deduce from behaviour. */
.brand #build-tag {
  font-family: var(--mono);
  font-style: normal;
  font-size: 9px;
  color: var(--bone-dim);
  margin-left: 6px;
  letter-spacing: .04em;
}


/* An ACE SPEC is limited to one per deck across all of them, and the card
   itself says so — the deck list should too. */
.deck-line .ace {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--brass);
  border: 1px solid var(--brass);
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 5px;
  vertical-align: middle;
}
