/* ===========================================================================
   Arkade Heroes — theme
   Arcade-cabinet DNA (dark phosphor base, neon accent, faint scanlines) on
   clean modern bones (generous spacing, crisp type, sharp cards).
   =========================================================================== */

:root {
    --bg:        #080b11;
    --bg-2:      #0c1119;
    --surface:   #121a25;
    --surface-2: #182231;
    --line:      #24324a;
    --line-soft: #1a2534;

    --text:      #e7eefc;
    --muted:     #8595ad;
    --faint:     #55637a;

    --accent:    #35f0d0;   /* phosphor teal — primary neon        */
    --accent-ink:#04120f;
    --accent-2:  #ff4d9d;   /* hot magenta — secondary             */
    --gold:      #ffd447;   /* rare / legendary highlight          */
    --danger:    #ff5a5a;
    --ok:        #5be08a;

    --r-common:    #8595ad;
    --r-uncommon:  #5bd6a0;
    --r-rare:      #4db6ff;
    --r-epic:      #c07bff;
    --r-legendary: #ffd447;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 18px 50px -20px rgba(0,0,0,.7);
    --glow: 0 0 0 1px rgba(53,240,208,.35), 0 0 22px -4px rgba(53,240,208,.45);

    --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-hud:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Ambient background: faint grid + soft radial glows, plus a scanline overlay. */
body {
    background-image:
        radial-gradient(1100px 600px at 78% -10%, rgba(53,240,208,.08), transparent 60%),
        radial-gradient(900px 500px at 5% 0%, rgba(255,77,157,.06), transparent 55%),
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: auto, auto, 46px 46px, 46px 46px;
    background-attachment: fixed;
}
body::after {
    content: "";
    position: fixed; inset: 0; z-index: 9999; pointer-events: none;
    background: repeating-linear-gradient(180deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
    mix-blend-mode: multiply; opacity: .35;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; }
h1:focus { outline: none; } /* Blazor FocusOnNavigate targets h1 — suppress the programmatic-focus ring */

.hud { font-family: var(--font-hud); text-transform: uppercase; letter-spacing: .14em; font-size: .68rem; color: var(--muted); }

/* --- Boot / loading screen (shown before Blazor mounts) ------------------- */
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1.4rem; }
.boot-logo { font-family: var(--font-hud); font-weight: 700; letter-spacing: .18em; font-size: 1.5rem; color: var(--text); }
.boot-logo span { color: var(--accent); }
.boot-bar { width: 210px; height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; background: var(--accent); box-shadow: var(--glow); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-120%);} 100% { transform: translateX(320%);} }
.boot-text { font-family: var(--font-hud); font-size: .72rem; letter-spacing: .12em; color: var(--faint); text-transform: uppercase; }

/* --- App shell ------------------------------------------------------------ */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 1.5rem;
    padding: .85rem 1.6rem;
    background: rgba(8,11,17,.78); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-hud); font-weight: 700; letter-spacing: .16em; font-size: 1.05rem; }
.brand b { color: var(--accent); }
.brand em { color: var(--accent-2); font-style: normal; }

.nav { display: flex; gap: .35rem; margin-left: .5rem; flex-wrap: wrap; }
.nav a {
    font-family: var(--font-hud); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); padding: .5rem .8rem; border-radius: var(--radius-sm);
    border: 1px solid transparent;
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a.active { color: var(--accent); border-color: var(--line); background: var(--surface); }

/* --- Section sub-nav (secondary tabs under the topbar) -------------------- */
.subnav {
    display: flex; gap: .25rem; flex-wrap: wrap; align-items: center;
    padding: .5rem 1.6rem;
    background: rgba(8,11,17,.45);
    border-bottom: 1px solid var(--line);
}
.subnav a {
    font-family: var(--font-hud); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); padding: .3rem .65rem; border-radius: var(--radius-sm);
}
.subnav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.subnav a.active { color: var(--accent-2); background: var(--surface); }

/* Backup nudge (shell) — shown until an auto-provisioned wallet's phrase is saved. */
.backup-nudge {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    padding: .55rem 1.6rem; font-size: .8rem;
    background: rgba(240,180,60,.10); border-bottom: 1px solid rgba(240,180,60,.35); color: var(--text);
}
.nudge-x {
    margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: .85rem; padding: .1rem .4rem; border-radius: var(--radius-sm);
}
.nudge-x:hover { color: var(--text); background: var(--surface); }

