:root {
    --wood-bg: url('assets/img/bg_3d_light_large.jpg');
    --board-filter: none;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --green: #16a34a;
    --green-hover: #15803d;
    --blue: #2563eb;
    --blue-hover: #1d4ed8;
    --danger: #dc2626;
    --panel-bg: rgba(24, 15, 8, 0.88);
    --panel-border: rgba(245, 158, 11, 0.32);
    --text-main: #fef3c7;
    --text-muted: #d6c3a5;
    --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.65);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    touch-action: manipulation;
    height: 100%;
    height: 100dvh;
    overflow: hidden; /* Zero page scroll - fits screen 100% */
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background-image: linear-gradient(rgba(12, 7, 3, 0.45), rgba(12, 7, 3, 0.65)), var(--wood-bg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Top Navigation Bar */
.topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: rgba(18, 10, 4, 0.94);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    z-index: 30;
    gap: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
}

.brand-title {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    line-height: 1.1;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.apk-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(58, 36, 18, 0.88);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--text-main);
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}

.apk-icon-btn:hover:not(:disabled) {
    background: rgba(92, 56, 26, 0.95);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.apk-icon-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.apk-icon-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.apk-icon-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.apk-icon-btn.highlight {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: #fbbf24;
    color: #fff;
}

/* Mobile Quick Section Switcher (Visible on mobile/tablet <= 860px) */
.mobile-nav-tabs {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 680px;
    margin: 0 auto 8px auto;
    background: rgba(18, 10, 4, 0.9);
    padding: 5px;
    border-radius: 11px;
    border: 1px solid var(--panel-border);
}

.mobile-nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 8px 4px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.mobile-nav-btn.active {
    background: linear-gradient(135deg, #d97706, #92400e);
    color: #fff;
    border-color: rgba(251, 191, 36, 0.5);
}

/* Main Viewport Container (Fixed 100dvh - Zero Page Scroll) */
.app-viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    width: 100%;
    position: relative;
}

.game-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 660px;
    padding: 3px 8px;
    margin: 0 auto;
    overflow: hidden;
    gap: 3px;
}

/* Ergonomic Bottom Dock (Thumb-friendly Navigation Bar) */
.bottom-dock {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    width: 100%;
    max-width: 660px;
    margin: 0 auto;
    background: rgba(18, 10, 4, 0.96);
    border-top: 1px solid var(--panel-border);
    padding: 6px 10px;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 6px));
    backdrop-filter: blur(12px);
    z-index: 30;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.45);
}

.dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    color: var(--text-muted);
    padding: 5px 2px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dock-btn:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: var(--accent);
    color: #fef3c7;
}

.dock-btn:active {
    transform: scale(0.95);
}

.dock-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.dock-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.dock-unread-dot {
    position: absolute;
    top: -2px;
    right: -6px;
    width: 9px;
    height: 9px;
    background: #ef4444;
    border: 1.5px solid #180f08;
    border-radius: 50%;
    box-shadow: 0 0 6px #ef4444;
    animation: pulse 1.2s infinite;
}

@media (max-width: 860px) {
    .topbar {
        padding: 6px 10px;
        gap: 6px;
    }
    .brand-icon {
        width: 32px;
        height: 32px;
    }
    .brand-title {
        font-size: 0.95rem;
    }
    .brand-sub {
        font-size: 0.68rem;
    }
    .top-actions {
        gap: 4px;
    }
    .apk-icon-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    .apk-icon-btn span {
        display: none; /* Icon-only in topbar on phones to keep game stage maximized */
    }
    .apk-icon-btn.highlight span {
        display: inline;
    }
}

.card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 15px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
}

.card + .card {
    margin-top: 14px;
}

@media (max-width: 1200px) {
    .left-sidebar .card + .card {
        margin-top: 0;
    }
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #fde68a;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mode Switcher Tabs */
.mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: rgba(0, 0, 0, 0.38);
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.mode-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 8px 6px;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.mode-tab.active {
    background: linear-gradient(135deg, #d97706, #92400e);
    color: #fff;
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Form Controls */
.field-group {
    margin-bottom: 11px;
}

.field-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 600;
}

.input-text, .select-box {
    width: 100%;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(10, 6, 3, 0.75);
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}

.input-text:focus, .select-box:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,0.2);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-green {
    background: linear-gradient(135deg, #22c55e, #15803d);
}
.btn-green:hover {
    background: linear-gradient(135deg, #16a34a, #166534);
    transform: translateY(-1px);
}

.btn-blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}
.btn-blue:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
}

.btn-amber {
    background: linear-gradient(135deg, #f59e0b, #b45309);
}
.btn-amber:hover {
    background: linear-gradient(135deg, #d97706, #92400e);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.16);
}

.btn-row {
    display: flex;
    gap: 8px;
}

/* Online Room Invite Box */
.invite-box {
    background: rgba(245, 158, 11, 0.12);
    border: 1px dashed rgba(251, 191, 36, 0.6);
    border-radius: 10px;
    padding: 11px;
    margin-top: 10px;
    text-align: center;
}

.room-code-badge {
    font-family: 'Courier New', monospace;
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.55);
    padding: 6px 14px;
    border-radius: 8px;
    display: inline-block;
    margin: 6px 0;
    border: 1px solid rgba(251, 191, 36, 0.4);
    user-select: text;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.status-pill.waiting {
    background: rgba(245, 158, 11, 0.2);
    color: #fde047;
    border-color: rgba(245, 158, 11, 0.45);
}

.dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.4s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Open Rooms Lobby List */
.lobby-list {
    max-height: 165px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.lobby-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
}

.lobby-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lobby-join-btn {
    padding: 5px 10px;
    font-size: 0.76rem;
    border-radius: 6px;
    background: var(--accent);
    color: #000;
    font-weight: 800;
    border: none;
    cursor: pointer;
}

/* Center Board Stage */
.board-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Player HUD Bars (Top & Bottom of Board) */
.player-hud {
    width: 100%;
    max-width: min(94vw, calc(100dvh - 205px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(20, 12, 5, 0.88);
    border: 1px solid var(--panel-border);
    padding: 5px 12px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.45);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.player-hud.active-turn {
    border-color: #fbbf24;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.35), 0 4px 14px rgba(0,0,0,0.5);
    background: rgba(42, 25, 10, 0.92);
}

.player-ident {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.hud-piece-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.player-name {
    font-weight: 800;
    font-size: 0.88rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.turn-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: #fbbf24;
    color: #1c1917;
    font-weight: 800;
    text-transform: uppercase;
    flex-shrink: 0;
}

.player-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.hud-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.clock-box {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    min-width: 60px;
    text-align: center;
}

.clock-box.low-time {
    color: #f87171;
    border-color: #ef4444;
    animation: pulse 1s infinite;
}

/* Board Container & 3D / 2D Perspective (Fits Viewport 100%) */
.board-outer-wrap {
    width: 100%;
    max-width: min(94vw, calc(100dvh - 205px));
    max-height: min(94vw, calc(100dvh - 205px));
    aspect-ratio: 1 / 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    flex-shrink: 1;
    margin: 2px 0;
}

.board-frame {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(90, 52, 20, 0.8);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
}

.board-frame.view-3d {
    transform: rotateX(15deg) scale(0.975);
    box-shadow:
        0 12px 0 #3b210d,
        0 16px 0 #261407,
        0 30px 55px rgba(0, 0, 0, 0.88);
}

@media (max-width: 600px) {
    .board-frame.view-3d {
        transform: rotateX(10deg) scale(0.99);
        box-shadow:
            0 8px 0 #3b210d,
            0 11px 0 #261407,
            0 20px 35px rgba(0, 0, 0, 0.85);
    }
    .player-hud {
        padding: 6px 10px;
    }
    .hud-piece-icon {
        width: 28px;
        height: 28px;
    }
    .player-name {
        font-size: 0.85rem;
    }
    .clock-box {
        font-size: 0.95rem;
        padding: 3px 8px;
        min-width: 58px;
    }
}

.board-frame.flipped .board-grid {
    transform: rotate(180deg);
}

.board-frame.flipped .piece-el,
.board-frame.flipped .coord-hint {
    transform: rotate(180deg);
}

.board-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    filter: var(--board-filter);
    transition: transform 0.35s ease;
}

.board-bg-img.rotated-90 {
    transform: rotate(90deg);
}

/* Inner 800x800 grid inside 830x830 texture (15/830 = 1.8072% border) */
.board-grid {
    position: absolute;
    top: 1.8072%;
    left: 1.8072%;
    width: 96.3855%;
    height: 96.3855%;
    display: grid;
}

.board-cell {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.board-cell.last-move-from {
    background: rgba(251, 191, 36, 0.25);
}

.board-cell.last-move-to {
    background: rgba(251, 191, 36, 0.36);
}

.board-cell.selected-cell {
    background: rgba(34, 197, 94, 0.42);
    box-shadow: inset 0 0 0 3px #4ade80;
}

.board-cell.hint-cell {
    background: rgba(56, 189, 248, 0.42);
    box-shadow: inset 0 0 0 3px #38bdf8;
}

.board-cell.mandatory-piece-cell::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2px dashed rgba(251, 191, 36, 0.85);
    pointer-events: none;
    animation: spinSlow 6s linear infinite;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Legal Move Target Indicator */
.move-dot {
    width: 34%;
    height: 34%;
    border-radius: 50%;
    background: radial-gradient(circle, #4ade80 20%, #16a34a 90%);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
    pointer-events: none;
    z-index: 4;
    transition: transform 0.15s ease;
}

.move-dot.capture-dot {
    width: 44%;
    height: 44%;
    background: radial-gradient(circle, #fbbf24 20%, #ea580c 90%);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.95);
    border: 2px solid #fff;
}

.board-cell:hover .move-dot {
    transform: scale(1.25);
}

/* Checkers Piece Rendering & Smooth Sliding Animation */
.piece-el {
    width: 88%;
    height: 88%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    z-index: 3;
    pointer-events: none;
    will-change: transform;
}

.piece-el.sliding-active {
    z-index: 25;
}

.piece-el.captured-fade {
    transform: scale(0.25) !important;
    opacity: 0 !important;
    transition: transform 0.32s ease-in, opacity 0.32s ease-in !important;
}

.piece-base-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
    transition: filter 0.25s ease;
}

.piece-el.sliding-active .piece-base-img {
    filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.75));
}

.piece-crown-img {
    position: absolute;
    width: 54%;
    height: 54%;
    top: 21%;
    left: 23%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.board-cell.selected-cell .piece-el {
    transform: scale(1.1) translateY(-4px);
}

.board-frame.flipped .board-cell.selected-cell .piece-el {
    transform: rotate(180deg) scale(1.1) translateY(-4px);
}

/* Mandatory Jump Banner & Status Toast */
.status-banner {
    width: 100%;
    max-width: min(94vw, calc(100dvh - 205px));
    background: rgba(28, 17, 7, 0.92);
    border: 1px solid var(--panel-border);
    border-radius: 9px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
    gap: 8px;
    flex-shrink: 0;
    min-height: 26px;
}

/* Variant Selector Grid */
.variant-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 290px;
    overflow-y: auto;
    padding-right: 4px;
}

.variant-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.15s;
}

.variant-card:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.45);
}

.variant-card.active {
    background: rgba(245, 158, 11, 0.24);
    border-color: #fbbf24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}

.variant-flag {
    width: 38px;
    height: 26px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.25);
}

.variant-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
}

.variant-sub {
    font-size: 0.67rem;
    color: var(--text-muted);
}

/* AI Levels List */
.level-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}

.level-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.15s;
}

.level-card.active {
    background: rgba(245, 158, 11, 0.25);
    border-color: #fbbf24;
}

.level-medal {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.level-title {
    font-size: 0.76rem;
    font-weight: 700;
}

/* Chat & Move History Sidebar */
.chat-messages {
    height: 190px;
    overflow-y: auto;
    background: rgba(8, 5, 2, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    padding: 9px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.chat-msg {
    font-size: 0.82rem;
    line-height: 1.35;
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    word-break: break-word;
}

.chat-msg.system {
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
    font-style: italic;
    font-size: 0.78rem;
}

.chat-sender {
    font-weight: 800;
    color: #fbbf24;
    margin-right: 5px;
}

.emoji-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    justify-content: space-between;
}

.emoji-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    padding: 5px 0;
    cursor: pointer;
    font-size: 1.05rem;
    transition: transform 0.12s;
}
.emoji-btn:hover {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.16);
}

.move-history-list {
    max-height: 150px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 10px;
    background: rgba(8, 5, 2, 0.55);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.move-entry {
    color: var(--text-muted);
}
.move-entry strong {
    color: #fde68a;
}

/* Modals (Settings, Rules Info, Victory/Draw) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-box {
    background: linear-gradient(180deg, #2b180a, #170d05);
    border: 2px solid #d97706;
    border-radius: 16px;
    max-width: 580px;
    width: 100%;
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    padding: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
}

.modal-box.modal-mode-box {
    max-width: 520px;
}

@media (max-width: 600px) {
    .modal-backdrop {
        padding: 10px;
    }
    .modal-box {
        padding: 14px;
        border-radius: 14px;
        max-height: 94dvh;
    }
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 8px;
}

@media (min-width: 520px) {
    .theme-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.theme-option {
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 9px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    text-align: center;
    transition: all 0.15s;
}

.theme-option.active {
    border-color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

.theme-option img {
    width: 100%;
    height: 64px;
    object-fit: cover;
    display: block;
}

.theme-option span {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px;
}

/* Draw Offer Alert */
.draw-offer-banner {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(180, 83, 9, 0.35));
    border: 1px solid #fbbf24;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.draw-offer-banner.visible {
    display: flex;
}

/* ============================================================================
   LEAGUE, LEADERBOARD, MATCHMAKING & CLOUD SYNC STYLES
   ============================================================================ */
.cloud-sync-pill {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.45);
    color: #93c5fd;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cloud-sync-pill:hover {
    background: rgba(59, 130, 246, 0.32);
    color: #fff;
}

.cloud-sync-pill.synced {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(74, 222, 128, 0.55);
    color: #86efac;
}

.profile-mini-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 8px;
    padding: 6px 10px;
    margin-top: 6px;
    cursor: pointer;
    font-size: 0.76rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-mini-bar:hover {
    border-color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
}

.mini-stat-label {
    color: var(--text-muted);
    font-size: 0.68rem;
    margin-right: 3px;
}

.matchmake-box {
    background: rgba(245, 158, 11, 0.09);
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 10px;
    padding: 9px;
    margin-bottom: 10px;
}

.modal-box.modal-wide {
    max-width: 860px;
    width: 96%;
}

.concurrency-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.concurrency-strip strong {
    color: #fef08a;
}

.table-scroll-wrap {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
}

.league-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: center;
}

.league-table th {
    position: sticky;
    top: 0;
    background: rgba(28, 19, 12, 0.96);
    color: #fde68a;
    font-weight: 800;
    padding: 9px 8px;
    border-bottom: 1px solid rgba(251, 191, 36, 0.3);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.league-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.league-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.league-table tr.me-row td {
    background: rgba(245, 158, 11, 0.18);
    font-weight: 700;
}

.rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.76rem;
}

