/* 공용 보드게임틀: Omok-first shared shell for opt-in student board games. */
:root {
    --common-board-radius-lg: 24px;
    --common-board-radius-md: 18px;
    --common-board-card-shadow: 0 16px 38px rgba(2, 6, 23, 0.22);
    --common-board-soft-shadow: 0 10px 24px rgba(2, 6, 23, 0.16);
    --common-board-focus-bg:
        radial-gradient(circle at top, rgba(16, 185, 129, 0.16), transparent 32%),
        radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.14), transparent 30%),
        #0f172a;
}

body.common-board-game-shell-page {
    --bg: #0f172a;
    --bg-grad: radial-gradient(circle at top, #1e293b 0, #0f172a 100%);
    --card-bg: rgba(30, 41, 59, 0.75);
    --border: rgba(255, 255, 255, 0.1);
    --accent: #10b981;
    --accent-dark: #059669;
    --primary: #818cf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.6);
    --breaktime-radius-lg: var(--common-board-radius-lg);
    --breaktime-radius-md: var(--common-board-radius-md);
    --breaktime-card-shadow: var(--common-board-card-shadow);
    --breaktime-soft-shadow: var(--common-board-soft-shadow);
    --breaktime-focus-bg: var(--common-board-focus-bg);
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body, "SUIT", "Noto Sans KR", sans-serif);
}

body.chess-page.common-board-game-shell-page {
    --chess-bg: var(--bg-grad);
    --chess-card: var(--card-bg);
    --chess-card-soft: rgba(15, 23, 42, 0.5);
    --chess-line: var(--border);
    --chess-accent: var(--accent);
    --chess-accent-strong: var(--accent-dark);
    --chess-mint: var(--success);
    --chess-danger: var(--danger);
    --chess-text: var(--text-main);
    --chess-sub: var(--text-sub);
    --chess-shadow: var(--common-board-card-shadow);
    --chess-radius-lg: var(--common-board-radius-lg);
    --chess-radius-md: var(--common-board-radius-md);
    background: var(--bg);
    background-image: var(--bg-grad);
    color: var(--text-main);
}

body.common-board-game-shell-page :is(.omok-shell, .othello-shell, .alkkagi-shell, .chess-shell) {
    width: min(100%, 1460px);
    max-width: 1460px;
    margin: 0 auto;
    padding: 24px 18px 40px;
}

body.common-board-game-shell-page :is(.omok-topbar, .othello-topbar, .alkkagi-topbar, .chess-topbar) {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

body.common-board-game-shell-page :is(.omok-topbar-copy, .othello-topbar-copy, .alkkagi-topbar-copy, .chess-topbar-copy) {
    flex: 1;
    min-width: 0;
}

body.common-board-game-shell-page :is(.omok-topbar-copy h1, .othello-topbar-copy h1, .alkkagi-topbar-copy h1, .chess-topbar-copy h1) {
    margin: 4px 0 8px;
    text-align: left;
    color: var(--text-main);
    font-size: 2.1rem;
    letter-spacing: 0;
}

body.common-board-game-shell-page :is(.omok-topbar-copy p, .othello-topbar-copy p, .alkkagi-topbar-copy p, .chess-topbar-copy p) {
    max-width: 640px;
    margin: 0;
    color: var(--text-sub);
    font-size: 0.92rem;
    line-height: 1.45;
}

body.common-board-game-shell-page :is(.omok-eyebrow, .othello-eyebrow, .alkkagi-eyebrow, .chess-eyebrow, .hero-kicker, .entry-state-eyebrow) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

body.common-board-game-shell-page :is(.omok-topbar-actions, .othello-topbar-actions, .alkkagi-topbar-actions, .topbar-actions) {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

body.common-board-game-shell-page :is(.omok-hero, .othello-hero, .alkkagi-hero) {
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

body.common-board-game-shell-page .hero-card {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 16px;
    margin-bottom: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

body.common-board-game-shell-page .hero-copy,
body.common-board-game-shell-page .hero-identity-strip,
body.common-board-game-shell-page .hero-command {
    border: 1px solid var(--border);
    border-radius: var(--common-board-radius-lg);
    background: var(--card-bg);
    box-shadow: var(--common-board-soft-shadow);
}

body.common-board-game-shell-page .hero-copy {
    padding: 18px;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 18%, transparent), transparent 42%),
        linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.08)),
        var(--card-bg);
}

body.common-board-game-shell-page .hero-identity-strip {
    grid-column: 1;
    padding: 16px 18px;
}

body.common-board-game-shell-page .hero-command {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: 18px;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 16%, transparent), transparent 38%),
        linear-gradient(180deg, rgba(148, 163, 184, 0.08), transparent 72%),
        var(--card-bg);
}

body.common-board-game-shell-page .chess-omok-hero .hero-command {
    grid-row: auto;
}

