/* ═══ DCC Chess — Dark Dungeon Aesthetic ═══ */

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

:root {
    --bg-darkest: #0a0a0f;
    --bg-dark: #12121a;
    --bg-medium: #1a1a2e;
    --bg-light: #252540;
    --bg-panel: #16162a;
    --text-primary: #e0d8c8;
    --text-secondary: #8a8478;
    --text-dim: #5a5650;
    --accent-gold: #c9a84c;
    --accent-red: #c04040;
    --accent-orange: #d47030;
    --white-piece: #d4cbb8;
    --black-piece: #d45828;
    --square-light: #3a3552;
    --square-dark: #252040;
    --highlight-move: rgba(100, 200, 100, 0.4);
    --highlight-selected: rgba(201, 168, 76, 0.5);
    --highlight-last-move: rgba(201, 168, 76, 0.2);
    --btn-primary: #c9a84c;
    --btn-primary-hover: #dab85c;
    --btn-secondary: #4a4560;
    --btn-secondary-hover: #5a5575;
    --danger: #c04040;
    --success: #40a040;
    --border-color: #333050;
}

body {
    background: var(--bg-darkest);
    color: var(--text-primary);
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ═══ LIGHT THEME (Game Settings toggle — remembered in localStorage) ═══ */
body.light-theme {
    --bg-dark: #f0f0f5;
    --bg-medium: #ffffff;
    --bg-light: #e8e8f0;
    --bg-panel: #f5f5fa;
    --text-primary: #1a1a2e;
    --text-secondary: #444466;
    --border-color: #ccccdd;
    --accent-gold: #8B6914;
    --accent-red: #cc2200;
}
body.light-theme .board .square.light { background: #d4c9b0; }
body.light-theme .board .square.dark { background: #8b7355; }

/* ═══ SCREENS ═══ */
.screen {
    display: none;
    min-height: 100vh;
}
.screen.active {
    display: flex;
}

/* ═══ START SCREEN ═══ */
#start-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, var(--bg-medium) 0%, var(--bg-darkest) 70%);
}
.start-container {
    text-align: center;
}
/* Subtle way back to the website homepage — plain text, not a button */
#start-screen {
    position: relative;
}
.home-link {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 50;
    min-height: 44px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.2s;
}
.home-link:hover,
.home-link:focus-visible {
    color: var(--accent-gold);
}
.home-link:focus-visible {
    outline: 1px solid var(--accent-gold);
    outline-offset: -4px;
}
/* Portrait phones: sit below the fixed "Rotate device" hint */
@media (max-width: 599px) and (orientation: portrait) {
    .home-link {
        top: 34px;
    }
}
.start-logo {
    display: block;
    /* Team photo is wider than tall (1000x889): cap by width and by screen height */
    width: min(560px, 90vw, 62vh);
    max-width: 90%;
    height: auto;
    margin: 0 auto 2.5rem;
}
@media (orientation: landscape) and (max-height: 520px) {
    .start-logo {
        width: min(90vw, 52vh);
        margin: 0.75rem auto 1rem;
    }
}
.mode-select {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
/* Fan project disclaimer at the bottom of the start screen (in the normal flow,
   so it never overlaps the buttons; bottom margin keeps it clear of #version-tag) */
.fan-disclaimer {
    max-width: 64ch;
    margin: 2.25rem auto 1.75rem;
    text-wrap: balance;
    padding: 0 16px;
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--text-secondary);
}
@media (orientation: landscape) and (max-height: 520px) {
    .fan-disclaimer {
        margin: 1.25rem auto 1.5rem;
    }
}
.dev-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}
.dev-status {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

/* ═══ BUTTONS ═══ */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.btn-primary {
    background: var(--btn-primary);
    color: var(--bg-darkest);
}
.btn-primary:hover:not(:disabled) {
    background: var(--btn-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
}
.btn-secondary {
    background: var(--btn-secondary);
    color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--btn-secondary-hover);
    transform: translateY(-1px);
}
.btn-dev {
    background: linear-gradient(135deg, #6a4c93 0%, #8b5cf6 100%);
    color: white;
}
.btn-dev:hover:not(:disabled) {
    background: linear-gradient(135deg, #7a5ca3 0%, #9b6cf6 100%);
    transform: translateY(-2px);
}
.btn-settings {
    background: var(--bg-light);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 8px 16px;
    font-size: 0.9rem;
}
.btn-settings:hover:not(:disabled) {
    background: var(--accent-gold);
    color: var(--bg-darkest);
    transform: translateY(-1px);
}
/* "← Back" on the draft screen and during the placement phase */
#draft-screen,
#game-screen {
    position: relative;
}
.btn-back {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 50;
    min-height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-panel);
    color: var(--accent-gold);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: background 0.15s, border-color 0.15s;
}
.btn-back:hover {
    background: var(--bg-light);
    border-color: var(--accent-gold);
}
/* Placement phase: drop the game layout below the button (12 + 44 + 12px) */
#game-screen.has-back-btn {
    padding-top: 68px;
}
#game-screen.has-back-btn .game-layout {
    height: calc(100vh - 84px);
}
/* Narrow screens: the centered draft title would run under the button */
@media (max-width: 720px) {
    #draft-screen .draft-header {
        padding-top: 48px;
    }
}
.btn-end-turn {
    background: var(--accent-red);
    color: #fff;
    margin-top: 10px;
    width: 100%;
}
.btn-end-turn:hover:not(:disabled) {
    background: #d04848;
}
.btn-undo {
    margin-top: 8px;
    width: 100%;
    border: 1px solid var(--accent-gold);
}

