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

/* Geometry Dash-ish neon theme */
:root {
    --gd-cyan: #00e5ff;
    --gd-pink: #ff2d55;
    --gd-green: #7cff00;
    --gd-purple: #9b5cff;
    --gd-bg-1: #06030d;
    --gd-bg-2: #0b0820;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 229, 255, 0.25), transparent 35%),
        radial-gradient(circle at 80% 10%, rgba(255, 45, 85, 0.18), transparent 40%),
        repeating-linear-gradient(45deg,
            rgba(0, 229, 255, 0.14) 0px,
            rgba(0, 229, 255, 0.14) 10px,
            rgba(0, 0, 0, 0) 10px,
            rgba(0, 0, 0, 0) 22px
        ),
        linear-gradient(135deg, var(--gd-bg-2) 0%, var(--gd-bg-1) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: linear-gradient(180deg, rgba(12, 14, 28, 0.92) 0%, rgba(8, 9, 18, 0.92) 100%);
    border-radius: 20px;
    border: 3px solid rgba(0, 229, 255, 0.35);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.55),
        0 0 30px rgba(0, 229, 255, 0.12);
    max-width: 900px;
    width: 100%;
    padding: 30px;
    text-align: center;
    position: relative;
}

/* Neon grid overlay inside the main container */
.container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg, rgba(0, 229, 255, 0.06) 0px, rgba(0, 229, 255, 0.06) 1px, transparent 1px, transparent 24px),
        repeating-linear-gradient(0deg, rgba(255, 45, 85, 0.05) 0px, rgba(255, 45, 85, 0.05) 1px, transparent 1px, transparent 24px);
    mix-blend-mode: screen;
    opacity: 0.7;
}

.container > * {
    position: relative;
    z-index: 1;
}

header h1 {
    color: var(--gd-cyan);
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow:
        0 0 10px rgba(0, 229, 255, 0.6),
        0 0 22px rgba(255, 45, 85, 0.25);
    -webkit-text-stroke: 1px rgba(255, 45, 85, 0.25);
}

.menu h2 {
    color: #f4f6ff;
    margin-bottom: 30px;
    font-size: 1.8em;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.game-card {
    background:
        linear-gradient(135deg, rgba(0, 229, 255, 0.95) 0%, rgba(155, 92, 255, 0.95) 45%, rgba(255, 45, 85, 0.85) 100%);
    border: 3px solid rgba(124, 255, 0, 0.55);
    border-radius: 14px;
    padding: 25px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    color: white;
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.35),
        0 0 18px rgba(0, 229, 255, 0.18);
    clip-path: polygon(0% 0%, 100% 0%, 96% 100%, 4% 100%);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.45),
        0 0 26px rgba(0, 229, 255, 0.28);
}

.game-card:active {
    transform: translateY(-2px);
}

.game-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.game-card h3 {
    font-size: 1.2em;
    margin-bottom: 5px;
}

.game-card p {
    font-size: 0.9em;
    opacity: 0.9;
}

.game-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-screen.hidden {
    display: none;
}

.game-screen h2 {
    color: var(--gd-cyan);
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.instruction {
    color: #b9b9d4;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.score-display {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--gd-cyan);
    margin: 10px 0;
}

.game-info {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #f4f6ff;
    margin: 10px 0;
}

.game-stats-bar {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(10, 12, 24, 0.65);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 999px;
    padding: 6px 10px;
    color: #eaf4ff;
    font-weight: 800;
    backdrop-filter: blur(6px);
}
.game-like-btn {
    appearance: none;
    outline: none;
    border: 0;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.95), rgba(155, 92, 255, 0.95));
    color: #fff;
    box-shadow: 0 6px 12px rgba(255, 45, 85, 0.35);
    transition: transform 0.1s, filter 0.15s;
}
.game-like-btn:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.1); }
.game-like-btn:active { transform: translateY(0) scale(0.98); }
.game-like-btn.liked { background: linear-gradient(135deg, rgba(124,255,0,0.95), rgba(0,229,255,0.95)); box-shadow: 0 6px 16px rgba(124,255,0,0.35); }

.timer, .counter {
    padding: 10px 20px;
    background: rgba(18, 20, 40, 0.65);
    border: 1px solid rgba(0, 229, 255, 0.22);
    border-radius: 10px;
    color: #eaeaff;
}

.btn-primary, .btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.95) 0%, rgba(155, 92, 255, 0.95) 60%, rgba(255, 45, 85, 0.9) 100%);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.25);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #eaeaff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* NomNomNom embed */
.nom-wrapper {
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 180px);
    min-height: 520px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    position: relative;
}

.nom-stats {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(10, 12, 24, 0.65);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 999px;
    padding: 8px 12px;
    color: #eaf4ff;
    font-weight: 800;
    backdrop-filter: blur(6px);
}

.nom-stats-main {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.viewer-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    background: rgba(10, 12, 24, 0.65);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 999px;
    padding: 8px 12px;
    color: #eaf4ff;
    font-weight: 800;
    backdrop-filter: blur(6px);
}

