/* CSS Design Tokens & Themes */
:root {
    /* Color Palette - Dark Mode Default */
    --bg-gradient: radial-gradient(circle at top right, #1e1b4b, #0f172a 60%, #020617);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* Board & Cell Colors */
    --grid-border: #475569;
    --block-border: #818cf8;
    --cell-bg: rgba(15, 23, 42, 0.6);
    --cell-hover: rgba(99, 102, 241, 0.2);
    --cell-selected: rgba(99, 102, 241, 0.35);
    --cell-selected-ring: #818cf8;
    --cell-highlight-same: rgba(139, 92, 246, 0.3);
    --cell-highlight-related: rgba(51, 65, 85, 0.5);
    --cell-given-text: #e0e7ff;
    --cell-user-text: #38bdf8;
    --cell-invalid-bg: rgba(239, 68, 68, 0.25);
    --cell-invalid-text: #fca5a5;
    --note-text: #94a3b8;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f0f4ff 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --grid-border: #cbd5e1;
    --block-border: #4f46e5;
    --cell-bg: #ffffff;
    --cell-hover: rgba(99, 102, 241, 0.12);
    --cell-selected: rgba(99, 102, 241, 0.25);
    --cell-selected-ring: #4f46e5;
    --cell-highlight-same: rgba(139, 92, 246, 0.2);
    --cell-highlight-related: rgba(241, 245, 249, 0.9);
    --cell-given-text: #0f172a;
    --cell-user-text: #0284c7;
    --cell-invalid-bg: #fee2e2;
    --cell-invalid-text: #dc2626;
    --note-text: #64748b;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

.app-container {
    width: 100%;
    max-width: 950px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
}

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

.brand-icon {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
}

.brand-text h1 span {
    color: var(--primary-color);
}

.sub-title {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.icon-btn.active {
    color: var(--primary-color);
}

#btn-stats {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

#btn-stats:hover, #btn-stats:focus {
    background: linear-gradient(135deg, #10b981, #6366f1) !important;
    color: #fff !important;
    border-color: rgba(99, 102, 241, 0.6) !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px) scale(1.05);
}

/* Status Ribbon */
.status-ribbon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
    flex-wrap: wrap;
    gap: 15px;
}

.difficulty-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.difficulty-picker .label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-group {
    display: flex;
    background: rgba(0, 0, 0, 0.15);
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
}

.diff-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.diff-btn:hover {
    color: var(--text-primary);
}

.diff-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.stats-timer-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.15);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-badge i {
    font-size: 1rem;
}

.mistakes-badge i {
    color: var(--danger-color);
}

.timer-badge {
    color: var(--primary-color);
    font-family: monospace;
    font-size: 1rem;
    letter-spacing: 1px;
}

.timer-pause-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.timer-pause-btn:hover {
    color: var(--text-primary);
}

/* Main Game Workspace */
.game-workspace {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 25px;
    align-items: start;
}

/* Board Card */
.board-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 500px;
    border: 3px solid var(--block-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--block-border);
    gap: 1px;
}

/* Sudoku Cell */
.cell {
    position: relative;
    background: var(--cell-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    transition: background 0.15s ease, transform 0.1s ease;
}

/* 3x3 Block Thicker Borders */
.cell[data-col="2"], .cell[data-col="5"] {
    border-right: 3px solid var(--block-border);
}
.cell[data-row="2"], .cell[data-row="5"] {
    border-bottom: 3px solid var(--block-border);
}

/* Cell Highlights & States */
.cell:hover {
    background: var(--cell-hover);
}

.cell.highlight-related {
    background: var(--cell-highlight-related);
}

.cell.highlight-same {
    background: var(--cell-highlight-same);
}

.cell.selected {
    background: var(--cell-selected) !important;
    box-shadow: inset 0 0 0 2px var(--cell-selected-ring);
    z-index: 2;
}

.cell.given {
    color: var(--cell-given-text);
    font-weight: 700;
}

.cell.user-input {
    color: var(--cell-user-text);
    font-weight: 600;
}

.cell.invalid {
    background: var(--cell-invalid-bg) !important;
    color: var(--cell-invalid-text) !important;
    animation: shake 0.3s ease;
}

.cell.hinted {
    animation: pulseHint 1s ease;
    color: var(--success-color);
}

/* Notes Grid inside Cell */
.notes-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 2px;
    pointer-events: none;
}

