.notification {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%) scale(1);
    min-width: 260px;
    max-width: 90vw;
    background: linear-gradient(135deg, #232a23 60%, #1a1a1a 100%);
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(34,197,94,0.18), 0 2px 8px #22c55e30;
    border: 2.5px solid #22c55e60;
    padding: 18px 32px 16px 22px;
    font-size: 1.13rem;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(.4,2,.6,1), transform 0.35s cubic-bezier(.4,2,.6,1);
}
.notification.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1.04);
    animation: notif-pop 0.35s cubic-bezier(.4,2,.6,1);
}
.notification.success {
    border-color: #22c55e;
    background: linear-gradient(135deg, #1e2e1e 60%, #1a1a1a 100%);
}
.notification.warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #2e261e 60%, #1a1a1a 100%);
}
.notification.error {
    border-color: #ef4444;
    background: linear-gradient(135deg, #2e1e1e 60%, #1a1a1a 100%);
}
.notif-icon {
    font-size: 1.5em;
    margin-right: 8px;
    filter: drop-shadow(0 1px 2px #0008);
}
.notif-message {
    flex: 1;
    word-break: break-word;
}
@keyframes notif-pop {
    0% { transform: translateX(-50%) scale(0.85); opacity: 0; }
    80% { transform: translateX(-50%) scale(1.08); opacity: 1; }
    100% { transform: translateX(-50%) scale(1.04); opacity: 1; }
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
}

/* Authentication Panel */
.auth-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.auth-button.profile-btn {
    background: linear-gradient(45deg, #8b5cf6, #a855f7);
    font-size: 0.85rem;
    padding: 8px 16px;
}

.auth-button.profile-btn:hover {
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid #333;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #22c55e;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.user-status {
    font-size: 0.7rem;
    color: #888;
    line-height: 1;
}

.auth-button {
    background: linear-gradient(45deg, #4285f4, #34a853);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.auth-button.sign-out {
    background: linear-gradient(45deg, #dc2626, #ef4444);
}

.auth-button.sign-out:hover {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.anonymous-notice {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #f59e0b;
    color: #fbbf24;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
    margin: 20px auto;
    max-width: 500px;
}

@media (max-width: 768px) {
    .auth-panel {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .auth-status {
        flex-direction: column;
        text-align: center;
        order: 1;
    }

    .auth-buttons {
        order: 2;
        margin-top: 10px;
    }
}

.logo {
    font-size: 7rem;
    font-weight: bold;
    background: linear-gradient(45deg, #06b6d4, #22c55e, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    text-shadow: 0 0 1px rgba(6, 182, 212, 0.3), 0 0 4px rgba(34, 197, 94, 0.2);
    filter: drop-shadow(0 0 1px rgba(6, 182, 212, 0.4)) drop-shadow(0 0 10px rgba(34, 197, 94, 0.3));
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.4)) drop-shadow(0 0 20px rgba(34, 197, 94, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 15px rgba(6, 182, 212, 0.6)) drop-shadow(0 0 30px rgba(34, 197, 94, 0.5));
    }
}

.subtitle {
    font-size: 1.3rem;
    color: #22c55e;
    margin-bottom: 8px;
    text-shadow: 0 0 1px rgba(34, 197, 94, 0.6), 0 0 20px rgba(34, 197, 94, 0.4), 0 0 30px rgba(34, 197, 94, 0.2);
    filter: drop-shadow(0 0 1px rgba(34, 197, 94, 0.5));
}

.description {
    font-size: 1.5rem;
    color: #ccc;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 5fr 0.5fr;
    gap: 20px;
    align-items: start;
    max-width: none; /* Remove max-width to allow full width */
    margin: 0; /* Remove auto margin to stretch to edges */
    padding: 20px 0; /* Remove horizontal padding */
}

/* Left Panel: How to Play */
.how-to-sidebar {
    position: sticky;      /* makes it stick once you scroll past it */
    top: 20px;             /* distance from top of viewport when sticky */

    background: #18181b;
    border-radius: 12px;
    padding: 20px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.how-to-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #22d3ee;
}


.how-to-sidebar ul {
    padding-left: 18px;
    color: #b3e5fc;
    font-size: 0.95rem;
    line-height: 1.6;
}

.how-to-step {
    margin-bottom: 6px;
    padding-left: 14px;
    position: relative;
    color: #ccc;
    font-size: 0.8rem;
    line-height: 1.3;
}

.how-to-step::before {
    content: "•";
    color: #22c55e;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Center Panel - Game Options */
.game-panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
}

.panel-title {
    font-size: 1.5rem;
    margin-bottom: 18px;
    color: #fff;
    text-align: center;
}

.game-modes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.game-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    outline: none;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.game-option:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.game-option:focus:not(:hover) {
    transform: none;
}

.game-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
}

.start-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 15px rgba(34, 197, 94, 0.3);
}

.start-button:active {
    transform: translateY(0);
}

/* Game mode specific styling */
.game-option#classicMode {
    background: rgba(26, 46, 26, 0.3);
    border-color: #166534;
}

.game-option#classicMode:hover {
    background: rgba(26, 46, 26, 0.5);
    border-color: #22c55e;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
}

.game-option#practiceMode {
    background: rgba(75, 75, 75, 0.3);
    border-color: #6b7280;
}

.game-option#practiceMode:hover {
    background: rgba(75, 75, 75, 0.5);
    border-color: #9ca3af;
    box-shadow: 0 4px 20px rgba(156, 163, 175, 0.2);
}