.rank-1 { background: linear-gradient(135deg, #fde047, #ca8a04); color: #1c1917; }
.rank-2 { background: linear-gradient(135deg, #e2e8f0, #64748b); color: #0f172a; }
.rank-3 { background: linear-gradient(135deg, #fdba74, #b45309); color: #1c1917; }

.league-split-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 720px) {
    .league-split-grid {
        grid-template-columns: 280px 1fr;
    }
}

.league-side-box,
.league-detail-box {
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 11px;
}

.fixture-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.fixture-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.8rem;
}

.fixture-item.my-fixture {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(245, 158, 11, 0.1);
}

.career-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 8px;
}

.career-stat-card {
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    padding: 10px;
    text-align: center;
}

.career-stat-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fbbf24;
    margin-top: 2px;
}

.career-stat-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
}


/* ==========================================================================
   WORLD CHECKERS LEAGUE (WCL) — BY FRIVANS GAMES
   STARTUP SPLASH INTRO, WELCOME HUB, GAME SETUP & MATCHUP STYLING
   ========================================================================== */

/* 1. STARTUP ANIMATED SPLASH INTRO */
.splash-intro {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #2e1709 0%, #100602 75%, #050201 100%);
    overflow: hidden;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

.splash-intro.splash-fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-stage {
    position: relative;
    width: min(92vw, 480px);
    height: min(85vh, 480px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.splash-board-3d {
    perspective: 700px;
    width: 260px;
    height: 260px;
    margin-bottom: 20px;
    position: relative;
}

.splash-board-surface {
    width: 100%;
    height: 100%;
    transform: rotateX(42deg) rotateZ(-12deg);
    border: 8px solid #5a2e12;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.85), inset 0 0 16px rgba(0,0,0,0.7);
    background: #2a1608;
    position: relative;
    overflow: hidden;
}

.splash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: 100%;
    height: 100%;
}

.splash-grid .sq-dark {
    background: #3a1c0d;
}

.splash-grid .sq-light {
    background: #c99355;
}

/* Animated Marble Moving Across Dark Squares into Center */
.splash-marble-mover {
    position: absolute;
    width: 48px;
    height: 48px;
    top: 50%;
    left: 50%;
    margin-top: -24px;
    margin-left: -24px;
    animation: marbleRollSlide 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.splash-marble-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.85));
}

@keyframes marbleRollSlide {
    0% {
        transform: translate3d(-130px, 110px, 0) scale(0.65) rotate(0deg);
        opacity: 0;
    }
    15% {
        transform: translate3d(-90px, 60px, 0) scale(0.8) rotate(90deg);
        opacity: 1;
    }
    45% {
        transform: translate3d(-35px, 20px, 0) scale(0.95) rotate(220deg);
    }
    72% {
        transform: translate3d(0, 0, 0) scale(1.18) rotate(360deg);
        filter: drop-shadow(0 0 18px #fbbf24) brightness(1.3);
        opacity: 1;
    }
    82% {
        transform: translate3d(0, 0, 0) scale(1.35) rotate(360deg);
        filter: drop-shadow(0 0 35px #f59e0b) brightness(1.7);
        opacity: 0.95;
    }
    100% {
        transform: translate3d(0, 0, 0) scale(0);
        opacity: 0;
    }
}

/* Golden Shockwave Expanding from Board Center */
.splash-burst {
    position: absolute;
    top: 38%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
    border-radius: 50%;
    border: 3px solid rgba(251, 191, 36, 0.9);
    box-shadow: 0 0 45px rgba(245, 158, 11, 0.9), inset 0 0 35px rgba(251, 191, 36, 0.7);
    pointer-events: none;
    animation: shockwaveExpand 2.4s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes shockwaveExpand {
    0%, 70% {
        transform: scale(0);
        opacity: 0;
    }
    74% {
        transform: scale(0.35);
        opacity: 1;
    }
    90% {
        transform: scale(2.6);
        opacity: 0.8;
    }
    100% {
        transform: scale(4.4);
        opacity: 0;
    }
}

/* Championship Crest Logo Form & Reveal */
.splash-logo-reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: logoFormReveal 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 2;
}

.splash-logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.85));
    margin-bottom: 8px;
}

.splash-title {
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 3px 8px rgba(0,0,0,0.9), 0 0 25px rgba(245, 158, 11, 0.6);
    line-height: 1.1;
    margin-bottom: 3px;
}

.splash-studio {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: #fbbf24;
    text-transform: uppercase;
}

@keyframes logoFormReveal {
    0%, 70% {
        opacity: 0;
        transform: scale(0.4) translateY(20px);
    }
    75% {
        opacity: 0.5;
        transform: scale(0.85) translateY(10px);
    }
    85% {
        opacity: 1;
        transform: scale(1.06) translateY(0);
        filter: drop-shadow(0 0 25px rgba(251, 191, 36, 0.85));
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.splash-skip-btn {
    position: absolute;
    bottom: -30px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fde68a;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.splash-skip-btn:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: #fbbf24;
    color: #fff;
}

/* 2. WELCOME SCREEN / MAIN MENU HUB */
.welcome-hub {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    background-image: linear-gradient(rgba(14, 8, 4, 0.75), rgba(12, 7, 3, 0.88)), var(--wood-bg);
    background-size: cover;
    background-position: center;
    color: var(--text-main);
    height: 100vh;
    height: 100dvh;
    overflow: hidden; /* Fits screen 100% without scroll */
    padding: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.welcome-hub.hidden {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
    visibility: hidden;
}

.hub-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(18, 10, 4, 0.94);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
}

.hub-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.6));
}

.hub-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.hub-sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fbbf24;
    letter-spacing: 1px;
}

.hub-brand-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    padding: 2px 0 8px;
}

@media (max-width: 719px) {
    .hub-header .hub-brand-copy {
        display: none;
    }
}

@media (min-width: 720px) {
    .hub-brand-banner {
        display: none;
    }
}

.hub-banner-logo {
    width: 76px;
    height: 76px;
    margin-bottom: 4px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.75));
}

.hub-brand-banner .hub-title {
    margin: 0;
    font-size: 1.25rem;
}

.hub-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hub-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 16px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Hub Profile Strip */
.hub-profile-bar {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.hub-player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-player-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hub-player-name {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.hub-btn-edit-name {
    background: transparent;
    border: none;
    color: #fbbf24;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.8;
}

.hub-btn-edit-name:hover {
    opacity: 1;
}

.hub-player-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.hub-rank-badge {
    font-size: 0.72rem;
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.hub-cloud-pill {
    font-size: 0.72rem;
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.hub-cloud-pill:hover {
    background: rgba(59, 130, 246, 0.35);
}

.hub-stats-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hub-stat-item {
    text-align: center;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.hub-stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.hub-stat-lbl {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.hub-stat-val {
    font-size: 1.05rem;
    font-weight: 900;
    color: #fbbf24;
}

/* Active Match In-Progress Banner */
.hub-active-banner {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.25), rgba(180, 83, 9, 0.15));
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin: 4px 0;
}

/* 3 Primary Game Modes (Sleek Mobile-First Action Banners) */
.hub-mode-banners {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0;
    width: 100%;
}

.mode-banner-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: all 0.18s cubic-bezier(0.2, 0, 0.2, 1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    background: #170d05;
}

.mode-banner-btn:hover {
    transform: translateY(-2px);
}

.mode-banner-btn:active {
    transform: scale(0.985);
}

/* Individual Mode Banner Themes & Gradients */
.banner-online {
    background: linear-gradient(135deg, rgba(50, 28, 12, 0.96) 0%, rgba(24, 13, 5, 0.98) 60%, rgba(70, 38, 12, 0.94) 100%);
    border-color: rgba(245, 158, 11, 0.5);
}
.banner-online:hover {
    border-color: #fbbf24;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.35);
}

.banner-friend {
    background: linear-gradient(135deg, rgba(16, 42, 24, 0.96) 0%, rgba(8, 22, 12, 0.98) 60%, rgba(20, 60, 32, 0.94) 100%);
    border-color: rgba(34, 197, 94, 0.5);
}
.banner-friend:hover {
    border-color: #4ade80;
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.35);
}

.banner-cpu {
    background: linear-gradient(135deg, rgba(18, 32, 58, 0.96) 0%, rgba(10, 18, 34, 0.98) 60%, rgba(28, 50, 90, 0.94) 100%);
    border-color: rgba(59, 130, 246, 0.5);
}
.banner-cpu:hover {
    border-color: #60a5fa;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.35);
}

/* Icon Box on Left */
.banner-icon-box {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

.banner-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Center Info: Title & Subtitle */
.banner-info {
    flex: 1;
    min-width: 0;
}

.banner-title {
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.banner-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.73rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.banner-tag {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.tag-online {
    background: rgba(245, 158, 11, 0.25);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.tag-friend {
    background: rgba(34, 197, 94, 0.25);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.45);
}

.tag-cpu {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.45);
}

/* Right Action Pill */
.banner-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.pill-online {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #170d05;
}

.pill-friend {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #06240f;
}

.pill-cpu {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #081a36;
}

.banner-arrow {
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
}

/* Secondary Quick Access Bar (Compact 3-Pill Bottom Row) */
.hub-secondary-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
    width: 100%;
}

.hub-sub-pill {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.18s ease;
}

.hub-sub-pill:hover,
.hub-sub-pill:active {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}

.sub-pill-icon {
    font-size: 1.05rem;
}

.sub-pill-label {
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-btn-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 3. DEDICATED GAME SETUP MODAL STYLING */
.setup-modal-box {
    max-width: 640px;
}

.setup-mode-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.setup-mode-tag {
    font-size: 0.75rem;
    font-weight: 900;
    background: #f59e0b;
    color: #170d05;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.setup-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.setup-step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 8px;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f59e0b;
    color: #1c1107;
    font-size: 0.74rem;
    font-weight: 900;
}

/* 12 Variant Selection Grid in Setup Modal */
.setup-variant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 2px;
    margin-bottom: 8px;
}

.setup-variant-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.setup-variant-card:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
}

.setup-variant-card.selected {
    border: 2px solid #fbbf24;
    background: rgba(245, 158, 11, 0.22);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}

.setup-variant-flag {
    width: 28px;
    height: 19px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}

.setup-variant-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.setup-variant-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Live Rule Details Preview Box */
.setup-rule-preview-box {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 9px 12px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.preview-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #fbbf24;
}

.preview-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.preview-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.preview-pill {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2px 7px;
    border-radius: 4px;
    color: #fef08a;
}

.preview-desc {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-main);
}

/* Timer Selection Pills in Setup Modal */
.setup-timer-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.timer-pill {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.timer-pill:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.5);
}

.timer-pill.active {
    background: #f59e0b;
    color: #170d05;
    border-color: #fbbf24;
    font-weight: 900;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.setup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

/* 4. MATCHUP / HEAD-TO-HEAD MODAL */
.matchup-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

@media (max-width: 480px) {
    .matchup-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.matchup-player-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.matchup-player-card.you-card {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
}

.matchup-tag {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fde68a;
    margin-bottom: 6px;
}

.matchup-piece-img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    margin: 0 auto 6px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.matchup-name {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.matchup-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.matchup-vs-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: radial-gradient(circle, #f59e0b 0%, #b45309 100%);
    color: #170d05;
    font-weight: 900;
    font-size: 0.88rem;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
    margin: 0 auto;
}

.matchup-h2h-summary {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
}


/* ==========================================================================
   DEDICATED MATCHMAKING RADAR SEARCH MODAL
   ========================================================================== */
.matchmake-radar-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 8px auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    animation: radarPulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.radar-ring.ring-2 {
    animation-delay: 0.65s;
}

.radar-ring.ring-3 {
    animation-delay: 1.3s;
}

@keyframes radarPulse {
    0% {
        transform: scale(0.3);
        opacity: 0.95;
        border-color: #fbbf24;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
        border-color: #f59e0b;
    }
}

.radar-core {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle, #2b170a 0%, #170d05 100%);
    border: 2px solid #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    z-index: 2;
}

.radar-flag {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.matchmake-criteria-pill {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fde68a;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 20px;
}


/* ==========================================================================
   AVATAR GALLERY PICKER MODAL
   ========================================================================== */
.avatar-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 2px;
}

@media (max-width: 420px) {
    .avatar-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.avatar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px 8px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, transform 0.14s;
    user-select: none;
}

.avatar-card:hover {
    border-color: rgba(251, 191, 36, 0.55);
    background: rgba(251, 191, 36, 0.09);
    transform: scale(1.04);
}

.avatar-card-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.6));
    transition: transform 0.14s;
}

.avatar-card.active .avatar-card-img {
    transform: scale(1.1);
}

.avatar-card-name {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.avatar-card.active .avatar-card-name {
    color: #fbbf24;
}

/* ==========================================================================
   CHAMPIONSHIP CLUB — 2026 visual layer
   Deep walnut, ivory, brass. Appended overrides for the full product pass.
   ========================================================================== */

@font-face {
    font-family: 'Marcellus';
    src: url('assets/fonts/marcellus-latin.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('assets/fonts/manrope-latin.woff2') format('woff2');
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink-900: #0a0705;
    --ink-800: #120d09;
    --ink-700: #1a130d;
    --ink-600: #241a12;
    --ivory: #f3e9d7;
    --ivory-soft: #d9cbb4;
    --ivory-dim: #ab9d87;
    --brass: #c9a566;
    --brass-bright: #e8cc94;
    --brass-deep: #8d6a36;
    --club-green: #2c6b4f;
    --club-red: #8a3630;
    --club-blue: #345a7d;
    --hairline: rgba(201, 165, 102, 0.22);
    --hairline-strong: rgba(201, 165, 102, 0.42);
    --glass: rgba(18, 12, 8, 0.84);
    --glass-soft: rgba(26, 18, 12, 0.7);
    --font-display: 'Marcellus', 'Times New Roman', Georgia, serif;
    --font-ui: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --table-size: min(94vw, calc(100dvh - 292px));
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 9px;
}

[hidden] {
    display: none !important;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.13em;
}

body {
    font-family: var(--font-ui);
    color: var(--ivory);
    background-image:
        radial-gradient(1100px 600px at 50% -15%, rgba(120, 83, 39, 0.28), transparent 62%),
        linear-gradient(rgba(9, 6, 4, 0.78), rgba(7, 5, 3, 0.9)),
        var(--wood-bg);
}

button {
    font-family: var(--font-ui);
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
}

button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid rgba(232, 204, 148, 0.85);
    outline-offset: 2px;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.24);
}
::-webkit-scrollbar-thumb {
    background: rgba(201, 165, 102, 0.28);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 165, 102, 0.45);
}

/* ---------- Shared controls ---------- */

.btn {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--hairline);
    background: rgba(201, 165, 102, 0.08);
    color: var(--ivory);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: none;
    box-shadow: none;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover:not(:disabled) {
    background: rgba(201, 165, 102, 0.16);
    border-color: var(--hairline-strong);
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.99);
}

.btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none !important;
}