.note-item {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--note-text);
}

/* Dashboard & Controls */
.dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tool-btn {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.tool-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.tool-btn.highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.tool-btn.highlight:hover {
    background: var(--warning-color);
    color: #fff;
}

.tool-btn.danger:hover {
    background: var(--danger-color);
    color: #fff;
}

.tool-icon {
    font-size: 1.2rem;
}

.tool-label {
    font-size: 0.78rem;
    font-weight: 600;
}

.badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--card-border);
}

.shortcut-key {
    display: inline-block;
    margin-top: 2px;
    font-family: var(--font-heading), monospace;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.tool-btn:hover .shortcut-key {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.tool-btn.active .shortcut-key {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    border-color: #fff;
}

.tool-btn.active .badge {
    background: #fff;
    color: var(--primary-color);
}

/* Shortcut Legend Card */
.shortcut-legend-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-header {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.legend-tags .tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.legend-tags kbd {
    font-family: var(--font-heading), monospace;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: var(--primary-color);
}

/* Numpad */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.num-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    font-family: var(--font-heading);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.num-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.num-btn .num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.num-btn .count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.num-btn:hover .count {
    color: rgba(255, 255, 255, 0.8);
}

.num-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* General Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px var(--primary-glow);
}

.btn-block {
    width: 100%;
}

/* Overlay & Modals */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card-bg, #0f172a);
    background-color: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.board-card.paused .sudoku-grid {
    filter: blur(30px);
    opacity: 0;
    pointer-events: none;
    user-select: none;
}

.overlay-card {
    text-align: center;
    padding: 30px;
}

.overlay-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.overlay-card h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.overlay-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Loading Spinner */
.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spinGlow 0.9s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 20px var(--primary-glow);
}

@keyframes spinGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 35px 30px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--card-shadow);
    z-index: 101;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: var(--radius-full);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    color: #fff;
    margin: 0 auto 20px;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
}

.modal-card h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.modal-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
}

#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.hidden {
    display: none !important;
}

.app-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-top: 10px;
}

/* Animations */
.cell.shake-block {
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

@keyframes pulseHint {
    0% { transform: scale(1); background: var(--cell-bg); }
    50% { transform: scale(1.15); background: rgba(16, 185, 129, 0.4); }
    100% { transform: scale(1); }
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Erase & Hint Badge specific */
#erase-badge, #hint-badge, #undo-badge {
    background: var(--card-border);
    color: var(--text-secondary);
}

#erase-badge.zero, #hint-badge.zero, #undo-badge.zero {
    background: rgba(239, 68, 68, 0.25);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* =========================================
   Ad Modal Popup (70vw x 70vh, 50% Screen Area)
   ========================================= */
.ad-modal-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 70vw;
    height: 70vh;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 50px var(--primary-glow);
    backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 101;
    animation: modalPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Ad Header */
.ad-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 30px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.ad-badge-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ad-sponsor-badge {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ad-reward-badge {
    font-size: 0.85rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--success-color);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ad-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ad-timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    border: 1.5px solid var(--primary-color);
    padding: 6px 18px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    box-shadow: 0 0 15px var(--primary-glow);
}

.ad-timer-pill i {
    color: var(--warning-color);
    animation: rotateSand 2s infinite linear;
}

@keyframes rotateSand {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(180deg); }
}

.ad-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.15rem;
    transition: all 0.2s ease;
}

.ad-close-btn:hover {
    background: var(--danger-color);
    color: #fff;
    border-color: var(--danger-color);
    transform: scale(1.08);
}

/* Progress Bar */
.ad-progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    flex-shrink: 0;
}

.ad-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--success-color));
    transition: width 0.1s linear;
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Notice Bar */
.ad-notice-bar {
    padding: 10px 30px;
    background: rgba(245, 158, 11, 0.1);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--warning-color);
    font-weight: 600;
    flex-shrink: 0;
}

/* Content Body */
.ad-content-body {
    position: relative;
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, rgba(15, 23, 42, 0.7) 80%);
    overflow-y: auto;
}

