/* ==========================================
   Gitm Re-Themed Stylesheet: Bronze & Cyber-Amber
   ========================================== */
/* docs/futuregoals.md FG-3 Batch B: every variable below is set by
   themes.js's applyGitmTheme() via root.style.setProperty() (never by a CSS
   class/cascade — matches PUB-NCN's own AuthContext theme engine exactly),
   using these :root values purely as the "obsidian" default and as the
   fallback if that script hasn't run yet (e.g. file:// / no JS).
   --*-rgb variables exist so that every existing rgba(R, G, B, alpha) glow/
   overlay in this file — at whatever alpha value it already used — could be
   converted in one safe global substitution to rgba(var(--x-rgb), alpha)
   instead of hand-editing hundreds of individual declarations. Any new rule
   using one of these colors should use the same split-channel form, not a
   fresh literal, so it keeps working once a theme actually changes it. */
:root {
    --bg-dark: #0a080d;
    --bg-grid: rgba(20, 16, 28, 0.4);
    --bg-panel: rgba(18, 14, 24, 0.82);
    /* Several near-identical dark solid backgrounds (#1e293b meter tracks,
       #110e16 meter bar, #07060c card art frame) collapsed into this one
       shared "recessed dark surface" token. */
    --bg-panel-solid: #110e16;
    /* The three screens' near-identical radial/linear gradients
       (#1b1226->#06040a, #1c152a->#06040a, #07050a->#020104) collapsed into
       one shared pair — they were already close enough to be visually
       interchangeable, and per-theme this is one pair to design, not three. */
    --bg-gradient-a: #1a1224;
    --bg-gradient-b: #06040a;
    /* The trading card face itself — by far the most-seen background in the
       app — kept as its own distinct, subtler pair rather than reusing
       --bg-gradient-a/b (which read as a much more dramatic swing when
       tried on a small card). */
    --card-bg-a: #13101c;
    --card-bg-b: #0d0a14;

    /* Backgrounds/borders/overlays that were rgba(255, 255, 255, X) or
       rgba(0, 0, 0, X) throughout — split so a light theme can invert the
       lightening-overlay direction (255,255,255 -> a dark tint) without
       touching the hundreds of individual alpha values that already existed. */
    --overlay-rgb: 255, 255, 255;
    --shadow-rgb: 0, 0, 0;

    /* Theme Palette - Matches the provided Artwork */
    --color-bronze: #ca8a04;
    --color-bronze-dark: #854d0e;
    --color-amber: #f97316;
    --color-amber-rgb: 249, 115, 22;
    --color-amber-glow: rgba(249, 115, 22, 0.45);
    --color-amber-light: #fdba74;
    --bronze-text-gradient: linear-gradient(to bottom, #ffffff 30%, #fcd34d 60%, #b45309 100%);

    --color-cyan: #06b6d4;
    --color-cyan-rgb: 6, 182, 212;
    --color-cyan-glow: rgba(6, 182, 212, 0.45);
    --color-cyan-light: #a5f3fc;

    /* Text hierarchy — was six near-duplicate hardcoded slate grays
       (#fff/#e2e8f0/#cbd5e1/#94a3b8/#64748b/#475569) scattered throughout;
       consolidated to these five tiers rather than eliminated, since they
       really were used at visually distinct weights. */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --text-disabled: #475569;

    /* Stats & Meters — deliberately NOT theme-reactive (docs/futuregoals.md
       FG-3): these are gameplay-legibility colors (HP always reads as
       danger-red, Defense always blue, etc.), the same way PUB-NCN's own
       destructive-red stays fixed across all 10 of its themes. Changing
       these per personal theme would make the game itself harder to read,
       not just look different. */
    --color-hp: #ff4a68;
    --color-hp-glow: rgba(255, 74, 104, 0.45);
    --color-defense: #3b82f6;
    --color-defense-glow: rgba(59, 130, 246, 0.45);
    --color-energy: #a855f7;
    --color-energy-glow: rgba(168, 85, 247, 0.45);

    /* Cards Color Profiles — also fixed, same reasoning as Stats above. */
    --color-devotion: #eaab08;
    --color-combat: #10b981;
    --color-heresy: #64748b;

    /* Card Sizing */
    --card-w: 115px;
    --card-h: 195px;

    --transition-fast: 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-light: rgba(var(--overlay-rgb), 0.05);
    --border-glow: rgba(var(--color-amber-rgb), 0.15);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

h1, h2, h3, .logo-text, .art-logo-text, .preset-name, .power-title, .score-value {
    font-family: 'Cinzel', serif;
}

/* ==========================================
   Utility & Glow Classes
   ========================================== */
/* docs/futuregoals.md FG-14 Batch 0 (2026-08-31): a real, live bug — this
   generic utility class was used throughout app.js/index.html since FG-10
   (assumed to already exist, the way it does in most codebases) but was
   NEVER actually defined here. Only four narrowly-scoped compound rules
   existed (.account-ref-badge.is-hidden etc.) — anything else toggling a
   bare .is-hidden class had zero CSS backing it, so it stayed visible to
   every user regardless of the class. Confirmed via a real admin-status
   diagnostic (a genuinely non-admin account's console/network output both
   showed is_admin: false, yet the admin-only header buttons and the
   experimental-lobby checkbox stayed visible) that this affected every
   admin-only control added since FG-10 — not an authorization bug (the
   server independently re-verifies admin status on every route/action
   regardless of what the client shows), but a real, live visibility bug
   nonetheless. `!important` since this needs to reliably beat every
   component's own `display` value regardless of selector specificity —
   the whole point of a generic "hide this" utility. */
.is-hidden { display: none !important; }

.text-green { color: #22c55e; }
.text-orange { color: var(--color-amber); }
.text-teal { color: var(--color-cyan); }
.glow-text-amber { color: var(--color-amber-light); text-shadow: 0 0 8px var(--color-amber-glow); }

.red-glow { text-shadow: 0 0 8px var(--color-hp-glow); }
.blue-glow { text-shadow: 0 0 8px var(--color-defense-glow); }
.purple-glow { text-shadow: 0 0 8px var(--color-energy-glow); }
.gold-glow { text-shadow: 0 0 8px rgba(234, 171, 8, 0.45); }
.bronze-glow { text-shadow: 0 0 10px var(--color-amber-glow); }

.red-fill { background: linear-gradient(90deg, #b91c1c, #ff4a68); }
.blue-fill { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.purple-fill { background: linear-gradient(90deg, #7e22ce, #a855f7); }

.bronze-text {
    background: var(--bronze-text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(var(--color-amber-rgb), 0.2));
}

/* ==========================================
   Screen Structure
   ========================================== */
#app {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(100vh - 55px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

/* ==========================================
   Screen 0: Sign-In / Login (Matches Artwork)
   ========================================== */
#login-screen {
    /* Tiny (80-byte) blurred placeholder shows instantly; app.js preloads the
       real background.webp and adds .bg-loaded once it's ready, swapping to
       full quality. See docs/backlog.md Batch 5 — background.png was 9.2MB;
       background.webp is ~580KB, but the LQIP swap still avoids a visible
       pop-in on a slow connection. */
    background: url('background-lqip.webp') no-repeat center center / cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

#login-screen.bg-loaded {
    background-image: url('background.webp');
}

.login-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(6, 4, 10, 0.45);
    backdrop-filter: blur(1px);
    z-index: 0;
}

/* Tap to Login view (Starts active) */
.tap-login-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
    animation: fadeIn var(--transition-slow);
}

.tap-login-container.active {
    display: flex;
}

.artwork-logo-wrap {
    margin-bottom: 5vh;
}

.art-logo-text {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 5px;
    /* Same variable as .bronze-text — was a near-duplicate hardcoded gradient
       with slightly different stop percentages and end color, consolidated
       rather than keeping two near-identical theme-reactive gradients. */
    background: var(--bronze-text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(var(--color-amber-rgb), 0.5));
    line-height: 1.1;
}

.art-subtitle {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(var(--overlay-rgb), 0.4);
    margin-top: 1rem;
}

/* Tap button layout matching bottom of artwork */
.tap-login-cta {
    background: rgba(12, 28, 38, 0.8);
    border: 2px solid var(--color-cyan);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.75rem 3rem;
    letter-spacing: 4px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(var(--color-cyan-rgb), 0.4), inset 0 0 15px rgba(var(--color-cyan-rgb), 0.2);
    transition: all var(--transition-fast);
    clip-path: polygon(15px 0%, 100% 0%, calc(100% - 15px) 100%, 0% 100%);
    animation: pulse-cyan 2.5s infinite alternate;
}

.tap-login-cta:hover {
    color: var(--text-primary);
    background: rgba(var(--color-cyan-rgb), 0.2);
    box-shadow: 0 0 35px rgba(var(--color-cyan-rgb), 0.7), inset 0 0 20px rgba(var(--color-cyan-rgb), 0.3);
}

@keyframes pulse-cyan {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(var(--color-cyan-rgb), 0.3); }
    100% { transform: scale(1.03); box-shadow: 0 0 30px rgba(var(--color-cyan-rgb), 0.6); }
}

/* Username input card form */
.login-card-container {
    display: none;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-card-container.active {
    display: block;
}

.login-card {
    border: 2px solid var(--color-amber);
    box-shadow: 0 0 35px rgba(var(--color-amber-rgb), 0.15);
    background: rgba(var(--shadow-rgb), 0.9);
}

.login-instruction {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

#username-input {
    background: rgba(var(--shadow-rgb), 0.5);
    border: 1px solid var(--color-amber);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.2rem;
    padding: 0.75rem 1rem;
    width: 100%;
    outline: none;
    margin-bottom: 1.5rem;
    transition: all var(--transition-fast);
}

#username-input:focus {
    box-shadow: 0 0 12px rgba(var(--color-amber-rgb), 0.3);
}

.connection-mode-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid rgba(var(--overlay-rgb), 0.03);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
}

.mode-label {
    font-size: 0.85rem;
    color: var(--text-faint);
    font-weight: 600;
}

.status-indicator-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-indicator-badge.success { color: var(--color-cyan); }
.status-indicator-badge.warning { color: var(--color-amber); }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.success .status-dot { background: var(--color-cyan); box-shadow: 0 0 8px var(--color-cyan); }
.warning .status-dot { background: var(--color-amber); box-shadow: 0 0 8px var(--color-amber); }

/* ==========================================
   Glass Panel Cards
   ========================================== */
.card-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.card-panel h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
}

/* ==========================================
   Screen 1: Lobby Browser View
   ========================================== */
#lobby-browser-screen {
    background: radial-gradient(circle at center, var(--bg-gradient-a) 0%, var(--bg-gradient-b) 100%);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.cyber-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(var(--overlay-rgb), 0.01) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(var(--overlay-rgb), 0.01) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    z-index: 10;
}

.lobby-header h1 {
    font-size: 2.2rem;
    letter-spacing: 2px;
}

.btn-back-to-hub {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid rgba(var(--overlay-rgb), 0.15);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    margin-bottom: 0.75rem;
}

.btn-back-to-hub:hover {
    border-color: var(--color-amber);
    color: var(--color-amber);
}

.user-status-card {
    /* It's a <button> (docs/futuregoals.md FG-2 — opens the Profile modal),
       so the browser's default button chrome needs resetting to keep the
       existing card look. */
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    transition: border-color 0.15s;
}

.user-status-card:hover {
    border-color: var(--color-amber);
}

/* ── SSO Identity: display name + NCN Account Reference ───────────────────── */
/* Stacks the display name over the account reference inside the status card. */
.user-identity-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

/* Monospace so the fixed-width NCN-XXXXXXXX reference stays legible.
   Uses generic families only — no @font-face, no external font request. */
.account-ref-badge {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-bronze);
    opacity: 0.85;
    display: block;
    white-space: nowrap;
}