.like-btn {
    appearance: none;
    outline: none;
    border: 0;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.95), rgba(155, 92, 255, 0.95));
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 45, 85, 0.35);
    transition: transform 0.1s, filter 0.15s;
}
.like-btn:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.1); }
.like-btn:active { transform: translateY(0) scale(0.98); }
.like-btn.liked { background: linear-gradient(135deg, rgba(124,255,0,0.95), rgba(0,229,255,0.95)); box-shadow: 0 6px 16px rgba(124,255,0,0.35); }

/* Perfect Circle */
#circle-canvas {
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: crosshair;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Check-limpics */
#checkbox-container {
    position: relative;
    width: 600px;
    height: 400px;
    border: 3px solid #667eea;
    border-radius: 15px;
    background: #f9f9f9;
    margin: 20px 0;
}

.checkbox-item {
    position: absolute;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.2s;
}

.checkbox-item:hover {
    transform: scale(1.1);
}

.checkbox-item input[type="checkbox"] {
    width: 100%;
    height: 100%;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-item.checked {
    opacity: 0.5;
    pointer-events: none;
}

/* Clicker */
.clicker-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    margin: 20px 0;
}

.clicker-btn:hover {
    transform: scale(1.05);
}

.clicker-btn:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.clicker-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tricked */
.tricked-btn {
    padding: 0;
    width: 240px;
    height: 90px;
    border-radius: 18px;
    border: 4px solid rgba(0, 229, 255, 0.55);
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.95) 0%, rgba(155, 92, 255, 0.95) 60%, rgba(255, 45, 85, 0.9) 100%);
    color: white;
    font-size: 2em;
    font-weight: 950;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 26px rgba(0, 229, 255, 0.28);
}

.tricked-btn:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.1);
}

.tricked-btn:active {
    transform: translateY(0px) scale(0.99);
}

.tricked-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.tricked-btn.is-no {
    border-color: rgba(255, 45, 85, 0.7);
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.95) 0%, rgba(155, 92, 255, 0.95) 60%, rgba(0, 229, 255, 0.9) 100%);
}

/* Dig Dig Dig */
#dig-container {
    width: 100%;
    max-width: 600px;
    margin: 20px 0;
}

#earth-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    background: #8B4513;
    padding: 10px;
    border-radius: 10px;
}

.dig-cell {
    aspect-ratio: 1;
    background: #A0522D;
    border: 2px solid #654321;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.dig-cell:hover {
    background: #CD853F;
    transform: scale(1.05);
}

.dig-cell.dug {
    background: #D2B48C;
    cursor: default;
}

.dig-cell.treasure {
    background: #FFD700;
    animation: pulse 0.5s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Pi Game */
.pi-display {
    font-size: 1.5em;
    font-family: 'Courier New', monospace;
    background: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    min-height: 60px;
    word-break: break-all;
}

#pi-digits-display {
    /* Prevent copying the digits from the screen during the memorization phase. */
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

#pi-input {
    width: 100%;
    max-width: 500px;
    padding: 15px;
    font-size: 1.2em;
    border: 3px solid #667eea;
    border-radius: 10px;
    text-align: center;
    font-family: 'Courier New', monospace;
    margin: 10px 0;
}

#pi-input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

#pi-input:disabled {
    background: #e0e0e0;
    cursor: not-allowed;
}

/* Waste Time Game */
#waste-time-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 600px;
    border: 4px solid #667eea;
    border-radius: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#distraction-area {
    width: 100%;
    height: 100%;
    position: relative;
    background: transparent;
}

.distraction {
    position: absolute;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    font-size: 2em;
    z-index: 10;
    pointer-events: auto;
}

.distraction:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
}

.distraction.clickable {
    animation: bounce 0.5s ease-in-out infinite;
}

.distraction.popup {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    font-size: 1em;
    z-index: 1000;
    animation: popup 0.3s ease-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); }
}

@keyframes popup {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

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

.hidden {
    display: none !important;
}

/* Waste Time: Totem of Undying overlay */
#totem-overlay.totem-overlay {
    position: absolute;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    pointer-events: none; /* don't block distraction clicks */
}

.totem-image {
    width: min(420px, 70vw);
    height: auto;
    filter:
        drop-shadow(0 0 28px rgba(124, 255, 0, 0.55))
        drop-shadow(0 0 55px rgba(0, 229, 255, 0.35));
}

.totem-text {
    font-size: 2em;
    font-weight: 900;
    color: #eaffff;
    text-shadow:
        0 0 12px rgba(0, 229, 255, 0.35),
        0 0 30px rgba(255, 45, 85, 0.2);
}

/* Intentionally no shaking animation for the totem. */

#waste-time-result {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    z-index: 50;
    background: rgba(255, 255, 255, 0.65);
}

#waste-time-result.hidden {
    display: none;
}

@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #checkbox-container {
        width: 100%;
        max-width: 500px;
    }
    
    #earth-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}
