:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-tertiary: #e8edf5;
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --text-muted: #95a5a6;

    --border-color: #dfe4ea;
    --border-dark: #495057;

    --cell-size: 60px;
    --cell-bg: #ffffff;
    --cell-fixed: #f0f4f8;
    --cell-selected: #bbdefb;
    --cell-highlight: #e3f2fd;
    --cell-related: #e8f5e9;
    --cell-same-number: #fff3cd;
    --cell-error: #ffe5e5;
    --cell-hint: #d4edda;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);

    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #4da6ff;
    --primary-hover: #3399ff;

    --bg-primary: #1e2126;
    --bg-secondary: #282c34;
    --bg-tertiary: #32363e;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-muted: #8a8d91;

    --border-color: #3a3f47;
    --border-dark: #555a62;

    --cell-bg: #2a2e35;
    --cell-fixed: #25292f;
    --cell-selected: #2563a8;
    --cell-highlight: #2c3e50;
    --cell-related: #2d4a3e;
    --cell-same-number: #5a4a2d;
    --cell-error: #5a2a2e;
    --cell-hint: #2a4a3a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Banner Ad */
.banner-ad {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    min-height: 90px;
    max-width: 728px;
    margin: 0 auto 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Difficulty Selector */
.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Game Modes */
.game-modes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.mode-toggle-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-toggle {
    padding: 0.5rem 1.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.mode-toggle:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.mode-toggle.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.mode-info {
    position: relative;
    display: inline-flex;
}

.info-icon {
    font-size: 1rem;
    cursor: help;
    opacity: 0.6;
    transition: var(--transition);
}

.info-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.mode-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1rem;
    width: 250px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.mode-info:hover .mode-tooltip {
    display: block;
}

.mode-tooltip strong {
    display: block;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.mode-tooltip p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.endless-counter {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
}

.endless-counter.hidden {
    display: none;
}

.endless-counter span {
    font-size: 1.1rem;
    font-weight: 700;
}

.difficulty-btn {
    padding: 0.75rem 2rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

.difficulty-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Game Layout */
.game-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 2rem;
    align-items: start;
}

/* Sidebars */
.sidebar {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.stat-card:last-child {
    margin-bottom: 0;
}

.stat-icon {
    font-size: 2rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ad-placeholder {
    margin-top: 1.5rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.ad-content {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-card {
    margin-bottom: 1.5rem;
}

.info-card:last-child {
    margin-bottom: 0;
}

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

.info-list {
    list-style: none;
}

.info-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-list li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
}

kbd {
    background: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    margin-right: 0.25rem;
}

/* Game Area */
.game-area {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.game-area.zen-mode {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.15);
}

[data-theme="dark"] .game-area.zen-mode {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    gap: 0.5rem;
}

.center-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.control-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}

.control-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.control-btn.active {
    background: var(--primary-color);
    color: white;
}

.hint-btn-wrapper {
    position: relative;
}

.hint-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

.hint-counter.zero {
    background: var(--secondary-color);
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Game Board Wrapper */
.game-board-wrapper {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* Grid Container */
.grid-container {
    position: relative;
    display: inline-block;
}

/* Sudoku Grid */
.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    grid-template-rows: repeat(9, var(--cell-size));
    gap: 0;
    border: 3px solid var(--border-dark);
    background: var(--border-dark);
    box-shadow: var(--shadow-lg);
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    background: var(--cell-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s ease, transform 0.1s ease;
    user-select: none;
}

.cell:hover:not(.fixed) {
    background: var(--cell-highlight);
}

.cell.fixed {
    background: var(--cell-fixed);
    color: var(--text-primary);
    font-weight: 700;
    cursor: default;
}

.cell.selected {
    background: var(--cell-selected) !important;
    outline: 3px solid var(--primary-color);
    outline-offset: -3px;
    z-index: 10;
}

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

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

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

.cell.error {
    background: var(--cell-error);
    color: var(--danger-color);
    animation: shake 0.4s;
}

.cell.hint-flash {
    background: var(--cell-hint);
    animation: pulse 0.6s;
}

/* Thick borders for 3x3 boxes */
.cell:nth-child(3n) {
    border-right: 2px solid var(--border-dark);
}

.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--border-dark);
}

/* Notes Display */
.notes-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    padding: 2px;
}

.note {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Number Pad */
.number-pad {
    display: flex;
    flex-direction: column;
}

.number-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0.5rem;
}

.number-btn {
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.number-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.number-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.number-btn.completed {
    opacity: 0.5;
}

/* Bottom Actions */
.bottom-actions {
    display: flex;
    justify-content: center;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.mistakes-counter {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.mistakes-counter #mistakes {
    color: var(--danger-color);
}

.dialog-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.secondary-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: var(--bg-tertiary);
}

.settings-content {
    margin: 2rem 0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.setting-item span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Overlays */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.overlay-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.primary-btn {
    padding: 1rem 2rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Win Overlay */
.win-content {
    max-width: 500px;
}

.win-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

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

.win-stat {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
}

.win-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.win-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.new-record {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    animation: pulse 1s infinite;
}

.new-record.hidden {
    display: none;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .left-sidebar,
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --cell-size: 38px;
    }

    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .main-container {
        padding: 0.5rem 0;
        padding-bottom: 70px;
        overflow-x: hidden;
        max-width: 100vw;
    }

    .sudoku-grid {
        width: calc(var(--cell-size) * 9 + 8px);
        max-width: 100%;
        margin: 0 auto;
    }

    .grid-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .game-board-wrapper {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0;
        max-width: 100vw;
    }

    .number-pad {
        width: 100%;
        max-width: 100vw;
        padding: 0 0.25rem;
        box-sizing: border-box;
    }

    .number-buttons {
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        gap: 0.2rem;
        width: 100%;
        box-sizing: border-box;
    }

    .header-content {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        display: flex;
        justify-content: space-around;
        padding: 0.5rem 0;
        z-index: 1000;
        gap: 0;
    }

    .nav-link {
        flex: 1;
        text-align: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
        border-bottom: none;
        border-top: 2px solid transparent;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .nav-link.active {
        border-bottom: none;
        border-top-color: var(--primary-color);
        background: var(--bg-secondary);
    }

    .main-container {
        padding-bottom: 70px; /* Space for fixed bottom nav */
    }

    .banner-ad {
        max-width: 100%;
        min-height: 60px;
        margin-bottom: 1rem;
    }

    .banner-ad .ad-content {
        font-size: 1rem;
    }

    .difficulty-selector {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .difficulty-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .game-area {
        padding: 1rem 0;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .game-controls {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .center-info {
        flex-direction: row;
        gap: 1.5rem;
        order: -1;
    }

    .control-group {
        justify-content: center;
    }

    .game-board-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .number-buttons {
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        grid-template-rows: 1fr;
        gap: 0.2rem;
    }

    .number-btn {
        width: 100% !important;
        height: 48px;
        font-size: 1.25rem;
        font-weight: 600;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .cell {
        font-size: 1.25rem;
        font-weight: 600;
    }

    .note {
        font-size: 0.55rem;
    }

    .timer-display {
        font-size: 1.125rem;
        font-weight: 600;
    }

    .mistakes-counter {
        font-size: 1rem;
        font-weight: 600;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }

    .control-btn svg {
        width: 16px;
        height: 16px;
    }

    .hint-counter {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }

    .overlay-content {
        padding: 1.5rem;
        margin: 1rem;
        max-width: 90%;
    }

    .overlay-content h2 {
        font-size: 1.75rem;
        font-weight: 700;
    }

    .overlay-content p {
        font-size: 1.125rem;
    }

    .action-btn {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        font-weight: 600;
        min-height: 48px;
    }

    .bottom-actions {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        --cell-size: 36px;
    }

    .sudoku-grid {
        width: calc(var(--cell-size) * 9 + 8px);
    }

    .header-content {
        padding: 0.5rem 0.75rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .number-pad {
        padding: 0 0.25rem;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .number-buttons {
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        grid-template-rows: 1fr;
        gap: 0.15rem;
        box-sizing: border-box;
    }

    .cell {
        font-size: 1.125rem;
        font-weight: 600;
    }

    .note {
        font-size: 0.5rem;
    }

    .number-btn {
        width: 100% !important;
        height: 44px;
        font-size: 1.125rem;
        font-weight: 600;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .difficulty-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        font-weight: 600;
        min-height: 44px;
    }

    .game-controls {
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .control-btn {
        width: 44px;
        height: 44px;
    }

    .control-btn svg {
        width: 18px;
        height: 18px;
    }

    .timer-display, .mistakes-counter {
        font-size: 1rem;
        font-weight: 600;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.5rem;
        font-weight: 700;
    }

    .stat-label {
        font-size: 0.875rem;
    }

    .page-title {
        font-size: 2rem;
        font-weight: 700;
    }

    .main-container {
        padding: 0.25rem;
        padding-bottom: 70px;
    }
}

/* Tab Navigation */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Learn Tab Styles */
.learn-container,
.stats-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header-with-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}

.stats-info-wrapper {
    position: relative;
    display: inline-flex;
}

.stats-info-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1rem;
    width: 280px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.stats-info-wrapper:hover .stats-info-tooltip {
    display: block;
}

.stats-info-tooltip strong {
    display: block;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stats-info-tooltip p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0.5rem 0;
}

.learn-section,
.stats-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Tutorial Cards */
.tutorial-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tutorial-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    transition: var(--transition);
}

.tutorial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.tutorial-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.tutorial-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.tutorial-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Technique Categories */
.technique-category {
    margin-bottom: 2rem;
}

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

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.technique-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.technique-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.technique-item h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.technique-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.technique-example {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.technique-visual {
    margin: 1rem 0;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    overflow-x: auto;
}

.technique-svg {
    max-width: 100%;
    height: auto;
    min-width: 300px;
}

@media (max-width: 768px) {
    .technique-visual {
        padding: 1rem;
        overflow-x: scroll;
    }

    .technique-svg {
        min-width: 320px;
    }
}

/* Strategy Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.tip-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.tip-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tip-card h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.tip-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Common Mistakes List */
.mistakes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mistake-item {
    display: flex;
    gap: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    align-items: flex-start;
}

.mistake-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.mistake-content h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.mistake-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Practice Buttons */
.practice-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.practice-btn {
    padding: 1rem 2rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.practice-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Statistics Tab Styles */

/* Records Grid */
.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.record-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.record-card.highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.record-card.highlight .record-label,
.record-card.highlight .record-value {
    color: white;
}

.record-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.record-icon {
    font-size: 2rem;
}

.record-content {
    flex: 1;
}

.record-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.record-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Progress Cards */
.progress-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.progress-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.progress-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.progress-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.progress-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Difficulty Stats */
.difficulty-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.difficulty-stat-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
}

.difficulty-stat-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.stat-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.stat-row span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.achievement-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    border: 2px solid var(--border-color);
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-color: #ffd700;
}

.achievement-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
    background: var(--bg-primary);
    cursor: pointer;
}

.achievement-card:hover .achievement-icon {
    filter: grayscale(0%) brightness(1.3);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: grayscale(100%);
    transition: all 0.3s ease;
    display: inline-block;
}

.achievement-card.unlocked .achievement-icon {
    filter: grayscale(0%);
}

.achievement-card h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.achievement-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.achievement-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.achievement-status.locked {
    background: var(--secondary-color);
    color: white;
}

.achievement-status.unlocked {
    background: var(--success-color);
    color: white;
}

/* Leveling System Styles */
.level-display {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 12px;
    color: white;
}

.level-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.level-number {
    font-size: 2.5rem;
    font-weight: 700;
}

.level-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.xp-info {
    flex: 1;
}

.xp-text {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.xp-bar-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    height: 30px;
    overflow: hidden;
}

.xp-bar {
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Daily Challenge Styles */
.daily-challenge-container {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.challenge-available,
.challenge-completed {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.challenge-difficulty,
.challenge-streak {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.challenge-btn {
    padding: 1rem 2rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.challenge-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Collections Grid */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.collection-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.collection-card.completed {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: var(--success-color);
}

.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.collection-card .collection-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.collection-card h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.collection-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: center;
}

.collection-progress {
    margin-top: 1rem;
}

.progress-bar-container {
    background: var(--bg-tertiary);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

.collection-reward {
    margin-top: 1rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

.collection-card.completed .collection-reward {
    color: var(--success-color);
}

/* Achievement Progress Bars */
.achievement-progress {
    margin: 1rem 0;
}

/* XP Notification */
.xp-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    text-align: center;
    animation: slideIn 0.5s ease;
}

.xp-gain {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.level-up {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
    animation: pulse 1s infinite;
}

.xp-notification.fade-out {
    animation: fadeOut 0.5s ease;
    opacity: 0;
}

/* Collection Complete Notification */
.collection-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    text-align: center;
    animation: slideIn 0.5s ease;
}

.collection-complete {
    text-align: center;
}

.collection-complete .collection-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.collection-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.collection-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.collection-reward {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

.collection-notification.fade-out {
    animation: fadeOut 0.5s ease;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

/* Endless Mode Notifications */
.endless-win-notification {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, 0);
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
    padding: 1.5rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    text-align: center;
    animation: slideInTop 0.5s ease;
}

.endless-win-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.endless-win-text {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.endless-win-count {
    font-size: 1rem;
    opacity: 0.9;
}

.endless-win-notification.fade-out {
    animation: fadeOut 0.5s ease;
    opacity: 0;
}

.endless-session-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    text-align: center;
    animation: slideIn 0.5s ease;
}

[data-theme="dark"] .endless-session-notification {
    background: var(--bg-primary);
}

.session-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.session-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.session-count {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.session-bonus {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.endless-session-notification.fade-out {
    animation: fadeOut 0.5s ease;
    opacity: 0;
}

@keyframes slideInTop {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Mode Activation Notifications */
.mode-activation-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    text-align: center;
    animation: slideIn 0.5s ease;
}

.mode-activation-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.mode-activation-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.mode-activation-message {
    font-size: 1rem;
    opacity: 0.95;
}

.mode-activation-notification.fade-out {
    animation: fadeOut 0.5s ease;
    opacity: 0;
}

.mode-deactivation-notification {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, 0);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--border-color);
    z-index: 2000;
    text-align: center;
    animation: slideInTop 0.5s ease;
}

[data-theme="dark"] .mode-deactivation-notification {
    background: var(--bg-secondary);
}

.mode-deactivation-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.mode-deactivation-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.mode-deactivation-notification.fade-out {
    animation: fadeOut 0.5s ease;
    opacity: 0;
}

/* Responsive for Learn & Stats */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.75rem;
    }

    .learn-section,
    .stats-section {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .tutorial-cards,
    .tips-grid,
    .records-grid,
    .progress-cards,
    .difficulty-stats,
    .achievements-grid,
    .collections-grid {
        grid-template-columns: 1fr;
    }

    .practice-buttons {
        flex-direction: column;
    }

    .practice-btn {
        width: 100%;
    }

    .level-display {
        flex-direction: column;
        text-align: center;
    }

    .xp-notification,
    .collection-notification,
    .mode-activation-notification {
        max-width: 90%;
        padding: 1.5rem;
    }

    .mode-tooltip {
        width: 200px;
        font-size: 0.8rem;
    }

    .game-modes {
        gap: 0.75rem;
    }

    .mode-toggle {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    .info-icon {
        font-size: 0.875rem;
    }
}