/* Guests get a muted badge rather than an account reference. */
.account-ref-badge.is-guest {
    color: var(--color-heresy);
    opacity: 0.7;
}

/* Collapsed until an identity resolves, so no empty gap is reserved. */
.account-ref-badge.is-hidden {
    display: none;
}

/* In-game HUD variant sits directly under the player name. */
.profile-details .account-ref-badge {
    font-size: 0.6rem;
    margin-top: 0.1rem;
    color: var(--color-amber);
}

.conn-mode-text {
    font-size: 0.75rem;
    color: var(--text-faint);
}

.lobby-browser-container {
    display: flex;
    gap: 2rem;
    flex: 1;
    z-index: 10;
}

/* docs/futuregoals.md FG-14 Sub-batch A: admin dashboard screen. */
.admin-dashboard-container {
    flex: 1;
    z-index: 10;
}

.admin-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.admin-tile-grid-empty {
    color: var(--text-faint);
    font-style: italic;
    grid-column: 1 / -1;
}

.admin-tile-btn {
    background: linear-gradient(160deg, var(--card-bg-a) 0%, var(--card-bg-b) 100%);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    font-family: inherit;
    transition: all var(--transition-fast);
}

.admin-tile-btn:hover {
    border-color: var(--color-amber);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.admin-tile-btn i {
    font-size: 1.6rem;
    color: var(--color-amber);
}

.admin-tile-btn-title {
    font-size: 1rem;
    font-weight: 700;
}

.admin-tile-btn-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.rooms-list-panel {
    flex: 3;
    overflow-y: auto;
}

.matchmaking-panel {
    flex: 2;
    border: 1px solid var(--color-amber);
    box-shadow: 0 0 20px rgba(var(--color-amber-rgb), 0.05);
}

/* Lobbies Table / List */
.rooms-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(var(--overlay-rgb), 0.05);
}

.rooms-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    overflow-y: auto;
    flex: 1;
}

.room-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    align-items: center;
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid rgba(var(--overlay-rgb), 0.03);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all var(--transition-fast);
}

.room-row:hover {
    background: rgba(var(--overlay-rgb), 0.05);
    border-color: rgba(var(--color-cyan-rgb), 0.3);
}

.room-name-text {
    font-weight: 700;
    color: var(--text-primary);
}

.room-host-text {
    color: var(--text-secondary);
}

.room-count-text {
    color: var(--color-cyan);
    font-weight: 700;
}

.no-rooms-msg {
    text-align: center;
    color: var(--text-faint);
    font-style: italic;
    padding: 3rem;
}

/* Realm Maker form group */
.creation-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-faint);
}

.form-group input {
    background: rgba(var(--shadow-rgb), 0.3);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group input[readonly] {
    color: var(--text-muted);
    cursor: default;
    opacity: 0.75;
}

.profile-modal-error {
    color: var(--color-heresy);
    font-size: 0.8rem;
    font-weight: 600;
    margin: -0.25rem 0 1rem;
}

.profile-modal-error.is-hidden {
    display: none;
}

.form-group input:focus {
    border-color: var(--color-amber);
}

.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-group span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.toggle-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-toggle {
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-faint);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    transition: all var(--transition-fast);
}

.btn-toggle.active {
    background: rgba(var(--color-amber-rgb), 0.15);
    border-color: var(--color-amber);
    color: var(--text-primary);
}

/* docs/futuregoals.md FG-12: admin-only lobby-creation toggle + the
   read-only per-match badge every player in an experimental lobby sees. */
.experimental-rules-group {
    border: 1px solid rgba(var(--color-cyan-rgb), 0.25);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    background: rgba(var(--color-cyan-rgb), 0.05);
}

.experiment-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.experimental-active-badge {
    color: var(--color-cyan) !important;
    font-weight: 700;
}

.divider-text {
    text-align: center;
    color: var(--text-disabled);
    font-weight: 800;
    margin: 1.5rem 0;
    position: relative;
}

.divider-text::before, .divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(var(--overlay-rgb), 0.05);
}

.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

.quick-match-desc {
    color: var(--text-faint);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0 0 0.85rem;
}

.quick-match-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    background: rgba(var(--color-cyan-rgb), 0.08);
    border: 1px solid var(--color-cyan);
    color: var(--color-cyan);
    font-size: 0.85rem;
    font-weight: 600;
}

.quick-match-status.is-hidden {
    display: none;
}

.btn-cancel-queue {
    background: none;
    border: 1px solid rgba(var(--overlay-rgb), 0.15);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.btn-cancel-queue:hover {
    border-color: var(--color-heresy);
    color: var(--color-heresy);
}

.join-private-form {
    display: flex;
    gap: 0.75rem;
}

.join-private-form input {
    flex: 1;
    background: rgba(var(--shadow-rgb), 0.3);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 800;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.join-private-form input:focus {
    border-color: var(--color-cyan);
}

/* ==========================================
   Screen 2: Lobby Room
   ========================================== */
#lobby-room-screen {
    background: radial-gradient(circle at center, var(--bg-gradient-a) 0%, var(--bg-gradient-b) 100%);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.lobby-room-container {
    display: flex;
    gap: 2rem;
    flex: 1;
    z-index: 10;
}

.players-slots-panel {
    flex: 3;
    display: flex;
    flex-direction: column;
}

.players-slots-panel h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
}

/* Lobby player slots UI */
.lobby-slot-card {
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    transition: all var(--transition-fast);
}

.lobby-slot-card.active {
    background: rgba(var(--overlay-rgb), 0.04);
    border-color: rgba(var(--overlay-rgb), 0.1);
}

.lobby-slot-card.ready {
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px rgba(var(--color-cyan-rgb), 0.1);
}

.slot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(var(--overlay-rgb), 0.05);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.slot-avatar:hover {
    transform: scale(1.8);
    border-radius: 10px;
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.85), 0 0 12px var(--color-amber);
}

