/* App typography is self-hosted NeverMind only. */

@import url('https://fonts.googleapis.com/css2?family=Nevermind:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary: #6366f1;
    --success: #22c55e;
    --danger: #ef4444;
    --fire: #f97316;
    --font-nevermind: 'Nevermind', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* shared "Break the Field" spice palette — teal, coral, violet, amber */
    --ec-teal: #0AB6B2;
    --ec-coral: #F4604B;
    --ec-violet: #7C5CFC;
    --ec-amber: #E08A00;
    --ec-grad: linear-gradient(110deg, #0AB6B2 0%, #09C0A1 30%, #F4604B 68%, #7C5CFC 100%);
}

#emoji-charades-app .hidden {
    display: none !important;
}

#game-body {
    font-family: var(--font-nevermind), var(--fh);
    background: radial-gradient(circle at top left, #f8fafc, #e2e8f0);
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    transition: background 0.5s ease, opacity 0.3s ease;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    /* Hide until the Tailwind Play CDN finishes compiling utility classes at
       runtime, so the first load never flashes unstyled markup. Revealed by JS. */
    opacity: 0;
}

#game-body.tt-ready {
    opacity: 1;
}

#emoji-charades-app {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.25rem;
    font-family: var(--font-nevermind);
}

@media (min-width: 768px) {
    #emoji-charades-app {
        padding: 2rem;
    }
}

/* Short / mobile viewports: squeeze vertical rhythm so the whole game-screen
   fits in one frame without clipping the stats or the action button. */
@media (max-height: 760px) {
    #emoji-charades-app { padding: 0.75rem 1.25rem; }
    #emoji-charades-app #start-screen { padding-top: 1rem; padding-bottom: 1rem; }
    #emoji-charades-app #start-screen .text-7xl { font-size: 3rem; }
    #emoji-charades-app #emoji-display { padding-top: 0.75rem; padding-bottom: 0.75rem; }
}

.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    font-family: var(--font-nevermind);
    letter-spacing: -0.02em;
}

.emoji-container {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 5px 15px rgba(0,0,0,0.05);
    font-family: var(--font-nevermind);
    letter-spacing: 0.05em;
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.progress-fill {
    transition: width 0.1s linear;
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

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

.xp-popup {
    position: absolute;
    animation: xp-float 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    pointer-events: none;
    font-weight: 900;
    color: var(--primary);
    z-index: 100;
    text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

@keyframes xp-float {
    0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -40px) scale(1.2); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--x-offset)), -100px) scale(1); }
}

.fire-mode {
    box-shadow: 0 0 40px rgba(249, 115, 22, 0.3);
    border: 3px solid var(--fire) !important;
}

.fire-bg-active {
    background: radial-gradient(circle at top left, #fff7ed, #ffedd5) !important;
}

.results-scroll {
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.star-gold {
    color: #fbbf24;
    fill: #fbbf24;
}
.star-gray {
    color: #e2e8f0;
    fill: #e2e8f0;
}

/* ============================================================
   PALETTE SPICE LAYER — multi-colour accents (teal/coral/violet)
   layered over the indigo base for a more "game" feel.
   ============================================================ */
@keyframes ec-shimmer { to { background-position: 220% center; } }
@keyframes ec-cta-pulse {
    0%, 100% { box-shadow: 0 8px 22px rgba(10, 182, 178, 0.30); }
    50%      { box-shadow: 0 8px 30px rgba(124, 92, 252, 0.42); }
}

/* gradient, shimmering text (titles + big numbers) */
#emoji-charades-app .ec-grad-text,
#emoji-charades-app #stat-score,
#emoji-charades-app #final-score {
    background: var(--ec-grad);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--ec-teal);
    animation: ec-shimmer 6s linear infinite;
}

/* primary buttons -> 3-colour gradient with a living glow */
#emoji-charades-app .ec-cta {
    background: var(--ec-grad);
    background-size: 180% auto;
    color: #fff;
    border: 0;
    touch-action: manipulation;
    animation: ec-cta-pulse 2.4s ease-in-out infinite;
    transition: transform 0.12s ease, background-position 0.4s ease, box-shadow 0.2s ease;
}
#emoji-charades-app .ec-cta:hover {
    background-position: 100% center;
    transform: translateY(-2px);
}

/* timer / progress bar -> multi-colour sweep */
#emoji-charades-app #timer-progress {
    background: linear-gradient(90deg, var(--ec-teal), var(--ec-coral) 55%, var(--ec-violet));
}

@media (prefers-reduced-motion: reduce) {
    #emoji-charades-app .ec-grad-text,
    #emoji-charades-app #stat-score,
    #emoji-charades-app #final-score,
    #emoji-charades-app .ec-cta { animation: none; }
}
