/* ============================================================
   MEMORY MASH — BASE DESIGN SYSTEM
   Vibrant green & white educational theme
============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --bg:           #020d06;
    --surface:      rgba(255,255,255,0.07);
    --surface-2:    rgba(255,255,255,0.13);
    --border:       rgba(255,255,255,0.13);
    --border-glow:  rgba(34,197,94,0.45);

    --green:        #22C55E;
    --green-dk:     #16A34A;
    --green-lt:     #4ADE80;
    --green-neon:   #00FF7F;
    --yellow:       #FDE047;
    --yellow-dk:    #CA8A04;
    --red:          #F43F5E;
    --red-dk:       #BE123C;
    --teal:         #2DD4BF;
    --teal-dk:      #0D9488;
    --danger:       #F87171;

    --text:         #FFFFFF;
    --text-muted:   rgba(255,255,255,0.6);
    --text-dim:     rgba(255,255,255,0.35);

    --radius:       16px;
    --radius-sm:    10px;
    --radius-xs:    6px;
    --shadow:       0 8px 32px rgba(0,0,0,0.55);
    --glow-green:   0 0 30px rgba(34,197,94,0.4);
    --glow-red:     0 0 30px rgba(244,63,94,0.4);
    --glow-yellow:  0 0 24px rgba(253,224,71,0.35);
}

/* ── Reset ────────────────────────────────────────────────── */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { height:100%; }
body {
    font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    position: relative;
}

/* ── Animated aurora background ───────────────────────────── */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.aurora::before {
    content: '';
    position: absolute;
    width: max(600px, 60vw);
    height: max(600px, 60vw);
    background: radial-gradient(circle, rgba(22,163,74,0.38) 0%, transparent 65%);
    top: -25%;
    left: -15%;
    animation: auroraA 14s ease-in-out infinite alternate;
}
.aurora::after {
    content: '';
    position: absolute;
    width: max(500px, 50vw);
    height: max(500px, 50vw);
    background: radial-gradient(circle, rgba(74,222,128,0.22) 0%, transparent 65%);
    bottom: -20%;
    right: -10%;
    animation: auroraB 11s ease-in-out infinite alternate;
}
.aurora-mid {
    position: absolute;
    width: max(400px, 40vw);
    height: max(400px, 40vw);
    background: radial-gradient(circle, rgba(253,224,71,0.12) 0%, transparent 65%);
    top: 40%;
    left: 55%;
    animation: auroraC 18s ease-in-out infinite alternate;
}

@keyframes auroraA { to { transform: translate(8vw, 10vh) scale(1.1); } }
@keyframes auroraB { to { transform: translate(-6vw, -8vh) scale(0.92); } }
@keyframes auroraC { to { transform: translate(-10vw, 5vh) scale(1.15); } }

/* All page content sits above aurora */
.page-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ── Typography ───────────────────────────────────────────── */
h1,h2,h3,h4 { font-weight: 900; line-height: 1.15; }
p            { line-height: 1.55; }