/* ═══ DRAFT SCREEN ═══ */
#draft-screen {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 24px 20px;
    background: radial-gradient(ellipse at top, var(--bg-medium) 0%, var(--bg-darkest) 70%);
    overflow: hidden;
}
.draft-container {
    display: flex;
    flex-direction: column;
    max-width: 1040px;
    width: 100%;
    max-height: calc(100vh - 48px);
}
.draft-header {
    text-align: center;
    margin-bottom: 1rem;
    flex: 0 0 auto;
}
.draft-header h2 {
    color: var(--accent-gold);
    font-size: 1.7rem;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}
.draft-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.draft-counter {
    margin-top: 0.4rem;
    font-size: 1.1rem;
    color: var(--accent-gold);
    font-weight: 700;
}

/* Major pieces reference panel (collapsible) */
.major-ref-panel {
    flex: 0 0 auto;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.major-ref-summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    flex-wrap: wrap;
}
.major-ref-summary::-webkit-details-marker { display: none; }
.major-ref-summary::before {
    content: '▸';
    color: var(--accent-gold);
    font-size: 0.9rem;
    transition: transform 0.15s;
}
.major-ref-panel[open] .major-ref-summary::before { transform: rotate(90deg); }
.mrp-title {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 0.95rem;
}
.mrp-hint {
    color: var(--text-dim);
    font-size: 0.75rem;
}
.major-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    gap: 10px;
    padding: 4px 14px 14px;
    max-height: 34vh;
    overflow-y: auto;
}
.major-ref-card {
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    overflow: hidden;
}
/* Portrait strip bleeding to the card's top edge (cancels the card padding) */
.major-ref-art {
    position: relative;
    overflow: hidden;
    height: 110px;
    margin: -8px -10px 8px;
    border-radius: 5px 5px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.major-ref-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}
.mrc-type {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.75rem;
}
.mrc-ability {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 0.75rem;
    padding: 3px 0;
    color: var(--text-primary);
}
.mrc-ability-name em {
    color: var(--text-dim);
    font-style: normal;
    font-size: 0.68rem;
}
.mrc-cost {
    color: var(--accent-gold);
    font-weight: 700;
    white-space: nowrap;
}
.mrc-ability.boss-only { opacity: 0.5; }
.mrc-boss-label {
    color: #b183d6;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Pawn card grid */
.draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 12px;
    padding: 4px;
    overflow-y: auto;
    flex: 1 1 auto;
    align-content: start;
}
.draft-actions {
    text-align: center;
    padding-top: 1rem;
    flex: 0 0 auto;
}

.pawn-card {
    position: relative;
    background: var(--bg-medium);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.pawn-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-accent, var(--accent-gold));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.pawn-card.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px var(--accent-gold), 0 0 16px rgba(201, 168, 76, 0.35);
}
.pawn-card-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: 0.2px;
}
.pawn-card-art {
    position: relative;
    overflow: hidden;
    height: 120px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}
/* Character portrait layered over the gradient/glyph fallback (attachPortrait) */
.portrait-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border: none;
    outline: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    user-select: none;
}
.portrait-img.loaded { opacity: 1; }
.portrait-img.instant { transition: none; }
.pawn-card-art.has-portrait {
    border-color: transparent;
    box-shadow: none;
}
.pawn-card-art-glyph {
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.pawn-card-ability {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--card-accent, var(--accent-gold));
}
.pawn-card-mana {
    align-self: flex-start;
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.pawn-card-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.35;
}
.pawn-card-check {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: var(--bg-darkest);
    font-size: 0.8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.12s, transform 0.12s;
}
.pawn-card.selected .pawn-card-check {
    opacity: 1;
    transform: scale(1);
}

@media (max-width: 640px) {
    .draft-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ═══ GAME SCREEN ═══ */
#game-screen {
    padding: 16px;
    background: var(--bg-darkest);
}
.game-layout {
    display: flex;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
    height: calc(100vh - 32px);
}

/* Board Section */
.board-section {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--bg-panel);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.turn-label {
    font-size: 1.2rem;
    font-weight: 700;
}
.turn-label.white-turn {
    color: var(--white-piece);
}
.turn-label.black-turn {
    color: var(--black-piece);
}
.turn-number {
    color: var(--text-secondary);
    margin-left: 12px;
    font-size: 0.9rem;
}
.phase-label {
    color: var(--accent-gold);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Check banner */
.check-banner {
    background: #b91c1c;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

/* Game over banner (top of board — same shape as the check banner, colored
   by result: gold for a White win, red for a Black win, grey for a draw).
   Stays visible until "Play Again" is clicked. */
.game-over-banner {
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.game-over-banner.white-wins {
    background: var(--accent-gold);
    color: var(--bg-darkest);
}
.game-over-banner.black-wins {
    background: var(--accent-red);
    color: #fff;
}
.game-over-banner.draw {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* "Play Again" — full width of the battle log container, below the Export /
   Report row. Only shown once the game is over. */
.play-again-btn {
    width: 100%;
    margin-top: 10px;
    padding: 14px;
    font-size: 1.05rem;
}

/* Matt's Drunk Again swap banner */
.swap-banner {
    background: linear-gradient(90deg, #7c3aed, #db2777);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    padding: 8px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    animation: swap-banner-pulse 1.6s ease-in-out infinite;
}
@keyframes swap-banner-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* Boss co-op: a player's Carl has fallen */
.fallen-banner {
    background: #1a1a1a;
    color: #ff8080;
    border: 2px solid #b91c1c;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    padding: 8px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

/* Boss health bar */
.boss-health-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a1a1a;
    border: 2px solid #b91c1c;
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 8px;
    color: #fff;
}
.boss-health-bar .boss-name {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}
.boss-health-bar .boss-hp-track {
    flex: 1;
    height: 14px;
    background: #3a1414;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #5a1f1f;
}
.boss-health-bar .boss-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #f87171);
    transition: width 0.3s ease;
}
.boss-health-bar .boss-hp-label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Boss-occupied board squares */
.square.boss-square {
    position: relative;
}
.square.boss-square::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(220, 38, 38, 0.45);
    animation: boss-square-pulse 1.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes boss-square-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.75; }
}
.square.boss-square.boss-square-move-flash::after {
    animation: boss-square-move-flash-anim 0.9s ease-out;
}

/* Boss identifying label — sits on top of the red pulsing overlay */
.boss-square-label {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1px;
    font-size: 0.46rem;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.95), 0 1px 2px rgba(0, 0, 0, 0.95);
    pointer-events: none;
    word-break: break-word;
}
.boss-square-label.boss-square-label-tag {
    font-size: 0.4rem;
    opacity: 0.92;
}
@keyframes boss-square-move-flash-anim {
    0% { background: rgba(255, 220, 80, 0.9); opacity: 1; }
    100% { background: rgba(220, 38, 38, 0.45); opacity: 0.6; }
}

/* Feral Goose puzzle squares: 4 corners + center */
.square.feral-goose-square {
    position: relative;
}
.square.feral-goose-square::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 3px solid rgba(90, 230, 130, 0.85);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(90, 230, 130, 0.5);
    animation: feral-goose-pulse 1.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes feral-goose-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* AI Card deck counter */
.ai-deck-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-gold);
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    white-space: nowrap;
}
.ai-deck-counter .ai-deck-icon {
    font-size: 1.1rem;
}
.ai-deck-counter.empty {
    color: var(--text-dim);
    border-color: var(--text-dim);
}