/* Game-first "Play" onboarding on the Home hero panel. */
.play-box { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.play-box .wallet-input { max-width: 260px; }
.play-note { font-size: .78rem; margin: .55rem 0 0; }

.spacer { flex: 1; }
.content { flex: 1; padding: 1.8rem 1.6rem 4rem; max-width: 1160px; width: 100%; margin: 0 auto; }

/* --- Wallet pill ---------------------------------------------------------- */
.pill {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--font-hud); font-size: .72rem; letter-spacing: .06em;
    padding: .45rem .75rem; border-radius: 100px;
    border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pill.on .dot { background: var(--ok); box-shadow: 0 0 10px 1px rgba(91,224,138,.7); }
.pill.on { color: var(--text); }

/* --- Cards & panels ------------------------------------------------------- */
.card {
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.15rem 1.25rem; box-shadow: var(--shadow);
}
.card.glow { border-color: rgba(53,240,208,.4); box-shadow: var(--glow), var(--shadow); }
.grid { display: grid; gap: 1.1rem; }
.grid.cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* --- Hero panel ----------------------------------------------------------- */
.hero-panel {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center;
    padding: 2.4rem; margin-bottom: 1.8rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    background:
        radial-gradient(700px 300px at 90% 10%, rgba(255,77,157,.10), transparent 60%),
        linear-gradient(180deg, var(--surface), var(--bg-2));
    box-shadow: var(--shadow);
}
.hero-panel h1 { font-size: 2.5rem; line-height: 1.05; }
.hero-panel h1 .neon { color: var(--accent); text-shadow: 0 0 24px rgba(53,240,208,.5); }
.hero-panel p { color: var(--muted); max-width: 46ch; }
.hero-art {
    aspect-ratio: 1; border-radius: var(--radius); border: 1px solid var(--line);
    background:
        repeating-linear-gradient(45deg, rgba(53,240,208,.05) 0 12px, transparent 12px 24px),
        radial-gradient(circle at 50% 40%, rgba(255,77,157,.14), transparent 60%),
        var(--bg-2);
    display: grid; place-content: center;
    font-family: var(--font-hud); color: var(--faint); letter-spacing: .2em; font-size: .72rem;
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
    font-family: var(--font-hud); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    font-size: .74rem; cursor: pointer;
    padding: .7rem 1.15rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
    transition: transform .05s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--accent); box-shadow: var(--glow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { box-shadow: 0 0 26px -4px rgba(53,240,208,.7); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); color: #160809; border-color: var(--danger); }
.btn.danger:hover { box-shadow: 0 0 26px -4px rgba(255,90,90,.7); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; border-color: var(--line); }
.btn-row { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* --- Chips / status ------------------------------------------------------- */
.chips { display: flex; gap: .6rem; flex-wrap: wrap; }
.chip { font-family: var(--font-hud); font-size: .72rem; padding: .35rem .6rem; border-radius: var(--radius-sm); border: 1px solid var(--line); color: var(--muted); background: var(--bg-2); }
.chip b { color: var(--text); }

.status-line { display: flex; align-items: center; gap: .6rem; font-family: var(--font-hud); font-size: .78rem; }
.status-line .dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px 1px rgba(91,224,138,.6); }
.dot.bad { background: var(--danger); }
.dot.wait { background: var(--gold); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
/* Design-review polish: keyboard focus ring, CTA burst, reduced-motion coverage */
a:focus-visible, button:focus-visible, select:focus-visible, .hero-card:focus-visible, .offer-card:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
.btn.primary:active { box-shadow: 0 0 34px -2px rgba(53,240,208,.9); }
@media (prefers-reduced-motion: reduce) { .dot.wait { animation: none; } .boot-bar span { animation: none; } }

.muted { color: var(--muted); }
.mono { font-family: var(--font-hud); }
.tag-legendary { color: var(--r-legendary); }
.tag-epic { color: var(--r-epic); }
.tag-rare { color: var(--r-rare); }
.tag-uncommon { color: var(--r-uncommon); }
.tag-common { color: var(--r-common); }

/* --- Page head + hero cards ----------------------------------------------- */
.page-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.page-head h2 { font-size: 1.5rem; margin: 0; }

.hero-card { display: block; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.hero-card:hover { transform: translateY(-3px); border-color: rgba(53,240,208,.4); box-shadow: var(--glow), var(--shadow); text-decoration: none; }

/* --- Summon / reveal animations — retro monster-game energy, modern neon ----- */
/* Grid entrance: every card (heroes, offers) materialises bright-to-crisp, lightly staggered. */
.grid.cols > *:not(.reveal) { animation: summon-in .55s cubic-bezier(.2,.85,.25,1) backwards; }
.grid.cols > *:nth-child(2){ animation-delay:.05s }
.grid.cols > *:nth-child(3){ animation-delay:.10s }
.grid.cols > *:nth-child(4){ animation-delay:.15s }
.grid.cols > *:nth-child(5){ animation-delay:.20s }
.grid.cols > *:nth-child(6){ animation-delay:.25s }
.grid.cols > *:nth-child(7){ animation-delay:.30s }
.grid.cols > *:nth-child(8){ animation-delay:.35s }
@keyframes summon-in {
    0%   { opacity:0; transform: translateY(10px) scale(.95); filter: brightness(1.9) saturate(.3); }
    55%  { opacity:1; filter: brightness(1.4) saturate(.7); }
    100% { opacity:1; transform: translateY(0) scale(1); filter: none; }
}

/* The big reveal — a hero materialises in a beam: scales up from a bright shard, a
   rarity/energy flare bursts behind it, and a scan bar wipes down the portrait. */
.hero-card.reveal { position: relative; animation: summon-reveal 1s cubic-bezier(.16,1,.3,1) backwards; }
@keyframes summon-reveal {
    0%   { opacity:0; transform: scale(.55) translateY(24px); filter: brightness(3.5) saturate(0) blur(5px); }
    28%  { opacity:1; filter: brightness(2.4) saturate(.4) blur(1.5px); }
    52%  { transform: scale(1.05) translateY(0); filter: brightness(1.3) saturate(1) blur(0); }
    66%  { transform: scale(.98) translateY(0); }
    80%  { transform: scale(1.01); }
    100% { opacity:1; transform: scale(1); filter: none; }
}
.hero-card.reveal::before {
    content:""; position:absolute; inset:-40%; z-index:-1; border-radius:50%; pointer-events:none;
    background: radial-gradient(circle, var(--flare, var(--accent)) 0%, transparent 62%);
    opacity:0; animation: flare 1s ease-out backwards;
}
@keyframes flare {
    0%{ opacity:0; transform:scale(.35) } 25%{ opacity:.7 } 60%{ opacity:.25 } 100%{ opacity:0; transform:scale(1.4) }
}
.hero-card.reveal .hero-tile { position: relative; }
.hero-card.reveal .hero-tile::before {
    content:""; position:absolute; left:0; right:0; top:0; height:16%; z-index:3; pointer-events:none;
    background: linear-gradient(var(--flare, var(--accent)), transparent);
    box-shadow: 0 0 26px 7px var(--flare, var(--accent));
    animation: scan-wipe 1s ease-in-out backwards;
}
@keyframes scan-wipe {
    0%{ transform:translateY(-120%); opacity:0 } 15%{ opacity:1 } 85%{ opacity:1 } 100%{ transform:translateY(560%); opacity:0 }
}
/* Fusion burns hotter: red flare (set on the card), a faster resolve, and the portrait
   shakes as the two heroes collide (on the tile, so it doesn't fight the card's scale). */
.hero-card.reveal.fuse { animation-duration: .85s; }
.hero-card.reveal.fuse .hero-tile { animation: fuse-shake .12s steps(2) 6 .1s backwards; }
@keyframes fuse-shake {
    0%,100%{ transform: translateX(0) } 25%{ transform: translateX(-3px) } 75%{ transform: translateX(3px) }
}

@media (prefers-reduced-motion: reduce) {
    .grid.cols > *:not(.reveal), .hero-card.reveal, .hero-card.reveal.fuse .hero-tile { animation: none; }
    .hero-card.reveal::before, .hero-card.reveal .hero-tile::before { display: none; }
}

/* --- Spar arena — GBA-style auto-battler replay ------------------------------- */
.spar-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.1rem; }
.vs-plus { color: var(--danger) !important; font-weight: 700; }

.arena {
    position: relative; margin-top: 1.4rem; padding: 1.5rem 1.2rem 1.1rem; overflow: hidden;
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    background:
        radial-gradient(120% 85% at 50% -12%, rgba(255,90,90,.07), transparent 60%),
        linear-gradient(180deg, var(--surface), var(--bg-2));
}
/* faint battlefield grid, faded top + bottom */
.arena::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
    background:
        repeating-linear-gradient(0deg, rgba(53,240,208,.04) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(90deg, rgba(53,240,208,.04) 0 1px, transparent 1px 26px);
    -webkit-mask: linear-gradient(180deg, transparent, #000 28%, #000 82%, transparent);
    mask: linear-gradient(180deg, transparent, #000 28%, #000 82%, transparent);
}

.turn-ticker {
    position: absolute; top: .7rem; left: 50%; transform: translateX(-50%); z-index: 4;
    font-size: .62rem; letter-spacing: .22em; color: var(--muted);
    border: 1px solid var(--line); background: rgba(8,11,17,.7); padding: .16rem .6rem; border-radius: 4px;
}

.arena-row { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem; margin-top: .7rem; }

.fighter { display: flex; flex-direction: column; gap: .42rem; transition: filter .3s ease, opacity .3s ease; }
.fighter.left  { --corner: var(--danger); }
.fighter.right { --corner: var(--accent); }

.f-head { display: flex; align-items: center; gap: .5rem; }
.fighter.right .f-head { justify-content: flex-end; }
.f-name { font-weight: 700; }
.f-corner { font-family: var(--font-hud); font-size: .56rem; letter-spacing: .16em; padding: .12rem .4rem; border-radius: 3px; border: 1px solid var(--corner); color: var(--corner); }

.hpbar { height: 10px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: rgba(0,0,0,.35); }
.hpbar > i { display: block; height: 100%; border-radius: 5px 0 0 5px; transition: width .45s cubic-bezier(.3,.7,.3,1), background .45s ease; }
.hpbar > i.ok   { background: linear-gradient(90deg, #2fb36a, var(--ok)); }
.hpbar > i.warn { background: linear-gradient(90deg, #c99a1e, var(--gold)); }
.hpbar > i.xp   { background: linear-gradient(90deg, var(--accent), var(--gold)); }

/* Slim XP-to-next bar under a hero's name — same primitive as the combat HP bar. */
.xpbar { height: 6px; margin-top: .6rem; max-width: 320px; }
.hpbar > i.low  { background: linear-gradient(90deg, #c13b3b, var(--danger)); }
.f-hp { font-size: .66rem; color: var(--muted); }
.f-hp span { opacity: .55; }

.f-portrait {
    position: relative; aspect-ratio: 16/12; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(120% 120% at 50% 12%, var(--bg-2), #06080c);
    border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
    transition: transform .18s cubic-bezier(.2,.85,.25,1), box-shadow .3s ease;
}
.f-portrait::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 2px, transparent 2px 4px); }
.f-el { position: absolute; bottom: .3rem; right: .4rem; z-index: 2; font-size: .56rem; letter-spacing: .08em; padding: .1rem .34rem; border-radius: 3px; background: rgba(8,11,17,.66); color: var(--text); }

.f-stats { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .6rem; color: var(--muted); }
.fighter.right .f-stats { justify-content: flex-end; }

/* Lunge: the actor's portrait drives toward the centre line. */
.fighter.left.attack  .f-portrait { transform: translateX(16%) scale(1.04); }
.fighter.right.attack .f-portrait { transform: translateX(-16%) scale(1.04); }

/* Hit: red wash (gold on a crit) + shake on the struck portrait. */
.fighter.hit .f-portrait { animation: hit-shake .34s steps(3) 1; }
.fighter.hit .f-portrait::before {
    content: ""; position: absolute; inset: 0; z-index: 3; background: var(--danger); mix-blend-mode: screen;
    animation: hit-flash .34s ease-out 1;
}
.fighter.hit.crit .f-portrait::before { background: var(--gold); animation-duration: .5s; }
@keyframes hit-flash { 0% { opacity: .78; } 100% { opacity: 0; } }
@keyframes hit-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }

/* Dodge: a quick sidestep, no damage. */
.fighter.left.dodge  { animation: dodge-l .36s ease; }
.fighter.right.dodge { animation: dodge-r .36s ease; }
@keyframes dodge-l { 40% { transform: translate(-16%,-6%) skewX(-6deg); opacity: .8; } }
@keyframes dodge-r { 40% { transform: translate(16%,-6%) skewX(6deg); opacity: .8; } }

/* KO: desaturate, dim, keel over. */
.fighter.ko { filter: grayscale(.85) brightness(.6); opacity: .72; }
.fighter.left.ko  { --ko-rot: -9deg; }
.fighter.right.ko { --ko-rot: 9deg; }
.fighter.ko .f-portrait { animation: ko-fall .7s cubic-bezier(.4,0,.6,1) forwards; }
@keyframes ko-fall { 100% { transform: rotate(var(--ko-rot,-8deg)) translateY(6%); filter: brightness(.5); } }

/* Winner: victory glow + bob. */
.fighter.win .f-portrait { box-shadow: 0 0 0 1px var(--corner), 0 0 26px 2px var(--corner); animation: win-bob 1.1s ease-in-out infinite; }
@keyframes win-bob { 50% { transform: translateY(-5px); } }

/* Floating damage / heal numbers over a portrait. */
.dmg, .heal {
    position: absolute; left: 50%; top: 40%; z-index: 5; transform: translateX(-50%); pointer-events: none;
    font-family: var(--font-hud); font-weight: 700; font-size: 1.5rem; text-shadow: 0 2px 8px rgba(0,0,0,.7);
}
.dmg { color: var(--danger); animation: float-up .9s ease-out forwards; }
.dmg.crit   { color: var(--gold); font-size: 2.1rem; }
.dmg.super  { color: #ff8a3d; }
.dmg.resist { color: var(--muted); font-size: 1.2rem; }
.heal { color: var(--ok); animation: float-up .9s ease-out forwards; }
@keyframes float-up { 0% { opacity: 0; transform: translate(-50%,6px) scale(.7); } 20% { opacity: 1; transform: translate(-50%,0) scale(1); } 100% { opacity: 0; transform: translate(-50%,-30px) scale(1); } }

/* Centre column: VS + the action banner. */
.arena-mid { position: relative; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 98px; }
.arena-mid .vs { font-family: var(--font-hud); font-size: .8rem; letter-spacing: .2em; color: var(--muted); opacity: .5; }
.banner {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 6; white-space: nowrap; text-align: center;
    font-family: var(--font-hud); font-weight: 700; letter-spacing: .06em; padding: .2rem .5rem;
    animation: banner-pop .5s cubic-bezier(.16,1,.3,1);
}
.banner.skill { color: var(--text);   font-size: .9rem;  text-shadow: 0 0 12px rgba(53,240,208,.5); }
.banner.crit  { color: var(--gold);   font-size: 1.25rem; text-shadow: 0 0 16px rgba(255,212,71,.7); }
.banner.miss  { color: var(--muted);  font-size: .9rem; }
.banner.dodge { color: var(--accent); font-size: .95rem; text-shadow: 0 0 12px rgba(53,240,208,.6); }
.banner.ko    { color: var(--danger); font-size: 1.5rem; text-shadow: 0 0 20px rgba(255,90,90,.8); animation: banner-slam .5s cubic-bezier(.16,1,.3,1); }
.banner.win   { color: var(--accent); font-size: 1.15rem; text-shadow: 0 0 18px rgba(53,240,208,.7); }
.banner.fight { color: var(--danger); font-size: 1.6rem; letter-spacing: .14em; text-shadow: 0 0 22px rgba(255,90,90,.8); animation: banner-slam .55s cubic-bezier(.16,1,.3,1); }
@keyframes banner-pop  { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.6); } 60% { opacity: 1; transform: translate(-50%,-50%) scale(1.08); } 100% { transform: translate(-50%,-50%) scale(1); } }
@keyframes banner-slam { 0% { opacity: 0; transform: translate(-50%,-50%) scale(2.4); filter: blur(4px); } 55% { opacity: 1; filter: blur(0); } 70% { transform: translate(-50%,-50%) scale(.94); } 100% { transform: translate(-50%,-50%) scale(1); } }

/* Crit screen-flash across the whole arena. */
.shock { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(255,212,71,.26), transparent 55%); animation: shock .42s ease-out; }
@keyframes shock { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

.arena-outcome { position: relative; z-index: 1; text-align: center; margin-top: 1rem; }

/* GBA-style running combat feed. */
.battle-log { position: relative; z-index: 1; margin-top: 1rem; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .25rem; min-height: 4.4rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(4,7,12,.55); }
.log-line { font-size: .72rem; letter-spacing: .01em; color: var(--muted); animation: log-in .3s ease-out backwards; }
.log-line:last-child { color: var(--text); }
.log-line.crit, .log-line.crit:last-child { color: var(--gold); }
.log-line.super { color: #ff8a3d; }
.log-line.miss, .log-line.dodge { font-style: italic; }
.log-line.ko, .log-line.ko:last-child { color: var(--danger); }
.log-line.win, .log-line.win:last-child { color: var(--accent); font-weight: 700; letter-spacing: .04em; }
@keyframes log-in { 0% { opacity: 0; transform: translateX(-6px); } 100% { opacity: 1; transform: translateX(0); } }

@media (max-width: 640px) {
    .arena-row { gap: .2rem; }
    .dmg { font-size: 1.2rem; } .dmg.crit { font-size: 1.6rem; }
    .banner.fight, .banner.ko { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
    .f-portrait, .fighter.left.attack .f-portrait, .fighter.right.attack .f-portrait { transition: none; transform: none; }
    .fighter.hit .f-portrait, .fighter.hit .f-portrait::before, .fighter.left.dodge, .fighter.right.dodge,
    .fighter.ko .f-portrait, .fighter.win .f-portrait, .dmg, .heal, .banner, .shock, .log-line { animation: none; }
}
.hero-tile { position: relative; aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; overflow: hidden; background: radial-gradient(120% 120% at 50% 12%, var(--bg-2), #06080c); }

.hero-tile::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 2px, transparent 2px 4px); }

/* ── holographic rarity treatment ─────────────────────────────── */
.hero-card, .offer-card { border-color: color-mix(in srgb, var(--tier, var(--line)) 32%, var(--line)); }
.hero-card:hover, .offer-card:hover { border-color: var(--tier); box-shadow: 0 0 22px -8px var(--tier), var(--glow), var(--shadow); }
.hero-tile .hero-foil, .offer-tile .hero-foil {
    position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0; z-index: 2;
    background: repeating-linear-gradient(112deg,
        rgba(255,60,140,.55) 0%, rgba(255,220,60,.55) 9%, rgba(70,255,180,.55) 18%,
        rgba(60,170,255,.55) 27%, rgba(190,80,255,.55) 36%, rgba(255,60,140,.55) 45%);
    background-size: 300% 300%; transition: opacity .25s ease, background-position .6s ease;
}
.hero-tile.tier-1 .hero-foil, .offer-tile.tier-1 .hero-foil { opacity: .06; }
.hero-tile.tier-2 .hero-foil, .offer-tile.tier-2 .hero-foil { opacity: .13; }
.hero-tile.tier-3 .hero-foil, .offer-tile.tier-3 .hero-foil { opacity: .20; }
.hero-tile.tier-4 .hero-foil, .offer-tile.tier-4 .hero-foil { opacity: .30; animation: foil-drift 7s ease-in-out infinite alternate; }
.hero-card:hover .hero-tile .hero-foil, .offer-card:hover .offer-tile .hero-foil { opacity: .34; background-position: 60% 60%; }
@keyframes foil-drift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
.rar-pips { display: flex; gap: 3px; }
.rar-pips .pip { height: 3px; flex: 1; border-radius: 2px; background: rgba(255,255,255,.09); }
.rar-pips .pip.on { background: var(--tier); box-shadow: 0 0 6px -1px var(--tier); }
.trait-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.tbadge { font-family: var(--font-hud); font-size: .5rem; letter-spacing: .06em; padding: .18rem .32rem;
    border-radius: 3px; border: 1px solid currentColor; text-transform: uppercase; opacity: .92; }
@media (prefers-reduced-motion: reduce) { .hero-tile.tier-4 .hero-foil, .offer-tile.tier-4 .hero-foil { animation: none; } }
.hero-gen { position: absolute; top: .5rem; left: .6rem; z-index: 1; font-size: .6rem; padding: .2rem .45rem; border-radius: 4px; background: rgba(8,11,17,.62); color: var(--text); letter-spacing: .12em; }
.hero-sterile { position: absolute; top: .5rem; right: .6rem; z-index: 1; color: var(--danger); background: rgba(8,11,17,.62); border-radius: 4px; padding: .05rem .4rem; font-size: .8rem; }
.hero-body { padding: .85rem .9rem 1rem; display: grid; gap: .6rem; }
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.hero-name { font-weight: 600; font-size: 1.02rem; }
.tier { font-family: var(--font-hud); font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; padding: .22rem .45rem; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; }
.statline { display: flex; flex-wrap: wrap; gap: .45rem .9rem; font-size: .68rem; color: var(--muted); }

/* --- Ranks: leaderboard table --------------------------------------------- */
.board { width: 100%; border-collapse: collapse; font-size: .86rem; }
.board thead th {
    text-align: left; font-family: var(--font-hud); font-weight: 500; text-transform: uppercase;
    letter-spacing: .08em; font-size: .64rem; color: var(--muted);
    padding: .35rem .6rem .55rem; border-bottom: 1px solid var(--line);
}
.board th.num, .board td.num { text-align: right; }
.board tbody td { padding: .55rem .6rem; border-bottom: 1px solid var(--line-soft); }
.board tbody tr:last-child td { border-bottom: none; }
.board tbody tr:hover { background: var(--surface); }
.board .rank { font-family: var(--font-hud); color: var(--accent); width: 2.5rem; }
.board td.num { font-family: var(--font-hud); }

/* --- Market: offer cards -------------------------------------------------- */
.offer-card { position: relative; display: flex; flex-direction: column; gap: .55rem; }
.offer-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.offer-name { font-weight: 600; font-size: 1.02rem; }
.offer-card .tier { align-self: flex-start; }
.offer-price { font-family: var(--font-hud); }
.offer-price b { font-size: 1.5rem; color: var(--accent); letter-spacing: -.02em; }
.offer-price span { color: var(--muted); font-size: .82rem; }
.offer-status { text-transform: uppercase; letter-spacing: .08em; font-size: .62rem; }
.offer-status.on { color: var(--ok); }
.offer-status.done { color: var(--danger); }
.buy-btn { width: 100%; margin-top: .35rem; }

/* Hero portrait on a hero offer, with a periodic gold coin-shine (a "for sale" gleam). */
.offer-tile { position: relative; aspect-ratio: 16/9; overflow: hidden; margin: -.15rem 0 .2rem; border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 120% at 50% 12%, var(--bg-2), #06080c); }
.offer-tile::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 2px, transparent 2px 4px); }
.offer-tile { border-color: color-mix(in srgb, var(--tier, var(--line)) 40%, var(--line)); }
/* Procedural item icons (ItemSprite): market item tiles + hero equipment rows */
.item-tile .item-px { filter: drop-shadow(0 3px 7px rgba(0,0,0,.55)); }
.equip-list { display: grid; gap: .5rem; }
.equip-row { display: flex; align-items: center; gap: .65rem; }
.equip-row .item-px { flex: none; background: radial-gradient(120% 120% at 50% 15%, var(--bg-2), #06080c); border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.equip-meta { display: flex; flex-direction: column; gap: .1rem; line-height: 1.15; }
.equip-slot { font-family: var(--font-hud); font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.equip-name { font-size: .92rem; }
.equip-row .equip-x { margin-left: auto; padding: .12rem .5rem; font-size: .95rem; line-height: 1; }
.equip-add { margin-top: .7rem; width: 100%; background: #11141d; border: 1px solid var(--line); color: var(--text); font: inherit; padding: .5rem .6rem; border-radius: var(--radius-sm); }
/* Gear catalog cards (the /gear armory) */
.gear-card { display: flex; flex-direction: column; gap: .55rem; }
.gear-tile { position: relative; aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; overflow: hidden; margin: -.15rem 0 .1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: radial-gradient(120% 120% at 50% 14%, var(--bg-2), #06080c); }
.gear-tile::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 2px, transparent 2px 4px); }
.gear-tile .item-px { position: relative; z-index: 1; filter: drop-shadow(0 3px 7px rgba(0,0,0,.55)); }
.gear-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.gear-name { font-weight: 600; font-size: 1rem; }
.gear-price { font-family: var(--font-hud); }
.gear-price b { font-size: 1.3rem; color: var(--accent); letter-spacing: -.02em; }
.gear-price span { color: var(--muted); font-size: .8rem; }
.gear-buy { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .1rem; }
.gear-buy .btn { padding: .4rem .95rem; }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.offer-kind { position: absolute; top: .4rem; left: .5rem; z-index: 2; font-size: .56rem; letter-spacing: .14em; padding: .14rem .4rem; border-radius: 3px; background: rgba(8,11,17,.66); color: var(--text); }
.price-shine { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.price-shine::before {
    content: ""; position: absolute; top: -60%; left: 0; width: 32%; height: 220%;
    background: linear-gradient(100deg, transparent, rgba(255,212,71,.5), transparent);
    transform: translateX(-140%) rotate(18deg); animation: coin-shine 3.6s ease-in-out infinite;
}
@keyframes coin-shine { 0%,72% { transform: translateX(-140%) rotate(18deg); opacity: 0; } 76% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateX(520%) rotate(18deg); opacity: 0; } }

/* Sold: dim the card + slam a red SOLD stamp across the portrait. */
.offer-card.sold { filter: saturate(.5) brightness(.82); }
.offer-card.sold .offer-price b { color: var(--muted); }
.sold-stamp {
    position: absolute; top: 34%; left: 50%; transform: translate(-50%,-50%) rotate(-9deg); z-index: 5; pointer-events: none;
    font-family: var(--font-hud); font-weight: 700; letter-spacing: .22em; font-size: 1.5rem; color: var(--danger);
    border: 3px solid var(--danger); border-radius: 6px; padding: .25rem 1.1rem; background: rgba(20,8,10,.55);
    text-shadow: 0 0 12px rgba(255,90,90,.6); box-shadow: 0 0 20px rgba(255,90,90,.35);
    animation: stamp-in .5s cubic-bezier(.16,1,.3,1) backwards;
}
@keyframes stamp-in { 0% { opacity: 0; transform: translate(-50%,-50%) rotate(-9deg) scale(2.2); } 60% { opacity: 1; } 75% { transform: translate(-50%,-50%) rotate(-9deg) scale(.92); } 100% { transform: translate(-50%,-50%) rotate(-9deg) scale(1); } }

/* Just-listed flourish: the card drops in with a gold flare (reuses @keyframes flare). */
.offer-card.reveal-offer { animation: offer-drop .7s cubic-bezier(.16,1,.3,1) backwards; }
@keyframes offer-drop { 0% { opacity: 0; transform: translateY(-16px) scale(.94); filter: brightness(1.8); } 60% { opacity: 1; transform: translateY(0) scale(1.02); } 100% { transform: scale(1); filter: none; } }
.offer-card.reveal-offer::before {
    content: ""; position: absolute; inset: -30%; z-index: -1; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, var(--flare, var(--gold)) 0%, transparent 62%); opacity: 0; animation: flare .9s ease-out backwards;
}

/* Sell page pickers (mirrors .breed-picks) + the ask input. */
.sell-picks { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.sell-picks label { display: flex; flex-direction: column; gap: .35rem; font-family: var(--font-hud); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.sell-picks select, .ask-input { font-family: var(--font-body); font-size: .9rem; padding: .55rem .7rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-2); color: var(--text); }
.sell-picks select { min-width: 240px; }
.ask-input { width: 160px; }
.sell-picks select:focus, .ask-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.sell-picks label .mini { color: var(--faint); font-size: .58rem; letter-spacing: .06em; }

@media (prefers-reduced-motion: reduce) {
    .price-shine::before { display: none; }
    .offer-card.reveal-offer, .offer-card.reveal-offer::before, .sold-stamp { animation: none; }
}

/* --- Hero detail page ----------------------------------------------------- */
.page-head .back { text-decoration: none; }
.page-head .back:hover { color: var(--accent); }

.detail-hero { display: grid; grid-template-columns: 260px 1fr; gap: 1.6rem; align-items: center; margin-bottom: 1.4rem; }
.detail-portrait {
    position: relative; aspect-ratio: 1; border-radius: var(--radius); border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: radial-gradient(120% 120% at 50% 12%, var(--bg-2), #06080c);
    box-shadow: var(--shadow);
}
.detail-portrait::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 2px, transparent 2px 4px); }
.detail-headings h1 { font-size: 2.2rem; margin: .1em 0 .4em; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.stat-grid > div { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.stat-grid span { color: var(--muted); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; }
.stat-grid b { font-size: 1.15rem; color: var(--text); }

.chip.ghost { background: transparent; border-style: dashed; }

.skill-list { display: grid; gap: .7rem; }
.skill { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); display: grid; gap: .35rem; }
.skill-head { display: flex; align-items: center; gap: .6rem; }

.kv { display: grid; gap: .5rem; }
.kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line-soft); padding-bottom: .45rem; }
.kv > div:last-child { border-bottom: none; padding-bottom: 0; }
.kv span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.kv.wide > div { flex-direction: column; align-items: stretch; gap: .3rem; }
.genome { display: block; word-break: break-all; font-size: .74rem; color: var(--accent); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .6rem; }

.receipt-list { display: grid; gap: .7rem; }
.receipt { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); display: grid; gap: .4rem; }
.receipt-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }

@media (max-width: 780px) {
    .detail-hero { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .wallet-grid { grid-template-columns: 1fr; }
}

/* --- Wallet pill: address + balance, as a link --------------------------- */
.pill { text-decoration: none; }
.pill:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.pill .bal { color: var(--accent); font-weight: 600; }

/* --- Wallet page ---------------------------------------------------------- */
.wallet-head { margin-bottom: 1.4rem; }
.wallet-head h1 { font-size: 2rem; }
.wallet-head h1 .neon { color: var(--accent); text-shadow: 0 0 24px rgba(53,240,208,.5); }

.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-bottom: 1.1rem; }
.wallet-grid .card { display: flex; flex-direction: column; gap: .5rem; }
.wallet-grid .card .btn { margin-top: auto; align-self: flex-start; }

.card.err { display: flex; align-items: center; gap: .6rem; color: #ffd0d0; border-color: var(--danger); font-family: var(--font-hud); font-size: .8rem; margin-top: 1.1rem; }

.wallet-input {
    width: 100%; resize: vertical;
    font-family: var(--font-hud); font-size: .82rem; line-height: 1.5;
    padding: .7rem .8rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
}
.wallet-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }

.send-form { display: grid; gap: .6rem; }
.send-row { display: flex; gap: .6rem; align-items: stretch; }
.wallet-input.amt { flex: 1; }

/* Recovery-phrase word grid */
.seed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.seed-word {
    display: flex; align-items: baseline; gap: .5rem;
    font-family: var(--font-hud); font-size: .86rem;
    padding: .5rem .65rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--bg-2);
}
.seed-word .idx { color: var(--faint); font-size: .68rem; min-width: 1.1rem; text-align: right; }

/* Receive address */
.addr-box { display: flex; align-items: center; gap: .6rem; margin-top: .3rem; }
.addr-box .addr {
    flex: 1; word-break: break-all; font-size: .8rem; color: var(--text);
    padding: .6rem .7rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--bg-2);
}
.btn.sm { padding: .45rem .7rem; font-size: .66rem; }

/* Balance */
.balance-card .balance { font-family: var(--font-hud); }
.balance-card .balance b { font-size: 2.1rem; letter-spacing: -.02em; color: var(--text); }
.balance-card .balance span { color: var(--muted); font-size: .9rem; margin-left: .3rem; }
.chip.as-btn { cursor: pointer; }
.chip.as-btn:hover { border-color: var(--accent); color: var(--text); }
.chip.as-btn:disabled { opacity: .5; cursor: not-allowed; }
.chip.as-btn.on { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.toggle { display: inline-flex; gap: .35rem; }

/* The "…and X assets" breakdown line under the sats, and its modal. */
.asset-line {
    display: inline-block; margin-top: .55rem;
    background: none; border: none; cursor: pointer; padding: 0;
    font-family: var(--font-hud); font-size: .72rem; letter-spacing: .04em; color: var(--accent-2);
}
.asset-line:hover { text-decoration: underline; }

.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 1.5rem;
    background: rgba(4,6,10,.72); backdrop-filter: blur(4px);
}
.modal {
    width: 100%; max-width: 440px; max-height: 80vh; overflow-y: auto;
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.modal-head h3 { margin: 0; flex: 1; }
.modal-x {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 1rem; padding: .2rem .45rem; border-radius: var(--radius-sm);
}
.modal-x:hover { color: var(--text); background: var(--bg-2); }

.asset-list { display: flex; flex-direction: column; gap: .35rem; }
.asset-row {
    display: flex; align-items: center; gap: .7rem;
    padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2);
}
.asset-name { flex: 1; font-weight: 600; }
.asset-id { color: var(--muted); font-size: .72rem; }
.asset-amt { color: var(--accent); font-family: var(--font-hud); font-size: .8rem; }

/* --- Breed pickers -------------------------------------------------------- */
.breed-picks { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.breed-picks label { display: flex; flex-direction: column; gap: .35rem; font-family: var(--font-hud); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.breed-picks select { font-family: var(--font-body); font-size: .9rem; padding: .55rem .7rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-2); color: var(--text); min-width: 240px; }
.breed-picks select:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.breed-plus { font-size: 1.5rem; color: var(--accent); padding-bottom: .35rem; }
.breed-picks label .mini { color: var(--faint); font-size: .58rem; letter-spacing: .06em; }

/* --- Blazor error UI ------------------------------------------------------ */
#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10000;
    padding: .8rem 1.2rem; background: #1a0e12; color: #ffd0d0;
    border-top: 1px solid var(--danger); font-family: var(--font-hud); font-size: .8rem;
}
#blazor-error-ui .reload { color: var(--accent); }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

@media (max-width: 780px) {
    .hero-panel { grid-template-columns: 1fr; padding: 1.6rem; }
    .topbar { flex-wrap: wrap; gap: .8rem; }
    .content { padding: 1.2rem 1rem 3rem; }
}

/* --- Duel (staked PvP) ---------------------------------------------------- */
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.oppgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; margin-bottom: .3rem; }
.oppcard {
    text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: .3rem;
    padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg-2); color: var(--text); font: inherit;
}
.oppcard:hover { border-color: var(--accent); }
.oppcard.sel { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 1px var(--accent) inset; }
.oppcard-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.oppcard-stats { font-size: .72rem; color: var(--muted); }
.oppcard-xp { font-size: .72rem; }
.match-row { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; font-size: .86rem; }
.match-row + .match-row { border-top: 1px solid var(--line); }
.dm-absorb { display: flex; flex-direction: row; align-items: center; gap: .5rem; font-size: .84rem; color: var(--muted); }
.dm-absorb input { width: auto; }

/* --- Terms of Use: the entry gate + the /terms page ----------------------- */
/* Wider and taller than the ordinary modal: this one has to be READ, not skimmed,
   and a cramped scroller is how a terms box becomes a formality. */
.terms-backdrop { z-index: 200; }
.terms-modal { max-width: 720px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.terms-lede { margin: .2rem 0 .9rem; font-size: .9rem; line-height: 1.55; }
.terms-scroll {
    flex: 1; min-height: 160px; overflow-y: auto;
    padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg-2);
}
.terms-check {
    display: flex; gap: .6rem; align-items: flex-start;
    margin: .9rem 0 .2rem; font-size: .86rem; line-height: 1.45;
}
.terms-check input { width: auto; margin-top: .2rem; flex: none; }
.terms-actions { margin-top: .8rem; }
/* Shown when the terms couldn't be put on screen, which also disables Accept — you cannot agree to a
   document you were never shown. */
.terms-blocked {
    margin: .8rem 0 0; font-size: .8rem; line-height: 1.5;
    padding: .55rem .7rem; border-radius: var(--radius-sm);
    border: 1px solid var(--danger); background: rgba(255,77,109,.07);
}
.terms-foot { margin: .7rem 0 0; font-size: .78rem; }

.terms-doc { font-size: .88rem; line-height: 1.6; }
.terms-doc h2 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
.terms-doc h3 { font-size: .95rem; margin: 1.1rem 0 .4rem; }
.terms-doc h4, .terms-doc h5, .terms-doc h6 { font-size: .88rem; margin: .9rem 0 .35rem; }
.terms-doc > :first-child { margin-top: 0; }
.terms-doc p { margin: .55rem 0; }
.terms-doc hr { border: none; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.terms-doc .md-list { margin: .5rem 0; padding-left: 1.2rem; }
.terms-doc .md-list li { margin: .3rem 0; }
.terms-doc .md-quote { color: var(--muted); border-left: 2px solid var(--line); padding-left: .8rem; }
.terms-doc .md-code {
    white-space: pre-wrap; word-break: break-word; font-family: var(--font-hud);
    font-size: .78rem; padding: .6rem .7rem; border-radius: var(--radius-sm);
    background: var(--bg-2); border: 1px solid var(--line);
}
.terms-doc code { font-family: var(--font-hud); font-size: .82em; }
.terms-doc a { color: var(--accent); }

.footer {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 1.2rem 1.6rem 2rem; border-top: 1px solid var(--line);
    font-size: .78rem;
}
.footer a { color: var(--accent-2); }

/* --- Operator console: paired panels that collapse to one column ---------- */
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.1rem; }