.active .slot-avatar {
    background: rgba(var(--color-amber-rgb), 0.1);
    border-color: var(--color-amber);
    color: var(--color-amber);
}

.slot-meta {
    flex: 1;
}

.slot-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slot-name i {
    font-size: 0.95rem;
}

.slot-god {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.slot-stats-preview {
    display: flex;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-faint);
    margin-top: 0.35rem;
}

.slot-status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.slot-status-badge.ready {
    background: rgba(var(--color-cyan-rgb), 0.15);
    border: 1px solid var(--color-cyan);
    color: var(--color-cyan);
}

.slot-status-badge.host {
    background: rgba(var(--color-amber-rgb), 0.15);
    border: 1px solid var(--color-amber);
    color: var(--color-amber);
}

.slot-status-badge.waiting {
    background: rgba(var(--overlay-rgb), 0.03);
    color: var(--text-disabled);
}

.slot-status-badge.disconnected {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--color-heresy);
    color: var(--color-heresy);
}

.slot-kick-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.slot-kick-btn:hover { color: #f87171; }

.lobby-slot-card.empty-slot {
    border: 1px dashed rgba(var(--overlay-rgb), 0.06);
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
}

.add-bot-cta {
    background: rgba(var(--color-amber-rgb), 0.05);
    border: 1px solid var(--color-amber);
    border-radius: 6px;
    color: var(--color-amber);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    transition: all var(--transition-fast);
}

.add-bot-cta:hover {
    background: rgba(var(--color-amber-rgb), 0.15);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(var(--color-amber-rgb), 0.2);
}

.waiting-slot-text {
    font-size: 0.85rem;
    color: var(--text-disabled);
    font-style: italic;
}

.creator-lobby-panel {
    flex: 2;
    border: 1px solid var(--color-amber);
    box-shadow: 0 0 20px rgba(var(--color-amber-rgb), 0.05);
}

/* docs/futuregoals.md FG-15: the whole Deity Calibration panel
   (.customizer-header down through .stat-derived/.btn-adjust below) had
   ZERO CSS before this — not a missed class, the entire stat customizer —
   confirmed by grep before writing any of this. That's the real cause of
   the "which number belongs to which stat" confusion a friend-tester
   reported: with no flex grouping, everything just stacked block-by-block
   in DOM order. */
.customizer-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.god-preset-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.god-preset-selector select {
    background: rgba(var(--shadow-rgb), 0.4);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem;
    outline: none;
    cursor: pointer;
}

.god-preset-selector select:focus {
    border-color: var(--color-amber);
}

.points-pool {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--color-amber-rgb), 0.08);
    border: 1px solid rgba(var(--color-amber-rgb), 0.25);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.points-pool strong {
    color: var(--color-amber);
    font-size: 1.15rem;
}

.stat-sliders {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* One bordered/backgrounded row per stat — the fix for the actual
   report: with no visual boundary between rows before this, a
   stat's own value/derived-stat could be misread as belonging to
   the NEXT stat down. Matches the .card-pile/.opponent-hud-tile
   "bordered row" language already used elsewhere in this app. */
.stat-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.6rem 1rem;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    /* Defensive, not expected to trigger at this panel's real width
       (confirmed comfortably wide via its 2-of-5 flex share of
       .lobby-room-container) — graceful single-line truncation instead
       of an ugly mid-row wrap if it ever is squeezed. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-adjust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 90px;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 1.4em;
    text-align: center;
    transition: font-size var(--transition-fast), color var(--transition-fast);
}

/* A fixed god preset hides the +/- buttons below (they were always
   non-functional there) — this is where that space goes instead: a
   bigger, more prominent number rather than empty room. */
.stat-control-row.locked .stat-value {
    font-size: 1.7rem;
    color: var(--color-amber);
    text-shadow: 0 0 8px var(--color-amber-glow);
}

.btn-adjust {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(var(--overlay-rgb), 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    transition: all var(--transition-fast);
}

.btn-adjust:hover:not(:disabled) {
    border-color: var(--color-amber);
    color: var(--color-amber);
}

.btn-adjust:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.stat-derived {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-cyan);
    min-width: 72px;
    text-align: right;
    /* Longest real value is "X Actions" (intelligence) — min-width is a
       floor, not a cap, so this never actually clips real content; nowrap
       just guarantees it never wraps to a second line either. */
    white-space: nowrap;
}

.lobby-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.lobby-controls .glow-button {
    flex: 1;
    margin-top: 0;
}

/* ==========================================
   Screen 3: Battle Arena Multi-HUD
   ========================================== */
#arena-screen {
    background: linear-gradient(180deg, var(--bg-gradient-a) 0%, var(--bg-gradient-b) 100%);
    width: 100vw;
    height: 100vh;
}

