/* Checkers Lingo - play page: neon arcade board vs trash-talking bots.
   Buttons ARE the craftpix 567216 blank-button art via border-image 9-slice
   (shared with the chessingo sibling); discs are pure CSS so they scale crisp
   at any board size. Palette tokens mirror style.css. */

:root {
    --red: #ff5a4d;
    --grape: #7b2ff7;
    --grape-deep: #22104e;
    --lime: #4dffb0;
    --lime-deep: #0e8c56;
    --magenta: #ff2d78;
    --corn: #ffd23f;
    --tangerine: #ff9f1c;
    --berry: #b34fff;
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.82);
    --card-line: rgba(255, 255, 255, 0.25);
    /* Board squares: warm dark oak + slate, neon-friendly. */
    --sq-dark: #2a1533;
    --sq-light: #3f2b52;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background-color: #0f0c1a;
    /* Spellspire in-game backdrop (ART-PROMPTS.md cl_02). The scrim keeps the
       board readable; if the CDN image is slow or blocked the gradient fallback
       below (and the base colour) still render an arcane dark backdrop. */
    background:
        linear-gradient(rgba(20, 15, 34, 0.82), rgba(15, 12, 26, 0.92)),
        radial-gradient(circle at 50% 120%, rgba(124, 58, 237, 0.18) 0%, transparent 55%),
        url('https://prodmedia.tyga.host/public/tyga.cloud/landing/checkerslingo.com/checkerslingo_02.jpg') center center / cover no-repeat,
        linear-gradient(180deg, #14121b 0%, #0d0e13 55%, #08080c 100%);
    background-attachment: fixed;
}

header.play-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    padding: 0.9rem clamp(0.8rem, 3vw, 1.4rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
header.play-head h1 {
    line-height: 0;
    margin-right: auto;
}
header.play-head h1 .logo-mark {
    display: block;
    height: clamp(2.2rem, 5.5vw, 3rem);
    width: auto;
    filter: drop-shadow(0 0 14px rgba(255, 210, 63, 0.35));
}
/* Nav links use the real craftpix blue button art (border-image 9-slice) - no
   improvised pill shapes, no square icon tiles. */
header.play-head a {
    position: relative;
    text-decoration: none;
    color: #06202f;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
    padding: 0.05rem 0.35rem 0.15rem;
    border-style: solid;
    border-width: 13px 18px 17px 16px;
    border-image-source: url('/img/ui/btnbg-blue.png');
    border-image-slice: 40 48 52 44 fill;
    border-image-repeat: stretch;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
    transition: transform 0.07s ease, filter 0.12s ease;
}
header.play-head a:hover { filter: brightness(1.07) saturate(1.06) drop-shadow(0 4px 7px rgba(0, 0, 0, 0.4)); }
header.play-head a:active { transform: translateY(2px); filter: brightness(0.97) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }

.arena {
    padding: 0.6rem clamp(0.6rem, 3vw, 1.4rem) 2rem;
    margin: 0 auto;
}

/* The 1v1 table: opponent | board | you. Board centred, rails either side. */
.arena-table {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(220px, 300px);
    gap: clamp(0.8rem, 1.6vw, 1.4rem);
    align-items: stretch;
    max-width: 1500px;
}
.arena-table .rail {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 0;
}

.board-wrap {
    position: relative;
    margin: 0 auto;
    align-self: start;
    justify-self: center;
    width: 100%;
    max-width: min(100%, calc(100dvh - 150px), 760px);
}

/* On a phone the table stacks the way you sit at it: opponent across the board
   at the top, the board, then YOU, then the rest. The rails dissolve so their
   cards order individually, and the two seats shrink to a one-line strip. */
@media (max-width: 900px) {
    .arena-table {
        grid-template-columns: minmax(0, 1fr);
        max-width: 760px;
    }
    .arena-table .rail { display: contents; }
    .arena-table .rail > * { order: 5; }
    .arena-table .hero-opponent { order: 1; }
    .arena-table .board-wrap { order: 2; }
    .arena-table .seat-card { order: 3; }
    .arena-table .lingo-card { order: 4; }
    .arena-table .hero-opponent, .arena-table .seat-card {
        flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; gap: 0.3rem 0.8rem;
    }
    .arena-table .hero-opponent .rail-cap, .arena-table .seat-card .rail-cap { display: none; }
    .arena-table .hero-opponent .bot-face, .arena-table .seat-card .seat-face {
        width: 64px; max-width: 64px; font-size: 2.2rem; border-radius: 12px;
    }
    .arena-table .hero-opponent .bot-name, .arena-table .seat-card .seat-name { margin-top: 0; font-size: 1.15rem; }
}
/* 3D mode (GDD s20): the three.js canvas replaces the #board grid inside the
   same wrap; the DOM board keeps rendering underneath as the instant fallback,
   so dropping .is-3d restores 2D with no other work. */
.board-wrap.is-3d #board { display: none; }
canvas.board3d {
    display: none;
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    border: 5px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow:
        0 0 0 3px rgba(123, 47, 247, 0.5),
        0 12px 44px rgba(123, 47, 247, 0.35),
        inset 0 0 22px rgba(0, 0, 0, 0.45);
    user-select: none;
    touch-action: none;
}
.board-wrap.is-3d canvas.board3d { display: block; }

/* The Trail HUD (GDD s6.1): one strip above the board. Idle it states the core
   rule; with a piece selected it previews the word each jump chain would spell,
   gold + payout when the trail is a real castable word. */
#trail-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.7rem;
    min-height: 2.2rem;
    margin: 0 0 0.6rem;
    padding: 0.32rem 0.85rem;
    border-radius: 12px;
    background: rgba(123, 47, 247, 0.12);
    border: 1px solid rgba(123, 47, 247, 0.35);
    font-size: 0.85rem;
    line-height: 1.25;
}
#trail-hud.live { border-color: rgba(255, 210, 63, 0.5); background: rgba(123, 47, 247, 0.2); }
#trail-hud .th-cap {
    font-family: 'Titan One', system-ui, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #b98cff;
    white-space: nowrap;
}
#trail-hud .th-hint { color: rgba(255, 255, 255, 0.6); }
#trail-hud .th-word {
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.08rem 0.55rem;
    white-space: nowrap;
}
#trail-hud .th-word.cast {
    color: var(--corn);
    background: rgba(255, 210, 63, 0.14);
    box-shadow: 0 0 10px rgba(255, 210, 63, 0.28);
}
#trail-hud .th-word b { margin-left: 0.4rem; font-weight: 800; }