.btn-brass {
    background: linear-gradient(180deg, #dcbb7f, #b98e4b);
    border-color: #e6cb98;
    color: #1b120a;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn-brass:hover:not(:disabled) {
    background: linear-gradient(180deg, #e8cc94, #c9a566);
    border-color: #f0dcb2;
    color: #150e08;
}

.btn-amber {
    background: linear-gradient(180deg, #c9a566, #a17a3f);
    border-color: rgba(232, 204, 148, 0.7);
    color: #17100a;
}

.btn-amber:hover:not(:disabled) {
    background: linear-gradient(180deg, #dcbb7f, #b98e4b);
}

.btn-green {
    background: linear-gradient(180deg, #357a5c, #24553f);
    border-color: rgba(122, 178, 148, 0.45);
    color: var(--ivory);
}

.btn-green:hover:not(:disabled) {
    background: linear-gradient(180deg, #3d8a67, #2a6249);
}

.btn-blue {
    background: linear-gradient(180deg, #3d648a, #2a4a68);
    border-color: rgba(150, 185, 216, 0.4);
    color: var(--ivory);
}

.btn-danger {
    background: linear-gradient(180deg, #903b34, #6c2a25);
    border-color: rgba(208, 132, 122, 0.4);
    color: #fbeee9;
}

.btn-ghost {
    background: transparent;
    border-color: rgba(201, 165, 102, 0.24);
    color: var(--ivory-soft);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(201, 165, 102, 0.1);
    color: var(--ivory);
}

.btn-sm {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.74rem;
}

.btn-xs {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.68rem;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.btn-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ivory-soft);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn .icon {
    width: 19px;
    height: 19px;
}

.icon-btn:hover {
    background: rgba(201, 165, 102, 0.12);
    border-color: rgba(201, 165, 102, 0.24);
    color: var(--brass-bright);
}

.icon-btn-mini {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--brass);
    cursor: pointer;
}

.icon-btn-mini .icon {
    width: 14px;
    height: 14px;
}

.icon-btn-mini:hover {
    background: rgba(201, 165, 102, 0.12);
    color: var(--brass-bright);
}

#btnHubSound .icon-sound-off,
#btnHubSound.sound-off .icon-sound-on {
    display: none;
}

#btnHubSound.sound-off .icon-sound-off {
    display: inline-block;
}

.input-text,
.select-box {
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 9px;
    border: 1px solid rgba(201, 165, 102, 0.26);
    background: rgba(8, 5, 3, 0.72);
    color: var(--ivory);
    font-size: 0.88rem;
    font-family: var(--font-ui);
}

.input-text::placeholder {
    color: rgba(171, 157, 135, 0.7);
}

.input-text:focus,
.select-box:focus {
    border-color: var(--brass);
    box-shadow: 0 0 0 3px rgba(201, 165, 102, 0.14);
}

.field-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ivory-dim);
    margin-bottom: 6px;
}

.card-header {
    border-bottom: 1px solid rgba(201, 165, 102, 0.16);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.16rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0.01em;
    color: var(--ivory);
}

.sheet-eyebrow {
    display: block;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 2px;
}

.sheet-grabber {
    width: 42px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 2px;
    background: rgba(201, 165, 102, 0.34);
}

/* ---------- Match header ---------- */

.topbar {
    height: 54px;
    min-height: 54px;
    padding: 0 10px;
    gap: 8px;
    background: linear-gradient(180deg, rgba(18, 12, 8, 0.97), rgba(11, 8, 5, 0.95));
    border-bottom: 1px solid var(--hairline);
    backdrop-filter: blur(16px);
}

.topbar-back {
    flex-shrink: 0;
    border-color: rgba(201, 165, 102, 0.16);
}

.match-identity {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
}

.match-crest {
    width: 29px;
    height: 29px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.92;
}

.match-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.match-eyebrow {
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brass);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-variant {
    background: none;
    border: 0;
    padding: 0;
    color: var(--ivory);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    max-width: 100%;
}

.match-variant:hover {
    color: var(--brass-bright);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.top-actions .icon-btn {
    width: 35px;
    height: 35px;
}

/* Waiting-room invite strip */
.room-wait-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    padding: 7px 12px;
    background: linear-gradient(90deg, rgba(201, 165, 102, 0.16), rgba(201, 165, 102, 0.04));
    border-bottom: 1px solid rgba(201, 165, 102, 0.24);
    font-size: 0.72rem;
    color: var(--ivory-soft);
}

.room-wait-banner[hidden] {
    display: none;
}

.room-wait-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.56rem;
    font-weight: 800;
    color: var(--brass);
}

.room-wait-code {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    letter-spacing: 0.18em;
    color: var(--brass-bright);
}

.room-wait-banner .btn {
    width: auto;
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.66rem;
    gap: 5px;
}

/* ---------- Game table ---------- */

.app-viewport {
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(120, 83, 39, 0.18), transparent 65%);
}

.game-stage {
    max-width: 720px;
    padding: 6px 10px;
    gap: 6px;
    justify-content: center;
}

.player-hud {
    max-width: min(94vw, calc(var(--table-size) + 26px));
    padding: 6px 11px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.18);
    background: linear-gradient(180deg, rgba(34, 23, 15, 0.92), rgba(17, 12, 8, 0.94));
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.player-hud.active-turn {
    border-color: rgba(201, 165, 102, 0.52);
    background: linear-gradient(180deg, rgba(55, 38, 21, 0.96), rgba(24, 17, 11, 0.96));
    box-shadow: 0 0 0 1px rgba(201, 165, 102, 0.14), 0 10px 24px rgba(0, 0, 0, 0.5);
}

.player-ident {
    gap: 9px;
}

.hud-avatar {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(201, 165, 102, 0.32);
    background: radial-gradient(circle at 35% 25%, rgba(201, 165, 102, 0.26), rgba(18, 12, 8, 0.9));
}

.hud-piece-icon {
    width: 25px;
    height: 25px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.hud-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.player-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ivory);
    letter-spacing: 0.01em;
}

.turn-badge {
    font-size: 0.53rem;
    letter-spacing: 0.09em;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--brass);
    color: #1a120a;
}

.player-meta {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    color: var(--ivory-dim);
}

.clock-box {
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    min-width: 62px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.46);
    border: 1px solid rgba(201, 165, 102, 0.2);
    color: var(--ivory);
}

.clock-box.low-time {
    color: #f2a19a;
    border-color: rgba(220, 120, 110, 0.55);
}

.board-outer-wrap {
    max-width: var(--table-size);
    max-height: var(--table-size);
    margin: 2px 0;
}

.board-frame {
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(201, 165, 102, 0.22);
}

.board-frame.view-3d {
    transform: rotateX(8deg) scale(0.985);
    box-shadow:
        0 10px 0 #2c1c0f,
        0 14px 0 #1a100a,
        0 26px 50px rgba(0, 0, 0, 0.82);
}

.status-banner {
    width: auto;
    max-width: min(94vw, 660px);
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(10, 7, 4, 0.58);
    color: var(--ivory-dim);
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.status-banner .status-mark .icon {
    width: 13px;
    height: 13px;
    color: var(--brass);
}

.status-text {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottom-dock {
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    max-width: 720px;
    padding: 5px 8px;
    padding-bottom: max(5px, env(safe-area-inset-bottom, 5px));
    background: linear-gradient(180deg, rgba(18, 12, 8, 0.97), rgba(9, 6, 4, 0.99));
    border-top: 1px solid var(--hairline);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.4);
}

.dock-btn {
    position: relative;
    min-height: 53px;
    padding: 6px 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ivory-dim);
    gap: 3px;
}

.dock-btn:hover:not(:disabled) {
    background: rgba(201, 165, 102, 0.1);
    color: var(--brass-bright);
    border: 0;
}

.dock-btn:disabled {
    opacity: 0.32;
}

.dock-icon {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

.dock-icon-wrap {
    position: relative;
    display: inline-flex;
}

.dock-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: inherit;
}

.dock-unread-dot {
    top: -1px;
    right: -5px;
    width: 8px;
    height: 8px;
    border-color: #120d09;
}

.draw-offer-banner {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: min(92vw, 520px);
    z-index: 34;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.5);
    background: linear-gradient(180deg, rgba(58, 42, 23, 0.98), rgba(27, 19, 12, 0.98));
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.6);
    margin: 0;
}

.draw-offer-banner.visible {
    display: flex;
}

.draw-offer-copy {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.draw-offer-copy .icon {
    width: 20px;
    height: 20px;
    color: var(--brass-bright);
}

.draw-offer-copy span {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.draw-offer-copy strong {
    font-size: 0.78rem;
    color: var(--ivory);
}

.draw-offer-copy small {
    font-size: 0.64rem;
    color: var(--ivory-dim);
}

.draw-offer-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.draw-offer-actions[hidden],
.connection-notice[hidden] {
    display: none;
}

.connection-notice {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 520px);
    z-index: 35;
    padding: 10px 14px;
    border: 1px solid var(--brass);
    border-radius: 10px;
    background: #2b2014;
    color: var(--ivory);
    font-size: 0.8rem;
    text-align: center;
}

@media (max-width: 440px) {
    .draw-offer-banner {
        flex-wrap: wrap;
    }

    .draw-offer-actions .btn {
        min-height: 44px;
    }
}

/* ---------- Club hall (welcome hub) ---------- */

.welcome-hub {
    background:
        radial-gradient(1100px 560px at 50% -12%, rgba(132, 94, 46, 0.3), transparent 62%),
        radial-gradient(700px 420px at 105% 105%, rgba(201, 165, 102, 0.1), transparent 60%),
        linear-gradient(180deg, rgba(10, 7, 4, 0.86), rgba(7, 5, 3, 0.95)),
        var(--wood-bg);
    background-size: cover;
    background-position: center;
}

.hub-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(520px 300px at 15% 20%, rgba(201, 165, 102, 0.06), transparent 70%),
        radial-gradient(560px 320px at 88% 78%, rgba(201, 165, 102, 0.09), transparent 70%);
}

.hub-atmosphere::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(201, 165, 102, 0.16) 0.7px, transparent 0.7px);
    background-size: 32px 32px;
    opacity: 0.18;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 75%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 75%);
}

.hub-header {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    padding: 9px 16px;
    background: rgba(10, 7, 4, 0.7);
    border-bottom: 1px solid var(--hairline);
    backdrop-filter: blur(18px);
}

.hub-brand {
    gap: 11px;
    min-width: 0;
}

.hub-logo {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 3px 9px rgba(0, 0, 0, 0.65));
}

.hub-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.hub-eyebrow {
    font-size: 0.53rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
    white-space: nowrap;
}

.hub-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--ivory);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-brand-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    padding: 2px 0 8px;
}

@media (max-width: 719px) {
    .hub-header .hub-brand-copy {
        display: none;
    }
}

@media (min-width: 720px) {
    .hub-brand-banner {
        display: none;
    }
}

.hub-banner-logo {
    width: 76px;
    height: 76px;
    margin-bottom: 4px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.75));
}

.hub-brand-banner .hub-title {
    margin: 0;
    font-size: 1.25rem;
}

.hub-header-actions {
    gap: 2px;
    flex-shrink: 0;
}

.hub-content {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px 14px;
    max-width: 1020px;
    overflow-y: auto;
}

.hub-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: auto;
    margin-bottom: auto;
}

.hub-profile-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    align-items: center;
    padding: 13px 14px 11px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--hairline);
    background: linear-gradient(135deg, rgba(48, 33, 20, 0.8), rgba(17, 12, 8, 0.9));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.hub-profile-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(201, 165, 102, 0.13), transparent 42%);
    pointer-events: none;
}

.hub-avatar-frame {
    position: relative;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--hairline-strong);
    background: radial-gradient(circle at 35% 25%, rgba(201, 165, 102, 0.32), rgba(26, 18, 12, 0.95));
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.hub-avatar-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px dashed rgba(201, 165, 102, 0.3);
    pointer-events: none;
}

.hub-player-avatar {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    object-fit: contain;
    cursor: pointer;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
    transition: border-color 0.18s, transform 0.14s, box-shadow 0.18s;
}

.hub-player-avatar:hover {
    border: 0;
    transform: scale(1.06);
    box-shadow: none;
}

.hub-profile-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hub-player-name-row {
    gap: 4px;
}

.hub-player-name {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--ivory);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-player-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0;
}

.rank-chip,
.cloud-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.3);
    background: rgba(201, 165, 102, 0.08);
    color: var(--ivory-soft);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: default;
}

.rank-chip .icon,
.cloud-chip .icon {
    width: 12px;
    height: 12px;
    color: var(--brass);
}

.cloud-chip {
    cursor: pointer;
    border-color: rgba(138, 170, 198, 0.25);
    background: rgba(88, 126, 160, 0.1);
    color: #c5d8e8;
    text-transform: none;
    letter-spacing: 0.02em;
}

.cloud-chip:hover {
    border-color: rgba(138, 170, 198, 0.45);
}

.cloud-chip.synced {
    border-color: rgba(122, 178, 148, 0.4);
    background: rgba(58, 122, 90, 0.14);
    color: #b8e0c8;
}

.cloud-chip.synced .icon {
    color: #8fd1a9;
}

.hub-stats-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(201, 165, 102, 0.14);
}

.hub-stat-item {
    text-align: left;
    padding: 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hub-stat-item + .hub-stat-item {
    border-left: 1px solid rgba(201, 165, 102, 0.14);
    padding-left: 12px;
}

.hub-stat-item:hover {
    background: transparent;
}

.hub-stat-item:hover .hub-stat-val {
    color: var(--brass-bright);
}

.hub-stat-lbl {
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ivory-dim);
}

.hub-stat-val {
    font-family: var(--font-ui);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ivory);
    transition: color 0.15s ease;
    font-variant-numeric: tabular-nums;
}

.hub-stat-pts {
    color: var(--brass-bright);
}

.hub-stat-elo {
    color: #b7cfe4;
}

.hub-stat-wdl {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding-top: 3px;
    color: var(--ivory-soft);
}

.hub-active-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.32);
    background: linear-gradient(90deg, rgba(201, 165, 102, 0.14), rgba(201, 165, 102, 0.03));
    cursor: pointer;
    margin: 0;
}

.hub-active-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brass-bright);
    box-shadow: 0 0 0 4px rgba(201, 165, 102, 0.15);
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.hub-active-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.hub-active-copy strong {
    font-size: 0.76rem;
    color: var(--ivory);
}

.hub-active-copy span {
    font-size: 0.64rem;
    color: var(--ivory-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-modes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.mode-card {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    text-align: left;
    border-radius: 16px;
    border: 1px solid var(--hairline);
    background: linear-gradient(135deg, rgba(38, 26, 16, 0.84), rgba(15, 10, 7, 0.92));
    color: var(--ivory);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.mode-card:hover {
    transform: translateY(-2px);
    border-color: var(--hairline-strong);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.46);
}

.mode-card:active {
    transform: translateY(0);
}

.mode-card-primary {
    min-height: 86px;
    background:
        linear-gradient(120deg, rgba(118, 82, 38, 0.92) 0%, rgba(62, 42, 22, 0.94) 46%, rgba(26, 18, 11, 0.96) 100%);
    border-color: rgba(201, 165, 102, 0.5);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.mode-card-primary::after {
    content: '';
    position: absolute;
    right: -36px;
    top: -48px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: 1px solid rgba(232, 204, 148, 0.16);
    box-shadow: 0 0 0 24px rgba(232, 204, 148, 0.035);
    pointer-events: none;
}

.mode-emblem {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--hairline-strong);
    background: rgba(201, 165, 102, 0.1);
    color: var(--brass-bright);
}

.mode-emblem .icon {
    width: 22px;
    height: 22px;
}

.mode-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.mode-kicker {
    font-size: 0.53rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brass);
}

.mode-title {
    font-family: var(--font-display);
    font-size: 1.06rem;
    font-weight: 400;
    letter-spacing: 0.015em;
    color: var(--ivory);
}

.mode-sub {
    font-size: 0.66rem;
    letter-spacing: 0.01em;
    color: var(--ivory-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mode-cta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brass-bright);
}

.mode-cta .icon {
    width: 14px;
    height: 14px;
}

.hub-mode-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.hub-mode-pair .mode-card {
    padding: 12px;
    gap: 9px;
    min-height: 72px;
}

.hub-mode-pair .mode-emblem {
    width: 37px;
    height: 37px;
    border-radius: 10px;
}

.hub-mode-pair .mode-emblem .icon {
    width: 18px;
    height: 18px;
}

.hub-mode-pair .mode-title {
    font-size: 0.9rem;
}

.hub-mode-pair .mode-sub {
    display: none;
}

.hub-mode-pair .mode-cta {
    display: none;
}

.hub-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
    padding-top: 4px;
    width: 100%;
}

.hub-secondary-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid rgba(201, 165, 102, 0.14);
    background: rgba(13, 9, 6, 0.62);
    backdrop-filter: blur(10px);
}

.hub-sub-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 3px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ivory-dim);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.hub-sub-pill .icon {
    width: 17px;
    height: 17px;
    color: var(--brass);
    stroke-width: 1.5;
}

.hub-sub-pill:hover {
    background: rgba(201, 165, 102, 0.1);
    color: var(--ivory);
}

.hub-credits {
    text-align: center;
    font-size: 0.54rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(217, 203, 180, 0.4);
}

/* ---------- Match setup wizard ---------- */

.modal-backdrop {
    padding: 16px;
    background: rgba(4, 3, 2, 0.72);
    backdrop-filter: blur(9px);
}

.modal-backdrop.modal-sheet {
    padding: 0;
    align-items: flex-end;
}

.modal-box {
    border-radius: var(--radius-lg);
    border: 1px solid var(--hairline-strong);
    background: linear-gradient(180deg, #1e150e, #100a06);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 16px;
    max-height: 88dvh;
}

.modal-sheet .modal-box {
    width: 100%;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    max-height: 94dvh;
    padding-top: 0;
}

.setup-modal-box {
    display: flex;
    flex-direction: column;
    max-width: 840px;
    width: 100%;
    padding: 0;
    overflow: hidden;
    max-height: 94dvh;
}

.setup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px 12px;
    margin: 0;
    border-bottom: 1px solid rgba(201, 165, 102, 0.16);
    flex-shrink: 0;
}

