:root {
    /* Base Colors - Dark Mode (Default) */
    --bg-base: #060608;
    --card-bg: rgba(24, 24, 27, 0.75);
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.4);

    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    --gray-950: #09090b;

    --brand-primary: #3b82f6;
    --brand-primary-hover: #2563eb;

    --board-bg: #1e3a8a;
    --board-border: #1e40af;
    --board-shadow: rgba(30, 64, 175, 0.4);

    --red-piece: #ef4444;
    --yellow-piece: #eab308;

    --error-text: #f87171;
    --error-bg: rgba(239, 68, 68, 0.1);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 32px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="light"] {
    --bg-base: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.9);

    --gray-950: #f4f4f5;
    --gray-900: #e4e4e7;
    --gray-800: #d4d4d8;
    --gray-700: #a1a1aa;
    --gray-600: #71717a;
    --gray-500: #52525b;
    --gray-400: #3f3f46;
    --gray-300: #27272a;
    --gray-200: #18181b;
    --gray-100: #09090b;
    --gray-50: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-base);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.theme-toggle-btn:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--brand-primary);
}

.theme-toggle-btn .sun-icon {
    display: none;
}

.theme-toggle-btn .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle-btn .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle-btn .moon-icon {
    display: none;
}

[data-theme="light"] .theme-toggle-btn {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('assets/premium_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0.9;
    animation: bgMovement 30s ease-in-out infinite alternate;
    transition: opacity 0.5s ease;
}

[data-theme="light"] .background-container {
    opacity: 0.2;
}

@keyframes bgMovement {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1) translate(-2%, -2%);
    }
}

.app-layout {
    width: 100%;
    max-width: 1024px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header & Logo */
.app-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    gap: 1.5rem;
}

.header-titles {
    text-align: center;
}

.logo-mark {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.logo-mark .dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: relative;
    box-shadow: inset -4px -4px 8px rgba(0, 0, 0, 0.3), inset 4px 4px 8px rgba(255, 255, 255, 0.3);
}

.logo-mark .dot.red {
    background: var(--red-piece);
}

.logo-mark .dot.yellow {
    background: var(--yellow-piece);
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: -0.25rem;
}

/* Premium Card */
.premium-card {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 3.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(59, 130, 246, 0.1), transparent 30%);
    animation: rotateBorder 10s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes rotateBorder {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.premium-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.premium-card:has(.active-turn) {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 20px rgba(59, 130, 246, 0.1);
}

/* Views */
.view {
    display: none;
    flex-direction: column;
    width: 100%;
}

.view.active {
    display: flex;
}

/* Auth View Specifics */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-md);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--gray-800);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms & Inputs */
#lobby-view {
    width: 100%;
}

.lobby-grid {
    display: flex;
    gap: 3rem;
    align-items: stretch;
}

.lobby-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lobby-sidebar {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--gray-800);
    padding-left: 2rem;
}

.sidebar-panel h3 {
    font-size: 0.9rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-list {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius-md);
    max-height: 200px;
    overflow-y: auto;
}

.empty-state {
    padding: 1.5rem;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-800);
    transition: background 0.2s;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item.room {
    cursor: pointer;
}

.list-item.room:hover {
    background: rgba(59, 130, 246, 0.1);
}

.item-primary {
    font-weight: 600;
    color: var(--gray-100);
}

.item-secondary {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.item-tag {
    background: var(--brand-primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.row-group {
    flex-direction: row;
    align-items: center;
    margin-top: -0.5rem;
    gap: 0.75rem;
}

.custom-checkbox {
    width: auto;
    accent-color: var(--brand-primary);
    cursor: pointer;
    transform: scale(1.2);
}

.check-label {
    cursor: pointer;
    margin: 0;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-300);
}

input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-md);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-sans);
    outline: none;
    transition: all 0.2s;
}

input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

input::placeholder {
    color: var(--gray-500);
}

/* Buttons */
.btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: var(--font-sans);
}

.btn.sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.btn.xs {
    padding: 0.4rem 0.6rem;
    width: auto;
    font-size: 0.75rem;
    border-radius: var(--border-radius-sm);
}

