/* ═══════════════════════════════════════════════════════════════
   BASE — reset, body, back-link, container, headings,
   decorative clouds, focus ring, reduced motion, utilities
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Body ── */
body {
    font-family: system-ui, "Segoe UI", "Helvetica Neue", sans-serif;
    background: linear-gradient(180deg,
        var(--sky-top) 0%,
        var(--sky-mid) 35%,
        var(--grass) 75%,
        var(--grass-deep) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    padding: 16px;
    position: relative;
    overflow-x: hidden;
}

/* ── Decorative clouds ── */
body::before,
body::after {
    content: "";
    position: fixed;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 180px;
    height: 60px;
    top: 8%;
    left: 6%;
    box-shadow:
        30px -18px 0 10px rgba(255, 255, 255, 0.5),
        60px 6px 0 18px rgba(255, 255, 255, 0.4),
        -20px 12px 0 6px rgba(255, 255, 255, 0.35);
}

body::after {
    width: 140px;
    height: 50px;
    top: 14%;
    right: 8%;
    box-shadow:
        -24px -14px 0 8px rgba(255, 255, 255, 0.45),
        20px 8px 0 14px rgba(255, 255, 255, 0.35);
}

/* ── Back-to-games link ── */
.back-link {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: rgba(90, 74, 58, 0.65);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(90, 74, 58, 0.12);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.18s ease;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    line-height: 1.4;
}

.back-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(90, 74, 58, 0.25);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.back-link:active {
    transform: scale(0.96);
}

.back-link .back-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* ── Container ── */
.container {
    background: var(--card);
    border: 3px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px 28px;
    width: 480px;
    max-width: 95vw;
    box-shadow:
        var(--shadow),
        0 0 0 10px rgba(255, 255, 255, 0.5);
    text-align: center;
    position: relative;
    z-index: 1;
}

/* ── Headings ── */
h1 {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
    color: var(--accent);
    text-transform: uppercase;
    text-shadow: 2px 2px 0 var(--accent-soft);
}

.subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ── Focus ring (shared) ── */
.btn:focus-visible,
.chip:focus-visible,
.step-btn:focus-visible,
.ans-btn:focus-visible,
.back-link:focus-visible,
.home-btn:focus-visible,
.key:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

.word-input:focus-visible {
    outline: none;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .result-overlay,
    .result-card,
    .chip,
    .step-btn,
    .ans-btn,
    .btn,
    .mascot-area,
    .hangman-area svg *,
    .letter-slot,
    .key,
    .game-card,
    .play-btn {
        animation: none !important;
        transition: none !important;
    }
}

/* ── Utilities ── */
.hidden {
    display: none !important;
}

/* ── Responsive (shared) ── */
@media (max-width: 440px) {
    .container {
        padding: 24px 18px 20px;
    }
    h1 {
        font-size: 2rem;
    }
}