.setup-heading {
    min-width: 0;
}

.setup-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 1px;
}

.setup-modal-icon {
    width: 31px;
    height: 31px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    border: 1px solid var(--hairline);
    background: rgba(201, 165, 102, 0.1);
    color: var(--brass-bright);
}

.setup-modal-icon .icon {
    width: 17px;
    height: 17px;
}

.setup-title-row h2 {
    font-family: var(--font-display);
    font-size: 1.34rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--ivory);
    line-height: 1.15;
}

.setup-hint {
    font-size: 0.7rem;
    color: var(--ivory-dim);
    margin-top: 3px;
}

.setup-stepper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 9px 18px;
    border-bottom: 1px solid rgba(201, 165, 102, 0.14);
    flex-shrink: 0;
}

.setup-step-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    color: var(--ivory-dim);
    text-align: left;
    cursor: pointer;
}

.setup-step-btn:hover {
    background: rgba(201, 165, 102, 0.07);
}

.setup-step-btn.active {
    border-color: rgba(201, 165, 102, 0.38);
    background: rgba(201, 165, 102, 0.1);
}

.step-index {
    width: 23px;
    height: 23px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--hairline);
    color: var(--brass);
    font-size: 0.64rem;
    font-weight: 800;
}

.setup-step-btn.active .step-index {
    background: var(--brass);
    border-color: var(--brass);
    color: #1a120a;
}

.setup-step-btn.done .step-index {
    color: var(--brass-bright);
    border-color: var(--hairline-strong);
}

.step-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.18;
    min-width: 0;
}

.step-copy strong {
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ivory-soft);
}

.step-copy small {
    font-size: 0.55rem;
    letter-spacing: 0.02em;
    color: var(--ivory-dim);
}

.setup-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 18px 8px;
}

.setup-pane {
    display: none;
}

.setup-pane.active {
    display: block;
    animation: setupPaneIn 0.18s ease;
}

@keyframes setupPaneIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.setup-settings-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(212, 165, 83, 0.12), rgba(25, 20, 14, 0.72));
    border: 1px solid rgba(212, 165, 83, 0.28);
}

.setup-settings-notice-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.setup-settings-notice-kicker {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brass-bright);
}

.setup-settings-notice-text {
    font-size: 0.78rem;
    color: var(--ivory-dim);
    line-height: 1.35;
}

.setup-settings-notice-text strong {
    color: var(--ivory);
    font-weight: 700;
}

.setup-override-badge {
    display: inline-block;
    margin-top: 3px;
    font-size: 0.68rem;
    color: #fbbf24;
    font-weight: 600;
}

.setup-override-badge.hidden {
    display: none;
}

.setup-pane-head h3 {
    font-family: var(--font-display);
    font-size: 1.04rem;
    font-weight: 400;
    color: var(--ivory);
    margin-bottom: 2px;
}

.setup-pane-head p {
    font-size: 0.68rem;
    color: var(--ivory-dim);
    margin-bottom: 12px;
}

.setup-rules-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.setup-variant-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
}

.setup-variant-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.setup-variant-card > div {
    min-width: 0;
}

.setup-variant-card:hover {
    border-color: var(--hairline-strong);
    background: rgba(201, 165, 102, 0.06);
}

.setup-variant-card.selected {
    border-color: var(--brass);
    background: rgba(201, 165, 102, 0.13);
    box-shadow: inset 0 0 0 1px rgba(201, 165, 102, 0.18);
}

.setup-variant-flag {
    width: 27px;
    height: 18px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.setup-variant-name {
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1.16;
    color: var(--ivory-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.setup-variant-sub {
    font-size: 0.54rem;
    color: var(--ivory-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.setup-rule-preview-box {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--hairline);
    background: rgba(10, 7, 4, 0.55);
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.variant-flag {
    width: 42px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.preview-title {
    font-family: var(--font-display);
    font-size: 0.98rem;
    color: var(--ivory);
    line-height: 1.2;
}

.preview-sub {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brass);
    margin-top: 1px;
}

.preview-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.preview-pill {
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.2);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ivory-soft);
    font-size: 0.56rem;
    letter-spacing: 0.02em;
}

.preview-desc {
    margin-top: 9px;
    font-size: 0.66rem;
    line-height: 1.5;
    color: var(--ivory-dim);
}

.setup-timer-pills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.timer-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 52px;
    padding: 8px 5px;
    border-radius: 10px;
    border: 1px solid rgba(201, 165, 102, 0.18);
    background: rgba(255, 255, 255, 0.02);
    color: var(--ivory-soft);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.timer-pill small {
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ivory-dim);
}

.timer-pill:hover {
    border-color: var(--hairline-strong);
    background: rgba(201, 165, 102, 0.07);
}

.timer-pill.active {
    border-color: var(--brass);
    background: rgba(201, 165, 102, 0.14);
    color: var(--ivory);
    box-shadow: inset 0 0 0 1px rgba(201, 165, 102, 0.22);
}

.timer-pill.active small {
    color: var(--brass-bright);
}

.setup-note {
    margin-top: 11px;
    font-size: 0.64rem;
    line-height: 1.5;
    color: var(--ivory-dim);
}

.setup-info-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.18);
    background: rgba(201, 165, 102, 0.05);
}

.setup-info-card > .icon {
    width: 20px;
    height: 20px;
    color: var(--brass);
    margin-top: 1px;
}

.setup-info-card strong {
    display: block;
    font-size: 0.76rem;
    color: var(--ivory);
    margin-bottom: 2px;
}

.setup-info-card p {
    font-size: 0.66rem;
    line-height: 1.5;
    color: var(--ivory-dim);
}

.setup-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(8, 6, 4, 0.5);
    flex-shrink: 0;
}

.setup-footer .btn {
    width: auto;
    flex-shrink: 0;
}

.setup-summary {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ivory-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#btnSetupConfirmStart {
    margin-left: auto;
}

/* Level medal picker inside setup + legacy panel */
.level-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 5px !important;
}

.level-card {
    min-width: 0;
    padding: 5px 3px !important;
    border-radius: 9px;
    border: 1px solid rgba(201, 165, 102, 0.16) !important;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    text-align: center;
}

.level-card.active {
    border-color: var(--brass) !important;
    background: rgba(201, 165, 102, 0.13) !important;
}

.level-medal {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain;
}

.level-title {
    font-size: 0.52rem !important;
    line-height: 1.15;
    color: var(--ivory-soft);
    white-space: normal;
    overflow: hidden;
    min-height: 1.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.level-card {
    position: relative;
}

.level-card.locked {
    opacity: 0.52;
    cursor: not-allowed;
    filter: grayscale(0.45);
    background: rgba(255, 255, 255, 0.015) !important;
    border-color: rgba(201, 165, 102, 0.1) !important;
}

.level-card.locked.active {
    border-color: rgba(201, 165, 102, 0.1) !important;
    background: rgba(255, 255, 255, 0.015) !important;
}

.level-card.locked .level-medal {
    opacity: 0.4;
}

.level-lock-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    color: var(--brass);
    pointer-events: none;
}

.ai-unlock-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 7px;
    font-size: 0.68rem;
    line-height: 1.45;
    color: var(--ivory-dim);
}

.ai-unlock-note .icon {
    width: 13px;
    height: 13px;
    margin-top: 1px;
    color: var(--brass);
}

.ai-unlock-note.complete {
    color: #86efac;
}

.ai-unlock-note.complete .icon {
    color: #86efac;
}

.game-over-unlock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: fit-content;
    margin: 10px auto 0;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.35);
    background: rgba(201, 165, 102, 0.12);
    color: var(--ivory);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
}

.game-over-unlock .icon {
    width: 14px;
    height: 14px;
    color: var(--brass);
}

/* ---------- Sheets & secondary modals ---------- */

.game-menu-sheet,
.settings-box,
.rules-box {
    max-width: 560px;
    width: 100%;
    padding: 0 16px 16px;
}

.game-menu-sheet .card-header,
.settings-box .card-header,
.rules-box .card-header {
    padding-top: 12px;
    margin-bottom: 12px;
}

.game-menu-info {
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    color: var(--ivory-dim);
    padding: 7px 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(201, 165, 102, 0.05);
}

.game-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.menu-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 10px;
    border-radius: 11px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(255, 255, 255, 0.02);
    color: var(--ivory);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.menu-action:hover {
    border-color: var(--hairline-strong);
    background: rgba(201, 165, 102, 0.08);
}

.menu-action.danger .menu-action-icon {
    color: #e5a49e;
}

.menu-action-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    border: 1px solid rgba(201, 165, 102, 0.2);
    background: rgba(201, 165, 102, 0.07);
    color: var(--brass);
}

.menu-action-icon .icon {
    width: 18px;
    height: 18px;
}

.menu-action-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.menu-action-copy strong {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ivory-soft);
}

.menu-action-copy small {
    font-size: 0.58rem;
    color: var(--ivory-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-menu-section {
    margin-top: 12px;
}

.menu-section-label {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 6px;
}

.settings-section {
    margin-bottom: 16px;
}

.settings-section-head h3 {
    font-size: 0.92rem;
    color: var(--ivory);
    margin-bottom: 1px;
}

.settings-section-head p {
    font-size: 0.64rem;
    color: var(--ivory-dim);
    margin-bottom: 9px;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.14);
    overflow: hidden;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.015);
    cursor: pointer;
}

.setting-row + .setting-row {
    border-top: 1px solid rgba(201, 165, 102, 0.1);
}

.setting-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.setting-copy strong {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--ivory-soft);
}

.setting-copy small {
    font-size: 0.6rem;
    color: var(--ivory-dim);
}

.switch {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 25px;
    flex-shrink: 0;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.28);
    background: rgba(0, 0, 0, 0.45);
    position: relative;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--ivory-dim);
    transition: transform 0.18s ease, background 0.18s ease;
}

.switch:checked {
    background: rgba(201, 165, 102, 0.28);
    border-color: var(--brass);
}

.switch:checked::after {
    transform: translateX(19px);
    background: var(--brass-bright);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-actions .btn {
    width: auto;
    min-width: 110px;
}

.theme-grid {
    gap: 8px;
}

.theme-option {
    border-radius: 10px;
    border: 1px solid rgba(201, 165, 102, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.theme-option.active {
    border-color: var(--brass);
    box-shadow: 0 0 0 1px rgba(201, 165, 102, 0.35), 0 8px 18px rgba(0, 0, 0, 0.4);
}

.theme-option img,
.theme-mini-board {
    height: 58px;
    width: 100%;
    display: block;
    overflow: hidden;
    border-radius: 9px 9px 0 0;
}

.theme-option span {
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    color: var(--ivory-soft);
}

.rules-header {
    align-items: center;
}

.rules-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.rules-desc {
    font-size: 0.76rem;
    line-height: 1.6;
    color: var(--ivory-soft);
    margin-bottom: 12px;
}

.rules-specs {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 12px;
    border-radius: 11px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(201, 165, 102, 0.04);
    font-size: 0.7rem;
    line-height: 1.45;
    color: var(--ivory-dim);
    margin-bottom: 14px;
}

.rules-specs div {
    padding-left: 4px;
    color: var(--ivory-dim);
}

.rules-specs strong {
    color: var(--ivory-soft);
    font-weight: 700;
}

/* Game over */
.modal-backdrop.modal-centered {
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.game-over-box {
    position: relative;
    max-width: 430px;
    width: 100%;
    text-align: center;
    padding: 20px 18px 16px;
    overflow: hidden;
}

.game-over-glow {
    position: absolute;
    inset: -40% -20% auto -20%;
    height: 70%;
    background: radial-gradient(closest-side, rgba(201, 165, 102, 0.26), transparent 70%);
    pointer-events: none;
}

.result-medallion {
    position: relative;
    width: 78px;
    height: 78px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(201, 165, 102, 0.45);
    background: radial-gradient(circle at 50% 28%, rgba(201, 165, 102, 0.24), rgba(13, 10, 7, 0.65) 72%);
    box-shadow: inset 0 0 0 4px rgba(13, 10, 7, 0.55), 0 10px 26px rgba(0, 0, 0, 0.5);
}

.result-medallion::after {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 1px solid rgba(201, 165, 102, 0.22);
    pointer-events: none;
}

.result-medallion .result-icon {
    width: 34px;
    height: 34px;
    color: var(--brass-bright);
    display: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.result-medallion[data-result="win"] .result-icon-win,
.result-medallion[data-result="loss"] .result-icon-loss,
.result-medallion[data-result="draw"] .result-icon-draw {
    display: block;
}

.result-medallion[data-result="loss"] {
    border-color: rgba(217, 138, 118, 0.4);
    background: radial-gradient(circle at 50% 28%, rgba(180, 84, 66, 0.22), rgba(13, 10, 7, 0.68) 72%);
}

.result-medallion[data-result="loss"] .result-icon {
    color: #d98a76;
}

.result-eyebrow {
    display: block;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 4px;
}

.game-over-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.1;
    color: var(--brass-bright);
    margin-bottom: 5px;
}

.game-over-subtitle {
    font-size: 0.74rem;
    line-height: 1.5;
    color: var(--ivory-dim);
    margin-bottom: 12px;
}

.game-over-rating {
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--ivory-soft);
    border: 1px solid rgba(201, 165, 102, 0.2);
    background: rgba(201, 165, 102, 0.06);
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 14px;
}

.game-over-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.game-over-actions .btn:first-child {
    grid-column: 1 / -1;
}

.game-over-actions .btn {
    min-height: 40px;
    font-size: 0.76rem;
}

/* Confirm / prompt dialog */
.dialog-box {
    max-width: 410px;
    width: 100%;
    padding: 22px 20px 18px;
    text-align: center;
}

.dialog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(201, 165, 102, 0.3);
    background: rgba(201, 165, 102, 0.1);
    color: var(--brass-bright);
}

.dialog-icon .icon {
    width: 22px;
    height: 22px;
}

.dialog-icon.danger {
    border-color: rgba(202, 120, 110, 0.4);
    background: rgba(138, 54, 48, 0.18);
    color: #e8a7a0;
}

.dialog-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--ivory);
    margin-bottom: 5px;
}

.dialog-message {
    font-size: 0.73rem;
    line-height: 1.55;
    color: var(--ivory-dim);
    margin-bottom: 14px;
}

.dialog-input {
    margin-bottom: 14px;
    text-align: center;
    font-size: 1rem !important;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Toasts */
.toast-stack {
    position: fixed;
    left: 50%;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: min(92vw, 430px);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(201, 165, 102, 0.32);
    background: linear-gradient(180deg, rgba(42, 30, 18, 0.98), rgba(20, 14, 9, 0.98));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
    color: var(--ivory);
    font-size: 0.72rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.in {
    opacity: 1;
    transform: none;
}

.toast .icon {
    width: 16px;
    height: 16px;
    color: var(--brass);
}

.toast-success {
    border-color: rgba(122, 178, 148, 0.4);
}

.toast-success .icon {
    color: #8fd1a9;
}

.toast-warn {
    border-color: rgba(211, 158, 96, 0.45);
}

.toast-warn .icon {
    color: #e4b273;
}

/* Chat, history, league, matchup, avatars */
.chat-messages {
    background: rgba(8, 5, 3, 0.6);
    border: 1px solid rgba(201, 165, 102, 0.14);
    border-radius: 10px;
}

.chat-msg {
    font-size: 0.74rem;
    color: var(--ivory-soft);
}

.chat-msg.system {
    background: rgba(201, 165, 102, 0.08);
    color: var(--ivory-dim);
}

.chat-sender {
    color: var(--brass-bright);
}

.emoji-bar {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.emoji-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.emoji-btn:hover {
    border-color: var(--hairline-strong);
    background: rgba(201, 165, 102, 0.09);
}

.mode-tabs {
    gap: 4px;
    padding: 4px;
    border-radius: 11px;
    border: 1px solid rgba(201, 165, 102, 0.14);
    background: rgba(0, 0, 0, 0.34);
}

.mode-tab {
    border-radius: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    padding: 8px 6px;
}

.mode-tab.active {
    background: rgba(201, 165, 102, 0.16);
    border-color: rgba(201, 165, 102, 0.4);
    color: var(--ivory);
    box-shadow: none;
}

.concurrency-strip {
    border: 1px solid rgba(201, 165, 102, 0.14);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.36);
    font-size: 0.68rem;
    gap: 6px 14px;
}

.concurrency-strip strong {
    color: var(--brass-bright);
}

.concurrency-strip span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brass);
    display: inline-block;
}

.stat-dot.live {
    background: #7fbf94;
    box-shadow: 0 0 0 3px rgba(127, 191, 148, 0.12);
}

.table-scroll-wrap {
    border: 1px solid rgba(201, 165, 102, 0.14);
    border-radius: 11px;
}

.league-table th {
    background: rgba(24, 17, 11, 0.98);
    color: var(--brass);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
}

.league-table td {
    border-bottom: 1px solid rgba(201, 165, 102, 0.07);
    font-size: 0.72rem;
    color: var(--ivory-soft);
}

.league-table tr:hover td {
    background: rgba(201, 165, 102, 0.06);
}

.career-stat-card {
    border-radius: 10px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(255, 255, 255, 0.02);
}

.career-stat-lbl {
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ivory-dim);
}

.career-stat-val {
    font-family: var(--font-display);
    color: var(--brass-bright);
}

.matchup-player-card {
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(255, 255, 255, 0.02);
}

.matchup-h2h-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--ivory-dim);
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: 6px;
}

.matchup-h2h-label .icon {
    width: 15px;
    height: 15px;
    color: var(--brass);
}

@media (max-width: 600px) {
    .matchup-player-card {
        padding: 10px 9px;
    }

    .matchup-tag {
        font-size: 0.56rem;
        letter-spacing: 0.1em;
    }

    .matchup-name {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .matchup-stat-row {
        font-size: 0.68rem;
        gap: 6px;
        padding: 2.5px 0;
    }

    .matchup-stat-row span {
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .matchup-stat-row strong {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .matchup-vs-badge {
        width: 36px;
        height: 36px;
        font-size: 0.76rem;
    }
}

.title-icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    color: var(--brass);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.matchup-name {
    font-family: var(--font-display);
    color: var(--ivory);
}

.matchup-tag {
    font-size: 0.54rem;
    letter-spacing: 0.14em;
    color: var(--brass);
}

.avatar-card {
    border-radius: 11px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(255, 255, 255, 0.02);
}

.avatar-card:hover {
    border-color: var(--hairline-strong);
}

.avatar-card.active {
    border-color: var(--brass);
    background: rgba(201, 165, 102, 0.1);
    box-shadow: 0 0 0 1px rgba(201, 165, 102, 0.25);
}

.avatar-card-name {
    color: var(--ivory-dim);
}

/* Matchmaking radar */
.matchmake-radar-wrap {
    margin-bottom: 14px;
}

.radar-core {
    border-color: rgba(201, 165, 102, 0.45);
    background: radial-gradient(circle, rgba(201, 165, 102, 0.16), rgba(11, 8, 5, 0.96));
}

#matchmakeModalHeader {
    font-family: var(--font-display) !important;
    font-weight: 400 !important;
    letter-spacing: 0.06em !important;
    color: var(--brass-bright) !important;
}

.matchmake-criteria-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.25);
    background: rgba(201, 165, 102, 0.07);
    font-size: 0.62rem;
    color: var(--ivory-soft);
}

#matchmakeTimerCounter {
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
    color: var(--ivory) !important;
}

.matchmake-box {
    border-radius: 11px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(201, 165, 102, 0.05);
}

.invite-box {
    border-radius: 11px;
    border: 1px dashed rgba(201, 165, 102, 0.4);
    background: rgba(201, 165, 102, 0.05);
}

.room-code-badge {
    color: var(--brass-bright);
    letter-spacing: 0.18em;
    font-family: var(--font-ui);
}

/* Splash refinement */
.splash-title {
    font-family: var(--font-display);
    letter-spacing: 0.2em;
    color: var(--ivory);
}

.splash-studio {
    letter-spacing: 0.32em;
    color: var(--brass);
}

.splash-skip {
    position: absolute;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    transform: translateX(-50%);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(217, 203, 180, 0.55);
    white-space: nowrap;
    animation: splashSkipPulse 2.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes splashSkipPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

/* ---------- Responsive ---------- */

@media (min-width: 720px) {
    .modal-backdrop.modal-sheet {
        align-items: center;
        padding: 24px;
    }

    .modal-sheet .modal-box {
        border-radius: var(--radius-lg);
        border-bottom: 1px solid var(--hairline-strong);
        max-height: 88dvh;
        padding-top: 5px;
    }

    .sheet-grabber {
        display: none;
    }

    .setup-modal-box {
        padding-top: 0;
    }

    .setup-modal-box .sheet-grabber {
        margin-top: 10px;
    }

    .setup-rules-layout {
        grid-template-columns: minmax(0, 1.3fr) minmax(225px, 0.7fr);
        align-items: start;
    }

    .setup-rule-preview-box {
        position: sticky;
        top: 0;
    }

    .setup-variant-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hub-mode-pair .mode-sub {
        display: block;
    }
}

@media (min-width: 900px) {
    .hub-header {
        padding: 13px 30px;
    }

    .hub-content {
        padding: 26px 30px 20px;
        gap: 22px;
    }

    .hub-main {
        display: grid;
        grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        gap: 16px 26px;
        align-items: start;
    }

    .hub-profile-card {
        grid-column: 1;
        grid-row: 1;
        padding: 18px 18px 14px;
    }

    .hub-avatar-frame {
        width: 68px;
        height: 68px;
    }

    .hub-player-avatar {
        width: 52px;
        height: 52px;
    }

    .hub-player-name {
        font-size: 1.3rem;
    }

    .hub-active-banner {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
    }

    .hub-modes {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .mode-card-primary {
        min-height: 112px;
    }

    .mode-card-primary .mode-title {
        font-size: 1.26rem;
    }

    .hub-mode-pair .mode-card {
        min-height: 92px;
        padding: 15px;
    }

    .hub-mode-pair .mode-title {
        font-size: 1rem;
    }

    .hub-secondary-bar {
        max-width: 560px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .player-hud {
        padding: 5px 9px;
        border-radius: 10px;
    }

    .hud-avatar {
        width: 31px;
        height: 31px;
    }

    .hud-piece-icon {
        width: 22px;
        height: 22px;
    }

    .clock-box {
        font-size: 0.88rem;
        min-width: 56px;
        padding: 3px 6px;
    }

    .player-name {
        font-size: 0.76rem;
    }

    .player-meta {
        font-size: 0.58rem;
    }

    .setup-stepper {
        padding: 8px 14px;
        gap: 4px;
    }

    .setup-step-btn {
        padding: 6px;
        gap: 6px;
    }

    .step-copy small {
        display: none;
    }

    .setup-header,
    .setup-body,
    .setup-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .setup-variant-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hub-logo {
        width: 32px;
        height: 32px;
    }

    .hub-title {
        font-size: 0.92rem;
    }

    .hub-eyebrow {
        font-size: 0.48rem;
    }
}

@media (max-width: 430px) {
    .setup-footer {
        flex-wrap: wrap;
        gap: 6px;
    }

    .setup-summary {
        order: -1;
        flex-basis: 100%;
        text-align: left;
    }

    .setup-footer .btn {
        flex: 1;
        min-height: 40px;
        font-size: 0.74rem;
    }

    #btnSetupConfirmStart {
        margin-left: 0;
    }

    .hub-stat-val {
        font-size: 1.02rem;
    }

    .hub-stat-wdl {
        font-size: 0.68rem;
    }

    .mode-emblem {
        width: 38px;
        height: 38px;
    }

    .mode-title {
        font-size: 0.94rem;
    }

    .match-crest {
        display: none;
    }

    .top-actions .icon-btn {
        width: 32px;
        height: 32px;
    }
}

@media (max-height: 620px) and (orientation: landscape) {
    :root {
        --table-size: min(52vw, calc(100dvh - 124px));
    }

    .game-stage {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--table-size) minmax(0, 1fr);
        gap: 8px;
        padding: 2px 8px;
    }

    .board-outer-wrap {
        grid-column: 2;
        grid-row: 1;
    }

    .player-hud {
        flex-direction: column;
        gap: 8px;
        padding: 6px;
        min-width: 0;
    }

    #hudBlackBar {
        grid-column: 1;
        grid-row: 1;
    }

    #hudWhiteBar {
        grid-column: 3;
        grid-row: 1;
    }

    .player-name {
        flex-wrap: wrap;
        overflow-wrap: anywhere;
    }

    .hud-avatar {
        display: none;
    }

    .status-banner {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 440px) {
    .setup-variant-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .setup-variant-name {
        font-size: 0.7rem;
    }
}

/* ==========================================================================
   FRIENDS & CHALLENGES
   ========================================================================== */
.hub-friends-btn,
.hub-notif-btn {
    position: relative;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 58dvh;
    overflow-y: auto;
    padding-right: 4px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.16s ease, background 0.16s ease;
}

.notif-item.unread {
    background: rgba(212, 165, 83, 0.09);
    border-color: rgba(212, 165, 83, 0.34);
}

.notif-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 165, 83, 0.14);
    font-size: 1rem;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.notif-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--ivory);
}

.notif-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.notif-text {
    font-size: 0.76rem;
    color: var(--ivory-dim);
    margin-top: 2px;
    line-height: 1.35;
}

.notif-actions {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.friend-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--brass);
    color: #1a1208;
    font-size: 0.56rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(13, 9, 6, 0.9);
}

.friends-box {
    max-height: min(88vh, 720px);
}

.friends-signed-out {
    padding: 4px 0 6px;
}

.friends-signed-out p {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.55;
    margin-bottom: 14px;
}

.friends-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.friends-add-row .input-text {
    flex: 1;
    min-width: 0;
}

.friends-action-msg {
    min-height: 18px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.friends-scroll {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 4px;
}

.friends-section h4 {
    margin: 0 0 6px;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass);
    font-weight: 700;
}

.friend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(201, 165, 102, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    margin-bottom: 6px;
}

.friend-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.friend-info strong {
    font-size: 0.84rem;
    color: var(--ivory);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-info span {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.friend-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.friend-waiting {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.friend-empty {
    font-size: 0.76rem;
    color: var(--text-muted);
    padding: 6px 2px;
}

/* =========================================================================
   WORLD SEASON — monthly divisions, nations & honours
   ========================================================================= */

.country-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    max-width: 160px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.24);
    background: rgba(201, 165, 102, 0.07);
    color: var(--ivory-soft);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.country-chip:hover {
    border-color: rgba(201, 165, 102, 0.48);
    background: rgba(201, 165, 102, 0.12);
}

.country-chip #hubCountryName {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-flag {
    font-size: 0.9rem;
    line-height: 1;
}

.season-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 16px;
    padding: 15px;
    border-radius: 14px;
    border: 1px solid rgba(201, 165, 102, 0.24);
    background:
        radial-gradient(circle at 8% 12%, rgba(201, 165, 102, 0.16), transparent 46%),
        linear-gradient(135deg, rgba(24, 30, 38, 0.92), rgba(10, 13, 18, 0.92));
    margin-bottom: 10px;
}

.season-eyebrow {
    display: block;
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 8px;
}

.season-division-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.season-division-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.season-division-copy strong {
    font-size: 0.9rem;
    color: var(--ivory);
}

.season-division-copy span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.season-nation-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--ivory-soft);
    margin-top: 4px;
}

.season-nation-line .season-link-btn {
    font-size: 0.72rem;
}

.season-hero-meter {
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.season-mp-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.season-mp-line strong {
    font-size: 1.3rem;
    line-height: 1;
    color: #fbbf24;
    letter-spacing: 0;
}

.season-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.season-progress span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #b8860b, #f7d774);
    transition: width 0.4s ease;
}

.season-progress-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.season-rules-line {
    font-size: 0.64rem;
    line-height: 1.4;
    color: rgba(232, 226, 212, 0.5);
}

.season-note {
    font-size: 0.63rem;
    color: var(--text-muted);
    margin: -4px 0 6px;
    line-height: 1.35;
}

.season-subhead {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid rgba(201, 165, 102, 0.25);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--brass);
}

.season-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 10px;
}

.season-panel {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    padding: 11px;
    min-width: 0;
}

.season-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.season-panel-head strong {
    font-size: 0.82rem;
    color: var(--ivory);
    letter-spacing: 0.03em;
}

.season-panel-head span {
    font-size: 0.66rem;
    color: var(--text-muted);
}

.season-link-btn {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--brass);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.season-link-btn:hover {
    color: #f7d774;
}

.season-set-country {
    display: inline-block;
    margin-top: 8px;
}

.season-tier-board {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}

.season-tier-group {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    padding: 7px 8px;
    background: rgba(255, 255, 255, 0.02);
}

.season-tier-group.is-mine {
    border-color: rgba(201, 165, 102, 0.42);
    background: rgba(201, 165, 102, 0.08);
}

.season-tier-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.season-tier-meta {
    font-size: 0.63rem;
    color: var(--text-muted);
    text-align: right;
}

.season-tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tier-global      { background: linear-gradient(135deg, #f7d774, #b8860b); color: #241a05; }
.tier-continental { background: linear-gradient(135deg, #a8c8e6, #41698a); color: #0a1622; }
.tier-national    { background: linear-gradient(135deg, #9fe3b6, #2f7a52); color: #062015; }
.tier-regional    { background: linear-gradient(135deg, #f2c27c, #a56313); color: #241304; }
.tier-town        { background: linear-gradient(135deg, #e7dfcf, #a2957c); color: #241f15; }
.tier-village     { background: linear-gradient(135deg, #c9cfd8, #6c7480); color: #14171c; }
.tier-community   { background: linear-gradient(135deg, #a9b2bf, #535b67); color: #0f1218; }
.tier-area        { background: linear-gradient(135deg, #8d96a3, #414750); color: #0c0e12; }

.season-player-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 2px;
    font-size: 0.78rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.season-tier-head + .season-player-row {
    border-top: 0;
}

.season-player-row.is-mine {
    color: #fbbf24;
}

.season-player-row.is-mine em,
.season-country-row.is-mine em {
    font-style: normal;
    font-size: 0.66rem;
    color: #fbbf24;
}

.season-player-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.season-player-mp {
    color: #93c5fd;
    font-size: 0.8rem;
}

.season-place {
    width: 30px;
    flex-shrink: 0;
    text-align: center;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.7rem;
}

.season-place.has-medal {
    font-size: 0.95rem;
}

.season-tier-self {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed rgba(201, 165, 102, 0.28);
}

.season-empty {
    font-size: 0.73rem;
    color: var(--text-muted);
    padding: 8px 4px;
    line-height: 1.4;
}

.season-empty-inline {
    font-size: 0.73rem;
    color: var(--text-muted);
}

.season-country-board {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 360px;
    overflow-y: auto;
}

.season-country-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.77rem;
}

.season-country-row:first-child {
    border-top: 0;
}

.season-country-row.is-mine {
    color: #fbbf24;
}

.season-country-flag {
    font-size: 0.92rem;
    line-height: 1;
    flex-shrink: 0;
}

.season-country-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.season-country-stats {
    font-size: 0.62rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.season-country-score {
    min-width: 30px;
    text-align: right;
    color: #fbbf24;
    font-size: 0.82rem;
}

.season-place.medal-gold,
.season-place.medal-silver,
.season-place.medal-bronze {
    font-size: 0.92rem;
}

.season-place.medal-gold   { color: #f7d774; }
.season-place.medal-silver { color: #cbd5e1; }
.season-place.medal-bronze { color: #d99a6c; }

.season-history {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 260px;
    overflow-y: auto;
}

.history-month {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 9px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
}

.history-month-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.history-month-head strong {
    font-size: 0.78rem;
    color: var(--ivory);
    letter-spacing: 0.03em;
}

.history-month-head span {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.history-kings {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.history-king {
    font-size: 0.75rem;
    color: var(--ivory-soft);
}

.history-king em {
    font-style: normal;
    margin-right: 2px;
}

.history-champs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 12px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.67rem;
    color: var(--text-muted);
}

.history-champ em {
    font-style: normal;
    font-weight: 800;
    color: rgba(232, 226, 212, 0.72);
    margin-right: 2px;
}

.season-medals {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.season-medal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.28);
    background: rgba(201, 165, 102, 0.08);
    font-size: 0.7rem;
    color: var(--ivory-soft);
}

.season-medal-chip strong {
    color: var(--ivory);
    font-size: 0.72rem;
}

.season-medal-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.country-modal-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 10px;
}

#countrySearchInput {
    margin-bottom: 8px;
}

.country-list {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.24);
}

.country-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--ivory-soft);
    cursor: pointer;
    text-align: left;
    font-size: 0.82rem;
}

.country-row:hover {
    background: rgba(201, 165, 102, 0.1);
}

.country-row.is-current {
    background: rgba(201, 165, 102, 0.14);
}

.country-row-name {
    flex: 1;
}

.country-row-code {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.country-row-check {
    color: #86efac;
    font-weight: 900;
}

@media (max-width: 720px) {
    .season-hero {
        grid-template-columns: 1fr;
    }

    .season-grid {
        grid-template-columns: 1fr;
    }

    .season-tier-board,
    .season-country-board {
        max-height: none;
    }

    .season-tier-meta {
        display: none;
    }
}

/* =========================================================================
   MANAGER MODE, WALLET PILL, STORE, MARKETPLACE & AI ARENA
   ========================================================================= */
.wallet-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.35);
    background: rgba(18, 13, 8, 0.78);
    color: var(--ivory);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.wallet-pill:hover {
    border-color: var(--brass);
    background: rgba(201, 165, 102, 0.14);
}
.wallet-pill-static { cursor: default; }
.wallet-sep { opacity: 0.45; }

.mode-card-manager {
    border-color: rgba(201, 165, 102, 0.38);
    background: linear-gradient(135deg, rgba(201, 165, 102, 0.14), rgba(16, 12, 8, 0.72));
}

.manager-modal-box {
    max-width: 920px;
    width: 96vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}
.manager-head-wallet {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.manager-head-wallet .btn {
    width: auto;
}
.manager-tabs {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 6px;
    padding: 2px 2px 10px;
    border-bottom: 1px solid var(--hairline);
    overflow-x: auto;
    overflow-y: hidden;
}
.mgr-tab {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.22);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ivory-dim);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.mgr-tab.active {
    background: rgba(201, 165, 102, 0.18);
    border-color: var(--brass);
    color: var(--ivory);
}
.manager-body {
    overflow-y: auto;
    padding-top: 12px;
    flex: 1 1 auto;
    min-height: 0;
}
.mgr-pane { display: none; }
.mgr-pane.active { display: block; }

.mgr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 12px;
}
.mgr-card {
    padding: 13px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.22);
    background: rgba(14, 10, 6, 0.72);
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.mgr-card.is-active-ai {
    border-color: var(--brass);
    box-shadow: inset 0 0 0 1px rgba(201, 165, 102, 0.28);
}
.mgr-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.mgr-ai-name {
    font-family: var(--font-display);
    font-size: 0.96rem;
    color: var(--ivory);
}
.mgr-ai-sub {
    font-size: 0.68rem;
    color: var(--ivory-dim);
    margin-top: 2px;
}
.mgr-ovr-badge {
    min-width: 44px;
    text-align: center;
    padding: 5px 7px;
    border-radius: 9px;
    background: rgba(201, 165, 102, 0.18);
    border: 1px solid rgba(201, 165, 102, 0.45);
    color: var(--brass-bright);
    font-weight: 900;
    font-size: 0.85rem;
    line-height: 1.1;
}
.mgr-ovr-badge small {
    display: block;
    font-size: 0.52rem;
    letter-spacing: 0.08em;
    color: var(--ivory-dim);
}
.mgr-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.mgr-tag {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ivory-soft);
}
.mgr-tag.peak { color: #86efac; border-color: rgba(134, 239, 172, 0.35); }
.mgr-tag.rusty { color: #fca5a5; border-color: rgba(252, 165, 165, 0.35); }
.mgr-tag.listed { color: #fde68a; border-color: rgba(253, 230, 138, 0.4); }

.mgr-attrs {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.mgr-attr-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--ivory-soft);
}
.mgr-train-btn {
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(201, 165, 102, 0.32);
    background: rgba(201, 165, 102, 0.12);
    color: var(--brass-bright);
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
}
.mgr-train-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mgr-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
}
.mgr-market-note {
    font-size: 0.72rem;
    color: var(--ivory-dim);
    margin-bottom: 10px;
}

.mgr-arena-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
.mgr-arena-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.mgr-arena-actions .btn { width: auto; flex: 1; min-width: 165px; }

.mgr-arena-stage {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--hairline);
    background: rgba(10, 7, 4, 0.65);
}
.mgr-arena-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.76rem;
}
.mgr-fighter-tag { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mgr-seed-pill {
    font-size: 0.66rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(201, 165, 102, 0.14);
    border: 1px solid rgba(201, 165, 102, 0.35);
    color: var(--brass-bright, #fbbf24);
    white-space: nowrap;
}
.dot-white, .dot-black {
    width: 11px; height: 11px; border-radius: 50%; display: inline-block;
}
.dot-white { background: #f8fafc; border: 1px solid #94a3b8; }
.dot-black { background: #1e293b; border: 1px solid #64748b; }

.mgr-speed-pills { display: flex; gap: 5px; }
.speed-pill {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.25);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ivory-dim);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}
.speed-pill.active {
    background: var(--brass);
    color: #161008;
    border-color: var(--brass);
}
.mgr-eval-bar-wrap {
    height: 7px;
    border-radius: 999px;
    background: #1f2937;
    overflow: hidden;
    margin-bottom: 10px;
}
.mgr-eval-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f8fafc, #d4af37);
    transition: width 0.25s ease;
}
.mgr-arena-board-wrap {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 12px;
    align-items: start;
}
@media (max-width: 640px) {
    .mgr-arena-board-wrap { grid-template-columns: 1fr; }
}
.mgr-mini-board {
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px solid rgba(201, 165, 102, 0.45);
    border-radius: 6px;
    overflow: hidden;
}
.mgr-sq {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    z-index: 1;
}
.mgr-sq.sliding-sq-origin {
    z-index: 30;
}
.mgr-sq.light { background: #e8cfa4; }
.mgr-sq.dark { background: #5a3821; }
.mgr-sq.last-move-from { box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.45); }
.mgr-sq.last-move-to { box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.85); }
.mgr-piece {
    width: 72%;
    height: 72%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    line-height: 1;
    font-weight: 900;
    overflow: hidden;
}
.mgr-piece.sliding-active {
    position: relative;
    z-index: 20;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.65);
}
.mgr-piece.captured-fade {
    opacity: 0;
    transform: scale(0.35);
    transition: opacity 140ms ease, transform 140ms ease;
}
.mgr-piece.white { background: #f8fafc; color: #1e293b; box-shadow: 0 2px 4px rgba(0,0,0,0.4); }
.mgr-piece.black { background: #18181b; color: #fbbf24; border: 1px solid #52525b; box-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.mgr-arena-status {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--brass-bright);
    margin-bottom: 8px;
}
.mgr-bracket-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--ivory-soft);
}
.mgr-bracket-round {
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 165, 102, 0.16);
}

/* =========================================================================
   CHAT POP-UP, QUICK PRESETS & MANAGER MULTI-MODAL CLUB HQ
   ========================================================================= */
.chat-popup-toast {
    position: fixed;
    top: 66px;
    right: 16px;
    z-index: 9500;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 310px;
    padding: 9px 13px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.55);
    background: rgba(18, 13, 8, 0.94);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
    color: var(--ivory);
    text-align: left;
    cursor: pointer;
    animation: setupPaneIn 0.2s ease;
}
.chat-popup-badge { font-size: 1.1rem; }
.chat-popup-copy {
    display: flex;
    flex-direction: column;
    font-size: 0.74rem;
    min-width: 0;
}
.chat-popup-copy strong { color: var(--brass-bright); font-size: 0.7rem; }
.chat-popup-copy span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-presets-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 7px;
}
.chat-preset-btn {
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.28);
    background: rgba(201, 165, 102, 0.1);
    color: var(--ivory-soft);
    font-size: 0.67rem;
    font-weight: 700;
    cursor: pointer;
}
.chat-preset-btn:hover {
    border-color: var(--brass);
    background: rgba(201, 165, 102, 0.22);
}
.emoji-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mgr-chat-btn { position: relative; }
.mgr-unread-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #ef4444; display: inline-block; margin-left: 4px;
}

.mgr-hero-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.35);
    background: linear-gradient(135deg, rgba(201, 165, 102, 0.14), rgba(14, 10, 6, 0.85));
    margin-bottom: 12px;
}
.mgr-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}
.mgr-hub-tile {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.24);
    background: rgba(15, 11, 7, 0.78);
    color: var(--ivory);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease;
}
.mgr-hub-tile:hover {
    border-color: var(--brass);
    background: rgba(201, 165, 102, 0.12);
    transform: translateY(-1px);
}
.mgr-hub-primary {
    border-color: rgba(201, 165, 102, 0.55);
    background: linear-gradient(135deg, rgba(201, 165, 102, 0.22), rgba(24, 17, 10, 0.88));
}
.mgr-tile-icon { font-size: 1.45rem; flex-shrink: 0; }
.mgr-tile-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mgr-tile-copy strong { font-size: 0.86rem; color: var(--ivory); }
.mgr-tile-copy small { font-size: 0.67rem; color: var(--ivory-dim); line-height: 1.3; }

.mgr-faceoff-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
@media (max-width: 600px) {
    .mgr-faceoff-row { grid-template-columns: 1fr; }
    .mgr-vs-badge { text-align: center; }
}
.mgr-faceoff-card {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(201, 165, 102, 0.25);
    background: rgba(14, 10, 6, 0.72);
}
.mgr-faceoff-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--brass);
    margin-bottom: 5px;
}
.mgr-vs-badge {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 900;
    color: var(--brass-bright);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.4);
    background: rgba(201, 165, 102, 0.12);
}
.mgr-chip-section { margin-bottom: 10px; }
.mgr-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mgr-pill {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(201, 165, 102, 0.22);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ivory-dim);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}
.mgr-pill.active {
    background: rgba(201, 165, 102, 0.2);
    border-color: var(--brass);
    color: var(--ivory);
}

.mgr-attr-bar-wrap {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 3px;
}
.mgr-attr-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #b08843, #f3d285);
}
.mgr-train-item {
    padding: 8px 10px;
    border-radius: 9px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 7px;
}
.mgr-train-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    gap: 8px;
}

.mgr-range { width: 100%; accent-color: #d4af37; margin: 10px 0; }
.mgr-sell-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 165, 102, 0.18);
    font-size: 0.76rem;
    margin-bottom: 10px;
}
.mgr-sell-row { display: flex; justify-content: space-between; }

.mgr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
}
.mgr-table th, .mgr-table td {
    padding: 8px 7px;
    border-bottom: 1px solid rgba(201, 165, 102, 0.14);
    text-align: left;
}
.mgr-table th {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brass);
}
.mgr-hist-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(201, 165, 102, 0.16);
    background: rgba(15, 11, 7, 0.65);
    margin-bottom: 7px;
    font-size: 0.74rem;
}
.mgr-bracket-tree {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    font-size: 0.68rem;
}

/* =========================================================================
   CONNECTIVITY GUARD (OFFLINE GREYING), AI PLAYING BANNER & TOUCH TARGETS
   ========================================================================= */
.hub-offline-banner {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(120, 53, 15, 0.28);
    color: #fde68a;
    font-size: 0.72rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

body.is-offline [data-requires-network="true"] {
    opacity: 0.42 !important;
    filter: grayscale(0.75);
    cursor: not-allowed !important;
}

.mgr-playing-banner {
    padding: 8px 11px;
    border-radius: 9px;
    border: 1px solid rgba(201, 165, 102, 0.35);
    background: rgba(201, 165, 102, 0.12);
    color: var(--ivory);
    font-size: 0.72rem;
    margin-bottom: 9px;
}

.mgr-pill, .mgr-tab, .hub-sub-pill {
    min-height: 40px;
}

.country-chip-readonly {
    cursor: default;
    pointer-events: none;
}

.prof-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(201, 165, 102, 0.22);
    background: rgba(201, 165, 102, 0.06);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.prof-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
}

.prof-stat-card {
    padding: 11px 12px;
    border-radius: 11px;
    border: 1px solid rgba(201, 165, 102, 0.18);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prof-stat-card span {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ivory-dim);
}

.prof-stat-card strong {
    font-size: 1rem;
    color: var(--ivory);
}

.prof-account-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.prof-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 11px;
    border: 1px solid rgba(201, 165, 102, 0.18);
    background: rgba(255, 255, 255, 0.025);
}

.prof-account-row strong {
    display: block;
    font-size: 0.84rem;
    color: var(--ivory);
}

.prof-account-row small {
    display: block;
    font-size: 0.7rem;
    color: var(--ivory-dim);
}

.prof-account-row .btn {
    width: auto;
    flex-shrink: 0;
}

.league-mode-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.league-mode-tabs::-webkit-scrollbar {
    display: none;
}

.league-mode-tabs .mode-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px;
}

.mgr-ai-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    background: #14100c;
}

.mgr-ai-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* =========================================================================
   SEAMLESS UI/UX UPGRADE: DRAG-AND-DROP, MULTI-JUMP TRAJECTORIES,
   CALLOUTS, COORDINATES, QUICK-PLAY & FC MOBILE LIVE EVENTS / OTA
   ========================================================================= */

/* 1. Board Coordinates (Algebraic A-H / A-J & 1-8 / 1-10) */
.board-coords {
    position: absolute;
    pointer-events: none;
    z-index: 6;
    display: flex;
    user-select: none;
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    font-weight: 800;
    color: rgba(254, 243, 199, 0.78);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

.board-coords.coords-hidden {
    display: none !important;
}

.board-coords-files {
    bottom: 2px;
    left: 4.16%;
    right: 4.16%;
    height: 14px;
    justify-content: space-around;
    align-items: center;
}

.board-coords-ranks {
    top: 4.16%;
    bottom: 4.16%;
    left: 3px;
    width: 14px;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

#boardFrame.flipped .board-coords span {
    transform: rotate(180deg);
}

/* 2. SVG Multi-Jump Trajectory Path Overlay */
.board-path-overlay {
    position: absolute;
    top: 4.16%;
    left: 4.16%;
    width: 91.68%;
    height: 91.68%;
    pointer-events: none;
    z-index: 18;
    overflow: visible;
}

.jump-trajectory-line {
    fill: none;
    stroke: #fbbf24;
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 3.2 2.2;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
    animation: jumpDashFlow 0.75s linear infinite;
}

.jump-trajectory-line.alt-route {
    stroke: rgba(251, 191, 36, 0.52);
    stroke-width: 1.05;
}

@keyframes jumpDashFlow {
    to {
        stroke-dashoffset: -10.8;
    }
}

.waypoint-step-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f0d0a;
    font-size: 0.62rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
    z-index: 22;
    pointer-events: none;
}

#boardFrame.flipped .waypoint-step-badge {
    transform: rotate(180deg);
}

/* 3. Tactile Drag-and-Drop & Hover Target Ring */
.board-cell {
    touch-action: none;
}

.piece-el.dragging-piece {
    z-index: 60 !important;
    pointer-events: none;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.72));
    transition: none !important;
}

.board-cell.drag-hover-target::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2.5px solid #fbbf24;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.75), inset 0 0 10px rgba(251, 191, 36, 0.35);
    pointer-events: none;
    z-index: 19;
    animation: hoverTargetPulse 0.65s ease-in-out infinite alternate;
}

@keyframes hoverTargetPulse {
    from { transform: scale(0.94); opacity: 0.85; }
    to { transform: scale(1.04); opacity: 1; }
}

.board-cell.waypoint-selected-cell {
    background: rgba(245, 158, 11, 0.28) !important;
    box-shadow: inset 0 0 0 2px #fbbf24;
}

.move-dot.preview-only-dot {
    background: rgba(147, 197, 253, 0.55);
    border: 1.5px dashed rgba(191, 219, 254, 0.9);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.45);
}

/* 4. Mandatory Capture Nudge, King Promotion Burst & Kwakwa Callout */
.board-cell.must-capture-nudge .piece-el {
    animation: mustCaptureNudgeShake 0.48s cubic-bezier(0.36, 0.07, 0.19, 0.97) 2;
}

.board-cell.must-capture-nudge::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 2.5px solid #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
    pointer-events: none;
    z-index: 25;
}

@keyframes mustCaptureNudgeShake {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.15) translate(-3px, 0); }
    50% { transform: scale(1.18) translate(3px, 0); }
    75% { transform: scale(1.12) translate(-2px, 0); }
}

.piece-el.crowned-burst {
    animation: crownPromotionPop 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes crownPromotionPop {
    0% { transform: scale(1); filter: brightness(1); }
    45% { transform: scale(1.28); filter: brightness(1.45) drop-shadow(0 0 16px #fbbf24); }
    100% { transform: scale(1); filter: brightness(1); }
}

.kwakwa-callout-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border: 1.5px solid #fde047;
    color: #fef08a;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    padding: 3px 7px;
    border-radius: 999px;
    white-space: nowrap;
    z-index: 70;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.85);
    animation: kwakwaFloatUp 1.25s ease-out forwards;
}

#boardFrame.flipped .kwakwa-callout-badge {
    transform: translate(-50%, -50%) rotate(180deg);
}

@keyframes kwakwaFloatUp {
    0% { opacity: 0; margin-top: 8px; }
    20% { opacity: 1; margin-top: 0; }
    80% { opacity: 1; margin-top: -12px; }
    100% { opacity: 0; margin-top: -20px; }
}

/* 5. HUD Material Advantage, Ticking Clock Glow, Pass & Play Auto-Flip & Titles */
.material-adv-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.16);
    border: 1px solid rgba(52, 211, 153, 0.42);
    color: #6ee7b7;
    font-size: 0.66rem;
    font-weight: 800;
}

.player-hud.active-turn .clock-box {
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.22);
    color: #fef3c7;
}

.turn-badge.thinking-pulse {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(217, 119, 6, 0.42));
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.55);
    animation: thinkingBadgePulse 1s ease-in-out infinite alternate;
}

@keyframes thinkingBadgePulse {
    from { opacity: 0.65; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1.03); }
}

.local-autoflip-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 165, 102, 0.32);
    color: var(--ivory-dim);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.66rem;
    font-weight: 700;
    cursor: pointer;
    margin-right: 6px;
    transition: all 0.18s ease;
}

.local-autoflip-chip.active {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(251, 191, 36, 0.6);
    color: #fde68a;
}

.equipped-title-pill,
.hud-title-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(180, 83, 9, 0.26));
    border: 1px solid rgba(251, 191, 36, 0.42);
    color: #fde68a;
    cursor: pointer;
    white-space: nowrap;
    max-width: 185px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-title-tag {
    cursor: default;
    padding: 1px 6px;
    font-size: 0.6rem;
}

/* 6. Post-Game Inspect Board Mode */
.inspect-return-pill {
    position: fixed;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 95;
    background: linear-gradient(135deg, #f59e0b, #b45309);
    color: #0f0d0a;
    border: 1.5px solid #fde68a;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 0.8rem;
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

/* 7. Welcome Hub Quick-Play Bar & FC Mobile Live Events Banner */
.hub-quickplay-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(201, 165, 102, 0.24);
}

.quickplay-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.quickplay-eyebrow {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--brass-bright, #fbbf24);
}

.quickplay-meta strong {
    font-size: 0.78rem;
    color: var(--ivory);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quickplay-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.quickplay-actions .btn {
    width: auto;
    padding: 6px 11px;
}

.hub-live-event-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.28) 0%, rgba(30, 24, 18, 0.92) 60%, rgba(56, 189, 248, 0.16) 100%);
    border: 1px solid rgba(251, 191, 36, 0.45);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.38);
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.hub-live-event-banner:hover {
    transform: translateY(-1px);
    border-color: rgba(251, 191, 36, 0.8);
}

.live-event-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.live-event-kicker-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-pulse-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.live-countdown-pill {
    font-size: 0.64rem;
    font-weight: 700;
    color: #fde68a;
}

.live-event-headline {
    font-size: 0.86rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-event-sub {
    font-size: 0.7rem;
    color: var(--ivory-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-event-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.live-ep-chip {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fde68a;
    font-size: 0.66rem;
    font-weight: 800;
}

.live-cta-btn {
    font-size: 0.74rem;
    font-weight: 800;
    color: #fbbf24;
}

/* 8. OTA Self-Updating Sync Bar & Live Events Modal Cards */
.ota-sync-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-size: 0.72rem;
    color: #bae6fd;
}

.ota-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(56, 189, 248, 0.35);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: otaSpin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes otaSpin {
    to { transform: rotate(360deg); }
}

.ota-ver-pill {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
    font-size: 0.64rem;
    font-weight: 800;
}

.ota-settings-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 165, 102, 0.22);
    flex-wrap: wrap;
}

.live-hero-card {
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(20, 16, 12, 0.94));
    border: 1px solid rgba(251, 191, 36, 0.4);
    margin-bottom: 12px;
}

.live-boss-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.38);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.live-pass-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.live-tier-card {
    padding: 10px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 165, 102, 0.22);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

.live-tier-card.unlocked {
    border-color: rgba(52, 211, 153, 0.55);
    background: rgba(16, 185, 129, 0.09);
}

.live-tier-card.claimed {
    opacity: 0.72;
    border-color: rgba(251, 191, 36, 0.35);
}

.live-quest-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.live-quest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 165, 102, 0.18);
    flex-wrap: wrap;
}

.live-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 5px;
}

.live-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #34d399);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.titles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.title-collectible-card {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 165, 102, 0.22);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.title-collectible-card.equipped {
    border-color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.18);
}

.game-over-live-box {
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.4);
    font-size: 0.78rem;
    color: #fde68a;
    text-align: center;
}

/* ==========================================================================
   TEAMS SIDE-BY-SIDE SUB-MENU, OVERVIEW SPLIT & CHAT INPUT ROW FIXES
   ========================================================================== */
#leagueModal.teams-view .modal-box {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 88dvh;
}

#leagueModal.teams-view .card-header,
#leagueModal.teams-view .concurrency-strip,
#leagueModal.teams-view .league-mode-tabs {
    flex-shrink: 0;
}

#leagueModal.teams-view #leagueTabTeams {
    flex: 1;
    min-height: 0;
    display: flex !important;
    flex-direction: column;
}

#leagueModal.teams-view #teamsHubBody,
.team-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.team-sticky-top {
    flex-shrink: 0;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.team-tab-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-top: 10px;
    padding-right: 4px;
}

.team-subnav-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 6px;
}

.team-subnav-bar .team-subnav-btn {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .team-subnav-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.team-header-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.team-header-btn-group .btn {
    width: auto;
    flex: 0 0 auto;
    padding: 7px 14px;
}

.team-overview-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    align-items: start;
}

.team-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.team-chat-input-row input.text-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.team-chat-input-row .btn {
    width: auto !important;
    flex: 0 0 auto !important;
    min-width: 88px;
    padding: 8px 18px;
}

#teamsHubBody .btn-xs,
#leagueDetailBox .btn-xs {
    width: auto;
    flex: 0 0 auto;
}

/* ==========================================================================
   MYSTERY BOX / DRAFT 3-STAGE CINEMATIC WALKOUT REVEAL ANIMATION
   ========================================================================== */
.mystery-reveal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    animation: mysteryFadeIn 0.28s ease-out;
}

@keyframes mysteryFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mystery-rays {
    position: absolute;
    width: 140vmax;
    height: 140vmax;
    background: repeating-conic-gradient(
        from 0deg,
        transparent 0deg 12deg,
        rgba(255, 255, 255, 0.04) 12deg 18deg
    );
    animation: mysteryRaysSpin 24s linear infinite;
    pointer-events: none;
}

@keyframes mysteryRaysSpin {
    to { transform: rotate(360deg); }
}

.mystery-stage-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.mystery-stage {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mystery-stage.active {
    display: flex;
    animation: mysteryStagePop 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes mysteryStagePop {
    0% { opacity: 0; transform: scale(0.84) translateY(16px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.mystery-kicker {
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    color: var(--reveal-color, #fbbf24);
    text-transform: uppercase;
    margin-bottom: 18px;
}

.mystery-chest-orb {
    width: 138px;
    height: 138px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle, rgba(255,255,255,0.18), rgba(0,0,0,0.65));
    border: 3px solid var(--reveal-color, #fbbf24);
    box-shadow: 0 0 48px var(--reveal-glow, rgba(251,191,36,0.65)), inset 0 0 24px var(--reveal-glow, rgba(251,191,36,0.45));
    animation: mysteryChestShake 0.48s ease-in-out infinite;
}

.mystery-chest-icon {
    font-size: 3.8rem;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.65));
}

@keyframes mysteryChestShake {
    0%, 100% { transform: rotate(0deg) scale(1); }
    20% { transform: rotate(-8deg) scale(1.05); }
    40% { transform: rotate(8deg) scale(1.08); }
    60% { transform: rotate(-6deg) scale(1.06); }
    80% { transform: rotate(6deg) scale(1.04); }
}

.mystery-stage-sub {
    margin-top: 16px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ivory);
}

.mystery-flare-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--reveal-color, #fbbf24);
    box-shadow: 0 0 60px var(--reveal-glow, rgba(251,191,36,0.8));
    margin-bottom: 18px;
    animation: mysteryFlareExpand 1.4s ease-out infinite;
}

@keyframes mysteryFlareExpand {
    0% { transform: scale(0.65); opacity: 1; }
    100% { transform: scale(1.45); opacity: 0; }
}

.mystery-walkout-step {
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--reveal-color, #fbbf24);
    text-shadow: 0 4px 18px rgba(0,0,0,0.8);
}

.mystery-walkout-card {
    width: 100%;
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(165deg, rgba(32, 23, 15, 0.96), rgba(12, 9, 6, 0.98));
    border: 2px solid var(--reveal-color, #fbbf24);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.85), 0 0 42px var(--reveal-glow, rgba(251, 191, 36, 0.45));
    text-align: left;
}

.mystery-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.mystery-tier-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    background: var(--reveal-color, #fbbf24);
    color: #0f0b07;
}

.mystery-cap-pill {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--ivory-dim);
    letter-spacing: 0.06em;
}

.mystery-card-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(201, 165, 102, 0.2);
}

.mystery-card-title-col {
    flex: 1;
    min-width: 0;
}

.mystery-ovr-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: 2.1rem;
    font-weight: 900;
    line-height: 1;
    color: var(--reveal-color, #fbbf24);
}

.mystery-ovr-counter small {
    font-size: 0.72rem;
    color: var(--ivory-dim);
    letter-spacing: 0.08em;
}

.mystery-fighter-name {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    margin-top: 2px;
}

.mystery-fighter-meta {
    font-size: 0.76rem;
    color: var(--ivory-dim);
    margin-top: 2px;
}

.mystery-attrs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin: 14px 0;
}

.mystery-bar-anim {
    animation: mysteryBarGrow 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: left;
}

@keyframes mysteryBarGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.mystery-bonus-banner {
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #6ee7b7;
    font-size: 0.78rem;
    text-align: center;
    margin-bottom: 14px;
}

.mystery-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================================================================
   PLAYER LEVEL, CPU STAGE CHIPS & PROFILE XP PROGRESS BAR
   ========================================================================= */
.level-chip {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(217, 119, 6, 0.14)) !important;
    border-color: rgba(251, 191, 36, 0.55) !important;
    color: #fde68a !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

.cpu-stage-chip {
    background: rgba(56, 189, 248, 0.14) !important;
    border-color: rgba(56, 189, 248, 0.42) !important;
    color: #bae6fd !important;
    font-weight: 700 !important;
    white-space: nowrap;
}

.prof-xp-bar-wrap {
    margin: 4px 0 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(20, 15, 10, 0.72);
    border: 1px solid rgba(251, 191, 36, 0.28);
}

.prof-xp-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fde68a;
    margin-bottom: 6px;
}

.prof-xp-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.prof-xp-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b, #fde047);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
    transition: width 0.35s ease;
}

/* =========================================================================
   PRO BROADCAST FORM PILL (MANAGER MODE HERO & LOCKER)
   ========================================================================= */
.mgr-tag {
    white-space: nowrap;
    flex-shrink: 0;
}

.mgr-hero-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.mgr-form-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.mgr-form-pill.peak {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(5, 150, 105, 0.14));
    border: 1px solid rgba(52, 211, 153, 0.55);
    color: #6ee7b7;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.mgr-form-pill.steady {
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #bae6fd;
}

.mgr-form-pill.rusty {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(185, 28, 28, 0.14));
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #fca5a5;
}

.mgr-form-arrow {
    font-size: 0.62rem;
    line-height: 1;
}

/* =========================================================================
   DISTINCT DAILY, WEEKLY & MONTHLY QUEST LAYOUTS + ACHIEVEMENT TROPHY PLAQUES
   ========================================================================= */
.pq-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    border-radius: 9px;
    margin-bottom: 8px;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.pq-head-daily {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.18), rgba(56, 189, 248, 0.03));
    border-left: 3px solid #38bdf8;
    color: #7dd3fc;
}

.pq-head-weekly {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.03));
    border-left: 3px solid #10b981;
    color: #6ee7b7;
}

.pq-head-monthly {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.22), rgba(251, 191, 36, 0.06));
    border-left: 3px solid #c084fc;
    color: #e9d5ff;
}

.pq-reset-pill {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--ivory-dim);
    letter-spacing: 0.02em;
}

/* Daily Quests: 3-column Sky Sprint Tiles */
.pq-daily-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.pq-card-daily {
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(14, 28, 42, 0.78), rgba(12, 16, 24, 0.9));
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.pq-card-daily.ready {
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.pq-daily-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pq-tier-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.07em;
}

.pq-tier-chip.daily {
    background: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.38);
}

.pq-tier-chip.weekly {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.38);
}

.pq-tier-chip.monthly {
    background: rgba(192, 132, 252, 0.22);
    color: #e9d5ff;
    border: 1px solid rgba(192, 132, 252, 0.45);
}

.pq-daily-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #f8fafc;
}

.pq-daily-desc {
    font-size: 0.72rem;
    color: var(--ivory-dim);
}

.pq-daily-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.pq-reward-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fde68a;
}

/* Weekly Quests: 2-column Emerald Tactical Cards */
.pq-weekly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 10px;
}

.pq-card-weekly {
    padding: 13px 14px;
    border-radius: 12px;
    background: linear-gradient(155deg, rgba(10, 32, 26, 0.78), rgba(11, 18, 16, 0.92));
    border: 1px solid rgba(16, 185, 129, 0.32);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pq-card-weekly.ready {
    border-color: #34d399;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.25);
}

.pq-weekly-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

/* Monthly Quests: Full-Width Amethyst & Gold Campaign Cards */
.pq-monthly-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pq-card-monthly {
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(46, 16, 101, 0.55), rgba(30, 20, 12, 0.92));
    border: 1px solid rgba(192, 132, 252, 0.42);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pq-card-monthly.ready {
    border-color: #fbbf24;
    box-shadow: 0 0 22px rgba(192, 132, 252, 0.3);
}

.pq-monthly-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 240px;
}

.pq-monthly-emblem {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.28), rgba(30, 15, 55, 0.85));
    border: 1px solid rgba(192, 132, 252, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
}

.pq-monthly-info {
    flex: 1;
    min-width: 0;
}

