* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.stats {
    display: flex;
    gap: 1rem;
}

.stat-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mystery-event-island {
    text-align: center;
    margin-bottom: 4rem;
}

.mystery-event-island h2 {
    font-weight: 300;
    margin-bottom: 1.5rem;
    color: #cbd5e1;
    font-size: 1.25rem;
}

.mystery-card {
    padding: 2rem;
    border-radius: 1rem;
    display: inline-block;
    min-width: 350px;
    max-width: 80%;
    border-top: 2px solid #38bdf8;
    animation: float 6s ease-in-out infinite;
}

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

#mystery-title {
    font-size: 1.5rem;
    font-weight: 500;
}

.mystery-desc {
    margin-top: 1rem;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 300;
}

/*
 * Safeguard: hide ALL date-badge elements inside the current-guess card.
 * This is the single source of truth — no matter what JS does,
 * the date will never leak while the player is guessing.
 */
.current-guess-card .date-badge {
    display: none !important;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-bottom: 4rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.2), transparent);
    z-index: 0;
}

.placement-slot {
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    margin: 0.5rem 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.placement-slot.visible {
    opacity: 1;
}

.insert-btn {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px dashed #38bdf8;
    padding: 0.75rem 2.5rem;
    border-radius: 9999px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.insert-btn:hover {
    transform: scale(1.05);
    background: #38bdf8;
    color: #0f172a;
    border-style: solid;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.anchor-card {
    width: 80%;
    max-width: 600px;
    padding: 1.5rem;
    margin: 0 auto;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.anchor-card:hover {
    transform: scale(1.02);
}

.anchor-date {
    background: #818cf8;
    color: white;
    padding: 0.3rem 1.25rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

.anchor-title {
    font-size: 1.4rem;
    text-align: center;
    font-weight: 700;
}

.anchor-desc {
    margin-top: 0.75rem;
    color: #94a3b8;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.5;
}

.feedback {
    margin-top: 1rem;
    font-weight: 700;
    min-height: 24px;
    font-size: 1.1rem;
}

.feedback.success { color: #4ade80; }

.game-over-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 3rem;
    border-radius: 1rem;
    text-align: center;
    z-index: 100;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #f87171;
    box-shadow: 0 0 50px rgba(248, 113, 113, 0.2);
}

.game-over-modal h2 {
    color: #f87171;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.game-over-modal p {
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
    color: #e2e8f0;
    line-height: 1.6;
}

.primary-btn {
    background: linear-gradient(to right, #818cf8, #c084fc);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 9999px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(129, 140, 248, 0.4);
}

/* ──────────────────────────────────────────────────────────────────────────
   Responsive Design (Mobile Optimization)
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .app-container {
        padding: 0.75rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
        text-align: center;
        align-items: center;
    }

    h1 {
        font-size: 1.75rem;
    }

    .stats {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .stat-box {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .mystery-event-island {
        margin-bottom: 2rem;
    }

    .mystery-event-island h2 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .mystery-card {
        padding: 1.25rem;
        min-width: unset;
        width: 100%;
        max-width: 100%;
    }

    #mystery-title {
        font-size: 1.25rem;
    }

    .mystery-desc {
        font-size: 0.9rem;
        margin-top: 0.75rem;
    }

    .timeline-container {
        padding-bottom: 2rem;
    }

    .placement-slot {
        height: 60px;
        margin: 0.25rem 0;
    }

    .insert-btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }

    .anchor-card {
        width: 100%;
        padding: 1rem;
    }

    .anchor-title {
        font-size: 1.1rem;
    }

    .anchor-desc {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }

    .anchor-date {
        font-size: 0.75rem;
        padding: 0.2rem 1rem;
        margin-bottom: 0.5rem;
    }

    .game-over-modal {
        width: 90%;
        padding: 2rem 1.5rem;
    }

    .game-over-modal h2 {
        font-size: 1.75rem;
    }

    .game-over-modal p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .primary-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}