/* Dummy Banner Visual */
.ad-banner-visual {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.92) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    backdrop-filter: blur(15px);
}

.ad-glow-effect {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: var(--accent-color);
    filter: blur(100px);
    opacity: 0.3;
    pointer-events: none;
}

.ad-brand-hero {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ad-brand-logo {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    color: #fff;
    box-shadow: 0 0 25px var(--primary-glow);
    flex-shrink: 0;
}

.ad-brand-title h3 {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

.ad-brand-title h3 span {
    color: var(--accent-color);
}

.ad-brand-tagline {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.ad-features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 15px 0;
}

.ad-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
    border-radius: var(--radius-md);
}

.ad-feature-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 2px;
}

.ad-feature-item strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ad-feature-item span {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: block;
}

.ad-cta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.ad-visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 26px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 18px var(--primary-glow);
    transition: all 0.2s ease;
}

.ad-visit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px var(--primary-glow);
}

.ad-cta-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Inactive Overlay (When Tab/Window is blurred or hidden) */
.ad-blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    animation: fadeIn 0.2s ease;
}

.ad-blur-card {
    text-align: center;
    padding: 24px;
    max-width: 380px;
}

.ad-blur-card i {
    font-size: 2.8rem;
    color: var(--warning-color);
    margin-bottom: 12px;
}

.ad-blur-card h4 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #fff;
}

.ad-blur-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Ad Modal Footer */
.ad-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--card-border);
    font-size: 0.76rem;
}

.ad-tip {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ad-status-msg {
    color: var(--primary-color);
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lang-btn {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--primary-color);
    letter-spacing: 0.03em;
}

/* =========================================
   Guide Button (Header)
   ========================================= */
.guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.guide-btn i {
    color: var(--primary-color);
    font-size: 1rem;
}

.guide-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(236, 72, 153, 0.25));
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

/* =========================================
   Guide Modal (How to Play & Strategies)
   ========================================= */
.guide-modal-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    width: 90vw;
    max-width: 920px;
    height: 82vh;
    max-height: 850px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-2xl), 0 0 40px rgba(99, 102, 241, 0.18);
    backdrop-filter: blur(24px);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.guide-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
}

.guide-title-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.guide-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 0 18px var(--primary-glow);
}

.guide-title-box h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.guide-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.guide-close-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.guide-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
    color: var(--danger-color);
    transform: rotate(90deg);
}

/* Guide Body Layout */
.guide-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar Navigation Tabs */
.guide-nav {
    width: 220px;
    background: rgba(0, 0, 0, 0.15);
    border-right: 1px solid var(--card-border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.guide-tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
}

.guide-tab-btn i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
}

.guide-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.guide-tab-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.guide-tab-btn.active i {
    color: var(--primary-color);
}

/* Content Area */
.guide-content-scroll {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
}

.guide-panel {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.guide-panel.active {
    display: block;
}

/* Hero Banner */
.guide-hero-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(236, 72, 153, 0.12));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 22px;
}

.guide-pill {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    margin-bottom: 8px;
}

.guide-pill.special {
    background: linear-gradient(135deg, #f59e0b, #ec4899);
}

.guide-hero-banner h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.guide-hero-banner p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* Grid Cards (Rules, etc.) */
.guide-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.guide-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition-fast);
}

.guide-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.guide-card .card-icon {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.guide-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.guide-card p {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* Tip Box */
.guide-tip-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.guide-tip-box i {
    color: #f59e0b;
    font-size: 1.1rem;
    margin-top: 2px;
}

.guide-tip-box strong {
    color: #f59e0b;
    display: block;
    margin-bottom: 2px;
}

/* Section Header */
.guide-section-header {
    margin-bottom: 18px;
}

.guide-section-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

/* Technique Box */
.technique-box {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 18px;
}

.technique-box.highlight-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(99, 102, 241, 0.08));
    border-color: rgba(16, 185, 129, 0.3);
}

.technique-box.advanced-highlight {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(99, 102, 241, 0.08));
    border-color: rgba(236, 72, 153, 0.35);
}

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