body.common-board-game-shell-page :is(.omok-hero-main, .othello-hero-main, .alkkagi-hero-main, .omok-hero-side, .othello-hero-side, .alkkagi-hero-side, .omok-card-panel, .othello-card-panel, .alkkagi-card-panel, .omok-stage, .othello-stage, .alkkagi-stage, .chess-card, .mode-panel, .room-stage, .board-card, .sidebar-card, .entry-state-card) {
    border: 1px solid var(--border);
    border-radius: var(--common-board-radius-lg);
    box-shadow: var(--common-board-soft-shadow);
}

body.common-board-game-shell-page .chess-topbar.chess-card,
body.common-board-game-shell-page .hero-card.chess-card {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

body.common-board-game-shell-page :is(.omok-hero-main, .othello-hero-main, .alkkagi-hero-main) {
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 18%, transparent), transparent 42%),
        linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.06)),
        var(--card-bg);
}

body.common-board-game-shell-page :is(.omok-hero-side, .othello-hero-side, .alkkagi-hero-side) {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 14%, transparent), transparent 38%),
        linear-gradient(180deg, rgba(148, 163, 184, 0.08), transparent 72%),
        var(--card-bg);
}

body.common-board-game-shell-page :is(.omok-kpi, .othello-kpi, .alkkagi-kpi, .kpi-box, .omok-stat-chip, .othello-stat-chip, .alkkagi-stat-chip, .chess-chip, .mini-badge) {
    border-color: var(--border);
    background: rgba(15, 23, 42, 0.38);
    color: var(--text-sub);
}

body.common-board-game-shell-page :is(.chess-chip strong, .mini-badge strong, .kpi-box .value) {
    color: var(--text-main);
}

body.common-board-game-shell-page :is(.btn, .btn-chess, .mode-tab, .segmented-row button, .online-entry-chip, .emoji-row button) {
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.42);
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: 0;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

body.common-board-game-shell-page :is(.btn:hover, .btn-chess:hover, .mode-tab:hover, .segmented-row button:hover, .online-entry-chip:hover) {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

body.common-board-game-shell-page :is(.btn-primary, .btn-chess.primary, .mode-tab.active, .online-entry-chip.active, .segmented-row button.active) {
    border-color: color-mix(in srgb, var(--accent) 58%, transparent);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #03130e;
    box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 24%, transparent);
}

body.common-board-game-shell-page :is(.omok-layout, .othello-layout, .alkkagi-layout) {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr) minmax(300px, 0.85fr);
    gap: 16px;
}

body.common-board-game-shell-page .chess-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.85fr);
    gap: 16px;
    margin-top: 0;
}

body.chess-page.common-board-game-shell-page:not(.chess-sidebar-visible) .chess-grid {
    grid-template-columns: 1fr;
}

body.common-board-game-shell-page :is(.omok-list, .othello-list, .alkkagi-list, .room-list, .move-list) {
    gap: 10px;
}

body.common-board-game-shell-page :is(.omok-room-item, .omok-match-item, .omok-rank-item, .othello-room-item, .othello-match-item, .othello-rank-item, .alkkagi-room-item, .alkkagi-match-item, .alkkagi-rank-item, .room-card, .record-item, .result-item, .leader-item, .move-row) {
    border-color: var(--border);
    background: rgba(15, 23, 42, 0.34);
}