/* Dev Game mode testing tools -- deliberately styled off the normal gold/red/purple
   game palette (bright cyan, dashed borders) so they always read as "not real UI". */
.dev-tool-btn {
    border: 1px dashed #22d3ee !important;
    color: #22d3ee !important;
    background: rgba(34, 211, 238, 0.08) !important;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    white-space: nowrap;
}
.dev-tool-btn:hover:not(:disabled) {
    background: rgba(34, 211, 238, 0.2) !important;
}

.die.die-dev-editable {
    cursor: pointer;
    border: 2px dashed #22d3ee;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
}
.die.die-dev-editable:hover {
    background: rgba(34, 211, 238, 0.18);
    transform: scale(1.06);
}
.dev-dice-label {
    margin-top: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #22d3ee;
    text-align: center;
    text-transform: uppercase;
}

/* AI summon trigger flash on the dice panel */
.dice-panel.ai-trigger-flash {
    animation: ai-trigger-border-flash 1s ease-in-out;
}
@keyframes ai-trigger-border-flash {
    0%, 100% { box-shadow: none; border-color: var(--border-color); }
    20%, 60% { box-shadow: 0 0 24px 4px rgba(192, 64, 64, 0.85); border-color: var(--accent-red); }
    40%, 80% { box-shadow: 0 0 24px 4px rgba(201, 168, 76, 0.85); border-color: var(--accent-gold); }
}
.ai-trigger-banner {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    z-index: 1900;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fff;
    text-shadow: 0 0 12px rgba(192, 64, 64, 0.9), 0 0 24px rgba(201, 168, 76, 0.6);
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    animation: ai-trigger-banner-anim 1s ease-in-out forwards;
}
@keyframes ai-trigger-banner-anim {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.75); }
    15%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}

/* Automatic turn transition banner (Chunk 4) */
.turn-transition-banner {
    position: fixed;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 2500;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.85);
    animation: turn-transition-anim 1s ease-in-out forwards;
}
.turn-transition-banner.white { color: var(--white-piece); }
.turn-transition-banner.black { color: var(--black-piece); }
.turn-transition-banner.boss {
    color: #ff4444;
    text-shadow: 0 0 24px rgba(255, 40, 40, 0.75), 0 2px 20px rgba(0, 0, 0, 0.85);
}
@keyframes turn-transition-anim {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    18%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.06); }
}

