:root {
    --ocean-deep: #0c4a6e;
    --ocean-light: #0ea5e9;
    --sand: #fde047;
    --plastic: #e2e8f0;
    --text: #f8fafc;
    --card-bg: rgba(12, 74, 110, 0.85);
    --primary: #38bdf8;
    --radius: 12px;
}

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

body {
    background-color: #082f49;
    color: var(--text);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.water-container {
    width: 100%;
    max-width: 1000px;
    height: 100%;
    max-height: 700px;
    position: relative;
    background: linear-gradient(to bottom, #0ea5e9, #0c4a6e);
    border-radius: 16px;
    border: 4px solid rgba(255,255,255,0.1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    overflow: hidden;
}

/* Header */
.game-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
    z-index: 50;
    pointer-events: none;
}

.back-link {
    pointer-events: auto;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: 0.2s;
}
.back-link:hover { background: rgba(255,255,255,0.2); }

.score-display {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.best-score {
    font-size: 0.8rem;
    background: var(--sand);
    color: #854d0e;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Stage */
#game-stage {
    width: 100%;
    height: 100%;
    position: relative;
}

#ecoCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Quiz HUD */
#quiz-hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    z-index: 40;
}

.question-container {
    text-align: center;
}

#question-text {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.option-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: 0.2s;
}

.option-item span {
    background: var(--primary);
    color: #082f49;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.option-item p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
}

.option-item.correct { background: #22c55e; border-color: #22c55e; }
.option-item.wrong { background: #ef4444; border-color: #ef4444; }

/* Overlay */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 47, 73, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.overlay.hidden { display: none; }

.overlay-content {
    text-align: center;
    max-width: 450px;
    padding: 2rem;
}

#overlay-title {
    font-family: 'Outfit';
    font-size: 4rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

#overlay-desc {
    color: #cbd5e1;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.btn-ocean {
    background: var(--primary);
    color: #082f49;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.4rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.3);
}

.btn-ocean:hover {
    transform: scale(1.05) rotate(-2deg);
    background: #fff;
}

.instructions {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.instructions p {
    font-size: 0.9rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.instructions strong { color: var(--sand); }