body.common-board-game-shell-page :is(.omok-invite-surface, .othello-invite-surface, .alkkagi-invite-surface, .invite-surface) {
    width: min(760px, 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    border-radius: 32px;
    background:
        radial-gradient(circle at top, color-mix(in srgb, var(--accent) 14%, transparent), transparent 36%),
        color-mix(in srgb, var(--card-bg) 88%, rgba(15, 23, 42, 0.08));
    box-shadow: var(--common-board-card-shadow);
}

body.common-board-game-shell-page :is(.omok-invite-code-panel, .othello-invite-code-panel, .alkkagi-invite-code-panel, .invite-code, .room-code-box, .omok-room-code-box, .othello-room-code-box, .alkkagi-room-code-box) {
    border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
    background: rgba(15, 23, 42, 0.42);
}

body.common-board-game-shell-page :is(input, select, textarea) {
    border-color: var(--border);
    background: var(--input-bg);
    color: var(--text-main);
}

body.common-board-game-shell-page :is(input, textarea)::placeholder {
    color: color-mix(in srgb, var(--text-sub) 74%, transparent);
}

body.common-board-game-shell-page:is(.omok-room-focus-active, .othello-room-focus-active, .alkkagi-room-focus-active, .chess-room-focus-active),
body.common-board-game-shell-page:is(.omok-waiting-active, .othello-waiting-active, .alkkagi-waiting-active, .chess-waiting-active, .omok-match-active, .othello-match-active, .alkkagi-match-active, .chess-match-active) {
    background: var(--common-board-focus-bg);
}

body.common-board-game-shell-page:is(.omok-match-active, .othello-match-active, .alkkagi-match-active, .chess-match-active) :is(.omok-stage-head, .othello-stage-head, .alkkagi-stage-head, .board-head, .battle-hud, .room-stage-head) {
    width: min(100%, 980px);
    border-radius: var(--common-board-radius-lg);
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid var(--border);
    box-shadow: var(--common-board-soft-shadow);
    backdrop-filter: blur(16px);
}

body.common-board-game-shell-page:is(.omok-match-active, .othello-match-active, .alkkagi-match-active) :is(.omok-side-pane, .othello-side-pane, .alkkagi-side-pane),
body.common-board-game-shell-page.chess-match-active :is(.player-strip, .guide-panel, .result-box) {
    border-radius: var(--common-board-radius-lg);
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid var(--border);
    box-shadow: var(--common-board-soft-shadow);
    backdrop-filter: blur(16px);
}

body.chess-page.common-board-game-shell-page :is(.entry-state-card, .chess-auth-card, .mode-block, .sidebar-card, .hero-action-card, .online-entry-panel, .public-room-block, .guide-panel, .result-box, .promotion-surface, .decision-surface) {
    border-color: var(--border);
    background:
        radial-gradient(circle at top right, rgba(129, 140, 248, 0.12), transparent 36%),
        rgba(15, 23, 42, 0.58);
    color: var(--text-main);
}

body.chess-page.common-board-game-shell-page :is(.hero-action-card, .online-entry-chip, .btn-chess-subtle, .promotion-choice) {
    border-color: var(--border);
    background: rgba(15, 23, 42, 0.42);
    color: var(--text-main);
}

body.chess-page.common-board-game-shell-page :is(.chess-quick-status, .chess-profile-badge) {
    border-color: var(--border);
    background: rgba(15, 23, 42, 0.42);
}

body.chess-page.common-board-game-shell-page :is(.hero-action-card:hover, .online-entry-chip:hover, .promotion-choice:hover) {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
    background: rgba(16, 185, 129, 0.12);
}

body.chess-page.common-board-game-shell-page :is(.hero-copy p, .status-note, .mode-block p, .entry-main span, .guide-panel, .inline-status, .invite-hint, .player-main span, .sidebar-card p, .decision-surface p, .promotion-surface p) {
    color: var(--text-sub);
}

body.chess-page.common-board-game-shell-page :is(.field-box label, .kpi-box .label, .hero-side-label, .hero-action-card span, .leader-meta, .record-meta, .room-card-meta span) {
    color: var(--text-sub);
}

body.chess-page.common-board-game-shell-page :is(.room-list .empty-state, .move-list .empty-state, .admin-table .empty-state) {
    background: rgba(15, 23, 42, 0.38);
    color: var(--text-sub);
}

body.chess-page.common-board-game-shell-page .error-state {
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(127, 29, 29, 0.32) !important;
    color: #fecaca !important;
}

body.chess-page.common-board-game-shell-page .chess-auth-overlay,
body.chess-page.common-board-game-shell-page .promotion-modal,
body.chess-page.common-board-game-shell-page .decision-modal {
    background: rgba(2, 6, 23, 0.66);
    backdrop-filter: blur(10px);
}

body.chess-page.common-board-game-shell-page.chess-waiting-active,
body.chess-page.common-board-game-shell-page.chess-match-active {
    background:
        radial-gradient(circle at top, rgba(16, 185, 129, 0.16), transparent 32%),
        radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.14), transparent 28%),
        #0f172a;
}

@media (max-width: 1120px) {
    body.common-board-game-shell-page :is(.omok-hero, .othello-hero, .alkkagi-hero, .hero-card, .chess-grid, .omok-layout, .othello-layout, .alkkagi-layout) {
        grid-template-columns: 1fr;
    }

    body.common-board-game-shell-page .hero-command,
    body.common-board-game-shell-page .hero-identity-strip {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 720px) {
    body.common-board-game-shell-page :is(.omok-shell, .othello-shell, .alkkagi-shell, .chess-shell) {
        padding: 14px 12px 28px;
    }

    body.common-board-game-shell-page :is(.omok-topbar, .othello-topbar, .alkkagi-topbar, .chess-topbar, .topbar-title) {
        align-items: flex-start;
    }

    body.common-board-game-shell-page :is(.omok-topbar-actions, .othello-topbar-actions, .alkkagi-topbar-actions, .topbar-actions) {
        width: 100%;
        justify-content: flex-start;
    }

    body.common-board-game-shell-page :is(.omok-topbar-copy h1, .othello-topbar-copy h1, .alkkagi-topbar-copy h1, .chess-topbar-copy h1) {
        font-size: 1.55rem;
    }
}