#board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    aspect-ratio: 1;
    width: 100%;
    border: 5px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 0 3px rgba(255, 90, 77, 0.5),
        0 12px 44px rgba(255, 90, 77, 0.4),
        inset 0 0 22px rgba(0, 0, 0, 0.45);
    user-select: none;
}
.sq {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    cursor: pointer;
}
.sq.light { background: var(--sq-light); }
.sq.dark { background: var(--sq-dark); }
.sq.last-move { box-shadow: inset 0 0 0 3px rgba(255, 210, 63, 0.5); }
.sq.selected { outline: 3px solid var(--corn); outline-offset: -3px; }

/* Playable checker discs - glossy 3D via layered gradients + grooved rings. */
.disc {
    width: 78%;
    height: 78%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    transition: transform 0.12s ease;
    -webkit-user-select: none;
    user-select: none;
}
.disc.red {
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 50% 60%, #ff7b6f 0%, #ff5a4d 42%, #c2261c 100%);
    box-shadow:
        inset 0 0 0 4px rgba(255, 255, 255, 0.14),
        inset 0 3px 5px rgba(255, 255, 255, 0.5),
        inset 0 -6px 10px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.5);
}
.disc.black {
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 50% 60%, #4a4a58 0%, #24242e 45%, #101014 100%);
    box-shadow:
        inset 0 0 0 4px rgba(255, 255, 255, 0.08),
        inset 0 3px 5px rgba(255, 255, 255, 0.28),
        inset 0 -6px 10px rgba(0, 0, 0, 0.55),
        0 4px 8px rgba(0, 0, 0, 0.55);
}
/* Kings get a gold crown glyph and a bright crown ring. */
.disc.king {
    color: var(--corn);
    text-shadow: 0 0 8px rgba(255, 210, 63, 0.9), 0 1px 1px rgba(0, 0, 0, 0.6);
}
.disc.red.king { box-shadow: inset 0 0 0 4px rgba(255, 210, 63, 0.6), inset 0 3px 5px rgba(255, 255, 255, 0.5), inset 0 -6px 10px rgba(0, 0, 0, 0.4), 0 0 14px rgba(255, 210, 63, 0.5), 0 4px 8px rgba(0, 0, 0, 0.5); }
.disc.black.king { box-shadow: inset 0 0 0 4px rgba(255, 210, 63, 0.55), inset 0 3px 5px rgba(255, 255, 255, 0.28), inset 0 -6px 10px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 210, 63, 0.45), 0 4px 8px rgba(0, 0, 0, 0.55); }
.sq:hover .disc { transform: translateY(-4%) scale(1.04); }
.sq.selected .disc { transform: translateY(-5%) scale(1.06); }