/* Top bar featuring up to 5 Opponent HUD cards */
.multiplayer-opponents {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    /* No background here on purpose — .hud-bar (also applied to this same
       element) already sets rgba(var(--shadow-rgb), 0.85), which wins the
       cascade since it's declared later in this file. A hardcoded value
       here was previously dead/overridden CSS, not a live bug, but kept
       reappearing every time someone (including this session, twice) went
       looking for contrast issues and had to re-verify it was harmless. */
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Opponent Tile UI */
.opponent-hud-tile {
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    height: 108px;
    position: relative;
    justify-content: space-between;
    transition: all var(--transition-fast);
}

.opponent-hud-tile.active-turn {
    border-color: var(--color-amber);
    background: rgba(var(--color-amber-rgb), 0.04);
}

.opp-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.opp-tile-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.opp-tile-god {
    font-size: 0.72rem;
    color: var(--text-faint);
}

.opp-tile-deck {
    display: flex;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.opp-tile-deck span {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.opp-tile-meters {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.opp-tile-meter-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.opp-tile-meter-row i {
    font-size: 0.72rem;
    width: 12px;
    text-align: center;
}

.opp-tile-bar {
    flex: 1;
    height: 10px;
    background: var(--bg-panel-solid);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.opp-tile-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease-out;
}

.opp-tile-bar-text {
    font-size: 0.6rem;
    font-weight: 900;
    color: var(--text-primary);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    /* Was display:none, hover-to-reveal only — real user feedback wants
       the whole tile more legible at a glance, and the taller bar above
       now has room for this text to sit in permanently rather than
       requiring a hover a player mid-combat won't stop to do. */
}

.opp-tile-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.opp-tile-stats-row span {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

/* Opponent Dead status overlay */
/* docs/futuregoals.md FG-16: an opponent (human or a quit-to-bot seat's
   PREVIOUS occupant) mid-disconnect, still inside the server's own
   reconnect grace window — same --color-heresy language already
   established for this exact state in the Lobby Room's own slot badge
   (.slot-status-badge.disconnected). Deliberately lighter than
   .dead — this is temporary, not a permanent "FALLEN" state. */
.opponent-hud-tile.disconnected {
    border-color: var(--color-heresy);
}

.opp-tile-disconnected-badge {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--color-heresy);
    color: var(--color-heresy);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.opponent-hud-tile.dead {
    opacity: 0.35;
    background: rgba(var(--shadow-rgb), 0.5);
    border-color: rgba(255, 74, 104, 0.2);
}

.opponent-hud-tile.dead::after {
    content: 'FALLEN';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg);
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--color-hp);
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 74, 104, 0.8);
}

/* ==========================================
   Combat Target Selection Mode UI
   ========================================== */
.targeting-bar-overlay {
    position: fixed;
    top: 95px;
    left: 0;
    width: calc(100vw - 320px);
    height: 50px;
    background: rgba(var(--shadow-rgb), 0.95);
    border-bottom: 2px solid var(--color-amber);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 100;
    box-shadow: 0 5px 30px rgba(var(--color-amber-rgb), 0.3);
    animation: slideDown 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.targeting-bar-overlay.active {
    display: flex;
}

/* docs/futuregoals.md FG-16: same shape as .targeting-bar-overlay above,
   red instead of amber (fixed --color-hp, not theme-reactive — same
   gameplay-legibility precedent HP/Defense/Energy already use), and a
   higher z-index so it stays visible over the targeting bar too, since
   a disconnect can happen mid-target-selection. */
.reconnect-bar-overlay {
    position: fixed;
    top: 95px;
    left: 0;
    width: calc(100vw - 320px);
    height: 50px;
    background: rgba(var(--shadow-rgb), 0.97);
    border-bottom: 2px solid var(--color-hp);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 150;
    box-shadow: 0 5px 30px rgba(255, 74, 104, 0.35);
    animation: slideDown 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reconnect-bar-overlay.active {
    display: flex;
}

.reconnect-banner-text {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--color-hp);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.targeting-prompt-text {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.targeting-prompt-text i {
    color: var(--color-amber);
}

.cancel-target-cta {
    background: rgba(255, 74, 104, 0.1);
    border: 1px solid var(--color-hp);
    border-radius: 6px;
    color: var(--color-hp);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.4rem 1.25rem;
    transition: all var(--transition-fast);
}

.cancel-target-cta:hover {
    background: var(--color-hp);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(255, 74, 104, 0.4);
}

/* Flash active target tiles red */
.opponent-hud-tile.targetable {
    border: 2px solid var(--color-amber);
    box-shadow: 0 0 20px var(--color-amber-glow);
    cursor: crosshair;
    animation: target-pulse-glow 1.2s infinite alternate;
}

.opponent-hud-tile.targetable:hover {
    transform: scale(1.04);
    border-color: #ef4444;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.8);
}

@keyframes target-pulse-glow {
    0% { border-color: var(--color-amber); box-shadow: 0 0 10px var(--color-amber-glow); }
    100% { border-color: var(--color-amber); box-shadow: 0 0 25px rgba(var(--color-amber-rgb), 0.7); }
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ==========================================
   Common Button Themes
   ========================================== */
.glow-button.bronze-theme {
    background: linear-gradient(135deg, #d97706, #78350f);
    border: 1px solid var(--color-amber);
    box-shadow: 0 4px 15px rgba(var(--color-amber-rgb), 0.25);
}

.glow-button.bronze-theme:hover:not(:disabled) {
    box-shadow: 0 4px 25px rgba(var(--color-amber-rgb), 0.5);
}

.glow-button.teal-theme {
    background: linear-gradient(135deg, var(--color-cyan), #0891b2);
    border: 1px solid var(--color-cyan);
    box-shadow: 0 4px 15px rgba(var(--color-cyan-rgb), 0.25);
}

.glow-button.teal-theme:hover:not(:disabled) {
    box-shadow: 0 4px 25px rgba(var(--color-cyan-rgb), 0.5);
}

.glow-button.red-theme {
    background: linear-gradient(135deg, #ef4444, #991b1b);
    border: 1px solid var(--color-hp);
    box-shadow: 0 4px 15px rgba(255, 74, 104, 0.2);
}

/* ==========================================
   Main Game Board Layout
   ========================================== */
.arena-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    /* Opponent row bumped 108px -> 132px (real user feedback: the
       opponent HUD reads too small) — the two fixed rows below (player
       stat bar, hand) are unchanged, and the middle `1fr` row (supply +
       play zone) simply absorbs the difference, same as it already
       absorbs any other viewport-height variation. */
    grid-template-rows: 132px 1fr 90px 240px;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* HUD Bars */
.hud-bar {
    grid-column: 1 / 2;
    background: rgba(var(--shadow-rgb), 0.85);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    justify-content: space-between;
    z-index: 10;
}

.player-hud {
    grid-row: 3 / 4;
    border-top: 1px solid var(--border-light);
    border-bottom: none;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.35);
}

.god-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 220px;
}

.god-avatar-small {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 1px solid rgba(var(--overlay-rgb), 0.08);
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.god-avatar-small:hover {
    transform: scale(2.2) translateY(-10px);
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.85), 0 0 12px var(--color-cyan);
}

.god-avatar-small.player-color {
    background: linear-gradient(135deg, rgba(var(--color-cyan-rgb), 0.2), rgba(99, 102, 241, 0.2));
    border-color: var(--color-cyan);
    color: #22d3ee;
}

.profile-details h3 {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.player-stats-mini {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.player-stats-mini span {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

/* Meters */
.stat-meters {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    max-width: 600px;
    padding: 0 1.5rem;
}

.hud-stat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.hud-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.meter-bar {
    position: relative;
    height: 16px;
    background: var(--bg-panel-solid);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(var(--overlay-rgb), 0.04);
}

.meter-fill {
    height: 100%;
    width: 100%;
    transition: width 0.3s ease-out;
}

.meter-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Turn Resource Counters */
.turn-resources {
    display: flex;
    gap: 0.75rem;
    margin-right: 1rem;
}

.resource-badge {
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 68px;
}

.badge-label {
    font-size: 0.6rem;
    color: var(--text-faint);
    text-transform: uppercase;
    font-weight: 700;
}

.badge-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.player-deck-stats {
    display: flex;
    gap: 0.75rem;
    color: var(--text-disabled);
}

.deck-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ==========================================
   Sidebar Chronicles & Action Area
   ========================================== */
.sidebar-panel {
    grid-column: 2 / 3;
    grid-row: 1 / 4;
    background: rgba(var(--shadow-rgb), 0.94);
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    z-index: 11;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sidebar-header h2 {
    font-size: 1.15rem;
    color: var(--text-primary);
}

.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-button {
    background: none;
    border: none;
    color: var(--text-disabled);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color var(--transition-fast);
}

.icon-button:hover { color: var(--color-amber); }

.combat-log {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(var(--overlay-rgb), 0.02);
    border-radius: 10px;
    padding: 0.75rem;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.log-message {
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(var(--overlay-rgb), 0.01);
}

/* docs/futuregoals.md FG-10 follow-up (2026-08-31): .combat-log's own
   backdrop is deliberately fixed dark on every theme (like every other
   .log-message.* color below, and .card-frame-name elsewhere) — these two
   were the one pair that accidentally used theme-reactive var(--text-*)
   instead, which went dark-on-dark on the 2 light themes. Restored to
   fixed light grays matching this file's own pre-theming slate palette
   (see the :root comment on --text-secondary/--text-muted's origin). */
.log-message.system { color: #94a3b8; font-style: italic; }
.log-message.player-turn { color: var(--color-amber-light); font-weight: 700; border-bottom: 1px solid rgba(var(--color-amber-rgb), 0.15); margin-top: 0.4rem; }
.log-message.enemy-turn { color: var(--color-cyan-light); font-weight: 700; border-bottom: 1px solid rgba(var(--color-cyan-rgb), 0.15); margin-top: 0.4rem; }
.log-message.action { color: #cbd5e1; }
.log-message.damage { color: #fca5a5; font-weight: 600; }
.log-message.defense { color: #93c5fd; }
.log-message.buy { color: #fde047; }
.log-message.game-over { color: #34d399; font-weight: 800; }

.turn-phase-hud {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    justify-content: center;
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
}

.phase-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-disabled);
    font-size: 0.8rem;
    font-weight: 700;
    transition: color var(--transition-fast);
}

.phase-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-disabled);
    transition: all var(--transition-fast);
}

.phase-indicator.active { color: var(--text-primary); }
#phase-action.active .dot { background: var(--color-amber); box-shadow: 0 0 6px var(--color-amber); }
#phase-buy.active .dot { background: var(--color-devotion); box-shadow: 0 0 6px var(--color-devotion); }

.turn-controls {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.arena-action-btn {
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.65rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.arena-action-btn:hover:not(:disabled) {
    background: rgba(var(--overlay-rgb), 0.05);
    border-color: rgba(var(--overlay-rgb), 0.15);
    color: var(--text-primary);
}

.arena-action-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.glow-button {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
    transition: all var(--transition-fast);
    margin-top: 1rem;
}

.glow-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.glow-button:disabled {
    background: var(--bg-panel-solid);
    color: var(--text-disabled);
    box-shadow: none;
    cursor: not-allowed;
}

/* ==========================================
   Battlefield Rack & Play field
   ========================================== */
.battlefield-main {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
}

.supply-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.35rem;
}

.tab-btn {
    background: none;
    /* Was var(--text-disabled) — the dimmest text tier in this app, meant
       for genuinely inert content, not the un-selected state of a button
       people need to notice and click (real user feedback: these read as
       barely visible). --text-secondary is still clearly de-emphasized
       relative to .active below, just not to the point of looking broken. */
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    border-color: rgba(var(--color-amber-rgb), 0.15);
}
.tab-btn.active {
    color: var(--text-primary);
    background: rgba(var(--color-amber-rgb), 0.16);
    border: 1px solid var(--color-amber);
    box-shadow: 0 0 12px rgba(var(--color-amber-rgb), 0.4);
    text-shadow: 0 0 8px var(--color-amber-glow);
}

.supply-rack {
    display: none;
    /* A minimum comfortable width per pile instead of a rigid 5-column
       split, so bigger piles (below) reflow to fewer per row rather than
       squeezing their now-larger art/text into an ever-narrower column. */
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.1rem;
    align-content: start;
    /* Cards got noticeably bigger below on real user feedback ("too
       small/thumbnail-like") — capped and scrollable rather than letting
       the whole battlefield column grow unpredictably tall, with
       #supply-rack-more-btn (app.js) as the visible "there's more below"
       affordance the same feedback asked for. */
    max-height: min(46vh, 420px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.supply-rack.active { display: grid; }

.card-pile {
    background: rgba(var(--overlay-rgb), 0.01);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1.3rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.card-pile::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--color-heresy);
}
.card-pile[data-type="manifestation"]::before { background: var(--color-energy); }
.card-pile[data-type="treasure"]::before { background: var(--color-devotion); }
.card-pile[data-type="victory"]::before { background: var(--color-combat); }
.card-pile[data-type="heresy"]::before { background: var(--color-heresy); }

.card-pile:hover:not(.empty) {
    background: rgba(var(--shadow-rgb), 0.98);
    transform: scale(1.22);
    z-index: 100 !important;
    border-color: rgba(var(--overlay-rgb), 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85);
}

.card-pile[data-type="manifestation"]:hover:not(.empty) {
    border-color: rgba(168, 85, 247, 0.65);
    box-shadow: 0 12px 30px rgba(0,0,0,0.85), 0 0 20px rgba(168, 85, 247, 0.35);
}
.card-pile[data-type="treasure"]:hover:not(.empty) {
    border-color: rgba(234, 171, 8, 0.65);
    box-shadow: 0 12px 30px rgba(0,0,0,0.85), 0 0 20px rgba(234, 171, 8, 0.35);
}
.card-pile[data-type="victory"]:hover:not(.empty) {
    border-color: rgba(16, 185, 129, 0.65);
    box-shadow: 0 12px 30px rgba(0,0,0,0.85), 0 0 20px rgba(16, 185, 129, 0.35);
}

.card-pile.empty {
    opacity: 0.25;
    cursor: not-allowed;
}

.pile-visual {
    position: relative;
    width: 108px;
    height: 150px;
    flex-shrink: 0;
    background: #09070c;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem;
}
.card-pile[data-type="manifestation"] .pile-visual { border-color: rgba(168, 85, 247, 0.25); }
.card-pile[data-type="treasure"] .pile-visual { border-color: rgba(234, 171, 8, 0.25); }
.card-pile[data-type="victory"] .pile-visual { border-color: rgba(16, 185, 129, 0.25); }

.pile-visual-cost {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--text-primary);
}
.pile-visual-icon {
    font-size: 1.95rem;
    align-self: center;
    color: var(--text-disabled);
}
.card-pile[data-type="manifestation"] .pile-visual-icon { color: var(--color-energy); }
.card-pile[data-type="treasure"] .pile-visual-icon { color: var(--color-devotion); }
.card-pile[data-type="victory"] .pile-visual-icon { color: var(--color-combat); }

.pile-visual-count {
    background: rgba(var(--shadow-rgb), 0.85);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    position: absolute;
    bottom: 4px;
    right: 4px;
}

.pile-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}
.pile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}
.pile-desc {
    font-size: 1.17rem;
    color: var(--text-faint);
    line-height: 1.3;
}
.pile-cost {
    font-size: 1.23rem;
    font-weight: 700;
    color: var(--color-devotion);
}

.supply-rack-more-btn {
    align-self: center;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.3rem 0 0;
    padding: 0.3rem 0.9rem;
    background: rgba(var(--color-amber-rgb), 0.12);
    border: 1px solid var(--color-amber);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(var(--color-amber-rgb), 0.35);
    animation: more-cards-pulse 1.8s infinite alternate;
}
@keyframes more-cards-pulse {
    0% { box-shadow: 0 0 6px rgba(var(--color-amber-rgb), 0.25); }
    100% { box-shadow: 0 0 16px rgba(var(--color-amber-rgb), 0.55); }
}

.play-zone {
    /* docs/futuregoals.md FG-12 follow-up (2026-08-31): real user feedback
       — bigger supply cards above need the room, and the play zone reads
       as oversized when empty (the common case turn-to-turn). flex-grow
       kept at a small value rather than 0 so it still absorbs any leftover
       space once a real played manifestation needs room, but no longer
       claims a 110px floor for a mostly-empty box. */
    flex: 0.4;
    background: rgba(var(--shadow-rgb), 0.25);
    border: 1px dashed rgba(var(--overlay-rgb), 0.03);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    min-height: 56px;
}

.play-zone-label {
    font-size: 0.7rem;
    /* Was a hardcoded #334155 (a dark slate) — low-contrast against this
       area's own dark backdrop on every theme, not just the 2 light ones;
       switched to the theme's own calibrated muted tier. */
    color: var(--text-faint);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.active-cards-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.empty-play-zone-text {
    font-size: 0.78rem;
    color: var(--text-faint);
    font-style: italic;
}

/* ==========================================
   Individual Card UI — Trading Card Layout
   ========================================== */
.card-item {
    width: var(--card-w);
    height: var(--card-h);
    background: linear-gradient(160deg, var(--card-bg-a) 0%, var(--card-bg-b) 100%);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
                border-color 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
                margin 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Top edge type glow strip */
.card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 10px 10px 0 0;
    z-index: 5;
}
.card-item[data-type="manifestation"]::before { background: linear-gradient(90deg, transparent, var(--color-energy), transparent); }
.card-item[data-type="treasure"]::before { background: linear-gradient(90deg, transparent, var(--color-devotion), transparent); }
.card-item[data-type="victory"]::before { background: linear-gradient(90deg, transparent, var(--color-combat), transparent); }
.card-item[data-type="heresy"]::before { background: linear-gradient(90deg, transparent, var(--color-heresy), transparent); }

/* Card hover lift effect */
.card-item:hover {
    transform: translateY(-32px) scale(1.45);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9);
    border-color: rgba(var(--overlay-rgb), 0.35);
    z-index: 100 !important;
}

.card-item[data-type="manifestation"]:hover {
    border-color: rgba(168, 85, 247, 0.75);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9), 0 0 30px rgba(168, 85, 247, 0.45);
}
.card-item[data-type="treasure"]:hover {
    border-color: rgba(234, 171, 8, 0.75);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9), 0 0 30px rgba(234, 171, 8, 0.45);
}
.card-item[data-type="victory"]:hover {
    border-color: rgba(16, 185, 129, 0.75);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9), 0 0 30px rgba(16, 185, 129, 0.45);
}
.card-item[data-type="heresy"]:hover {
    border-color: rgba(239, 68, 68, 0.75);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9), 0 0 30px rgba(239, 68, 68, 0.45);
}

/* ── Card Frame Header ── */
.card-frame-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.4rem 0.2rem;
    background: rgba(0, 0, 0, 0.6);
    gap: 0.2rem;
    flex-shrink: 0;
    z-index: 2;
}

.card-frame-name {
    font-size: 0.6rem;
    font-weight: 900;
    color: #f1f5f9;
    font-family: 'Cinzel', serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    line-height: 1.1;
}

.card-frame-cost {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.62rem;
    font-weight: 900;
    color: var(--color-devotion);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(234, 171, 8, 0.35);
    border-radius: 4px;
    padding: 0.05rem 0.25rem;
    flex-shrink: 0;
    line-height: 1.2;
}

/* ── Art Window ── */
.card-art-window {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-top: 1px solid rgba(var(--overlay-rgb), 0.04);
    border-bottom: 1px solid rgba(var(--overlay-rgb), 0.04);
    flex-shrink: 0;
    background: var(--bg-panel-solid);
}

.card-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.3s ease;
}

.card-item:hover .card-art-img {
    transform: scale(1.05);
}

/* CSS Placeholder — shows when image missing/fails */
.card-art-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            rgba(var(--overlay-rgb),0.01) 0px,
            rgba(var(--overlay-rgb),0.01) 1px,
            transparent 1px,
            transparent 10px
        ),
        linear-gradient(160deg, #12101e 0%, #0a0814 100%);
}

.card-item[data-type="manifestation"] .card-art-placeholder {
    background: 
        repeating-linear-gradient(45deg, rgba(168,85,247,0.04) 0px, rgba(168,85,247,0.04) 1px, transparent 1px, transparent 10px),
        linear-gradient(160deg, #1a0e2a 0%, #0d0918 100%);
}
.card-item[data-type="treasure"] .card-art-placeholder {
    background: 
        repeating-linear-gradient(45deg, rgba(234,171,8,0.04) 0px, rgba(234,171,8,0.04) 1px, transparent 1px, transparent 10px),
        linear-gradient(160deg, #1a1500 0%, #0d0e08 100%);
}
.card-item[data-type="victory"] .card-art-placeholder {
    background: 
        repeating-linear-gradient(45deg, rgba(16,185,129,0.04) 0px, rgba(16,185,129,0.04) 1px, transparent 1px, transparent 10px),
        linear-gradient(160deg, #001a12 0%, #040d0a 100%);
}
.card-item[data-type="heresy"] .card-art-placeholder {
    background:
        repeating-linear-gradient(45deg, rgba(100,116,139,0.05) 0px, rgba(100,116,139,0.05) 1px, transparent 1px, transparent 10px),
        linear-gradient(160deg, #120a0a 0%, #0a0808 100%);
}

.card-placeholder-icon {
    font-size: 1.6rem;
    opacity: 0.18;
}
.card-item[data-type="manifestation"] .card-placeholder-icon { color: var(--color-energy); opacity: 0.25; }
.card-item[data-type="treasure"] .card-placeholder-icon { color: var(--color-devotion); opacity: 0.25; }
.card-item[data-type="victory"] .card-placeholder-icon { color: var(--color-combat); opacity: 0.25; }

/* ── Rule Text (description) ── */
.card-rule-text {
    font-size: 0.55rem;
    color: var(--text-muted);
    line-height: 1.3;
    padding: 0.25rem 0.4rem;
    flex: 1;
    overflow: hidden;
    background: rgba(var(--shadow-rgb), 0.3);
}

/* ── Bottom Bar: req badge + type tag ── */
.card-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.18rem 0.4rem;
    background: rgba(0, 0, 0, 0.55);
    border-top: 1px solid rgba(var(--overlay-rgb), 0.03);
    gap: 0.2rem;
    flex-shrink: 0;
}

.card-req-badge {
    font-size: 0.52rem;
    font-weight: 800;
    color: var(--color-cyan);
    display: flex;
    align-items: center;
    gap: 0.15rem;
    text-shadow: 0 0 5px var(--color-cyan-glow);
    white-space: nowrap;
}
.card-req-badge.warning {
    color: var(--color-hp);
    text-shadow: 0 0 5px var(--color-hp-glow);
}

.card-type-tag {
    font-size: 0.48rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.08rem 0.25rem;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.card-item[data-type="manifestation"] .card-type-tag { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.card-item[data-type="treasure"] .card-type-tag { background: rgba(234,171,8,0.15); color: #fbbf24; border: 1px solid rgba(234,171,8,0.3); }
.card-item[data-type="victory"] .card-type-tag { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.card-item[data-type="heresy"] .card-type-tag { background: rgba(100,116,139,0.15); color: var(--text-muted); border: 1px solid rgba(100,116,139,0.3); }

/* ── Stat Footer (CP / Devotion) ── */
.card-stat-footer {
    display: flex;
    justify-content: center;
    padding: 0.12rem 0.4rem;
    background: rgba(0, 0, 0, 0.45);
    border-top: 1px solid rgba(var(--overlay-rgb),0.03);
    flex-shrink: 0;
}
.card-stat-value {
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.3px;
}
.cp-value { color: var(--color-combat); }
.dev-value { color: var(--color-devotion); }

/* Playable pulse glow animation */
.card-item.playable {
    animation: playable-pulse 2s infinite alternate;
}
@keyframes playable-pulse {
    0% { border-color: rgba(var(--overlay-rgb), 0.06); }
    100% { border-color: var(--color-amber); box-shadow: 0 0 12px rgba(var(--color-amber-rgb), 0.2); }
}

/* Legacy compat — keep card-intel-badge alias */
.card-intel-badge {
    font-size: 0.52rem;
    font-weight: 800;
    color: var(--color-cyan);
    display: flex;
    align-items: center;
    gap: 0.15rem;
    text-shadow: 0 0 5px var(--color-cyan-glow);
}
.card-intel-badge.warning {
    color: var(--color-hp);
    text-shadow: 0 0 5px var(--color-hp-glow);
}

.card-item.low-intel {
    opacity: 0.5;
    border-color: rgba(255, 74, 104, 0.25);
    cursor: not-allowed;
}
.card-item.low-intel:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 74, 104, 0.4);
}

/* ==========================================
   Player Hand dock
   ========================================== */
.player-hand-container {
    grid-column: 1 / 2;
    grid-row: 4 / 5;
    background: rgba(var(--shadow-rgb), 0.96);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem 60px 2rem; /* 60px bottom padding clears the fixed 55px music player bar! */
    z-index: 10;
    overflow: visible;
}

.hand-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    height: 100%;
    overflow: visible;
}

.hand-row .card-item {
    margin: 0 -0.2rem;
}
.hand-row .card-item:hover {
    margin: 0 1.2rem;
    z-index: 15;
}

/* ==========================================
   Modals
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal.active { display: flex; }

.modal-content {
    max-width: 550px;
    width: 90%;
    max-height: 80vh;
}
.modal-content.scrollable { overflow-y: auto; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}
.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-disabled);
    cursor: pointer;
    font-size: 1.3rem;
    transition: color var(--transition-fast);
}
.close-modal-btn:hover { color: var(--text-primary); }

.modal-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.quit-match-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-quit-confirm {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #ef4444;
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-quit-confirm:hover {
    background: #ef4444;
    color: var(--text-primary);
}

/* "Quit & Watch" — a real but less-final choice than "Leave", so it gets a
   neutral/informational color (cyan) rather than the destructive red used
   for "Leave & Return to Lobby". */
.btn-quit-watch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(var(--color-cyan-rgb), 0.15);
    border: 1px solid var(--color-cyan);
    color: var(--color-cyan);
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-quit-watch:hover {
    background: var(--color-cyan);
    color: var(--text-primary);
}

/* docs/futuregoals.md FG-2. Deliberately NOT `.glow-button` — that class
   carries a `margin-top: 1rem` meant for a standalone full-width CTA, which
   pushed this button visibly lower than its Cancel sibling when the two sat
   side by side (confirmed via screenshot). Sized to match .btn-back-to-hub
   /.btn-quit-watch instead, so all three modal-footer button styles share
   the same box. */
.btn-save-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(var(--color-amber-rgb), 0.15);
    border: 1px solid var(--color-amber);
    color: var(--color-amber);
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-save-profile:hover:not(:disabled) {
    background: var(--color-amber);
    color: #1a1000;
}

.btn-save-profile:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* docs/futuregoals.md FG-4 */
.header-actions-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.btn-icon-only:hover {
    border-color: var(--color-amber);
    color: var(--color-amber);
}

.settings-modal-content {
    max-width: 640px;
    width: 100%;
}

.settings-modal-body {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.settings-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 0 0 160px;
}

.settings-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.settings-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(var(--overlay-rgb), 0.03);
}

.settings-tab-btn.active {
    color: var(--color-amber);
    background: rgba(var(--color-amber-rgb), 0.1);
    border-color: rgba(var(--color-amber-rgb), 0.3);
}

.settings-panels {
    flex: 1;
    min-width: 280px;
}

.settings-panel {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.settings-panel.active {
    display: flex;
}

.theme-swatch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.theme-swatch-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all var(--transition-fast);
}

.theme-swatch-btn:hover {
    border-color: rgba(var(--color-amber-rgb), 0.4);
}

.theme-swatch-btn.selected {
    border-color: var(--color-amber);
    box-shadow: 0 0 0 1px var(--color-amber);
}

.theme-swatch-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(var(--overlay-rgb), 0.15);
}

.theme-swatch-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.settings-account-card {
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem;
}

.settings-account-card h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.settings-account-card .modal-desc {
    margin-bottom: 0.75rem;
}

.settings-account-card-danger {
    /* --color-hp is a fixed (non-theme-reactive) stat color with no -rgb
       split variant defined — it never changes, so no need for one. */
    border-color: rgba(255, 74, 104, 0.3);
}

/* docs/futuregoals.md FG-10: admin battle-log panel. */
.battle-log-modal-content {
    max-width: 720px;
    width: 100%;
}

.battle-log-modal-body {
    max-height: 65vh;
    overflow-y: auto;
}

.battle-log-view.is-hidden {
    display: none;
}

.battle-log-match-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 1rem 0;
    max-height: 45vh;
    overflow-y: auto;
}

.battle-log-empty {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem 0;
}

.battle-log-match-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: left;
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font: inherit;
    color: inherit;
}

.battle-log-match-row:hover {
    border-color: var(--color-amber);
    background: rgba(var(--overlay-rgb), 0.05);
}

.battle-log-match-row-title {
    font-weight: 600;
    color: var(--text-primary);
}

.battle-log-match-row-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.battle-log-participant-block {
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.battle-log-participant-block h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.battle-log-entries {
    max-height: 30vh;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.78rem;
    white-space: pre-wrap;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* docs/futuregoals.md FG-12 Phase 2: experiment ledger panel. */
.experiment-status-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.experiment-status-badge.testing { background: rgba(var(--color-cyan-rgb), 0.15); color: var(--color-cyan); }
.experiment-status-badge.promoted { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.experiment-status-badge.rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.experiment-vote-tally {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.experiment-vote-list {
    max-height: 25vh;
    overflow-y: auto;
    margin: 0.75rem 0;
}

.experiment-vote-list-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(var(--overlay-rgb), 0.04);
    font-size: 0.82rem;
}

.experiment-resolution-note {
    background: rgba(var(--shadow-rgb), 0.3);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.experiment-note-input {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    background: rgba(var(--shadow-rgb), 0.3);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    outline: none;
}

.experiment-vote-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}
.experiment-vote-btn { flex: 1; }

.experiment-resolve-row {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.power-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.power-option-card {
    background: rgba(var(--overlay-rgb), 0.01);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.85rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    text-align: left;
    color: inherit;
    transition: all var(--transition-fast);
    font-family: inherit;
}
.power-option-card:hover:not(:disabled) {
    background: rgba(var(--overlay-rgb), 0.03);
    border-color: rgba(var(--overlay-rgb), 0.12);
}
.power-option-card:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.power-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(var(--overlay-rgb), 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.power-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.power-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}
.power-effect {
    font-size: 0.75rem;
    color: var(--text-faint);
}
.power-cost {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-energy);
}

.font-small {
    font-size: 0.85rem;
}
.font-small h3 {
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.25rem;
}
.font-small ul, .font-small ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* ==========================================
   Screen 4: Game Over Overlay Multi-score
   ========================================== */
#game-over-screen {
    background: radial-gradient(circle at center, #241410 0%, #050202 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.game-over-container {
    max-width: 650px;
    width: 100%;
    text-align: center;
    border: 2px solid var(--color-hp);
    box-shadow: 0 0 45px rgba(255, 74, 104, 0.12);
    background: rgba(var(--shadow-rgb), 0.94);
}

#game-over-title {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(to right, var(--text-primary), #ff4a68, #ea580c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 74, 104, 0.4);
    margin-bottom: 0.5rem;
}

#game-over-subtitle {
    color: var(--text-faint);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.score-grid-multi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.multi-score-card {
    background: rgba(var(--overlay-rgb), 0.01);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    transition: all var(--transition-fast);
}

.multi-score-card.winner {
    border-color: var(--color-cyan);
    background: rgba(var(--color-cyan-rgb), 0.02);
}

.multi-score-card.fallen {
    border-color: rgba(255, 74, 104, 0.2);
    opacity: 0.65;
}

.multi-score-rank {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-faint);
}
.winner .multi-score-rank { color: var(--color-cyan); }

.multi-score-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.multi-score-val {
    font-size: 1.8rem;
    font-weight: 900;
    font-family: 'Cinzel', serif;
    color: var(--text-secondary);
}
.winner .multi-score-val { color: var(--color-cyan); text-shadow: 0 0 10px rgba(var(--color-cyan-rgb), 0.3); }

.multi-score-hp {
    font-size: 0.72rem;
    color: var(--text-disabled);
}

/* ==========================================
   Media Music Player Widget
   ========================================== */
.audio-player-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 55px;
    /* docs/futuregoals.md FG-11 follow-up (2026-08-31): a real user report
       — the track name was unreadable on Light Mode/Arctic Frost. Same bug
       class as FG-11's other 7 spots (missed there since this one wasn't
       exactly rgba(0,0,0,X)), same fix. */
    background: rgba(var(--shadow-rgb), 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(var(--color-amber-rgb), 0.35);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
}

/* Left Panel: visualizer and track info */
.audio-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 320px;
}

.visualizer-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
    width: 25px;
}

.v-bar {
    width: 3px;
    height: 4px;
    background-color: var(--color-amber);
    border-radius: 2px;
    transition: height 0.15s ease;
}

.visualizer-container.playing .v-bar {
    animation: bounce-bar 1.2s ease-in-out infinite alternate;
}

.visualizer-container.playing .v-bar:nth-child(1) { animation-delay: 0.1s; }
.visualizer-container.playing .v-bar:nth-child(2) { animation-delay: 0.4s; }
.visualizer-container.playing .v-bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer-container.playing .v-bar:nth-child(4) { animation-delay: 0.5s; }

@keyframes bounce-bar {
    0% { height: 4px; }
    100% { height: 18px; }
}

.track-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.now-playing-label {
    font-size: 0.65rem;
    color: var(--text-faint);
    font-weight: 700;
    letter-spacing: 1px;
}

.track-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 250px;
    text-shadow: 0 0 5px rgba(var(--overlay-rgb), 0.1);
}

/* Center Panel: controls */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.audio-btn:hover {
    color: var(--text-primary);
    background: rgba(var(--overlay-rgb), 0.05);
}

.audio-btn.main-play-btn {
    background: rgba(var(--color-amber-rgb), 0.1);
    border: 1px solid var(--color-amber);
    color: var(--color-amber);
    font-size: 1.25rem;
    width: 38px;
    height: 38px;
    box-shadow: 0 0 10px rgba(var(--color-amber-rgb), 0.2);
}

.audio-btn.main-play-btn:hover {
    background: var(--color-amber);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(var(--color-amber-rgb), 0.4);
}

.audio-btn.toggle-btn {
    border-radius: 6px;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    width: auto;
    height: auto;
    border: 1px solid transparent;
    gap: 0.35rem;
    font-weight: 700;
}

.audio-btn.toggle-btn:hover {
    border-color: rgba(var(--overlay-rgb), 0.1);
}

.audio-btn.toggle-btn.active {
    background: rgba(var(--color-amber-rgb), 0.15);
    border-color: var(--color-amber);
    color: var(--color-amber);
    box-shadow: 0 0 10px rgba(var(--color-amber-rgb), 0.15);
}

.audio-btn.toggle-btn.active-cyan {
    background: rgba(var(--color-cyan-rgb), 0.15);
    border-color: var(--color-cyan);
    color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(var(--color-cyan-rgb), 0.15);
}

#loop-mode-label {
    font-size: 0.65rem;
    font-weight: 800;
}

/* Dual Volume Control Group (Music & SFX) */
.audio-volume-controls-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.volume-slider-box {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.volume-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.volume-label i.text-amber { color: var(--color-amber); }
.volume-label i.text-cyan { color: var(--color-cyan); }

#audio-volume, #sfx-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 4px;
    background: var(--bg-panel-solid);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#audio-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-amber);
    box-shadow: 0 0 6px rgba(var(--color-amber-rgb), 0.8);
    transition: all var(--transition-fast);
}

#sfx-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-cyan);
    box-shadow: 0 0 6px rgba(var(--color-cyan-rgb), 0.8);
    transition: all var(--transition-fast);
}

#audio-volume::-webkit-slider-thumb:hover, #sfx-volume::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.volume-percentage {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: right;
}


/* ==========================================
   God Avatars and Card Back Visual Styles
   ========================================== */
.lobby-avatar-preview-wrap {
    /* docs/futuregoals.md FG-15: was width:100% (full-panel-width, self-
       centering) from when this stacked below the selector; now a sibling
       flex item in .customizer-header alongside it, so it just needs to
       not shrink below the portrait's own fixed size. */
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    margin-top: 0.2rem;
}

.lobby-avatar-preview {
    /* docs/futuregoals.md FG-15: 25% bigger, same aspect ratio (140/196 == 175/245). */
    width: 175px;
    height: 245px;
    border-radius: 12px;
    border: 2px solid var(--color-amber);
    box-shadow: 0 0 15px rgba(var(--color-amber-rgb), 0.35);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0c0810;
    /* docs/futuregoals.md FG-15.2: click-to-enlarge, on top of the
       pre-existing hover-scale below. */
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lobby-avatar-preview:hover {
    transform: scale(1.35) translateY(-5px);
    z-index: 100;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.95), 0 0 25px rgba(var(--color-amber-rgb), 0.6);
    border-color: var(--color-amber);
}

.visual-pile {
    width: 60px;
    height: 84px;
    position: relative;
    border-radius: 6px;
    cursor: default;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--overlay-rgb), 0.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.visual-pile .pile-card-back {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: url('cards/templates/GITM_Back_Card.webp') no-repeat center center / cover;
    transition: opacity var(--transition-fast);
}

.visual-pile .pile-card-front {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: url('cards/templates/GITM_Back_Card.webp') no-repeat center center / cover;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.visual-pile .pile-card-front.has-cards {
    opacity: 0.85;
}

.visual-pile .pile-count {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: rgba(var(--shadow-rgb), 0.95);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.05rem 0.3rem;
    border: 1px solid var(--color-amber);
    box-shadow: 0 0 5px rgba(0,0,0,0.6);
    z-index: 5;
}

.draw-pile .pile-card-back.empty {
    opacity: 0.15;
}

.opp-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--color-amber);
    margin-right: 0.5rem;
    flex-shrink: 0;
    box-shadow: 0 0 5px rgba(var(--color-amber-rgb), 0.2);
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.opp-avatar-mini:hover {
    transform: scale(3.5) translateY(12px);
    z-index: 1000;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.9), 0 0 15px var(--color-amber);
}