.tech-tag {
    padding: 3px 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.tech-tag.special {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.tech-tag.master {
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    border: none;
    color: #fff;
}

.tech-header h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.technique-box p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
}

.technique-box p:last-child {
    margin-bottom: 0;
}

.tech-example-box {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--primary-color);
    padding: 10px 14px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-top: 10px;
}

.example-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.logic-explain-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-top: 10px;
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.logic-explain-card ul {
    margin: 6px 0 0 0;
    padding-left: 18px;
    line-height: 1.55;
}

.sub-note {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    margin-top: 8px !important;
}

/* X-Wing Diagram Card */
.xwing-diagram-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 14px;
}

.xwing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ec4899;
    font-size: 0.92rem;
    margin-bottom: 12px;
}

.xwing-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.xwing-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
}

.xwing-step-item.highlight-step {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid #10b981;
}

.step-num {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.highlight-step .step-num {
    background: #10b981;
    color: #fff;
}

.xwing-step-item div strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.xwing-step-item div span {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Shortcuts Guide Table */
.shortcuts-guide-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
}

.shortcut-row .key-col {
    width: 170px;
    flex-shrink: 0;
}

.shortcut-row .desc-col {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Guide Modal Footer */
.guide-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
}

.guide-footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Responsive Media Queries */
@media (max-width: 820px) {
    .game-workspace {
        grid-template-columns: 1fr;
    }
    .board-card {
        max-width: 520px;
        margin: 0 auto;
        width: 100%;
    }
    .dashboard-card {
        max-width: 520px;
        margin: 0 auto;
        width: 100%;
    }
    .ad-modal-card {
        width: 94vw;
        height: auto;
        max-height: 85vh;
    }
    .ad-features-grid {
        grid-template-columns: 1fr;
    }
    .guide-modal-body {
        flex-direction: column;
    }
    .guide-nav {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
        overflow-x: auto;
    }
}

/* Shortcut Legend Card */
.shortcut-legend-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-top: 14px;
}

.legend-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

.legend-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.legend-tags .tag {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Increase Korean shortcut text size by 1pt in Korean mode */
html[data-lang="ko"] .legend-tags .tag span {
    font-size: 0.88rem;
    font-weight: 500;
}

/* =========================================
   Same Number Highlight & Cell Effects
   ========================================= */
.cell.same-number {
    background-color: rgba(99, 102, 241, 0.28) !important;
    color: var(--primary-color) !important;
    font-weight: 800 !important;
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.6) !important;
}

[data-theme="light"] .cell.same-number {
    background-color: rgba(99, 102, 241, 0.2) !important;
    color: #4f46e5 !important;
}

/* =========================================
   Stats Modal (All-Time & Monthly)
   ========================================= */
.stats-modal-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    width: 90vw;
    max-width: 780px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-2xl), 0 0 40px rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(24px);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
}

.stats-title-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stats-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10b981, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.3);
}

.stats-title-box h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.stats-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.stats-close-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.stats-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
    color: var(--danger-color);
    transform: rotate(90deg);
}

/* Stats Tab Bar */
.stats-tab-bar {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--card-border);
}

.stats-tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stats-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.stats-tab-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(16, 185, 129, 0.2));
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.stats-tab-btn.active i {
    color: #10b981;
}

/* Stats Scroll Content */
.stats-content-scroll {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
}

.stats-panel {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.stats-panel.active {
    display: block;
}

/* Streak Banner */
.stats-streak-banner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    margin-bottom: 20px;
}

.streak-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.streak-icon {
    font-size: 1.6rem;
    color: #f97316;
}

.streak-icon.gold {
    color: #f59e0b;
}

.streak-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.streak-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.streak-divider {
    width: 1px;
    height: 36px;
    background: var(--card-border);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-fast);
}

.stat-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--card-border);
}

.diff-tag {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.diff-easy .diff-tag { color: #10b981; }
.diff-medium .diff-tag { color: #6366f1; }
.diff-hard .diff-tag { color: #f59e0b; }
.diff-expert .diff-tag { color: #ec4899; }

.win-rate {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.stat-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.row-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-row strong {
    font-size: 0.88rem;
    color: var(--text-primary);
}

/* Stats Footer Buttons */
.stats-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--danger-color);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger-color);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.2);
}