/* Purchased cosmetics (server-gated via /api/entitlement). Backgrounds re-tint
   the square vars; skins re-paint the disc gradients. Applied as data-attrs on
   #board so a single owned pick themes the whole board. */
#board[data-bg="bg-midnight-arena"] { --sq-dark: #0a1030; --sq-light: #16205a; }
#board[data-bg="bg-golden-hour"] { --sq-dark: #4a2410; --sq-light: #7a4a1c; }
#board[data-skin="skin-neon-discs"] .disc.red {
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 50% 60%, #ff9be0 0%, #ff2d78 45%, #a80f4d 100%);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.18), inset 0 3px 5px rgba(255, 255, 255, 0.6), inset 0 -6px 10px rgba(0, 0, 0, 0.35), 0 0 16px rgba(255, 45, 120, 0.7), 0 4px 8px rgba(0, 0, 0, 0.5);
}
#board[data-skin="skin-neon-discs"] .disc.black {
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 50% 60%, #7bffe0 0%, #4dffb0 45%, #128a63 100%);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.16), inset 0 3px 5px rgba(255, 255, 255, 0.45), inset 0 -6px 10px rgba(0, 0, 0, 0.4), 0 0 16px rgba(77, 255, 176, 0.65), 0 4px 8px rgba(0, 0, 0, 0.5);
}
#board[data-skin="skin-classic-ivory"] .disc.red {
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 50% 60%, #fff7e6 0%, #f2e3c2 45%, #c9b083 100%);
    box-shadow: inset 0 0 0 4px rgba(120, 90, 40, 0.2), inset 0 3px 5px rgba(255, 255, 255, 0.7), inset 0 -6px 10px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.5);
    color: rgba(90, 60, 20, 0.9);
}
#board[data-skin="skin-classic-ivory"] .disc.black {
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 50% 60%, #6a5b48 0%, #3a3026 45%, #1c160f 100%);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.1), inset 0 3px 5px rgba(255, 255, 255, 0.3), inset 0 -6px 10px rgba(0, 0, 0, 0.55), 0 4px 8px rgba(0, 0, 0, 0.55);
}

/* Owned-cosmetic picker in the side panel. */
#cosmetics { display: flex; flex-direction: column; gap: 0.55rem; }
.cos-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.cos-label { font-family: 'Silkscreen', monospace; font-size: 0.7rem; color: var(--text-dim); width: 100%; }
.cos-btn {
    font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 600;
    padding: 0.22rem 0.6rem; border-radius: 8px; cursor: pointer;
    color: var(--text-dim); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-line);
    transition: transform 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}
.cos-btn:hover { transform: translateY(-1px); color: #fff; }
.cos-btn.active { color: var(--corn); border-color: var(--corn); background: rgba(255, 210, 63, 0.12); }

/* Move hints: a mint ring for quiet moves, a magenta ring for a jump landing.
   RING, not dot: every dark square carries a rune letter, and the old 26% dot
   sat UNDER the glyph reading as a faint halo - the e2e vision pass failed the
   board as "no legal moves marked". The ring wraps the rune, the square tints,
   and the letter stays readable inside (the letters ARE the game). */
.sq.hint { background-image: linear-gradient(rgba(77, 255, 176, 0.16), rgba(77, 255, 176, 0.16)); }
.sq.hint::after {
    content: '';
    position: absolute;
    width: 68%;
    height: 68%;
    border-radius: 50%;
    background: transparent;
    border: 3px solid rgba(77, 255, 176, 0.85);
    box-shadow: 0 0 12px rgba(77, 255, 176, 0.7), inset 0 0 10px rgba(77, 255, 176, 0.25);
    pointer-events: none;
}
.sq.hint.capture-hint::after {
    width: 84%;
    height: 84%;
    background: transparent;
    border: 3px solid rgba(255, 45, 120, 0.85);
    box-shadow: 0 0 12px rgba(255, 45, 120, 0.85);
}

/* Game-over overlay */
#overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.8rem;
    background: rgba(10, 10, 16, 0.82);
    border-radius: 12px;
    z-index: 5;
    text-align: center;
}
#overlay.show { display: flex; }
#overlay h2 { font-family: 'Titan One', 'Arial Black', sans-serif; color: var(--corn); font-size: 1.9rem; letter-spacing: 0.02em; }
#overlay p { color: var(--text-dim); }