/* AI Card draw overlay */
.ai-card-overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 8, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: pointer;
    transition: background 0.25s ease;
}
.ai-card-overlay-backdrop.visible {
    background: rgba(4, 4, 8, 0.82);
}
.ai-card {
    width: 320px;
    max-width: 86vw;
    padding: 28px 24px;
    border-radius: 16px;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, var(--bg-medium), var(--bg-darkest) 80%);
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 20px 60px rgba(0,0,0,0.7);
    opacity: 0;
    transform: scale(0.75) translateY(60px);
    transition: opacity 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.2), transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.2);
    cursor: default;
}
.ai-card-overlay-backdrop.visible .ai-card {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.ai-card-overlay-backdrop.exiting .ai-card {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
}
.ai-card-name {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin-bottom: 14px;
    text-transform: uppercase;
}
.ai-card-icon {
    font-size: 4rem;
    line-height: 1;
    margin: 8px 0 18px;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.6));
}
.ai-card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.ai-card-boss-meta {
    margin-top: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

/* Card-type variants */
.ai-card.buff {
    border-color: var(--accent-gold);
    background: radial-gradient(circle at 50% 0%, #3a2f14, var(--bg-darkest) 80%);
}
.ai-card.buff .ai-card-name { color: var(--accent-gold); }

.ai-card.debuff {
    border-color: var(--accent-red);
    background: radial-gradient(circle at 50% 0%, #2e1414, var(--bg-darkest) 80%);
}
.ai-card.debuff .ai-card-name { color: #e06060; }

.ai-card.chaos {
    border-color: #9b5cf0;
    background: linear-gradient(160deg, #2a1a3e, #14101f 70%);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 20px 60px rgba(155, 92, 240, 0.35);
}
.ai-card.chaos .ai-card-name {
    color: #c896ff;
    text-shadow: 0 0 10px rgba(155, 92, 240, 0.7);
}

.ai-card.summon {
    border-color: #5a0f0f;
    background: radial-gradient(circle at 50% 0%, #1c0505, #050202 85%);
    box-shadow: 0 0 0 1px #000, 0 0 50px rgba(192, 20, 20, 0.55), 0 20px 60px rgba(0,0,0,0.85);
}
.ai-card.summon .ai-card-name {
    color: #ff4444;
    text-shadow: 0 0 14px rgba(255, 40, 40, 0.8);
}

.ai-card.victory {
    border-color: var(--accent-gold);
    background: radial-gradient(circle at 50% 0%, #2e2a10, var(--bg-darkest) 80%);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 0 50px rgba(201, 168, 76, 0.5), 0 20px 60px rgba(0,0,0,0.7);
}
.ai-card.victory .ai-card-name {
    color: var(--accent-gold);
    text-shadow: 0 0 14px rgba(201, 168, 76, 0.8);
}

/* AI Event Panel: persistent record of the last drawn AI Card */
.ai-event-panel {
    position: relative;
    margin-top: 10px;
    padding: 12px 30px 12px 14px;
    border-radius: 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-gold);
    font-size: 0.82rem;
    width: 100%;
    max-width: 624px; /* matches .dice-panel's rendered width (the fixed 11x52px board grid) */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}
.ai-event-panel-dismiss {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}
.ai-event-panel-dismiss:hover {
    color: var(--text-primary);
}
.ai-event-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ai-event-panel-icon {
    font-size: 1.3rem;
}
.ai-event-panel-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--accent-gold);
}
.ai-event-panel-header.buff { border-color: var(--accent-gold); }
.ai-event-panel-header.buff .ai-event-panel-name { color: var(--accent-gold); }
.ai-event-panel-header.debuff .ai-event-panel-name { color: #e06060; }
.ai-event-panel-header.chaos .ai-event-panel-name { color: #c896ff; }
.ai-event-panel-header.summon .ai-event-panel-name { color: #ff4444; }
.ai-event-panel.buff { border-left-color: var(--accent-gold); }
.ai-event-panel.debuff { border-left-color: var(--accent-red); }
.ai-event-panel.chaos { border-left-color: #9b5cf0; }
.ai-event-panel.summon { border-left-color: #5a0f0f; }
.ai-event-panel-row {
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 3px;
}
.ai-event-panel-row .aep-label {
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 4px;
}
.ai-event-panel-status {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    color: var(--accent-orange);
    font-weight: 600;
    line-height: 1.4;
}

/* Boss summon board announcement */
.boss-announcement-overlay {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(140, 10, 10, 0);
    transition: background 0.2s ease;
}
.boss-announcement-overlay.flashing {
    animation: boss-board-flash 1.8s ease-out;
}
@keyframes boss-board-flash {
    0% { background: rgba(140, 10, 10, 0); }
    10% { background: rgba(140, 10, 10, 0.55); }
    30% { background: rgba(140, 10, 10, 0.25); }
    100% { background: rgba(140, 10, 10, 0); }
}
.boss-announcement-text {
    font-size: 2.4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 16px rgba(255, 30, 30, 0.9), 0 0 40px rgba(0,0,0,0.9);
    opacity: 0;
    animation: boss-announcement-text-anim 1.8s ease-out forwards;
}
@keyframes boss-announcement-text-anim {
    0% { opacity: 0; transform: scale(0.7); }
    15%, 70% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.08); }
}

/* Board */
.board-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}
.row-labels {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.row-labels span {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    width: 20px;
}
.col-labels {
    display: flex;
    gap: 0;
}
.col-labels span {
    width: 52px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 2px 0;
}
.board {
    display: grid;
    grid-template-columns: repeat(11, 52px);
    grid-template-rows: repeat(11, 52px);
    border: 2px solid var(--border-color);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}
.square {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}
.square.light {
    background: var(--square-light);
}
.square.dark {
    background: var(--square-dark);
}
.square:hover {
    filter: brightness(1.2);
}
.square.selected {
    background: var(--highlight-selected) !important;
}
.square.legal-move::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--highlight-move);
}
.square.legal-capture {
    box-shadow: inset 0 0 0 3px rgba(200, 60, 60, 0.6);
}
.square.valid-target {
    background: rgba(255, 215, 0, 0.09) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.30);
}

/* Persistent zone overlays */
.zone-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    border-radius: 2px;
}
.air-strike-overlay {
    background: rgba(70, 70, 70, 0.38);
    color: rgba(210, 210, 210, 0.92);
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1;
}
.lava-zone-overlay {
    background: rgba(200, 70, 10, 0.30);
    font-size: 0.95rem;
}
.ghost-overlay {
    background: rgba(80, 0, 120, 0.28);
    color: rgba(220, 180, 255, 0.95);
    font-size: 0.9rem;
}

/* Piece status-effect tints (applied as a class on the piece element) */
.piece-frozen {
    background: rgba(50, 130, 255, 0.40) !important;
    border: 1px solid rgba(100, 170, 255, 0.70) !important;
}
.piece-suppressed {
    background: rgba(110, 110, 110, 0.50) !important;
    border: 1px solid rgba(160, 160, 160, 0.65) !important;
}
.piece-restrained {
    background: rgba(220, 200, 20, 0.38) !important;
    border: 1px solid rgba(220, 200, 20, 0.72) !important;
}
.piece-she-tank {
    background: rgba(255, 120, 30, 0.40) !important;
    border: 1px solid rgba(255, 150, 60, 0.70) !important;
}

/* Small symbol badge pinned to bottom-right corner of piece */
.effect-badge {
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 0.44rem;
    line-height: 1;
    pointer-events: none;
    letter-spacing: -0.5px;
}

/* Floating tooltip for status effects and zone info */
.piece-tooltip {
    position: fixed;
    background: rgba(16, 8, 28, 0.96);
    color: #fff;
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-family: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
    z-index: 5000;
    white-space: pre;
    line-height: 1.6;
}
.piece-tooltip.visible {
    opacity: 1;
}

/* Floating tooltip for ability cards */
.ability-tooltip {
    position: fixed;
    background: rgba(16, 8, 28, 0.97);
    color: #fff;
    border: 1px solid var(--accent-gold);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.74rem;
    font-family: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 7000;
    white-space: normal;
    line-height: 1.45;
    max-width: 260px;
}
.ability-tooltip.visible {
    opacity: 1;
}
.ability-tooltip .at-title {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 3px;
}
.ability-tooltip .at-mana {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-bottom: 5px;
}
.ability-tooltip .at-desc {
    color: var(--text-primary);
    margin-bottom: 4px;
}
.ability-tooltip .at-limits {
    color: #d4a840;
    font-size: 0.68rem;
    font-style: italic;
}
/* Per-ability sections in the Major Pieces panel tooltip. Wider than the
   pawn version since it holds three abilities -- at 260px it's too tall to
   fit above or below the panel cards. */
.ability-tooltip.at-wide {
    max-width: 380px;
}
.ability-tooltip .at-ability {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(201, 168, 76, 0.25);
}
.ability-tooltip .at-ability-name {
    font-weight: 700;
    font-size: 0.76rem;
    margin-bottom: 1px;
}
.ability-tooltip .at-boss-tag {
    color: #b183d6;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 4px;
}
.ability-tooltip .at-boss-only .at-limits { color: #b183d6; }

/* Targeting instruction panel docked inside dice panel */
.targeting-ui-docked {
    background: rgba(16, 8, 28, 0.96);
    border: 1px solid var(--accent-gold);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 10px;
    text-align: center;
}
.targeting-ui-title {
    color: var(--accent-gold);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.targeting-ui-msg {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
    margin-bottom: 6px;
}
.square.last-move {
    background: var(--highlight-last-move) !important;
}
.square.check {
    background: rgba(200, 40, 40, 0.4) !important;
}
.square.center-square {
    box-shadow: inset 0 0 0 2px rgba(201, 168, 76, 0.3);
}

/* Pieces on squares */
.piece {
    font-size: 0.55rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
    user-select: none;
    pointer-events: none;
    width: 46px;
    height: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    letter-spacing: 0.3px;
}
/* Small, dimmer chess piece-type subtitle under the character name (main board only) */
.piece-type-label {
    font-size: 0.68em;
    font-weight: 600;
    opacity: 0.55;
    letter-spacing: 0.2px;
    margin-top: 1px;
}
.piece.white {
    background: rgba(212, 203, 184, 0.15);
    color: var(--white-piece);
    border: 1px solid rgba(212, 203, 184, 0.3);
}
.piece.black {
    background: rgba(212, 88, 40, 0.15);
    color: var(--black-piece);
    border: 1px solid rgba(212, 88, 40, 0.3);
}

/* ═══ BATTLE LOG ═══ */
.battle-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.battle-log-title {
    color: var(--accent-gold);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}
.battle-log-clear-btn {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 9px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.battle-log-clear-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-gold);
}
.battle-log {
    margin-top: 4px;
    padding: 6px 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.7rem;
    /* Fixed height regardless of entry count -- the full log (from the start
       of the game) scrolls inside this box instead of growing it. 40px taller
       than the original 6-line box. */
    height: calc(6 * 1.6em + 52px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.battle-log-entry {
    font-size: 1em;
    line-height: 1.4em;
    padding: 2px 0;
    white-space: normal;
    overflow-wrap: break-word;
    flex: 0 0 auto;
}
.battle-log-white { color: var(--white-piece); }
.battle-log-black { color: var(--black-piece); }
.battle-log-aicard { color: var(--accent-gold); font-weight: 600; }
.battle-log-boss { color: #ff6b6b; font-weight: 600; }
.battle-log-neutral { color: var(--text-secondary); }
.battle-log-empty { color: var(--text-dim); font-style: italic; }
.battle-log-divider {
    color: var(--text-dim);
    font-size: 0.66rem;
    text-align: center;
    letter-spacing: 0.06em;
    opacity: 0.7;
    margin: 3px 0;
    flex: 0 0 auto;
}

/* ═══ DICE PANEL ═══ */
.dice-panel {
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}
.dice-panel h3 {
    color: var(--accent-gold);
    font-size: 1rem;
    margin-bottom: 10px;
}
.dice-display {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    justify-content: center;
}
.die {
    width: 52px;
    height: 52px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    transition: all 0.2s;
    position: relative;
}
.die.used {
    opacity: 0.4;
    border-color: var(--danger);
    color: var(--text-dim);
}
.die-x {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 900;
    color: var(--danger);
    line-height: 1;
    pointer-events: none;
}
.die.available {
    border-color: var(--accent-gold);
    cursor: pointer;
}
.die.available:hover {
    background: rgba(201, 168, 76, 0.15);
}
.die.die-reserved {
    border-color: var(--accent-orange);
    border-style: dashed;
    opacity: 0.75;
    cursor: not-allowed;
}
.die.die-banked {
    border-color: var(--accent-gold);
    border-style: double;
    border-width: 4px;
    background: rgba(201, 168, 76, 0.12);
}

/* Die face dots */
.die-face {
    width: 52px;
    height: 52px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    padding: 8px;
    transition: all 0.2s;
}
.die-face.used {
    opacity: 0.3;
    border-color: transparent;
}
.die-face.available {
    border-color: var(--accent-gold);
}
.die-dot {
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    align-self: center;
    justify-self: center;
}

.ability-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
}
.ability-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: all 0.15s;
}
.ability-btn:hover:not(:disabled):not(.disabled) {
    border-color: var(--accent-gold);
    background: rgba(201, 168, 76, 0.1);
}
.ability-btn.can-activate {
    border-color: var(--success);
    background: rgba(64, 160, 64, 0.1);
}
.ability-btn.cannot-activate {
    border-color: var(--danger);
    opacity: 0.5;
    cursor: not-allowed;
}
.ability-btn.boss-event-only {
    border-color: #5a3070;
    background: rgba(60, 20, 80, 0.3);
    opacity: 0.65;
    cursor: not-allowed;
    color: var(--text-dim);
}
.ability-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.ability-btn .ab-name {
    font-weight: 600;
}
.ability-btn .ab-floor {
    font-size: 0.7rem;
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--text-secondary);
}
.ability-btn .ab-piece {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-right: 6px;
}

/* ═══ ABILITY CARD GRID ═══ */
.ability-buttons.ability-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    align-content: start;
}
.ability-section-divider {
    grid-column: 1 / -1;
    color: var(--accent-gold);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 4px;
}
.ability-section-divider:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}
.ability-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--bg-medium);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 7px 9px;
    cursor: pointer;
    font-size: 0.72rem;
    transition: all 0.15s;
}
.ability-card:hover {
    transform: translateY(-1px);
}
.ability-card.status-green {
    border-color: var(--success);
    background: rgba(64, 160, 64, 0.1);
}
.ability-card.status-red {
    border-color: var(--danger);
    opacity: 0.65;
    cursor: not-allowed;
}
.ability-card.status-grey {
    border-color: var(--text-dim);
    opacity: 0.5;
    cursor: not-allowed;
}
.ability-card.status-purple {
    border-color: #9a60c0;
    background: rgba(60, 20, 80, 0.25);
    opacity: 0.75;
    cursor: not-allowed;
}
.ability-card .ac-piece-name {
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 0.76rem;
}
.ability-card .ac-ability-name {
    font-weight: 600;
    color: var(--text-primary);
}
.ability-card .ac-mana {
    font-size: 0.68rem;
    color: var(--text-secondary);
}
.ability-card .ac-x2-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--accent-gold);
    color: var(--bg-darkest);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 8px;
}

