/* Zen Minimalist ChronoPulse CSS */
:root {
    --bg-dark: #07080d;
    --panel-bg: rgba(20, 22, 38, 0.7);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;

    /* Tailored Color System */
    --color-green: #10b981;
    --color-green-glow: rgba(16, 185, 129, 0.35);
    
    --color-red: #ef4444;
    --color-red-glow: rgba(239, 68, 68, 0.35);
    
    --color-accent: #6366f1;
    --color-accent-glow: rgba(99, 102, 241, 0.35);

    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-secondary);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

/* Background Gradients */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.12;
}

.orb-1 {
    top: 20%;
    left: 15%;
    width: 60vw;
    height: 60vw;
    background: var(--color-accent);
}

.orb-2 {
    bottom: 10%;
    right: 15%;
    width: 50vw;
    height: 50vw;
    background: var(--color-green);
}

/* Top Nav bar */
.top-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    z-index: 50;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    font-family: var(--font-primary);
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Zen Viewport (Centered Circle) */
.game-zen-viewport {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.minimal-stats-bar {
    display: flex;
    gap: 1.1rem;
    padding: 0;
    background: transparent;
    border: none;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    color: var(--text-muted);
    align-items: center;
    height: fit-content;
}

.minimal-stats-bar strong {
    color: var(--text-main);
}

.minimal-stats-bar .divider {
    color: var(--color-accent);
    opacity: 0.7;
}

/* The Perfect Circular Trigger Button */
.reaction-circle {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: none;
    outline: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.reaction-circle:disabled {
    cursor: not-allowed;
}

.circle-inner {
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border-radius: 50%;
    background: rgba(10, 11, 18, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.btn-text {
    font-family: var(--font-primary);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-main);
    z-index: 5;
    pointer-events: none;
    user-select: none;
}

/* Interactive States */
.state-idle {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 15px rgba(255,255,255,0.05);
}

.state-idle .btn-text {
    color: var(--text-muted);
}

.state-wait {
    background: linear-gradient(135deg, #0d1117 0%, #05070a 100%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.state-wait .btn-text {
    color: var(--text-muted);
    opacity: 0.3;
}

.state-green {
    background: linear-gradient(135deg, var(--color-green) 0%, #34d399 100%);
    box-shadow: 0 0 45px var(--color-green-glow);
    animation: pulseCircle 1.2s infinite alternate;
}

.state-green .circle-inner {
    background: rgba(16, 185, 129, 0.1);
}

.state-green .btn-text {
    color: #fff;
    text-shadow: 0 0 10px var(--color-green-glow);
}

.state-red {
    background: linear-gradient(135deg, var(--color-red) 0%, #f87171 100%);
    box-shadow: 0 0 45px var(--color-red-glow);
}

.state-red .circle-inner {
    background: rgba(239, 68, 68, 0.1);
}

.state-red .btn-text {
    color: #fff;
    text-shadow: 0 0 10px var(--color-red-glow);
}

@keyframes pulseCircle {
    0% { transform: scale(1); box-shadow: 0 0 35px var(--color-green-glow); }
    100% { transform: scale(1.04); box-shadow: 0 0 55px rgba(16, 185, 129, 0.5); }
}

/* Micro-animations feedback */
.correct-flash {
    animation: correctFlash 0.3s ease-out;
}

@keyframes correctFlash {
    0% { box-shadow: 0 0 0 0px rgba(16, 185, 129, 0.8); }
    100% { box-shadow: 0 0 0 40px rgba(16, 185, 129, 0); }
}

.incorrect-shake {
    animation: incorrectShake 0.4s ease-in-out;
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-12px); }
    30%, 60%, 90% { transform: translateX(12px); }
}

/* Ripple Touch Effect */
.btn-ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.4s linear;
    pointer-events: none;
    z-index: 1;
}

@keyframes ripple {
    to {
        transform: scale(3.5);
        opacity: 0;
    }
}

/* Drawer Menu (Slide-out) */
.stats-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100%;
    background: rgba(13, 14, 25, 0.95);
    border-left: 1px solid var(--border-subtle);
    z-index: 100;
    padding: 2rem;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    backdrop-filter: blur(20px);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-drawer.open {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    color: var(--text-main);
}

.drawer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.stat-row span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-row strong {
    font-family: var(--font-primary);
    font-size: 1rem;
}

/* Overlays / Screens Modals */
.screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 8, 13, 0.97);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 80;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
}

.screen-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.overlay-modal {
    background: var(--panel-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 440px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen-overlay.active .overlay-modal {
    transform: scale(1);
}

/* Stats Drawer Sections */
.stats-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.stats-section h4 {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.25rem;
    text-align: left;
}

/* Circle Intro Transitions */
.scale-in-circle {
    animation: scaleInCircle 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleInCircle {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.overlay-modal h2 {
    font-family: var(--font-primary);
    font-size: 1.75rem;
    font-weight: 700;
}

.overlay-modal p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.rule-hint {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    width: 100%;
}

.green-text { color: var(--color-green); }
.red-text { color: var(--color-red); }

.pulsing-heart {
    font-size: 3.5rem;
    animation: heartBeat 2s infinite ease-in-out;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0px var(--color-accent-glow)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 15px var(--color-accent-glow)); }
}

.trophy-icon {
    font-size: 3.5rem;
    animation: floatingTrophy 3s infinite ease-in-out;
}

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

/* Scoreboard */
.scoreboard {
    display: flex;
    width: 100%;
    gap: 0.75rem;
    margin: 0.5rem 0 1.2rem 0;
}

.score-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.score-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.score-value {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Action Buttons inside Modals */
.menu-action-btn {
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 0.85rem 2.2rem;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px var(--color-accent-glow);
    width: 100%;
}

.menu-action-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

/* Footer Signature */
.zen-footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.6;
    letter-spacing: 1.2px;
    z-index: 10;
}

/* Responsiveness */
@media (max-width: 480px) {
    .reaction-circle {
        width: 220px;
        height: 220px;
    }
    .btn-text {
        font-size: 1.85rem;
    }
    .stats-drawer {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 360px) {
    .top-nav {
        padding: 0.75rem;
    }
    .minimal-stats-bar {
        gap: 0.45rem;
        padding: 0.3rem 0.65rem;
        font-size: 0.7rem;
    }
    .icon-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    .reaction-circle {
        width: 170px;
        height: 170px;
    }
    .btn-text {
        font-size: 1.40rem;
    }
    .overlay-modal {
        padding: 1.5rem;
        gap: 1rem;
    }
    .scoreboard {
        gap: 0.4rem;
    }
    .score-card {
        padding: 0.5rem;
    }
    .score-value {
        font-size: 0.95rem;
    }
    .zen-footer {
        padding: 1rem;
        font-size: 0.7rem;
    }
}
