:root{
  --bg:#000;
  --fg:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.55);
  --line:rgba(255,255,255,.10);
  --accent:#22d3ee;
  --accent2:#7c3aed;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 700px at 50% 20%, rgba(124,58,237,.18), transparent 60%),
              radial-gradient(1000px 600px at 30% 80%, rgba(34,211,238,.12), transparent 60%),
              var(--bg);
  color:var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

.stage{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:28px 20px 26px;
  gap:20px;
}

.intro{
  position: fixed;
  inset: 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:22px;
  background: radial-gradient(900px 520px at 50% 40%, rgba(0,0,0,.08), rgba(0,0,0,.72));
  backdrop-filter: blur(6px);
  z-index: 50;
}

.intro[hidden]{display:none}

.intro__btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,.22);
  background:
    radial-gradient(circle at 25% 25%, rgba(34,211,238,.20), transparent 55%),
    radial-gradient(circle at 75% 75%, rgba(124,58,237,.22), transparent 55%),
    rgba(255,255,255,.08);
  color: var(--fg);
  font-weight: 820;
  letter-spacing: .02em;
  border-radius: 999px;
  padding: 14px 22px;
  min-width: 170px;
  font-size: 16px;
  cursor:pointer;
  box-shadow: 0 18px 55px rgba(0,0,0,.65);
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}
.intro__btn:hover{filter:brightness(1.05)}
.intro__btn:active{transform: translateY(1px) scale(.995)}
.intro__btn:focus-visible{
  outline: 2px solid rgba(34,211,238,.45);
  outline-offset: 3px;
}
.intro__btn[disabled]{opacity:.65; cursor:wait; transform:none}

.intro__hint{
  max-width: 520px;
  text-align:center;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}

.hud{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}

.brand{
  width:44px; height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  background:
    radial-gradient(circle at 30% 30%, rgba(34,211,238,.45), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(124,58,237,.45), transparent 55%),
    rgba(255,255,255,.04);
  box-shadow: 0 10px 40px rgba(0,0,0,.55);
  flex:0 0 auto;
}

.copy{flex:1 1 auto; min-width:0}
.headline{font-size:18px; font-weight:750; letter-spacing:-.01em}
.subline{margin-top:6px; font-size:13px; color:var(--muted); line-height:1.35}

.status{
  flex:0 0 auto;
  font-size: clamp(18px, 2.6vw, 28px);
  font-weight: 750;
  color:rgba(255,255,255,.70);
  padding:16px 20px;
  border:1px solid var(--line);
  border-radius:18px;
  background: rgba(255,255,255,.04);
  white-space:nowrap;
}

.topbar{
  width:100%;
  max-width:980px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.controls{display:flex; align-items:center; gap:10px}

.toggle{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  cursor:pointer;
  user-select:none;
}

.toggle input{
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
  pointer-events:none;
}

.toggle__track{
  position:relative;
  width:44px;
  height:26px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.16);
  transition: background .12s ease, border-color .12s ease, filter .12s ease;
  flex:0 0 auto;
}

.toggle__thumb{
  position:absolute;
  top:50%;
  left:3px;
  width:20px;
  height:20px;
  border-radius:999px;
  transform: translateY(-50%);
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  transition: transform .12s ease, background .12s ease;
}

.toggle__label{
  font-size:13px;
  font-weight:800;
  letter-spacing:.01em;
  color: var(--muted);
}

.toggle:focus-within{
  outline: 2px solid rgba(34,211,238,.45);
  outline-offset: 3px;
}

.toggle input:checked + .toggle__track{
  background: rgba(34,211,238,.55);
  border-color: rgba(34,211,238,.75);
}

.toggle input:checked + .toggle__track .toggle__thumb{
  transform: translate(18px, -50%);
  background: rgba(255,255,255,.98);
}

.toggle input:checked ~ .toggle__label{color: rgba(255,255,255,.86)}
.toggle input:disabled + .toggle__track{opacity:.55}
.toggle input:disabled ~ .toggle__label{opacity:.60}
.toggle input:disabled ~ .toggle__label{text-decoration: line-through}

.reveal{
  width:100%;
  max-width:980px;
  margin:0 auto;
  border:1px solid var(--line);
  border-radius:18px;
  background: rgba(0,0,0,.42);
  overflow:hidden;
  box-shadow: 0 20px 80px rgba(0,0,0,.65);
}
.reveal__frame{aspect-ratio: 16/9; background:#000;}
.reveal__frame video{border:0; width:100%; height:100%; object-fit:cover;}
.reveal__reward{
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:22px;
  background:
    radial-gradient(circle at 30% 30%, rgba(34,211,238,.18), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(124,58,237,.18), transparent 55%),
    rgba(0,0,0,.45);
}
.reveal__rewardTitle{
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 900;
  letter-spacing: .01em;
  text-align:center;
}
.reveal__actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.reveal__actions--below{
  padding:14px 16px 16px;
}
.reveal__rewardBtn{
  appearance:none;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(34,211,238,.95), rgba(124,58,237,.88));
  color: rgba(255,255,255,.98);
  font-weight: 900;
  letter-spacing: .01em;
  border-radius: 999px;
  padding: 12px 20px;
  min-width: 220px;
  cursor:pointer;
  box-shadow: 0 18px 55px rgba(0,0,0,.65);
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}
.reveal__rewardBtn--secondary{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.22);
  color: rgba(255,255,255,.92);
}
.reveal__rewardBtn:hover{filter:brightness(1.05)}
.reveal__rewardBtn:active{transform: translateY(1px) scale(.995)}
.reveal__rewardBtn:focus-visible{
  outline: 2px solid rgba(34,211,238,.55);
  outline-offset: 3px;
}
.reveal__note{
  border-top:1px solid var(--line);
  background: rgba(255,255,255,.04);
  padding:14px 16px;
  font-size:13px;
  color:var(--muted);
}
.reveal__note--above{
  border-top:0;
  border-bottom:1px solid var(--line);
}
.reveal__note--april{
  font-size: clamp(22px, 3.2vw, 38px);
  font-weight: 900;
  color: var(--fg);
  text-align:center;
  letter-spacing:.02em;
}