.gradient-text {
    background: linear-gradient(135deg, #4ADE80 0%, #FDE047 50%, #2DD4BF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Buttons ──────────────────────────────────────────────── */
button {
    font-family: inherit;
    font-weight: 800;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.15s;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
button:active { transform: scale(0.96) !important; }

.btn-purple {
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: #fff;
    box-shadow: 0 6px 24px rgba(34,197,94,0.45);
}
.btn-purple:hover { box-shadow: 0 8px 32px rgba(34,197,94,0.65); transform: translateY(-2px); }

.btn-pink {
    background: linear-gradient(135deg, #F43F5E, #BE123C);
    color: #fff;
    box-shadow: 0 6px 24px rgba(244,63,94,0.4);
}
.btn-pink:hover { box-shadow: 0 8px 32px rgba(244,63,94,0.6); transform: translateY(-2px); }

.btn-cyan {
    background: linear-gradient(135deg, #2DD4BF, #0D9488);
    color: #021a0a;
    box-shadow: 0 6px 24px rgba(45,212,191,0.35);
}
.btn-cyan:hover { box-shadow: 0 8px 32px rgba(45,212,191,0.55); transform: translateY(-2px); }

.btn-gold {
    background: linear-gradient(135deg, #FDE047, #CA8A04);
    color: #1a2e0a;
    box-shadow: 0 6px 24px rgba(253,224,71,0.35);
}
.btn-gold:hover { box-shadow: 0 8px 32px rgba(253,224,71,0.55); transform: translateY(-2px); }

.btn-glass {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-glass:hover { background: var(--surface-2); transform: translateY(-2px); }

.btn-teal {
    background: linear-gradient(135deg, #2DD4BF, #0D9488);
    color: #fff;
    box-shadow: 0 6px 24px rgba(45,212,191,0.4);
}
.btn-teal:hover { box-shadow: 0 8px 32px rgba(45,212,191,0.6); transform: translateY(-2px); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }

/* ── Cards / Panels ───────────────────────────────────────── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.panel-glow {
    box-shadow: var(--glow-green);
}

/* ── Inputs ───────────────────────────────────────────────── */
input[type="text"],
select,
textarea {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
    padding: 13px 16px;
    background: rgba(0,0,0,0.35);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--green-lt);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
select option { background: #0a2e10; color: var(--text); }
select optgroup { background: #061a09; color: var(--text-muted); font-style: normal; }

/* Select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='rgba(74,222,128,0.7)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ── Page header (inner pages) ────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(2,13,6,0.95) 0%, transparent 100%);
    backdrop-filter: blur(8px);
    margin-bottom: 6px;
}
.page-header-text h1 { font-size: 1.5rem; }
.page-header-text p  { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.back-btn {
    padding: 9px 16px;
    font-size: 0.88rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
}
.back-btn:hover { color: var(--text); background: var(--surface-2); }

/* ── Container ────────────────────────────────────────────── */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 18px 90px;
}

/* ── Section headings ─────────────────────────────────────── */
.section-title {
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--green-lt);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Ad containers ────────────────────────────────────────── */

/* Inline banner wrapper — shows a visible placeholder until AdSense loads */
.ad-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Visible dev placeholder */
    background: rgba(0,0,0,0.35);
    border: 1px dashed rgba(255,255,255,0.12);
}
/* "ADVERTISEMENT · 728×90" dev label — hidden once real ad fills the space */
.ad-wrap::before {
    content: 'AD SPACE · BANNER';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.18);
    pointer-events: none;
}
.ad-label {
    position: absolute;
    top: 4px; left: 8px;
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.25);
    pointer-events: none;
}

/* ── Fixed bottom sticky banner ───────────────────────────── */
/* 320×50 mobile banner — the safest, least-intrusive AdSense placement */
.bottom-ad-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 900;
    background: rgba(2,13,6,0.97);
    border-top: 1px solid var(--border);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: env(safe-area-inset-bottom);
}
/* Dev placeholder for bottom bar */
.bottom-ad-bar::before {
    content: 'BOTTOM BANNER AD · 320×50';
    position: absolute;
    font-size: 0.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.2);
    pointer-events: none;
}

/* ── Modals ───────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 800;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(6px);
}
.modal-box {
    background: linear-gradient(155deg, #031a08 0%, #020d06 100%);
    border: 1px solid var(--border-glow);
    border-radius: 22px;
    padding: 32px 26px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 0 60px rgba(34,197,94,0.2), 0 24px 60px rgba(0,0,0,0.6);
}
.modal-icon { font-size: 3.2rem; display: block; margin-bottom: 14px; }
.modal-box h2 { font-size: 1.65rem; margin-bottom: 10px; }
.modal-box p  { color: var(--text-muted); font-size: 0.93rem; line-height: 1.5; }

.modal-close-btn {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-size: 1rem;
    border-radius: 50px;
}


/* ── Utility classes ──────────────────────────────────────── */
.text-center { text-align: center; }
.mt-sm  { margin-top: 10px; }
.mt-md  { margin-top: 20px; }
.mt-lg  { margin-top: 32px; }
.mb-sm  { margin-bottom: 10px; }
.mb-md  { margin-bottom: 20px; }
.gap-sm { gap: 10px; }
.gap-md { gap: 16px; }
.flex   { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.w-full { width: 100%; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .container { padding: 12px 14px 90px; }
    .page-header { padding: 12px 14px 0; }
    .modal-box { padding: 26px 20px; }
}

/* ── Google Fonts import (fallback to system if offline) ──── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');