/* Copy-selection popover for x2 major-piece cards */
.copy-select-popover {
    position: fixed;
    background: rgba(16, 8, 28, 0.98);
    border: 1px solid var(--accent-gold);
    border-radius: 6px;
    padding: 8px;
    z-index: 6000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}
.copy-select-popover .csp-title {
    color: var(--accent-gold);
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.copy-select-popover button {
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.72rem;
    cursor: pointer;
}
.copy-select-popover button:hover {
    border-color: var(--accent-gold);
}

/* Juice Box acquired-abilities sub-panel inside her card */
.juice-box-subpanel {
    margin-top: 4px;
    border-top: 1px solid var(--border-color);
    padding-top: 4px;
}
.juice-box-subpanel summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.68rem;
    user-select: none;
}
.juice-box-subpanel .jb-entry {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 3px 5px;
    margin-top: 3px;
    border-radius: 4px;
    background: var(--bg-light);
    font-size: 0.68rem;
    cursor: pointer;
}
.juice-box-subpanel .jb-entry:hover {
    background: rgba(201, 168, 76, 0.15);
}
.juice-box-subpanel .jb-empty {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.68rem;
    margin-top: 3px;
}

/* ═══ PLAYER PANELS (permanent dual sidebar) ═══ */
.player-panel {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 260px;
    max-width: 320px;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid transparent;
    padding: 2px;
    transition: border-color 0.2s, box-shadow 0.2s, min-width 0.3s ease, max-width 0.3s ease;
}
.player-panel.active-panel {
    border-color: var(--accent-gold);
    box-shadow: 0 0 14px rgba(201, 168, 76, 0.25);
}

