/* Shared styles for Ellie's Games.
   Load before a game's own <style>, so the game can override anything here:
   <link rel="stylesheet" href="shared/kit.css?v=1">
   Bump ?v= in every game when this file changes (see CLAUDE.md). */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@keyframes bgShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ── Stars (filled in by kit.js) ── */
#stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--d) ease-in-out infinite var(--delay);
    opacity: 0;
}
@keyframes twinkle {
    0%, 100% { opacity: 0;   transform: scale(0.4); }
    50%       { opacity: 0.9; transform: scale(1);   }
}

/* ── Top bar: back + title ── */
.back-btn {
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 50px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    transition: background 0.2s;
    letter-spacing: 0.5px;
}
.back-btn:active { background: rgba(255,255,255,0.22); }
/* invisible spacer to balance the back button */
.top-spacer {
    flex-shrink: 0;
    width: 74px;
}

/* ── Buttons ── */
.new-game-btn {
    background: rgba(255,255,255,0.12);
    color: white;
    border: 2px solid rgba(255,255,255,0.28);
    border-radius: 50px;
    padding: 11px 32px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 1.5px;
    transition: all 0.2s;
}
.new-game-btn:active {
    transform: scale(0.94);
    background: rgba(255,255,255,0.22);
}
.play-again-btn {
    background: linear-gradient(135deg, #ffd700, #ff8800);
    color: #1a0033;
    border: none;
    border-radius: 50px;
    padding: 16px 40px;
    font-size: 1.15rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(255,140,0,0.5);
    letter-spacing: 1px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.play-again-btn:active {
    transform: scale(0.93);
    box-shadow: 0 3px 12px rgba(255,140,0,0.35);
}

/* ── Result overlay ── */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,0,20,0.80);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.overlay.show { opacity: 1; pointer-events: all; }

.result-card {
    background: linear-gradient(145deg, rgba(50,0,90,0.97), rgba(10,15,80,0.97));
    border: 2.5px solid rgba(255,215,0,0.55);
    border-radius: 30px;
    padding: 36px 28px 30px;
    text-align: center;
    max-width: 320px;
    width: 88%;
    box-shadow: 0 0 60px rgba(255,215,0,0.2), 0 24px 60px rgba(0,0,0,0.6);
    animation: cardIn 0.5s cubic-bezier(0.34, 1.5, 0.64, 1);
}
@keyframes cardIn {
    from { transform: scale(0.55) translateY(50px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);    opacity: 1; }
}
.result-big-emoji {
    font-size: 5rem;
    display: block;
    margin-bottom: 8px;
    animation: bounceIn 0.55s cubic-bezier(0.34, 1.6, 0.64, 1);
}
@keyframes bounceIn {
    from { transform: scale(0.3) rotate(-20deg); }
    to   { transform: scale(1)   rotate(0deg);   }
}
.result-title {
    font-size: 2rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255,215,0,0.7);
    margin-bottom: 6px;
}
.result-scores {
    font-size: 1rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 6px;
    line-height: 1.7;
}
.result-msg {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 26px;
}

/* ── Confetti (pieces added by Kit.confetti) ── */
.confetti-wrap {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99;
    overflow: hidden;
}
.cp {
    position: absolute;
    top: -14px;
    animation: fall var(--fd) ease-in var(--del) forwards;
}
@keyframes fall {
    0%   { transform: translateY(0)     rotate(0deg);   opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