.btn.primary {
    background-color: var(--brand-primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn.primary:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
}

.btn.primary:active {
    transform: translateY(0);
}

.btn.secondary {
    background-color: var(--gray-800);
    color: var(--gray-100);
    border: 1px solid var(--gray-700);
}

.btn.secondary:hover {
    background-color: var(--gray-700);
    border-color: var(--gray-600);
}

.btn.secondary.outline {
    background-color: transparent;
    border-color: var(--gray-600);
}

.btn.secondary.outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Footer */
.app-footer {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-dot {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.3;
}

.app-footer p {
    opacity: 0.7;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-800);
}

.divider span {
    padding: 0 1rem;
}

/* Error */
.error-msg {
    color: var(--error-text);
    background: var(--error-bg);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-top: -0.5rem;
}

.hidden {
    display: none !important;
}

/* ----------------------------------------------------
   GAME VIEW
   ---------------------------------------------------- */
.room-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-800);
}

.room-pill {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-400);
    border: 1px solid var(--gray-800);
}

.mono-text {
    font-family: var(--font-mono);
}

.room-pill-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.highlight {
    color: white;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-left: 0.25rem;
}

.matchup-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    border: 1px solid transparent;
    opacity: 0.5;
    transition: all 0.3s;
    font-size: 0.875rem;
    font-weight: 600;
}

.player-pill.active-turn {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    animation: pulseActive 2s infinite;
}

@keyframes pulseActive {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
}

.indicator.red {
    background: var(--red-piece);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.indicator.yellow {
    background: var(--yellow-piece);
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}

.vs-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
}

.game-flex-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Board */
.board-column {
    flex: 1 1 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.turn-banner {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gray-300);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.board-shadow-wrapper {
    position: relative;
    padding: 24px;
    background: var(--board-bg);
    border-radius: 28px;
    box-shadow: 0 20px 40px var(--board-shadow), inset 0 2px 0px rgba(255, 255, 255, 0.1);
    border: 1px solid var(--board-border);
    max-width: 500px;
    width: 100%;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 12px;
    aspect-ratio: 7/6;
}

.game-board.disabled {
    pointer-events: none;
}

.cell {
    background: #0f1c4a;
    border-radius: 50%;
    box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.6);
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.game-board:not(.disabled) .cell:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
}

.piece {
    width: 84%;
    height: 84%;
    position: absolute;
    top: 8%;
    left: 8%;
    border-radius: 50%;
    box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.3), inset 4px 4px 10px rgba(255, 255, 255, 0.3), 0 4px 8px rgba(0, 0, 0, 0.4);
    animation: drop 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes drop {
    0% {
        transform: translateY(calc(var(--drop-distance, -400px)));
    }

    100% {
        transform: translateY(0);
    }
}

.piece.red {
    background: var(--red-piece);
}

.piece.yellow {
    background: var(--yellow-piece);
}

/* Lottie Overlay */
.animation-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pointer-events-none {
    pointer-events: none;
}

/* Game Over Dialog */
.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 28, 74, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
    z-index: 10;
}

.overlay-dialog {
    background: var(--gray-900);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-800);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: scale(0.95);
    animation: zoomIn 0.3s forwards;
}

@keyframes zoomIn {
    to {
        transform: scale(1);
    }
}

.overlay-dialog h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: white;
}

.dialog-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Chat */
.chat-column {
    flex: 1 1 40%;
    height: 500px;
    /* Align roughly with board height */
    display: flex;
    flex-direction: column;
}

.chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--gray-800);
}

.chat-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-300);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--gray-700);
    border-radius: 3px;
}

.msg {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    line-height: 1.4;
    max-width: 85%;
}

.msg.system {
    align-self: center;
    background: transparent;
    color: var(--gray-500);
    font-size: 0.75rem;
    text-align: center;
}

.msg.self {
    align-self: flex-end;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-bottom-right-radius: 4px;
}

.msg.other {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
}

.msg-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400);
    margin-bottom: 2px;
    display: block;
}

.chat-composer {
    display: flex;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--gray-800);
    gap: 0.5rem;
}

.chat-composer input {
    border-radius: var(--border-radius-sm);
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--gray-700);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--brand-primary-hover);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Responsiveness */
@media (max-width: 850px) {
    .premium-card {
        padding: 1.5rem;
    }

    .lobby-grid {
        flex-direction: column;
        gap: 2rem;
    }

    .lobby-sidebar {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--gray-800);
        padding-top: 2rem;
    }

    .game-flex-container {
        flex-direction: column;
    }

    .chat-column {
        width: 100%;
        height: 350px;
    }
}

/* Game Selection Grid */
.game-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.game-card-mini {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.game-card-mini i {
    font-size: 1.5rem;
}

.game-card-mini span {
    font-size: 0.8rem;
    font-weight: 600;
}

.game-card-mini:hover {
    border-color: var(--brand-primary);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
}

.game-card-mini.active {
    border-color: var(--brand-primary);
    background: rgba(59, 130, 246, 0.1);
    color: white;
}

/* Specific Game Boards */
#game-board-container {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    min-height: 300px;
}

/* Snake Styles */
.snake-canvas {
    background: #000;
    border: 4px solid #333;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

/* Chess Styles */
.chess-board {
    width: 400px;
    border: 5px solid #333;
    border-radius: 4px;
}

/* Minesweeper Styles */
.minesweeper-grid {
    display: grid;
    gap: 2px;
    background: #444;
    padding: 2px;
    border: 4px solid #222;
}

.mine-cell {
    width: 30px;
    height: 30px;
    background: var(--gray-300);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    border: 2px outset #eee;
}

.mine-cell.revealed {
    background: #eee;
    border: 1px solid #ccc;
}

.mine-cell.mine {
    background: #f87171;
}

.mine-cell.flagged {
    background: #eab308;
}

/* Stats in Game Over */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 4px;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.stat-val {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--brand-primary);
}

/* Tic Tac Toe Extensions */
.ttt-cell {
    font-size: 3rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2048 Extensions */
.cell-2048 {
    border-radius: 4px;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: var(--gray-800);
}

.cell-2048[data-value="2"] {
    background: #eee4da;
    color: #776e65;
}

.cell-2048[data-value="4"] {
    background: #ede0c8;
    color: #776e65;
}

.cell-2048[data-value="8"] {
    background: #f2b179;
}

.cell-2048[data-value="16"] {
    background: #f59563;
}

.cell-2048[data-value="32"] {
    background: #f67c5f;
}

.cell-2048[data-value="64"] {
    background: #f65e3b;
}

.cell-2048[data-value="128"] {
    background: #edcf72;
    font-size: 1.2rem;
}

.cell-2048[data-value="256"] {
    background: #edcc61;
    font-size: 1.2rem;
}

.cell-2048[data-value="512"] {
    background: #edc850;
    font-size: 1.1rem;
}

.cell-2048[data-value="1024"] {
    background: #edc53f;
    font-size: 1rem;
}

.cell-2048[data-value="2048"] {
    background: #edc22e;
    font-size: 1rem;
}

/* Checkers Extensions */
.checkers-cell.selected {
    box-shadow: inset 0 0 10px var(--brand-primary);
}

.checker-piece {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    margin: 10%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    cursor: pointer;
}

.checker-piece.red {
    background: var(--red-piece);
}

.checker-piece.black {
    background: #333;
}

.checker-piece.king::after {
    content: '\f521';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
}

/* Sudoku Extensions */
.sudoku-cell {
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    font-size: 1.5rem;
    color: white;
}

.sudoku-cell.fixed {
    background: var(--gray-900);
    color: var(--gray-400);
}

.sudoku-cell:nth-child(3n) {
    border-right: 2px solid white;
}

.sudoku-cell:nth-child(9n) {
    border-right: 1px solid var(--gray-700);
}

.sudoku-cell:nth-of-type(n+19):nth-of-type(-n+27),
.sudoku-cell:nth-of-type(n+46):nth-of-type(-n+54) {
    border-bottom: 2px solid white;
}

/* Pool Game Styles */
.pool-canvas {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 2/1;
    background: #065f46;
    /* Felt green */
    border: 12px solid #3f2b1d;
    /* Wood rail */
    border-radius: 12px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 0 auto;
    cursor: crosshair;
}

.pool-ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: none;
    color: white;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.indicator.blue {
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.vs-text.hidden {
    display: none;
}