/* ═══ COLLAPSIBLE SIDEBARS ═══ */
.sidebar-toggle {
    position: absolute;
    top: 6px;
    z-index: 5;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--bg-light);
    color: var(--accent-gold);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s, background 0.15s, border-color 0.15s;
}
.sidebar-toggle:hover {
    background: var(--bg-medium);
    border-color: var(--accent-gold);
}
#black-player-panel .sidebar-toggle { right: 6px; }
#white-player-panel .sidebar-toggle { left: 6px; }

.sidebar-collapsed-label {
    display: none;
}

.player-panel.collapsed {
    min-width: 40px;
    max-width: 40px;
}
.player-panel.collapsed .player-panel-header,
.player-panel.collapsed .sidebar-section {
    display: none;
}
.player-panel.collapsed .sidebar-collapsed-label {
    display: flex;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.player-panel.collapsed .sidebar-collapsed-label span {
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    white-space: nowrap;
}
#black-player-panel.collapsed .sidebar-collapsed-label span { transform: rotate(-90deg); }
#white-player-panel.collapsed .sidebar-collapsed-label span { transform: rotate(90deg); }
#black-player-panel.collapsed .sidebar-toggle,
#white-player-panel.collapsed .sidebar-toggle { transform: rotate(180deg); }

/* Keep the board centered as it expands into space freed by a collapsed sidebar */
.game-layout:has(.player-panel.collapsed) {
    justify-content: center;
}

/* ═══ PER-SECTION COLLAPSE TOGGLES (inside each sidebar) ═══
   State lives as .section-collapsed on the individual .sidebar-section, so each
   section is controlled independently and its open/closed state is untouched
   when the whole sidebar is horizontally collapsed (.player-panel.collapsed
   hides every .sidebar-section) and later reopened. */
.sidebar-section > h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.sidebar-section > h3 .section-chevron {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: var(--accent-gold);
    transition: transform 0.2s ease;
}
.sidebar-section > h3 + div {
    overflow: hidden;
    max-height: 60vh;
    opacity: 1;
    transition: max-height 0.25s ease, opacity 0.2s ease;
}
.sidebar-section.section-collapsed {
    flex: 0 0 auto;
    min-height: 0;
}
.sidebar-section.section-collapsed > h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
}
.sidebar-section.section-collapsed > h3 .section-chevron {
    transform: rotate(-90deg);
}
.sidebar-section.section-collapsed > h3 + div {
    max-height: 0;
    opacity: 0;
}