/* Chest / coins reveal on the result screen. The SERVER decides the payout
   (routes/economy.js); this just renders what it granted. */
#reward { display: none; }
#reward.show { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
#reward .chest {
    font-size: 2.6rem; line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
    animation: chest-pop 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}
#reward .coins {
    font-family: 'Silkscreen', 'Titan One', monospace; font-size: 1.15rem; color: var(--corn);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
#reward .coins .plus { color: var(--lime); }
@keyframes chest-pop { 0% { transform: scale(0.2) rotate(-12deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }

/* Coin balance pill in the play header (links to the store to top up). */
.coin-pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.28rem 0.8rem; border-radius: 9999px; text-decoration: none;
    font-family: 'Silkscreen', 'Titan One', monospace; font-size: 0.85rem; font-weight: 700;
    color: var(--corn); background: rgba(255, 210, 63, 0.12); border: 1px solid rgba(255, 210, 63, 0.5);
    transition: transform 0.12s ease, background 0.12s ease;
}
.coin-pill:hover { background: rgba(255, 210, 63, 0.2); transform: translateY(-1px); }
.coin-pill .coin-ico { color: var(--corn); font-size: 0.9rem; }
.coin-pill.bump { animation: coin-bump 0.45s ease; }
@keyframes coin-bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }

/* Side panel */
.panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    flex: 1 1 260px;
    min-width: 240px;
    max-width: 380px;
}
@media (max-width: 780px) { .panel { max-width: none; } }
/* The Lingo card grows to fill the rest of the left rail; its feed scrolls. */
.arena-table .lingo-card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.arena-table .lingo-card #events { flex: 1 1 auto; }
.card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 55%),
        rgba(26, 20, 34, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 18px;
    padding: 0.95rem 1.05rem 1.05rem;
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -6px 14px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}
.card h3 {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 0.6rem;
    text-shadow: 0 0 10px rgba(255, 90, 77, 0.5);
}
/* OPPONENT HERO + YOUR SEAT: the same frame on both sides of the board, holding
   a face (a living-ladder member's tygazen avatar, a Warden's portrait, or
   yours). The glyph set by play.js stays as the fallback until the image loads,
   so a dead CDN is never a broken picture. Pattern: ../chessingo.com. */
.hero-opponent, .seat-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.rail-cap {
    align-self: stretch; text-align: left;
    font-family: 'Outfit', sans-serif; font-size: 0.78rem;
    letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800;
    margin-bottom: 0.6rem;
}
.hero-opponent .rail-cap { color: var(--corn); }
.seat-card .rail-cap { color: var(--red); }

.hero-opponent .bot-face {
    position: relative;
    width: 100%; max-width: 190px; aspect-ratio: 1 / 1; border-radius: 18px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    font-size: clamp(3.4rem, 8vw, 6rem); line-height: 1; color: var(--corn);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 52%),
        radial-gradient(circle at 50% 32%, rgba(123, 47, 247, 0.5), rgba(0, 0, 0, 0.45));
    border: 3px solid rgba(255, 210, 63, 0.4);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.3), 0 8px 22px rgba(0, 0, 0, 0.4);
    text-shadow: 0 0 18px currentColor;
}
.seat-card .seat-face {
    position: relative;
    width: 100%; max-width: 150px; aspect-ratio: 1 / 1; border-radius: 18px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    font-size: 2.8rem; line-height: 1; color: var(--red);
    background: radial-gradient(circle at 50% 32%, rgba(255, 90, 77, 0.28), rgba(0, 0, 0, 0.45));
    border: 3px solid rgba(255, 90, 77, 0.45);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.25), 0 8px 22px rgba(0, 0, 0, 0.4);
}
.hero-opponent .bot-name, .seat-card .seat-name {
    font-family: 'Titan One', 'Outfit', sans-serif; color: var(--text);
    font-size: 1.5rem; margin-top: 0.6rem; letter-spacing: 0.02em;
}
.hero-opponent .bot-name { color: var(--corn); }
.hero-opponent .bot-tier, .seat-card .seat-sub {
    font-size: 0.85rem; color: var(--text-dim);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 0.3rem; margin-top: 0.2rem;
}