.mini-card-back {
    display: inline-block;
    width: 10px;
    height: 14px;
    background: url('cards/templates/GITM_Back_Card.webp') no-repeat center center / cover;
    border-radius: 2px;
    border: 1px solid rgba(var(--overlay-rgb),0.15);
    vertical-align: middle;
    margin-right: 0.2rem;
}

/* ==========================================
   Table Setup & Manifestations Drafting UI
   ========================================== */
.table-setup-panel {
    margin-top: 2rem;
    border: 1px solid rgba(var(--color-amber-rgb), 0.25);
    box-shadow: 0 0 20px rgba(var(--color-amber-rgb), 0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
}

.setup-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.75rem;
}

.setup-panel-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 1px;
}

.setup-summary {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-cyan);
    background: rgba(var(--color-cyan-rgb), 0.08);
    border: 1px solid rgba(var(--color-cyan-rgb), 0.25);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
}

.setup-hint {
    font-size: 0.82rem;
    color: var(--text-faint);
    margin-bottom: 0.5rem;
}

/* docs/futuregoals.md FG-10 follow-up (2026-08-31): this rule was
   accidentally declared TWICE (see "Draft Grid Item Card representation"
   below) — the second, smaller minmax() silently won the cascade, shrinking
   every draft-grid card ~16% below what was actually intended. Consolidated
   to one declaration, and bumped further per a real friend-playtester
   report that cards read as too small/thumbnail-like to see artwork
   clearly without an extra click. */