.pq-monthly-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* Achievements: Hall of Fame Trophy Plaques */
.ach-trophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 12px;
}

.ach-trophy-card {
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(30, 22, 14, 0.92), rgba(14, 10, 7, 0.96));
    border: 1px solid rgba(251, 191, 36, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.ach-trophy-card.ach-locked {
    background: linear-gradient(160deg, rgba(22, 18, 15, 0.84), rgba(12, 10, 8, 0.92));
    border: 1px dashed rgba(201, 165, 102, 0.28);
}

.ach-trophy-card.ach-ready {
    border: 1.5px solid #34d399;
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.25);
}

.ach-trophy-card.ach-claimed {
    border: 1.5px solid rgba(251, 191, 36, 0.65);
    background: linear-gradient(160deg, rgba(45, 31, 14, 0.88), rgba(18, 13, 8, 0.96));
}

.ach-trophy-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ach-emblem-box {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.24), rgba(24, 17, 10, 0.92));
    border: 1px solid rgba(251, 191, 36, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    flex-shrink: 0;
}

.ach-emblem-box.is-locked {
    filter: saturate(0.45);
    opacity: 0.82;
    border-color: rgba(255, 255, 255, 0.16);
}

.ach-head-meta {
    flex: 1;
    min-width: 0;
}

.ach-rarity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}

.ach-rarity-tag {
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.16);
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.ach-state-pill {
    font-size: 0.62rem;
    font-weight: 800;
}

.ach-state-pill.locked { color: #cbd5e1; }
.ach-state-pill.ready { color: #6ee7b7; }
.ach-state-pill.claimed { color: #fde047; }

.ach-title-name {
    font-size: 0.94rem;
    font-weight: 900;
    color: #fff;
}

.ach-howto-row {
    font-size: 0.74rem;
    color: var(--ivory-soft);
    margin-top: 2px;
}

.ach-reward-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* =========================================================================
   CUSTOM BOARDS, CHECKERS MARBLES, KING CROWNS, BOARD HEALTH & FULL-SIZE MANAGER BOARD
   ========================================================================= */

/* 1. In-Game Board Health HUD Pill & Surface Wear Overlays */
.board-health-hud-pill {
    position: static;
    flex-shrink: 0;
    margin-left: auto;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    border: 1px solid rgba(52, 211, 153, 0.5);
    background: rgba(10, 16, 14, 0.72);
    color: #6ee7b7;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.board-health-hud-pill.health-weathered {
    border-color: rgba(251, 191, 36, 0.65);
    color: #fde68a;
    background: rgba(28, 20, 8, 0.88);
}

.board-health-hud-pill.health-damaged {
    border-color: rgba(248, 113, 113, 0.8);
    color: #fca5a5;
    background: rgba(40, 12, 12, 0.92);
    animation: pulseWarn 1.6s infinite;
}

.board-health-hud-pill.health-destroyed {
    border-color: rgba(239, 68, 68, 0.9);
    color: #fecaca;
    background: rgba(68, 12, 12, 0.92);
}

@keyframes pulseWarn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.board-wear-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Weathered (<75% HP): visible surface scuffs & dust */
.board-wear-overlay.wear-weathered {
    opacity: 0.48;
    background-image:
        radial-gradient(circle at 22% 30%, rgba(42, 30, 18, 0.42) 0%, transparent 45%),
        radial-gradient(circle at 76% 68%, rgba(36, 26, 15, 0.45) 0%, transparent 50%),
        repeating-linear-gradient(125deg, transparent 0px, transparent 18px, rgba(255, 235, 200, 0.05) 19px, transparent 21px);
    mix-blend-mode: multiply;
}

.board-frame.board-is-weathered .board-bg-img {
    filter: var(--board-filter) contrast(0.84) saturate(0.78) brightness(0.92) !important;
}

/* Damaged / Dirty (<40% HP): heavy grime, scratches & low square contrast making traps harder to spot */
.board-wear-overlay.wear-damaged {
    opacity: 0.86;
    background-image:
        radial-gradient(circle at 28% 26%, rgba(58, 42, 24, 0.72) 0%, transparent 42%),
        radial-gradient(circle at 72% 74%, rgba(48, 35, 20, 0.78) 0%, transparent 46%),
        radial-gradient(circle at 50% 50%, rgba(65, 50, 32, 0.55) 0%, transparent 68%),
        repeating-linear-gradient(38deg, rgba(20, 14, 8, 0.22) 0px, rgba(20, 14, 8, 0.22) 2px, transparent 2px, transparent 13px),
        repeating-linear-gradient(-42deg, rgba(255, 240, 210, 0.08) 0px, rgba(255, 240, 210, 0.08) 1px, transparent 1px, transparent 19px);
}

.board-frame.board-is-damaged .board-bg-img {
    filter: var(--board-filter) contrast(0.58) saturate(0.48) sepia(0.42) brightness(0.78) !important;
}

.board-frame.board-is-damaged .move-dot {
    opacity: 0.45;
}

/* 2. Board Health Settings & Store Card */
.board-health-settings-card {
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(28, 20, 12, 0.92), rgba(14, 10, 7, 0.96));
    border: 1px solid rgba(251, 191, 36, 0.35);
    margin-bottom: 12px;
}

.bh-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bh-eyebrow {
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--brass);
    display: block;
}

.bh-status-line {
    font-size: 0.88rem;
    font-weight: 900;
    margin-top: 2px;
}

.bh-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.bh-eternal-tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #7dd3fc;
    font-size: 0.68rem;
    font-weight: 800;
}

.bh-progress-track {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin: 8px 0 6px;
}

.bh-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.bh-desc {
    font-size: 0.7rem;
    color: var(--ivory-dim);
    margin: 0;
    line-height: 1.4;
}

/* 3. Settings & Store Cosmetics Grids (Boards, Marbles & Crowns) */
.cosmetic-subhead {
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brass-bright);
    margin: 8px 0 6px;
}

.cosmetic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.cosmetic-mini-card,
.theme-option {
    position: relative;
    padding: 9px;
    border-radius: 11px;
    border: 1px solid rgba(201, 165, 102, 0.22);
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    transition: border-color 0.16s ease, transform 0.14s ease, background 0.16s ease;
}

.cosmetic-mini-card:hover,
.theme-option:hover {
    border-color: var(--brass);
    transform: translateY(-1px);
}

.cosmetic-mini-card.active,
.theme-option.active {
    border-color: #34d399 !important;
    background: rgba(16, 185, 129, 0.1) !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

.cosmetic-mini-card.is-locked,
.theme-option.is-locked {
    opacity: 0.82;
    border-style: dashed;
}

.cosmetic-stone-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
}

.cosmetic-stone-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.55));
}

.cosmetic-crown-preview-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
}

.cosmetic-opt-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.cosmetic-opt-meta strong {
    font-size: 0.72rem;
    color: #fff;
}

.cosmetic-opt-meta small {
    font-size: 0.62rem;
    font-weight: 800;
}

.store-stone-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.14), rgba(10, 8, 6, 0.78));
    border: 1px solid rgba(201, 165, 102, 0.2);
}

.store-stone-preview {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.65));
}

.store-crown-preview {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
}

.cosmetic-store-card.is-equipped {
    border-color: #34d399 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.18);
}

.mgr-div-pill {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.16);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fde68a;
    font-size: 0.68rem;
    font-weight: 800;
}

/* 4. Full-Size Championship Board & Real Marbles/Crowns in Manager Mode (#mgrArenaModal) */
.mgr-arena-board-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100%;
}

#managerModal,
#mgrArenaModal,
#mgrTourneyModal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(6, 4, 2, 0.92);
}

.mgr-mini-board {
    display: grid;
    width: 100% !important;
    max-width: 500px !important;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border: 5px solid var(--brass, #c9a566) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    position: relative;
}

.mgr-mini-board .mgr-sq.light {
    background: var(--mgr-light-sq, #ebd7b5) !important;
}

.mgr-mini-board .mgr-sq.dark {
    background: var(--mgr-dark-sq, #6c4427) !important;
}

.mgr-mini-board.wear-weathered {
    opacity: 0.94;
}

.mgr-mini-board.wear-damaged {
    opacity: 0.86;
}

.mgr-mini-board .mgr-piece,
.mgr-mini-board .mgr-piece.white,
.mgr-mini-board .mgr-piece.black {
    width: 84% !important;
    height: 84% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
}

.mgr-piece-base-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.mgr-piece-crown-img {
    position: absolute;
    width: 62%;
    height: 62%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -54%);
    object-fit: contain;
    pointer-events: none;
}

.mgr-arena-sidebar {
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 165, 102, 0.22);
}






/* Keyboard accessibility focus indicator */
:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* =========================================================================
 * COMPACT STATIC HOME SCREEN & FIXED BOTTOM TOOLBAR (MOBILE / NATIVE)
 * ========================================================================= */
@media (max-width: 899px) {
    .welcome-hub {
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
    }

    .hub-header {
        padding: 6px 10px;
    }

    .hub-header .wallet-pill {
        padding: 3px 8px;
        font-size: 0.7rem;
        gap: 5px;
    }

    .hub-header .icon-btn {
        width: 30px;
        height: 30px;
    }

    .hub-content {
        flex: 1;
        min-height: 0;
        overflow: hidden !important;
        padding: 5px 10px 6px;
        gap: 5px;
        justify-content: flex-start;
    }

    .hub-main {
        gap: 5px;
        margin-top: 0;
        margin-bottom: 0;
    }

    .hub-profile-card {
        padding: 7px 10px 6px;
        gap: 5px 9px;
        border-radius: 13px;
    }

    .hub-avatar-frame {
        width: 42px;
        height: 42px;
    }

    .hub-player-avatar {
        width: 32px;
        height: 32px;
    }

    .hub-profile-copy {
        gap: 2px;
    }

    .hub-player-name {
        font-size: 0.92rem;
    }

    .equipped-title-pill {
        font-size: 0.58rem;
        padding: 1px 6px;
    }

    .hub-player-sub {
        gap: 4px;
    }

    .level-chip,
    .cpu-stage-chip,
    .rank-chip,
    .country-chip {
        font-size: 0.6rem;
        padding: 1px 6px;
    }

    .hub-stats-row {
        margin-top: 1px;
        padding-top: 5px;
        gap: 4px;
    }

    .hub-stat-item {
        padding: 2px 4px;
    }

    .hub-stat-lbl {
        font-size: 0.54rem;
    }

    .hub-stat-val {
        font-size: 0.82rem;
    }

    .hub-live-event-banner {
        padding: 6px 10px;
        border-radius: 12px;
        gap: 6px;
    }

    .live-pulse-tag,
    .live-countdown-pill {
        font-size: 0.54rem;
        padding: 1px 6px;
    }

    .live-event-headline {
        font-size: 0.76rem;
        line-height: 1.18;
    }

    .live-event-sub {
        font-size: 0.62rem;
        line-height: 1.18;
    }

    .live-ep-chip {
        font-size: 0.62rem;
        padding: 2px 6px;
    }

    .live-cta-btn {
        font-size: 0.66rem;
    }

    .hub-quickplay-bar {
        padding: 6px 10px;
        border-radius: 12px;
        gap: 6px;
    }

    .quickplay-eyebrow {
        font-size: 0.54rem;
    }

    #hubQuickPlaySummary {
        font-size: 0.74rem;
        line-height: 1.15;
    }

    .quickplay-actions .btn {
        padding: 5px 9px;
        font-size: 0.68rem;
        border-radius: 8px;
    }

    .hub-modes {
        gap: 5px;
    }

    .mode-card {
        padding: 7px 10px;
        min-height: 0;
        border-radius: 12px;
        gap: 8px;
    }

    .mode-card-primary {
        min-height: 0;
        padding: 8px 10px;
    }

    .mode-emblem {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .mode-emblem .icon {
        width: 15px;
        height: 15px;
    }

    .mode-kicker {
        font-size: 0.52rem;
        margin-bottom: 1px;
    }

    .mode-title {
        font-size: 0.84rem;
        line-height: 1.15;
    }

    .mode-sub {
        font-size: 0.62rem;
        line-height: 1.18;
        margin-top: 1px;
    }

    .mode-cta {
        font-size: 0.66rem;
    }

    .hub-mode-pair {
        gap: 5px;
    }

    .hub-mode-pair .mode-card {
        min-height: 0;
        padding: 7px 8px;
    }

    .hub-mode-pair .mode-title {
        font-size: 0.78rem;
    }

    .hub-mode-pair .mode-sub {
        display: none;
    }

    .hub-footer {
        position: sticky;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        margin-top: auto;
        padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(12, 9, 7, 0) 0%, rgba(12, 9, 7, 0.94) 30%, rgba(12, 9, 7, 0.99) 100%);
        pointer-events: none;
    }

    .hub-secondary-bar {
        pointer-events: auto;
        padding: 4px;
        border-radius: 12px;
        background: rgba(18, 13, 9, 0.96);
        border: 1px solid rgba(201, 165, 102, 0.24);
        box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.5);
    }

    .hub-sub-pill {
        padding: 4px 2px;
        gap: 2px;
        font-size: 0.52rem;
    }

    .hub-sub-pill .icon {
        width: 14px;
        height: 14px;
    }

    .hub-credits {
        display: none;
    }
}

.hub-wealth-row {
    display: flex;
    align-items: center;
    margin-top: 3px;
}

.hub-profile-wallet {
    padding: 2px 9px;
    font-size: 0.72rem;
    gap: 6px;
}

@media (min-width: 900px) {
    .hub-footer {
        position: sticky;
        bottom: 0;
        z-index: 60;
        margin-top: auto;
        padding-bottom: 6px;
        background: linear-gradient(180deg, rgba(12, 9, 7, 0) 0%, rgba(12, 9, 7, 0.92) 35%, rgba(12, 9, 7, 0.98) 100%);
    }
}

@media (max-width: 899px) and (max-height: 740px) {
    .hub-profile-card {
        padding: 5px 9px;
        gap: 3px 8px;
    }

    .hub-avatar-frame {
        width: 38px;
        height: 38px;
    }

    .hub-player-avatar {
        width: 28px;
        height: 28px;
    }

    .hub-stats-row {
        padding-top: 4px;
    }

    .hub-live-event-banner {
        padding: 5px 9px;
    }

    .live-event-sub,
    .mode-card-primary .mode-sub,
    .mode-card-manager .mode-sub {
        display: none;
    }

    .hub-quickplay-bar {
        padding: 5px 9px;
    }

    .mode-card,
    .mode-card-primary {
        padding: 6px 9px;
    }

    .hub-community-banner {
        padding: 5px 9px;
    }

    .community-banner-sub {
        display: none;
    }
}

/* ==========================================================================
   OFFICIAL FACEBOOK COMMUNITY BANNER & MODAL STYLES
   ========================================================================== */
.hub-community-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(24, 119, 242, 0.24) 0%, rgba(18, 22, 34, 0.94) 55%, rgba(245, 158, 11, 0.16) 100%);
    border: 1px solid rgba(24, 119, 242, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.38);
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    margin-bottom: 10px;
}

.hub-community-banner:hover {
    transform: translateY(-1px);
    border-color: rgba(24, 119, 242, 0.85);
    box-shadow: 0 8px 24px rgba(24, 119, 242, 0.25);
}

.community-banner-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.community-banner-kicker {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.community-pulse-tag {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #60a5fa;
    background: rgba(24, 119, 242, 0.25);
    border: 1px solid rgba(24, 119, 242, 0.4);
    border-radius: 4px;
    padding: 1px 6px;
    display: inline-flex;
    align-items: center;
}

.community-bonus-pill {
    font-size: 0.62rem;
    font-weight: 800;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 4px;
    padding: 1px 6px;
}

.community-banner-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-banner-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-channel-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.community-channel-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(24, 119, 242, 0.6);
    transform: translateY(-1px);
}

.community-channel-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.community-channel-info {
    flex: 1;
    min-width: 0;
}

.channel-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    padding: 1px 6px;
    margin-bottom: 2px;
}

.channel-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.channel-desc {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.channel-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
    padding-left: 4px;
}