/* A face painted by js/seat.js. Member avatars are pixel art (cover, crisp);
   smooth Warden portraits and the disc are contained. */
.has-face { padding: 0 !important; text-shadow: none !important; background: rgba(4, 10, 20, 0.82) !important; overflow: hidden; }
.seat-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.seat-img.is-pixel { image-rendering: pixelated; }

/* Glossy candy select. */
select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 48%),
        linear-gradient(180deg, #3a1f2c 0%, #24141c 100%);
    color: var(--text);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.3), inset 0 -3px 6px rgba(0, 0, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* Buttons ARE the craftpix blank button art, drawn as a border-image 9-slice
   so the glossy body, rounded corners and baked shadow scale to any label. */
button.btn {
    position: relative;
    display: block;
    width: 100%;
    min-height: 20px;
    padding: 0.2rem 0.7rem 0.35rem;
    border-style: solid;
    border-width: 18px 24px 26px 22px;
    border-image-source: url('/img/ui/btnbg-grey.png');
    border-image-slice: 40 48 52 44 fill;
    border-image-repeat: stretch;
    background: transparent;
    color: #2a1a08;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
    filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.4));
    transition: transform 0.07s ease, filter 0.12s ease;
}
button.btn:hover { filter: brightness(1.07) saturate(1.06) drop-shadow(0 5px 9px rgba(0, 0, 0, 0.45)); }
button.btn:active { transform: translateY(3px); filter: brightness(0.97) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)); }
button.btn + button.btn, button.btn + select, select + button.btn { margin-top: 0.6rem; }

/* Colour variants = swap in the matching kit button PNG. */
button.btn.primary { border-image-source: url('/img/ui/btnbg-gold.png'); color: #2a1600; }
button.btn.danger  { border-image-source: url('/img/ui/btnbg-red.png');  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

/* Per-action kit button colour. */
#new-game, #rematch { border-image-source: url('/img/ui/btnbg-gold.png'); color: #2a1600; }
#resign             { border-image-source: url('/img/ui/btnbg-red.png');  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

#status { font-size: 0.95rem; min-height: 1.4em; }
#status .thinking { color: var(--red); }
#status .danger { color: var(--magenta); }

/* Lingo feed (trash talk) */
#events {
    max-height: 230px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
}
#events .ev {
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-dim);
}
#events .ev.spicy { border-left: 3px solid var(--magenta); color: var(--text); }
#events .ev-who { color: var(--corn); font-weight: 700; }
/* The player's own jab, right-aligned so the back-and-forth reads like a chat. */
#events .ev.you { align-self: flex-end; background: rgba(77, 255, 176, 0.1); border-right: 3px solid var(--lime); color: var(--text); max-width: 85%; }
#events .ev.you .ev-who { color: var(--lime); }
/* The bot is composing a clap-back. */
#events .ev.typing { color: var(--text-dim); font-style: italic; opacity: 0.75; }

/* Talk-back box: type a jab, the bot fires back in-persona (the Lingo moat). */
#lingo-form { display: flex; gap: 0.4rem; margin-top: 0.55rem; }
#lingo-input {
    flex: 1; min-width: 0;
    padding: 0.4rem 0.6rem; border-radius: 8px;
    font-family: 'Outfit', sans-serif; font-size: 0.85rem;
    color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--card-line);
}
#lingo-input:focus { outline: none; border-color: var(--lime); }
#lingo-input::placeholder { color: var(--text-dim); }
#lingo-send { width: auto; padding: 0.4rem 0.9rem; font-size: 0.8rem; flex: 0 0 auto; }
#lingo-form.busy #lingo-input, #lingo-form.busy #lingo-send { opacity: 0.55; pointer-events: none; }

