/* SharpLab HQ — Pokédle page.
   Builds on hqstyle.css (shared vars/header/nav/.btn/.card). Only page-specific styling here. */

/* ── Page intro ── */
.pd-head { margin: 4px 0 20px; text-align: center; }
.pd-head h1 { font-size: 26px; margin: 0 0 4px; }
.pd-head p { color: var(--muted); margin: 0 auto; font-size: 14px; max-width: 560px; }

.balancechip {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px;
  font-size: 13px; font-weight: 700; color: var(--gold);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 3px 11px; vertical-align: middle;
}

/* ── Game card ── */
.pd-wrap { max-width: 640px; margin: 0 auto; }
.pdcard { display: flex; flex-direction: column; gap: var(--s-4); }

/* ── Guess input + datalist ── */
.pdguessrow { display: flex; gap: 8px; width: 100%; }
.pdguess {
  flex: 1; font-family: inherit; font-size: 16px; font-weight: 600; color: var(--fg);
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 14px; text-align: center;
}
.pdguess:focus { outline: none; border-color: var(--accent); }
.pdguess:disabled { opacity: .5; }
.pdguess.shake { animation: pd-shake .4s ease; border-color: var(--red); }
@keyframes pd-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

.pdmsg { font-size: 13px; min-height: 18px; font-weight: 600; text-align: center; }
.pdmsg.wrong { color: var(--red); }
.pdmsg.idle { color: var(--muted); font-weight: 400; }

/* ── Buttons ── */
.pdbtns { display: flex; gap: 8px; width: 100%; justify-content: center; flex-wrap: wrap; }
.pdbtns .btn { flex: 1; min-width: 130px; text-align: center; }
.btn.big { font-size: 16px; padding: 12px 18px; }

/* ── Guess board (table) ── */
.pdtablewrap { width: 100%; overflow-x: auto; }
.pdtable { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 13px; }
.pdtable thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  font-weight: 700; text-align: center; padding: 2px 6px; white-space: nowrap;
}
.pdtable thead th:first-child { text-align: left; }

.pdrow td { background: var(--panel2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pdrow td:first-child { border-left: 1px solid var(--line); border-top-left-radius: var(--r); border-bottom-left-radius: var(--r); }
.pdrow td:last-child { border-right: 1px solid var(--line); border-top-right-radius: var(--r); border-bottom-right-radius: var(--r); }

.pdnamecell { display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-width: 130px; }
.pdsprite { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.pdname { font-weight: 700; text-transform: capitalize; }

.pdcell {
  text-align: center; padding: 8px 6px; vertical-align: middle; white-space: nowrap;
}
.pdcell .pdmark { display: block; font-size: 14px; line-height: 1.2; }
.pdcell .pdval { display: block; font-size: 12px; font-weight: 600; margin-top: 2px; }
.pdcell.hit {
  background: color-mix(in srgb, var(--green) 22%, var(--panel2));
  border-color: color-mix(in srgb, var(--green) 40%, var(--line));
}
.pdcell.miss {
  background: color-mix(in srgb, var(--red) 16%, var(--panel2));
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
}
.pddir { font-size: 12px; }

.pdrow.pdpop td { animation: pd-pop .28s ease both; }
@keyframes pd-pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Reveal panel ── */
.pdreveal:empty { display: none; }
.pdrevcard {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel2);
}
.pdrevcard.win { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.pdrevcard.lose { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.pdbigsprite { width: 120px; height: 120px; object-fit: contain; }
.pdrevname { font-size: 17px; }
.pdrevname b { text-transform: capitalize; }
.pdreward { font-size: 16px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.pddexline { font-size: 12px; color: var(--muted); }

.pdcounter { font-size: 12px; color: var(--muted); text-align: center; }
.pdcounter b { color: var(--fg); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .pdguess.shake { animation: none; }
  .pdrow.pdpop td { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Copied verbatim from cards.css / pokemon.css so the coins hub + toasts are
   styled on this page too.
   ═══════════════════════════════════════════════════════════════════════════ */
.coinschip { font-weight: 700; color: var(--gold); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 13px; white-space: nowrap; cursor: pointer; transition: border-color .15s, transform .15s; }
.coinschip:hover { border-color: var(--gold); transform: translateY(-1px); }

/* Coins hub modal */
.hubov { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px; background: rgba(5,7,11,.6); backdrop-filter: blur(3px); animation: cd-scrim-in .18s ease both; }
@keyframes cd-scrim-in { from { opacity: 0; } to { opacity: 1; } }
.hubcard { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 20px; box-shadow: 0 24px 60px -20px #000; }
.hubhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hubhead h3 { margin: 0; font-size: 17px; }
.hubx { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.hubx:hover { color: var(--fg); background: var(--panel2); }
.hubrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.hubrow:first-of-type { border-top: 0; }
.hubicon { font-size: 20px; width: 30px; text-align: center; flex: 0 0 auto; }
.hubt { font-weight: 700; font-size: 14px; }
.hubd { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.hubfoot { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: right; }
.hubfoot b { color: var(--gold); }

.cardtoast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 300;
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 18px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
