/* ==========================================================================
   Deathroll – WoW-inspired fantasy UI. Original CSS/SVG only, no game assets.
   Fonts (Cinzel, Cinzel Decorative, Crimson Text) are SIL OFL, self-hosted in ./fonts
   ========================================================================== */

@font-face { font-family: "Cinzel"; src: url("/deathroll/fonts/cinzel-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("/deathroll/fonts/cinzel-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cinzel Decorative"; src: url("/deathroll/fonts/cinzel-decorative-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cinzel Decorative"; src: url("/deathroll/fonts/cinzel-decorative-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Crimson Text"; src: url("/deathroll/fonts/crimson-text-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Crimson Text"; src: url("/deathroll/fonts/crimson-text-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #0d0907;
  --bg-2: #1a100b;
  --gold: #e8b84a;
  --gold-hi: #ffe08a;
  --gold-lo: #8a6417;
  --blood: #a0171b;
  --blood-hi: #e84a4a;
  --parch: #dcc89c;
  --parch-hi: #ecdcb6;
  --ink: #2a1a0c;
  --ink-soft: #5a4026;
  --pa: #2d5f8a;           /* player a colour */
  --pb: #5f7a1f;           /* player b colour */
  --pos: #7fe08a;
  --neg: #ff7b7b;

  --head: "Cinzel", "Trajan Pro", Georgia, serif;
  --deco: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --body: "Crimson Text", Georgia, "Times New Roman", serif;

  --page: min(64rem, 100% - 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 1.15rem;
  line-height: 1.5;
  color: #f1e6cc;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(70rem 40rem at 50% -10%, rgb(160 23 27 / 0.28), transparent 65%),
    radial-gradient(50rem 30rem at 100% 40%, rgb(232 184 74 / 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; border-radius: 3px; }
.parchment :focus-visible { outline-color: var(--blood); }

.wrap { width: var(--page); margin-inline: auto; padding-bottom: 3rem; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: #cdb98f; margin: 0 0 1rem; }

/* ---------- Icons ---------- */
.icon { width: 1.25em; height: 1.25em; vertical-align: -0.2em; flex: none; }
.icon--inline { width: 1em; height: 1em; vertical-align: -0.12em; color: var(--gold); }
.icon--lg { width: 2.5rem; height: 2.5rem; }
.icon--xl { width: 4rem; height: 4rem; }
.coin { width: 1em; height: 1em; margin-left: 0.2em; vertical-align: -0.12em; filter: drop-shadow(0 0 3px rgb(232 184 74 / 0.6)); }
.gold { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Top bar & title ---------- */
.topbar { display: flex; justify-content: space-between; align-items: baseline; padding: 1.5rem 0 0; }
.home-link { font-family: var(--head); font-weight: 700; font-size: 1.4rem; text-transform: uppercase; text-decoration: none; letter-spacing: 0.08em; }
.home-link:hover { color: var(--gold); }
.topbar-title { font-family: var(--head); color: #cdb98f; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.85rem; }

.title-block { text-align: center; padding: 2rem 0 1.5rem; }
.title-block h1 {
  margin: 0;
  font-family: var(--deco); font-weight: 900;
  font-size: clamp(2.6rem, 11vw, 5.5rem);
  line-height: 1;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 50%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgb(232 184 74 / 0.35)) drop-shadow(0 3px 0 rgb(0 0 0 / 0.6));
}
.subtitle { margin: 0.75rem 0 0; font-family: var(--head); letter-spacing: 0.3em; text-transform: uppercase; font-size: clamp(0.7rem, 2.6vw, 1rem); color: var(--blood-hi); }
.subtitle::before, .subtitle::after { content: "◆"; margin: 0 0.8em; color: var(--gold); font-size: 0.7em; vertical-align: 0.1em; }

/* ---------- Panels: framed, ornate ---------- */
.panel {
  position: relative;
  margin: 0 0 1.75rem;
  padding: clamp(1.1rem, 4vw, 2rem);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 0 0 2px #2a1805,
    0 0 0 4px var(--gold-lo),
    0 0 0 5px #2a1805,
    0 12px 32px rgb(0 0 0 / 0.65);
}
/* inner hairline + gold corner studs */
.panel::before {
  content: ""; position: absolute; inset: 6px; pointer-events: none; border-radius: 3px;
  border: 1px solid rgb(232 184 74 / 0.55);
  background:
    radial-gradient(circle at 0 0, var(--gold) 0 5px, transparent 6px) top left,
    radial-gradient(circle at 100% 0, var(--gold) 0 5px, transparent 6px) top right,
    radial-gradient(circle at 0 100%, var(--gold) 0 5px, transparent 6px) bottom left,
    radial-gradient(circle at 100% 100%, var(--gold) 0 5px, transparent 6px) bottom right;
  background-repeat: no-repeat;
}
.panel > * { position: relative; }

.panel--dark {
  background:
    radial-gradient(40rem 20rem at 50% 0, rgb(160 23 27 / 0.22), transparent 70%),
    linear-gradient(180deg, #24150e 0%, #150d08 100%);
  color: #f1e6cc;
}

.parchment {
  color: var(--ink);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.22  0 0 0 0 0.08  0 0 0 0.22 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    radial-gradient(120% 90% at 50% 0%, var(--parch-hi) 0%, var(--parch) 55%, #bfa56f 100%);
}
.parchment::after { /* burnt edges */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 3px;
  box-shadow: inset 0 0 40px rgb(90 50 10 / 0.45), inset 0 0 8px rgb(60 30 5 / 0.5);
}

.panel-title {
  margin: 0 0 1.25rem; text-align: center;
  font-family: var(--head); font-weight: 700; font-size: clamp(1.3rem, 5vw, 1.8rem);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.parchment .panel-title { color: #5a1010; text-shadow: 0 1px 0 rgb(255 255 255 / 0.4); }
.panel--dark .panel-title { color: var(--gold); text-shadow: 0 0 12px rgb(232 184 74 / 0.4); }
.panel-title--small { font-size: 1.1rem; margin-bottom: 0.75rem; }
.panel--slim { padding-block: 1.25rem; }

/* ---------- Scoreboard ---------- */
.scoreboard { display: grid; grid-template-columns: 1fr minmax(13rem, 1.1fr) 1fr; gap: 1rem; align-items: stretch; }
.champ { text-align: center; padding: 0.5rem; border-radius: 4px; }
.champ-name { margin: 0; font-family: var(--deco); font-weight: 700; font-size: clamp(1rem, 3.2vw, 1.5rem); line-height: 1.2; overflow-wrap: anywhere; }
.champ--a .champ-name { color: #8cc4f0; }
.champ--b .champ-name { color: #b8dc6a; }
.champ-wins { margin: 0.5rem 0; }
.big {
  font-family: var(--deco); font-weight: 900; font-size: clamp(3.2rem, 13vw, 5.5rem); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.glow { color: var(--gold-hi); text-shadow: 0 0 10px rgb(232 184 74 / 0.8), 0 0 28px rgb(232 184 74 / 0.45), 0 2px 0 #5c3f0a; }
.champ.is-leading .big { animation: pulse 3.5s ease-in-out infinite; }
.champ-label { font-family: var(--head); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.85rem; color: #cdb98f; }
.champ-stats { margin: 0; display: grid; gap: 0.25rem; }
.champ-stats div { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.15rem 0.5rem; border-bottom: 1px dotted rgb(232 184 74 / 0.3); font-size: 1rem; }
.champ-stats dt { color: #cdb98f; }
.champ-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

.versus { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; text-align: center; padding: 0.75rem; border-inline: 1px solid rgb(232 184 74 / 0.25); }
.versus-icon { color: var(--blood-hi); filter: drop-shadow(0 0 8px rgb(224 58 58 / 0.7)); }
.versus-balance { margin: 0; font-size: 1.15rem; }
.versus-balance strong { color: var(--gold-hi); font-weight: 600; }
.versus-streak, .versus-meta { margin: 0; color: #cdb98f; font-size: 1rem; }
.versus-streak strong { color: #f1e6cc; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 1.25rem; margin-bottom: 1rem; }
.field { margin: 0 0 0.25rem; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
fieldset.field { border: 0; padding: 0; }
label, legend { display: block; padding: 0; font-family: var(--head); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: #5a1010; margin-bottom: 0.3rem; }
.optional { text-transform: none; letter-spacing: 0; font-family: var(--body); color: var(--ink-soft); font-weight: 400; }

input[type=text], input[type=number], input[type=datetime-local], textarea {
  width: 100%; padding: 0.65rem 0.75rem; min-height: 2.9rem;
  font: inherit; font-size: 1.15rem; color: var(--ink);
  background: rgb(255 250 232 / 0.65);
  border: 2px solid #8a6a3a; border-radius: 4px;
  box-shadow: inset 0 2px 5px rgb(90 50 10 / 0.25);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #7a6445; opacity: 1; }
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--blood); outline-offset: 1px; border-color: var(--blood); }
input[aria-invalid=true] { border-color: var(--blood); background: rgb(255 225 215 / 0.7); }

.hint { margin: 0.3rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.field-msg { margin: 0.3rem 0 0; min-height: 0; font-size: 1rem; font-weight: 600; color: #8a0f12; }
.field-msg:empty { display: none; }

/* segmented toggle */
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid #8a6a3a; border-radius: 4px; overflow: hidden; }
.seg { margin: 0; position: relative; cursor: pointer; text-transform: none; letter-spacing: 0; font-family: var(--body); font-size: 1.05rem; color: var(--ink); }
.seg + .seg { border-left: 2px solid #8a6a3a; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 2.9rem; padding: 0.3rem 0.5rem; background: rgb(255 250 232 / 0.4); font-weight: 600; line-height: 1.15; }
.seg input:checked + span { color: #fff7e0; background: linear-gradient(180deg, var(--blood-hi), var(--blood)); text-shadow: 0 1px 0 rgb(0 0 0 / 0.5); }
.seg--a input:checked + span { background: linear-gradient(180deg, #3f7db0, var(--pa)); }
.seg--b input:checked + span { background: linear-gradient(180deg, #7d9b2c, var(--pb)); }
.seg input:focus-visible + span { outline: 3px solid var(--blood); outline-offset: -3px; }

.preview { margin: 0.5rem 0 1rem; padding: 0.75rem 1rem; background: rgb(40 20 5 / 0.12); border: 1px dashed #8a6a3a; border-radius: 4px; }
.preview:has(#preview-chain:empty) #preview-chain { display: none; }
.winner-line { margin: 0; font-family: var(--head); font-size: 0.95rem; letter-spacing: 0.06em; }
.winner-line output { font-weight: 700; color: #5a1010; }

/* ---------- Buttons ---------- */
.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.btn {
  font-family: var(--head); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase;
  min-height: 2.9rem; padding: 0.5rem 1.25rem; cursor: pointer; border-radius: 4px;
  color: #3b2606; border: 2px solid var(--gold-lo);
  background: linear-gradient(180deg, #f6dd96, #d2a23c 55%, #a77a22);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 2px 0 #3d2a08;
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { filter: brightness(1.12); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 2px 0 #3d2a08, 0 0 14px rgb(232 184 74 / 0.5); }
.btn:active { transform: translateY(1px); }
.btn--primary { color: #fff3d6; border-color: #4d0a0c; background: linear-gradient(180deg, #d4383c, var(--blood) 55%, #6e0e11); text-shadow: 0 1px 0 rgb(0 0 0 / 0.6); }
.btn--danger { color: #fff3d6; border-color: #4d0a0c; background: linear-gradient(180deg, #b32a2e, #7e1114); text-shadow: 0 1px 0 rgb(0 0 0 / 0.6); }
.btn--small { min-height: 2.5rem; padding: 0.3rem 0.9rem; font-size: 0.78rem; }
.btn[hidden] { display: none; }

/* ---------- History ---------- */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.game { padding: 0.9rem 1rem 0.8rem; border-radius: 4px; border: 1px solid #8a6a3a; border-left-width: 6px; background: rgb(255 250 232 / 0.35); }
.game--a { border-left-color: var(--pa); } .game--b { border-left-color: var(--pb); }
.game-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.game-head time { color: var(--ink-soft); font-size: 1rem; }
.game-gold { font-family: var(--head); font-weight: 700; font-size: 1.15rem; color: #6b4a08; }
.game-winner { font-weight: 600; }
.game-winner .icon { color: #a97a10; }
.game-count { margin-left: auto; color: var(--ink-soft); font-size: 0.95rem; }
.game-note { margin: 0.5rem 0 0; font-style: italic; color: #3d2a14; overflow-wrap: anywhere; }
.game-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; padding: 1.5rem 0; color: var(--ink-soft); }
.empty[hidden] { display: none; }
.empty .icon { color: #7a1013; opacity: 0.85; }
.empty-title { font-family: var(--head); font-weight: 700; font-size: 1.3rem; color: #5a1010; }

/* roll chain */
.chain { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.2rem; }
.roll { display: flex; flex-direction: column; align-items: center; min-width: 3.1rem; }
.roll { position: relative; margin-left: 1rem; }
.roll + .roll::before { content: "›"; position: absolute; left: -0.7rem; top: 0.1rem; font-size: 1.3rem; line-height: 1.5; color: var(--ink-soft); }
.roll:first-child { margin-left: 0; }
.roll-n { display: inline-flex; align-items: center; gap: 0.25rem; min-width: 2.9rem; justify-content: center; padding: 0.2rem 0.6rem; font-family: var(--head); font-weight: 700; font-size: 1.05rem; border-radius: 999px; border: 2px solid; font-variant-numeric: tabular-nums; background: rgb(255 250 232 / 0.6); color: var(--ink); }
.roll-who { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.2; margin-top: 0.1rem; }
.roll--start .roll-n { border-style: dashed; border-color: #8a6a3a; color: var(--ink-soft); background: transparent; }
.roll--a .roll-n { border-color: var(--pa); } .roll--b .roll-n { border-color: var(--pb); }
.roll--death .roll-n {
  color: #fff3d6; border-color: #3d0507; padding-inline: 0.7rem;
  background: radial-gradient(circle at 50% 30%, #e84a4a, var(--blood) 60%, #5b0a0d);
  box-shadow: 0 0 0 2px rgb(160 23 27 / 0.35), 0 0 16px rgb(224 58 58 / 0.85);
  text-shadow: 0 1px 2px #000;
  animation: deathpulse 2.4s ease-in-out infinite;
}
.roll--death .skull { width: 1.15em; height: 1.15em; }
.roll--death .roll-who { color: #8a0f12; font-weight: 600; }

/* ---------- Achievements ---------- */
.ach-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.5rem; }
.ach-col-title { margin: 0 0 0.75rem; font-family: var(--deco); font-size: 1.15rem; color: var(--gold); display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; border-bottom: 1px solid rgb(232 184 74 / 0.4); padding-bottom: 0.4rem; }
.ach-count { font-family: var(--head); font-size: 0.85rem; color: #cdb98f; white-space: nowrap; }
.ach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }

.ach {
  --q: #9d9d9d; --qt: #b8b8b8;
  position: relative; display: flex; gap: 0.75rem; align-items: center; padding: 0.6rem 0.75rem; border-radius: 4px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.05), rgb(0 0 0 / 0.25));
  border: 1px solid rgb(255 255 255 / 0.12); overflow: visible; cursor: default;
}
.ach-icon { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 6px; border: 2px solid var(--q); background: #120a06; color: var(--qt); }
.ach-icon .icon { width: 1.5rem; height: 1.5rem; }
.ach-body { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.ach-name { font-family: var(--head); font-weight: 700; font-size: 1rem; color: var(--qt); }
.ach-desc { font-size: 0.95rem; color: #cdb98f; }
.ach-prog { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: #000; border: 1px solid rgb(255 255 255 / 0.15); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--q); }
.ach-prog-n { font-size: 0.85rem; color: #cdb98f; font-variant-numeric: tabular-nums; }
.ach-state { color: var(--qt); font-size: 1.1rem; }

.ach.is-locked { opacity: 0.62; filter: grayscale(0.85); }
.ach.is-locked:hover, .ach.is-locked:focus-visible { opacity: 0.9; }
.ach.is-unlocked { border-color: var(--q); box-shadow: 0 0 14px -4px var(--q), inset 0 0 18px -10px var(--q); }
.ach.is-unlocked .ach-icon { box-shadow: 0 0 10px var(--q); }

/* shine sweep on hover and when freshly unlocked */
.ach.is-unlocked { overflow: hidden; }
.ach.is-unlocked::after { content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-120%); background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.28) 50%, transparent 65%); }
.ach.is-unlocked:hover::after { transform: translateX(120%); transition: transform 0.7s ease; }
.ach.is-fresh { animation: unlock 1.2s ease-out 1; }
.ach.is-fresh::after { animation: shine 1.4s ease-out 0.3s 2; }

/* WoW-style item tooltip */
.tooltip {
  position: absolute; left: 0.75rem; right: 0.75rem; bottom: calc(100% + 6px); z-index: 20;
  display: none; flex-direction: column; gap: 0.15rem; padding: 0.6rem 0.8rem; pointer-events: none;
  background: linear-gradient(180deg, rgb(16 12 24 / 0.98), rgb(6 5 10 / 0.98));
  border: 2px solid var(--q); border-radius: 5px; box-shadow: 0 0 0 1px #000, 0 8px 24px rgb(0 0 0 / 0.8), 0 0 14px -2px var(--q);
}
.ach { overflow: visible; }
.ach.is-unlocked { overflow: visible; }
.ach.is-unlocked::after { clip-path: inset(0 round 4px); }
.ach:hover .tooltip, .ach:focus .tooltip, .ach:focus-visible .tooltip { display: flex; }
.tt-name { font-family: var(--head); font-weight: 700; font-size: 1.05rem; color: var(--qt); }
.tt-rar { font-size: 0.85rem; color: #aaa; }
.tt-desc { color: #ffd100; font-size: 1rem; }
.tt-state { font-size: 0.9rem; color: #cfcfcf; }
.ach.is-locked .tooltip { filter: none; opacity: 1; }
.ach-list > .ach:first-child .tooltip { bottom: auto; top: calc(100% + 6px); } /* keep the first tooltip on screen */

.data-status { margin: 0.75rem 0 0; min-height: 1.5em; color: var(--pos); }
.data-status.is-error { color: var(--neg); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; left: 1rem; display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; pointer-events: none; }
.toast {
  --q: var(--gold);
  display: flex; gap: 0.75rem; align-items: center; width: min(100%, 22rem); padding: 0.7rem 0.9rem;
  background: linear-gradient(180deg, #2b1a10, #140c07);
  border: 2px solid var(--q); border-radius: 6px; color: #f1e6cc;
  box-shadow: 0 0 0 1px #000, 0 10px 28px rgb(0 0 0 / 0.7), 0 0 18px -2px var(--q);
  animation: toastin 0.4s ease-out;
}
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s; }
.toast-icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none; border: 2px solid var(--q); border-radius: 5px; background: #120a06; color: var(--q); }
.toast-title { display: block; font-family: var(--head); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-hi); }
.toast-text { display: block; line-height: 1.25; }

/* ---------- Dialog ---------- */
.dlg { width: min(30rem, calc(100% - 2rem)); padding: 0; border: 3px solid var(--gold-lo); border-radius: 6px; color: #f1e6cc; background: linear-gradient(180deg, #2b1a10, #140c07); box-shadow: 0 0 0 2px #000, 0 20px 60px #000; }
.dlg::backdrop { background: rgb(5 3 2 / 0.78); }
.dlg-body { padding: 1.25rem 1.5rem 1.5rem; }
.dlg h2 { margin: 0 0 0.75rem; font-family: var(--head); font-size: 1.3rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }
.dlg p { margin: 0 0 0.6rem; } .dlg ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.dlg li { margin-bottom: 0.4rem; }

.site-footer { text-align: center; color: #9a8a68; font-size: 0.95rem; padding-top: 1rem; }

/* ---------- Animations ---------- */
@keyframes pulse { 50% { text-shadow: 0 0 14px rgb(232 184 74 / 1), 0 0 40px rgb(232 184 74 / 0.6), 0 2px 0 #5c3f0a; } }
@keyframes deathpulse { 50% { box-shadow: 0 0 0 3px rgb(160 23 27 / 0.45), 0 0 24px rgb(255 70 70 / 1); } }
@keyframes toastin { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes shine { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@keyframes unlock { 0% { transform: scale(0.94); box-shadow: 0 0 0 0 var(--q); } 40% { transform: scale(1.03); box-shadow: 0 0 30px 4px var(--q); } 100% { transform: scale(1); } }

/* ---------- Responsive ---------- */
@media (max-width: 40rem) {
  body { font-size: 1.1rem; }
  .scoreboard { grid-template-columns: 1fr 1fr; }
  .versus { grid-column: 1 / -1; grid-row: 2; border-inline: 0; border-top: 1px solid rgb(232 184 74 / 0.25); flex-direction: column; }
  .champ-stats div { flex-direction: column; gap: 0; align-items: center; border: 0; padding: 0; }
  .game-count { margin-left: 0; }
  .toasts { right: 0.75rem; left: 0.75rem; bottom: 0.75rem; }
  .toast { width: 100%; }
  .tooltip { display: none !important; } /* cards already show everything on small screens */
}

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