.setup-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* Card Inspect (i) Icon Button */
.card-inspect-btn {
    background: rgba(var(--overlay-rgb), 0.05);
    border: 1px solid rgba(var(--overlay-rgb), 0.1);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    padding: 0.12rem 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
    line-height: 1;
    margin-left: 0.2rem;
}

.card-inspect-btn:hover {
    color: var(--color-cyan);
    background: rgba(var(--color-cyan-rgb), 0.2);
    border-color: var(--color-cyan);
    transform: scale(1.2);
    box-shadow: 0 0 8px var(--color-cyan-glow);
}

.pile-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.pile-inspect-btn {
    font-size: 0.98rem;
    padding: 0.15rem;
}

/* Draft Grid Item Card representation */
.draft-card-item {
    background: linear-gradient(160deg, var(--card-bg-a) 0%, var(--card-bg-b) 100%);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.draft-card-item:hover {
    background: linear-gradient(160deg, #191426 0%, #100c1a 100%);
    border-color: rgba(var(--overlay-rgb), 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.draft-card-item.selected {
    border-color: var(--color-amber);
    box-shadow: 0 0 15px rgba(var(--color-amber-rgb), 0.3);
}

.draft-card-item.selected::after {
    content: '\f00c'; /* FontAwesome check icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    color: var(--color-amber);
    font-size: 0.85rem;
    z-index: 10;
    background: rgba(0,0,0,0.7);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-amber);
}

.draft-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(var(--overlay-rgb), 0.04);
}

.draft-card-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.draft-card-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-right: 1rem; /* clear space for checkmark */
}

.draft-card-cost {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--color-devotion);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(234, 171, 8, 0.3);
    border-radius: 3px;
    padding: 0.05rem 0.25rem;
}

.draft-card-art-window {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-panel-solid);
    border-bottom: 1px solid rgba(var(--overlay-rgb), 0.04);
}

.draft-card-desc {
    font-size: 0.62rem;
    color: var(--text-muted);
    line-height: 1.3;
    padding: 0.35rem 0.5rem;
    flex: 1;
    background: rgba(var(--shadow-rgb), 0.25);
}

.draft-card-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(var(--overlay-rgb), 0.03);
}

.draft-card-item.read-only {
    cursor: default;
}

/* Enlarged Card Inspection Modal */
.card-inspect-modal-content {
    /* docs/futuregoals.md FG-15.3: bumped from 380px to match the
       enlarged card's new, bigger footprint below (same 480px used by
       .god-portrait-modal-content, for the same reason — ~2rem padding
       on each side around a ~420px-wide inner element). */
    max-width: 480px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-inspect-modal-body {
    width: 100%;
    display: flex;
    justify-content: center;
}

.enlarged-card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0;
    width: 100%;
}

.enlarged-card-item.card-item {
    /* docs/futuregoals.md FG-15.3: "as big as the god cards" — same
       sizing approach as .enlarged-god-portrait (a pixel ceiling, a
       viewport-width ceiling, and a viewport-height ceiling expressed as
       an equivalent width via the card's own aspect ratio, so a fixed
       width can never force this taller than 65vh on a short window). */
    width: min(420px, 75vw, calc(65vh * 250 / 390));
    height: auto;
    aspect-ratio: 250 / 390;
    transform: none !important;
    box-shadow: 0 12px 40px rgba(var(--shadow-rgb), 0.9), 0 0 25px rgba(var(--color-amber-rgb), 0.35);
    cursor: default;
}

/* Internal text was hand-tuned for the old fixed 250px width — scaled
   up ~1.68x (the ratio from 250px to this size's 420px pixel ceiling)
   rather than left at the old, now-too-small values. */
.enlarged-card-item .card-frame-name {
    font-size: 1.5rem;
}

.enlarged-card-item .card-frame-cost {
    font-size: 1.4rem;
}

.enlarged-card-item .card-rule-text {
    font-size: 1.3rem;
    padding: 1rem;
    line-height: 1.4;
}

.enlarged-card-item .card-req-badge {
    font-size: 1.2rem;
}

.enlarged-card-item .card-type-tag {
    font-size: 1.1rem;
    padding: 0.15rem 0.45rem;
}

/* Enlarged God Portrait Modal (docs/futuregoals.md FG-15.2) */
.god-portrait-modal-content {
    max-width: 480px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.god-portrait-modal-body {
    width: 100%;
    display: flex;
    justify-content: center;
}

.enlarged-god-portrait {
    /* Same 5:7 aspect ratio as .lobby-avatar-preview (175x245), just
       bigger — capped by both a pixel ceiling and viewport-relative
       bounds so it doesn't blow out on a short/narrow window. */
    width: min(420px, 75vw);
    aspect-ratio: 5 / 7;
    max-height: 65vh;
    border-radius: 16px;
    border: 3px solid var(--color-amber);
    box-shadow: 0 12px 40px rgba(var(--shadow-rgb), 0.9), 0 0 30px rgba(var(--color-amber-rgb), 0.5);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0c0810;
}

.enlarged-card-item .card-stat-value {
    font-size: 0.82rem;
}

/* ==========================================
   Inspect Deity Modal Styles
   ========================================== */
.inspect-deity-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

@media (max-width: 500px) {
    .inspect-deity-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
}

.inspect-deity-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.inspect-avatar-large {
    width: 140px;
    height: 185px;
    border: 2px solid var(--color-amber);
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(var(--color-amber-rgb), 0.25);
    background-size: cover;
    background-position: center;
    margin-bottom: 1rem;
}

#inspect-name {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
}

#inspect-title {
    font-size: 0.85rem;
    color: var(--color-amber);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.inspect-deity-right {
    flex: 1.8;
    width: 100%;
}

.inspect-section-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.4rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inspect-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.inspect-stat-item {
    background: rgba(var(--overlay-rgb), 0.02);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.inspect-stat-item .stat-lbl {
    font-size: 0.72rem;
    color: var(--text-faint);
    font-weight: 700;
}

.inspect-stat-item .stat-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.inspect-purchased-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.inspect-purchased-item {
    background: rgba(var(--overlay-rgb), 0.01);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inspect-purchased-card-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.inspect-purchased-card-info i {
    width: 20px;
    text-align: center;
}

.inspect-purchased-count {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #c084fc;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 800;
}

.inspect-purchased-empty {
    font-size: 0.8rem;
    color: var(--text-disabled);
    font-style: italic;
    text-align: center;
    padding: 1rem 0;
}

/* Opponent HUD tile inspect button style */
.opp-inspect-btn {
    background: none;
    border: none;
    color: var(--text-disabled);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.opp-inspect-btn:hover {
    color: var(--color-amber);
    transform: scale(1.15);
}
