/* =========================================
   GLOBAL RESET
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }

body {
    background: #1a1a1a;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Nunito', sans-serif;
    overflow: hidden;
    color: white;
}

.hidden { display: none !important; }

/* =========================================
   PHASE 1: COUNTDOWN STYLES
   ========================================= */
#countdown-container {
    text-align: center;
    z-index: 100;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}

.timer-box h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: #ff6b81;
    margin-bottom: 10px; /* Adjusted margin */
    text-shadow: 0 0 10px rgba(255, 107, 129, 0.5);
}

#timer {
    font-size: 3.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    padding: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    background: rgba(0,0,0,0.3);
    min-width: 300px;
    margin-bottom: 10px; /* Added margin below timer */
}

/* New Subtitle Style */
#timer-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

#instruction-text {
    margin-top: 10px;
    font-size: 1.2rem;
    color: #ffd700;
    animation: blink 0.8s infinite;
}

/* SECRET FOOTER STYLING */
#secret-footer {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    cursor: default;
    letter-spacing: 1px;
    z-index: 200;
    transition: color 0.3s;
}
#secret-footer:hover { color: rgba(255, 255, 255, 0.3); }

@keyframes blink { 50% { opacity: 0.3; } }

/* Flying Emojis */
#hype-emojis span {
    position: absolute;
    font-size: 3rem;
    animation: hypeFly 2s linear infinite;
    pointer-events: none;
}
@keyframes hypeFly {
    0% { transform: translateY(100vh) scale(0.5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

/* =========================================
   PHASE 3: GAME STYLES
   ========================================= */
#game-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: hidden; }
.floating-bg span { position: absolute; bottom: -50px; font-size: 40px; animation: floatUp 15s linear infinite; opacity: 0.6; }
.floating-bg span:nth-child(1) { left: 10%; animation-duration: 12s; }
.floating-bg span:nth-child(2) { left: 30%; animation-duration: 15s; }
.floating-bg span:nth-child(3) { left: 70%; animation-duration: 10s; }
.floating-bg span:nth-child(4) { left: 50%; animation-duration: 18s; }
@keyframes floatUp { 0% { transform: translateY(0) rotate(0deg); opacity: 0.6; } 100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; } }

#main-container {
    width: 95%; max-width: 450px; background: rgba(255, 255, 255, 0.95);
    padding: 30px; border-radius: 30px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center; position: relative; z-index: 10;
    max-height: 90vh; overflow-y: auto; border: 4px solid #fff;
    color: #333;
}
#main-container::-webkit-scrollbar { display: none; }

h1 { font-family: 'Fredoka One', cursive; color: #ff6b81; font-size: 2.2rem; margin-bottom: 15px; }
p { color: #555; font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }
input { padding: 15px; border-radius: 15px; border: 3px solid #eee; width: 100%; margin-bottom: 15px; font-size: 1.1rem; text-align: center; outline: none; color: #333; }
input:focus { border-color: #ff6b81; }
button { background: #ff6b81; color: white; border: none; padding: 15px 40px; border-radius: 50px; font-size: 1.2rem; font-family: 'Fredoka One', cursive; cursor: pointer; width: 100%; box-shadow: 0 4px 0 #d63031; transition: transform 0.1s;}
button:active { transform: translateY(4px); box-shadow: none; }

.memory-photo { width: 100%; height: auto; border-radius: 15px; margin-bottom: 20px; border: 4px solid #fff; box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.error-msg { color: red; font-weight: bold; margin-top: 10px; display: none; }

#hug-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 2000; display: flex; justify-content: center; align-items: center; animation: fadeIn 0.5s; }
.hug-content { text-align: center; color: white; }
.hug-content img { max-width: 90%; max-height: 300px; border-radius: 20px; border: 5px solid white; margin-bottom: 15px; }
.hug-content h2 { font-family: 'Fredoka One', cursive; font-size: 1.8rem; }

.bounce-in { animation: bounceIn 0.8s; }
.fade-in { animation: fadeIn 1s; }
.shake { animation: shake 0.5s; }
@keyframes bounceIn { 0% { opacity: 0; transform: scale(0.3); } 50% { opacity: 1; transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }