/* Echo — glowing Simon-style sequence memory. */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap");

:root{
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,*::before,*::after{ box-sizing: border-box; }
html,body{
  -webkit-tap-highlight-color: transparent; height:100%; }
body{
  margin:0; font-family:var(--font); color:#eaf0ff;
  overflow:hidden; overscroll-behavior:none;
  background: radial-gradient(130% 100% at 50% -10%, #131a33 0%, #0a0e1c 52%, #05060e 100%);
}

/* drifting aurora backdrop */
.bg{ position:fixed; inset:-20%; z-index:0; pointer-events:none; filter: blur(80px) saturate(1.2); opacity:.5; }
.bg::before,.bg::after{ content:""; position:absolute; width:55vmax; height:55vmax; border-radius:50%; mix-blend-mode:screen; }
.bg::before{ background:radial-gradient(circle,#1f6feb,transparent 62%); top:-10%; left:-6%; animation:drift 30s ease-in-out infinite; }
.bg::after{ background:radial-gradient(circle,#7b2ff7,transparent 62%); bottom:-12%; right:-8%; animation:drift 38s ease-in-out infinite reverse; }
@keyframes drift{ 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(5vw,4vh) scale(1.15);} }

.stage{
  position:fixed; inset:0; z-index:1; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:clamp(20px,4vh,40px);
}

/* ---- the pad cluster ---- */
.simon{
  position:relative; width:min(86vw, 72vh, 520px); aspect-ratio:1;
  display:grid; grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr;
  gap:clamp(10px,2.4vw,18px);
}
.pad{
  appearance:none; border:none; cursor:pointer; padding:0; position:relative;
  border-radius:22px; transition:transform .09s ease, filter .12s ease, box-shadow .12s ease;
  filter:brightness(.42) saturate(.8);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -10px 26px rgba(0,0,0,.42);
  outline:none;
}
.pad--0{ border-top-left-radius:46%; background:radial-gradient(120% 120% at 30% 26%, #46f0b0, #16b673 64%, #0c8a55); }
.pad--1{ border-top-right-radius:46%; background:radial-gradient(120% 120% at 70% 26%, #ffd97a, #f5a623 62%, #c97c10); }
.pad--2{ border-bottom-left-radius:46%; background:radial-gradient(120% 120% at 30% 74%, #8db4ff, #3f7bff 60%, #2351d6); }
.pad--3{ border-bottom-right-radius:46%; background:radial-gradient(120% 120% at 70% 74%, #ff9bc4, #f0398b 60%, #c41e69); }
.pad:focus-visible{ box-shadow: inset 0 2px 0 rgba(255,255,255,.2), 0 0 0 3px rgba(255,255,255,.5); }

.pad.is-lit{ filter:brightness(1.18) saturate(1.25); transform:scale(1.015); }
.pad--0.is-lit{ box-shadow:0 0 40px 6px rgba(60,240,170,.65), inset 0 0 30px rgba(255,255,255,.4); }
.pad--1.is-lit{ box-shadow:0 0 40px 6px rgba(245,190,60,.65), inset 0 0 30px rgba(255,255,255,.4); }
.pad--2.is-lit{ box-shadow:0 0 40px 6px rgba(90,150,255,.65), inset 0 0 30px rgba(255,255,255,.4); }
.pad--3.is-lit{ box-shadow:0 0 40px 6px rgba(255,90,170,.65), inset 0 0 30px rgba(255,255,255,.4); }

.simon.is-locked .pad{ cursor:default; }

/* ---- center hub ---- */
.hub{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:34%; aspect-ratio:1; border-radius:50%; z-index:2;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  background: radial-gradient(circle at 50% 36%, #1a2138, #0c1020 72%);
  border:1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12);
  cursor:pointer; user-select:none;
}
.hub__num{ font-size:clamp(1.8rem,6vw,2.9rem); font-weight:700; line-height:1; letter-spacing:-.02em; color:#fff; }
.hub__label{ font-size:.6rem; font-weight:600; letter-spacing:.22em; text-transform:uppercase; color:rgba(234,240,255,.55); }
.hub__best{ position:absolute; bottom:18%; font-size:.56rem; font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:rgba(150,200,255,.6); }
.hub.is-pulse{ animation:hubPulse 1.4s ease-in-out infinite; }
@keyframes hubPulse{ 0%,100%{ box-shadow:0 18px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 0 rgba(120,170,255,.5);} 50%{ box-shadow:0 18px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 14px rgba(120,170,255,0);} }

.simon.is-over .hub{ background:radial-gradient(circle at 50% 36%, #3a1320, #1a0810 72%); border-color:rgba(255,120,140,.4); }

/* ---- status / frame / hint ---- */
.status{
  margin:0; font-size:clamp(.8rem,2.4vw,1rem); font-weight:600; letter-spacing:.02em;
  color:rgba(234,240,255,.82); text-align:center; min-height:1.4em; padding:0 18px;
}
.status.is-bad{ color:#ff7a92; }
.status.is-good{ color:#6dffc2; }

.frame{ position:fixed; inset:0; z-index:5; pointer-events:none; }
.frame__corner{
  position:absolute; font-size:clamp(.56rem,1.2vw,.7rem); font-weight:500;
  letter-spacing:.2em; text-transform:uppercase; color:rgba(234,240,255,.42); white-space:nowrap;
}
.frame__corner--tl{ top:clamp(18px,3.5vw,34px); left:clamp(18px,3.5vw,34px); }
.frame__corner--tr{ top:clamp(18px,3.5vw,34px); right:clamp(18px,3.5vw,34px); }
.frame__corner--bl{ bottom:clamp(20px,3.5vw,34px); left:clamp(18px,3.5vw,34px); }
.frame__corner a{ color:inherit; text-decoration:none; pointer-events:auto; border-bottom:1px solid transparent; transition:color .14s ease,border-color .14s ease; }
.frame__corner a:hover{ color:#fff; border-bottom-color:#8ab4ff; }

.hint{
  position:fixed; left:50%; top:clamp(38px,7vh,72px); transform:translateX(-50%);
  margin:0; z-index:4; font-size:.64rem; font-weight:600; letter-spacing:.18em;
  text-transform:uppercase; color:rgba(234,240,255,.4); pointer-events:none;
  transition:opacity .6s ease; text-align:center;
}
.hint.is-hidden{ opacity:0; }

@media (prefers-reduced-motion: reduce){ .bg::before,.bg::after,.hub.is-pulse{ animation:none; } }