.game-option#hardMode {
    background: rgba(46, 26, 26, 0.3);
    border-color: #991b1b;
}

.game-option#hardMode:hover {
    background: rgba(46, 26, 26, 0.5);
    border-color: #ef4444;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.game-option#timeTrialMode {
    background: rgba(26, 26, 26, 0.3);
    border-color: #374151;
}

.game-option#timeTrialMode:hover {
    background: rgba(26, 26, 26, 0.5);
    border-color: #6b7280;
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.2);
}

.game-option#quickMode {
    background: rgba(46, 46, 26, 0.3);
    border-color: #a16207;
}

.game-option#quickMode:hover {
    background: rgba(46, 46, 26, 0.5);
    border-color: #f59e0b;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

.game-option#marathonMode {
    background: rgba(26, 46, 46, 0.3);
    border-color: #155e75;
}

.game-option#marathonMode:hover {
    background: rgba(26, 46, 46, 0.5);
    border-color: #0891b2;
    box-shadow: 0 4px 20px rgba(8, 145, 178, 0.2);
}

.game-option#survivalMode {
    background: rgba(46, 42, 26, 0.3);
    border-color: #c2410c;
}

.game-option#survivalMode:hover {
    background: rgba(46, 42, 26, 0.5);
    border-color: #ea580c;
    box-shadow: 0 4px 20px rgba(234, 88, 12, 0.2);
}

.game-option#practiceMode:hover {
    border-color: #ffffff;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.2);
}

.option-title {
    font-size: 1.05rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #22c55e;
}

.option-description {
    color: #ccc;
    font-size: 0.8rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.option-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: #888;
    flex-wrap: wrap;
    gap: 6px;
}

.option-stats {
    flex: 1;
    min-width: 0;
}

.start-button {
    background: linear-gradient(45deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Right Panel - Daily Scores */
.daily-scores-panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
    max-height: 85vh;
    overflow-y: auto;
}

.stats-section {
    margin-bottom: 20px;
}

.stats-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #22c55e;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #333;
    font-size: 0.85rem;
}

.stat-item:last-child {
    border-bottom: none;
}

.how-to-play {
    margin-top: 20px;
}

.how-to-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #3b82f6;
}

.how-to-step {
    margin-bottom: 6px;
    padding-left: 14px;
    position: relative;
    color: #ccc;
    font-size: 0.8rem;
    line-height: 1.3;
}

.how-to-step::before {
    content: "•";
    color: #22c55e;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Footer */
.footer {
    text-align: center;
    padding: 25px 20px;
    color: #666;
    border-top: 1px solid #333;
    margin-top: 30px;
    font-size: 0.9rem;
}

/* Navigation */
.nav-section {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #333;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.nav-links a {
    color: #bbb;
    text-decoration: none;
    font-size: 0.9rem;
    position: relative;
    padding: 5px 10px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #22c55e;
}

.nav-links a.active {
    color: #22c55e;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr 2fr 1fr;
        gap: 16px;
        max-width: none;
        margin: 0;
        padding: 20px 0;
    }

    .game-modes-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: none;
        margin: 0;
        padding: 20px 0;
    }

    .logo {
        font-size: 3.25rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .game-modes-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-panel, .info-panel {
    animation: fadeInUp 0.6s ease-out;
}

.info-panel {
    animation-delay: 0.2s;
}

/* Username Modal Styles */
.username-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.username-modal-content {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.username-modal h3 {
    color: #22c55e;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.username-modal p {
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.4;
}

.username-modal input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #333;
    border-radius: 8px;
    background: #2a2a2a;
    color: white;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s;
}

.username-modal input:focus {
    border-color: #22c55e;
}

.username-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.username-modal button {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.username-modal .btn-primary {
    background: #22c55e;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.username-modal .btn-primary:hover {
    background: #16a34a;
}

.username-modal .btn-primary:disabled {
    background: #666;
    cursor: not-allowed;
}

.username-modal .btn-secondary {
    background: #666;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.username-modal .btn-secondary:hover {
    background: #555;
}

.username-note {
    font-size: 0.85rem;
    color: #888;
    margin-top: 15px;
    margin-bottom: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse animation for Expert Mode */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
}

/* Expert Mode card pulse animation */
@keyframes expertCardPulse {
    0%, 100% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.4), inset 0 0 20px rgba(139, 92, 246, 0.1);
        border-color: rgba(139, 92, 246, 0.6);
    }
    50% {
        box-shadow: 0 0 60px rgba(139, 92, 246, 0.6), inset 0 0 30px rgba(139, 92, 246, 0.2);
        border-color: rgba(139, 92, 246, 0.8);
    }
}

/* Expert Mode card styling */
.expert-mode-card {
    position: relative;
    overflow: hidden;
}

.expert-mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(139, 92, 246, 0.05), rgba(168, 85, 247, 0.05));
    animation: expertShimmer 3s infinite;
    pointer-events: none;
}

@keyframes expertShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}