/* Reward view: when the reward is shown, hide the rest of the game UI. */
body.is-reward .topbar,
body.is-reward .pianoWrap{
  display:none !important;
}
body.is-reward .stage{
  justify-content:center;
}

.pianoWrap{
  width:100%;
  max-width:980px;
  margin:0 auto;
}

.piano{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap:10px;
}

.key{
  position:relative;
  height: clamp(92px, 18vh, 140px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
  color: rgba(0,0,0,.88);
  font-weight: 800;
  font-size: 18px;
  cursor:pointer;
  user-select:none;
  transition: transform .08s ease, box-shadow .12s ease, filter .12s ease;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.key:active{transform: translateY(1px) scale(.995)}
.key[disabled]{opacity:.55; cursor:not-allowed; transform:none}

.key__label{
  position:absolute;
  left:12px;
  bottom:10px;
  font-size:14px;
  opacity:.75;
}

.key.is-next{
  color: rgba(255,255,255,.96);
  border-color: rgba(34,211,238,.95);
  background: linear-gradient(180deg, rgba(34,211,238,.95), rgba(124,58,237,.86));
  outline: 3px solid rgba(34,211,238,.55);
  outline-offset: 3px;
  box-shadow:
    0 0 0 1px rgba(34,211,238,.35),
    0 0 34px rgba(34,211,238,.26),
    0 18px 40px rgba(0,0,0,.45);
  animation: pulse 1.05s ease-in-out infinite;
}

.key.is-preview{
  filter: brightness(1.06);
  box-shadow:
    0 0 0 1px rgba(124,58,237,.26),
    0 0 18px rgba(124,58,237,.18),
    0 18px 40px rgba(0,0,0,.45);
}

.key.is-wrong{
  animation: wrong .25s ease-in-out 1;
  box-shadow:
    0 0 0 1px rgba(244,63,94,.28),
    0 0 18px rgba(244,63,94,.18),
    0 18px 40px rgba(0,0,0,.45);
}

@keyframes pulse{
  0%,100%{transform: translateY(0)}
  50%{transform: translateY(-2px)}
}

@keyframes wrong{
  0%{transform: translateX(0)}
  25%{transform: translateX(-5px)}
  50%{transform: translateX(5px)}
  75%{transform: translateX(-3px)}
  100%{transform: translateX(0)}
}

@media (max-width:720px){
  .hud{flex-direction:column; align-items:stretch}
  .topbar{flex-direction:column; align-items:stretch}
  .status{white-space:normal}
  .toggle{justify-content:space-between}
  .piano{grid-template-columns: repeat(3, minmax(0, 1fr));}
}

/* Consent gate */
body.is-gated .stage{
  pointer-events:none;
  user-select:none;
  filter: blur(2px);
}

.gate{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
}
.gate[hidden]{display:none}

.gate__card{
  width:min(520px, 100%);
  border:1px solid var(--line);
  border-radius:18px;
  background:
    radial-gradient(900px 420px at 25% 0%, rgba(34,211,238,.18), transparent 60%),
    radial-gradient(900px 420px at 75% 100%, rgba(124,58,237,.18), transparent 60%),
    rgba(0,0,0,.55);
  box-shadow: 0 30px 120px rgba(0,0,0,.75);
  padding:18px 18px 16px;
}

.gate__title{
  font-size:18px;
  font-weight:900;
  letter-spacing:-.01em;
}
.gate__text{
  margin-top:10px;
  color: var(--muted);
  line-height:1.45;
  font-size:13px;
}

.gate__btn{
  margin-top:14px;
  width:100%;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(34,211,238,.95), rgba(124,58,237,.88));
  color: rgba(255,255,255,.98);
  font-weight:900;
  letter-spacing:.01em;
  cursor:pointer;
}
.gate__btn:active{transform: translateY(1px)}

.gate__error{
  margin-top:10px;
  font-size:13px;
  color: rgba(244,63,94,.92);
  min-height: 18px;
}
.gate__error[hidden]{display:none}

.gate__fineprint{
  margin-top:10px;
  font-size:12px;
  color: rgba(255,255,255,.45);
}