/* ═══ ROTATE DEVICE HINT ═══ */
.rotate-hint {
    display: none;
}
@media (max-width: 599px) and (orientation: portrait) {
    .rotate-hint {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 400;
        padding: 6px 12px;
        background: rgba(22, 22, 42, 0.96);
        border-bottom: 1px solid var(--border-color);
        color: var(--text-secondary);
        font-size: 0.8rem;
        text-align: center;
        cursor: pointer;
    }
}
.player-panel-header {
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px;
    border-radius: 6px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
}
.player-panel-header.white-panel-header {
    color: var(--white-piece);
}
.player-panel-header.black-panel-header {
    color: var(--black-piece);
}
.sidebar-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}
/* The player-panel-header ("WHITE"/"BLACK" title) sits before these sections,
   so :first-child never matches a .sidebar-section — use the general sibling
   combinator to target every section after the first one instead. */
.sidebar-section ~ .sidebar-section {
    flex: 0 0 auto;
    max-height: 220px;
}
.sidebar-section h3 {
    color: var(--accent-gold);
    font-size: 0.95rem;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.piece-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ═══ STATUS EFFECTS PANEL ═══ */
.status-effects {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.status-effect-entry {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 0.74rem;
}
.status-effect-entry .se-label {
    color: var(--text-primary);
}
.status-effect-entry .se-label .se-piece {
    font-weight: 700;
    color: var(--accent-gold);
}
.status-effect-entry .se-turns {
    color: var(--text-dim);
    font-size: 0.68rem;
    white-space: nowrap;
}
.status-effects-empty {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-style: italic;
}

/* ═══ CAPTURED PIECES PANEL ═══ */
.captured-pieces {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.captured-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.captured-tag {
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 2px 9px;
    font-size: 0.7rem;
    color: var(--text-primary);
}
.captured-tag.permanently-dead {
    border-color: var(--accent-red);
    color: var(--text-secondary);
}
.captured-empty {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-style: italic;
}
.piece-card {
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.15s;
}
.piece-card:hover {
    border-color: var(--accent-gold);
}
.piece-card.suppressed {
    opacity: 0.5;
    border-color: var(--danger);
}
.piece-card .pc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}
.piece-card .pc-name {
    font-weight: 700;
    font-size: 0.85rem;
}
.piece-card .pc-type {
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.piece-card .pc-x2-badge {
    display: inline-block;
    background: var(--accent-gold);
    color: var(--bg-darkest);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}
.piece-card .pc-ability {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.piece-card .pc-ability .ab-label {
    color: var(--accent-gold);
    font-weight: 600;
}
.piece-card .pc-ability .floor-num {
    color: var(--text-dim);
    margin-left: 4px;
}
.piece-card .used-label {
    color: var(--danger);
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
}

/* ═══ OVERLAY ═══ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.overlay-content {
    background: var(--bg-medium);
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 0 40px rgba(201, 168, 76, 0.2);
}
.overlay-content h2 {
    color: var(--accent-gold);
    font-size: 2rem;
    margin-bottom: 12px;
}
.overlay-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

/* ═══ TOAST ═══ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-medium);
    border: 1px solid var(--accent-gold);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.toast.show {
    opacity: 1;
    pointer-events: auto;
}
.toast.success {
    border-color: var(--success);
}
.toast.fail {
    border-color: var(--danger);
}

/* ═══ DEV SETTINGS MODAL ═══ */
.dev-settings-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
}
.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}
.roster-section {
    margin-bottom: 24px;
}
.roster-section h3 {
    color: var(--accent-gold);
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.roster-counter {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: normal;
}
.roster-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.roster-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-medium);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.roster-item:hover {
    background: var(--bg-light);
    border-color: var(--accent-gold);
}
.roster-item.selected {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--accent-gold);
}
.roster-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.roster-item input[type="checkbox"] {
    cursor: pointer;
}
.roster-item label {
    cursor: pointer;
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* ═══ DEV STAGING BOARD ═══ */
.dev-board-section {
    margin-bottom: 24px;
}
.dev-board-section h3 {
    color: var(--accent-gold);
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.dev-board-hint {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-bottom: 10px;
}
.dev-staging-grid {
    display: grid;
    grid-template-columns: repeat(11, 30px);
    grid-template-rows: repeat(11, 30px);
    gap: 0;
    border: 1px solid var(--border-color);
    width: fit-content;
    margin: 0 auto;
}
.dev-sq {
    width: 30px;
    height: 30px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dev-sq-light { background: var(--square-light); }
.dev-sq-dark  { background: var(--square-dark); }
.dev-sq:hover {
    box-shadow: inset 0 0 0 1px rgba(201, 168, 76, 0.5);
}
.dev-sq-selected {
    box-shadow: inset 0 0 0 2px var(--accent-gold) !important;
}
.dev-piece {
    font-size: 0.33rem;
    font-weight: 900;
    text-align: center;
    line-height: 1;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    pointer-events: none;
    letter-spacing: -0.02em;
    padding: 1px;
}
.dev-piece-white {
    background: rgba(201, 168, 76, 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(201, 168, 76, 0.35);
}
.dev-piece-black {
    background: rgba(212, 88, 40, 0.15);
    color: var(--black-piece);
    border: 1px solid rgba(212, 88, 40, 0.4);
}
.dev-board-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
}

/* ═══ HOW TO PLAY TUTORIAL ═══ */
.btn-tutorial {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 0.9rem;
}
.btn-tutorial:hover:not(:disabled) {
    background: var(--bg-medium);
    color: var(--text-primary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

/* "Export Log" + "Playtest Report" — a compact row directly below the Battle
   Log, inside its collapsible wrapper so they hide/show together with the log. */
.battle-log-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.btn-log-action {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    padding: 6px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.1;
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn-log-action:hover {
    background: var(--bg-medium);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
}

/* Battle Log vertical collapse — mirrors the .sidebar-section pattern */
.battle-log-title {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.battle-log-title .section-chevron {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: var(--accent-gold);
    transition: transform 0.2s ease;
}
.battle-log-collapse-wrap {
    overflow: hidden;
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.25s ease, opacity 0.2s ease;
}
.battle-log-section.battle-log-collapsed .battle-log-title .section-chevron {
    transform: rotate(-90deg);
}
.battle-log-section.battle-log-collapsed .battle-log-collapse-wrap {
    max-height: 0;
    opacity: 0;
}

.tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}
.tutorial-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 40px);
    background: var(--bg-medium);
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(201, 168, 76, 0.2);
    overflow: hidden;
}
.tutorial-header {
    flex: 0 0 auto;
    padding: 20px 28px 14px;
    border-bottom: 1px solid var(--border-color);
}
.tutorial-header h2 {
    color: var(--accent-gold);
    font-size: 1.4rem;
    letter-spacing: 0.5px;
}
.tutorial-content {
    flex: 1 1 auto;
    padding: 20px 28px;
    overflow-y: auto;
}
.tutorial-content p {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
}
.tutorial-content p:last-of-type {
    margin-bottom: 0;
}
.tutorial-footer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 28px 20px;
    border-top: 1px solid var(--border-color);
}
.tutorial-counter {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.tutorial-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.tutorial-nav .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Shared tutorial diagram shell */
.tut-diagram {
    margin-top: 18px;
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Slide 2 — board diagram */
.tut-board {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.tbd-grid {
    display: grid;
    grid-template-columns: repeat(11, 15px);
    grid-template-rows: repeat(11, 15px);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    flex: 0 0 auto;
}
.tbd-cell { width: 15px; height: 15px; }
.tbd-light { background: var(--square-light); }
.tbd-dark { background: var(--square-dark); }
.tbd-back { background: rgba(201, 168, 76, 0.75); }
.tbd-pawn { background: rgba(56, 189, 248, 0.6); }
.tbd-center {
    background: var(--accent-gold);
    box-shadow: inset 0 0 0 2px #fff;
}
.tbd-legend {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.tbd-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tbd-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    flex: 0 0 auto;
}

/* Slide 5 — turn flow diagram */
.tut-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.tut-flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 76px;
    padding: 8px 10px;
    background: var(--bg-medium);
    border: 1px solid var(--accent-gold);
    border-radius: 6px;
}
.tfs-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: var(--bg-darkest);
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tfs-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}
.tut-flow-arrow {
    color: var(--accent-gold);
    font-weight: 700;
}

/* Slide 7 — AI trigger combinations */
.tut-triggers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
}
.tut-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tut-die {
    width: 34px;
    height: 34px;
    background: var(--bg-light);
    border: 2px solid var(--accent-gold);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}
.tut-plus {
    color: var(--text-secondary);
    font-weight: 700;
}

/* ═══ UTILITIES ═══ */
.hidden {
    display: none !important;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ═══ MOBILE LANDSCAPE — scale the whole interface down as one unit ═══ */
@media (max-height: 500px) and (orientation: landscape) {
    #game-screen {
        zoom: 0.55;
    }

    body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .game-layout {
        height: auto;
        min-height: 100vh;
        align-items: stretch;
    }

    .player-panel {
        overflow: visible !important;
        overflow-y: auto !important;
        overflow-x: hidden;
        min-width: 280px;
        max-width: 300px;
        height: auto;
        max-height: none;
    }

    .sidebar-section.pieces-section {
        flex: 1 1 auto !important;
        min-height: 180px;
        max-height: 350px;
        overflow-y: auto !important;
    }

    .sidebar-section ~ .sidebar-section {
        flex: 0 0 auto !important;
        max-height: 200px;
        overflow-y: auto;
    }

    .sidebar-section {
        flex-shrink: 0;
    }

    /* The per-section collapse wrapper (.sidebar-section > h3 + div, e.g.
       #piece-list-*) carries `overflow: hidden; max-height: 60vh` from the base
       CSS purely to drive the collapse animation. Under the landscape `zoom`
       that 60vh (~234px) is far shorter than the Pieces list, so the list was
       hard-clipped with no scrollable ancestor — invisible and untappable
       below the cut. Let the content flow to full height here so the section's
       own `overflow-y: auto` becomes the real scroll container. Collapsed
       sections are excluded, so the collapse toggle still hides them. */
    .sidebar-section:not(.section-collapsed) > h3 + div {
        overflow: visible;
        max-height: none;
    }
}

/* ═══ GAME SETTINGS MODAL ═══ */
.game-settings-modal {
    max-width: 460px;
    width: 100%;
    padding: 32px 36px;
    text-align: left;
}
.game-settings-modal h2 {
    text-align: center;
}
.game-settings-list {
    display: flex;
    flex-direction: column;
    margin: 20px 0 4px;
}
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 2px;
    border-bottom: 1px solid var(--border-color);
}
.setting-row:last-child {
    border-bottom: none;
}
.setting-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.setting-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}
.setting-hint {
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.setting-switch {
    flex: 0 0 auto;
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 13px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}
.setting-switch.on {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}
.setting-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform 0.15s ease, background 0.15s;
}
.setting-switch.on .setting-switch-knob {
    transform: translateX(20px);
    background: var(--bg-darkest);
}

/* Start-screen "Custom Rules Active" note (non-default gameplay toggles) */
.custom-rules-indicator {
    margin: 6px 0 0;
    font-size: 0.8rem;
    font-style: italic;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

/* ═══ VERSION TAG ═══ */
#version-tag {
    position: fixed;
    bottom: 4px;
    right: 8px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
    pointer-events: none;
    z-index: 9999;
    font-family: monospace;
}