/* ---------------------------------------------------- The Trail (words) */
/* Runes on the dark squares; the disc sits above them. */
.sq-letter {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Silkscreen', monospace;
    /* Runes are GOLD, the same glow as the 3D glyphs (GDD s20.4: 2D and 3D are
       one palette) - and cyan stays reserved for DAME's frozen runes, which
       were indistinguishable when every rune was green-cyan. Sized up: the
       letters ARE the game and were illegible at 0.65rem. */
    font-size: clamp(0.85rem, 3.2vw, 1.35rem);
    color: rgba(255, 210, 63, 0.92);
    text-shadow: 0 0 7px rgba(255, 210, 63, 0.5), 0 1px 1px rgba(0, 0, 0, 0.6);
    z-index: 1;
    pointer-events: none;
    user-select: none;
}
.sq .disc { position: relative; z-index: 2; }

/* Arcana pill in the header (word score this run). */
.arcana-pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.28rem 0.8rem; border-radius: 9999px;
    font-family: 'Silkscreen', monospace; font-size: 0.85rem; font-weight: 700;
    color: #a78bfa; background: rgba(124, 58, 237, 0.14); border: 1px solid rgba(124, 58, 237, 0.5);
}
.arcana-pill .arcana-ico { color: #34d399; font-size: 0.9rem; }

/* The LINGO pop: a word just got cast. */
#lingo-pop {
    position: absolute; left: 50%; top: 34%;
    transform: translate(-50%, -50%);
    z-index: 30; pointer-events: none; opacity: 0;
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    text-align: center;
}
#lingo-pop.show { animation: lingo-pop 1.6s ease forwards; }
#lingo-pop .lingo-word {
    font-family: 'Titan One', 'Arial Black', sans-serif;
    font-size: clamp(1.8rem, 7vw, 3rem); letter-spacing: 0.06em;
    color: #fbbf24; text-shadow: 0 0 18px rgba(251, 191, 36, 0.7), 0 3px 0 rgba(0, 0, 0, 0.4);
}
#lingo-pop .lingo-score {
    font-family: 'Silkscreen', monospace; font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: #34d399; text-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}
@keyframes lingo-pop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-6deg); }
    18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(0); }
    70% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -84%) scale(1); }
}

/* ------------------------------------------------------- rogue run HUD */
.run-line { font-family: 'Silkscreen', monospace; color: var(--corn); font-size: 0.9rem; margin-bottom: 0.4rem; }
.run-relics { display: flex; flex-wrap: wrap; gap: 0.3rem; min-height: 1.2rem; margin-bottom: 0.6rem; }
.relic-chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.7rem; height: 1.7rem; border-radius: 8px; font-size: 0.95rem;
    color: #a78bfa; background: rgba(124, 58, 237, 0.16); border: 1px solid rgba(124, 58, 237, 0.5);
    cursor: default;
}

/* The between-rungs sigil draft (shown in the result overlay on a win). */
#draft { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem auto 0.8rem; max-width: 340px; }
#draft .draft-head { font-family: 'Titan One', sans-serif; color: var(--lime); font-size: 1rem; letter-spacing: 0.03em; }
.draft-pick {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
    padding: 0.5rem 0.7rem; border-radius: 12px; cursor: pointer; text-align: left;
    color: var(--text); background: rgba(124, 58, 237, 0.12); border: 1px solid rgba(124, 58, 237, 0.45);
    transition: transform 0.1s ease, border-color 0.1s ease, background 0.1s ease;
}
.draft-pick:hover { transform: translateY(-1px); border-color: var(--corn); background: rgba(124, 58, 237, 0.2); }
.draft-pick .draft-top { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.95rem; color: var(--corn); }
.draft-pick .draft-glyph { color: #a78bfa; }
.draft-pick .draft-desc { font-size: 0.8rem; color: var(--text-dim); }

/* --------------------------------------------------- Warden gimmicks */
.sq-letter.frozen { color: #7dd3fc; text-shadow: 0 0 8px rgba(125, 211, 252, 0.8); opacity: 0.95; }
.bot-gimmick {
    margin-top: 0.5rem; padding: 0.35rem 0.55rem; border-radius: 8px;
    font-size: 0.82rem; color: var(--corn);
    background: rgba(192, 38, 211, 0.12); border: 1px solid rgba(192, 38, 211, 0.5);
}
