/* Pentagrama Pop: a neon concert stage. */
:root {
  --c1: #19e3d3;
  --c2: #2f6bff;
  --ink: #140a33;
  --panel: rgba(24, 12, 62, 0.82);
  --line: rgba(255, 255, 255, 0.14);
  --gold: #ffd84d;
  --pink: #ff4fb4;
  --ok: #2ee68a;
  --bad: #ff4d6d;
  --font: "Baloo 2", ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #140a33;
  color: #fff;
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}
.app {
  position: fixed;
  inset: 0;
  z-index: 1;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--sat) + 10px) calc(var(--sar) + 12px) calc(var(--sab) + 10px) calc(var(--sal) + 12px);
}

/* ---------- Shared bits ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex: none;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}
.round {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.35) inset;
  flex: none;
}
.round svg {
  width: 24px;
  height: 24px;
}
.snd .cross {
  display: none;
}
.snd.off .cross {
  display: inline;
}
.snd.off .waves {
  display: none;
}
.pill {
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 216, 77, 0.45);
  color: var(--gold);
  font-weight: 800;
  font-size: 18px;
  text-shadow: 0 0 10px rgba(255, 216, 77, 0.6);
}
.btn {
  min-height: 52px;
  padding: 8px 22px;
  border-radius: 18px;
  font-weight: 800;
  font-size: 19px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.28);
  transition: transform 0.12s;
}
.btn:active,
.opt:active,
.mode:active,
.big-go:active,
.node:active,
.wtab:active,
.demo:active {
  transform: scale(0.95);
}
.btn.go {
  background: linear-gradient(180deg, #ff6ec7, #e2329f);
  border-color: #ffb3e3;
  box-shadow: 0 5px 0 #8d1a63, 0 0 22px rgba(255, 79, 180, 0.55);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.btn.small {
  min-height: 42px;
  font-size: 16px;
  padding: 4px 16px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}
.toggle i {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  transition: background 0.2s;
}
.toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.toggle.on i {
  background: var(--c1);
  box-shadow: 0 0 10px var(--c1);
}
.toggle.on i::after {
  transform: translateX(18px);
}
.srow i {
  font-style: normal;
  color: rgba(255, 255, 255, 0.22);
}
.srow i.on {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 216, 77, 0.8);
}
.shake {
  animation: shake 0.4s;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-7px);
  }
  40%,
  80% {
    transform: translateX(7px);
  }
}

/* ---------- Corchi ---------- */
.corchi {
  display: block;
  overflow: visible;
}
.corchi .cbody {
  transform-origin: 54px 140px;
  animation: bop 1.1s ease-in-out infinite;
}
.corchi .cflag {
  transform-origin: 86px 20px;
  animation: flag 0.55s ease-in-out infinite alternate;
}
.corchi .ceyes {
  transform-origin: 52px 102px;
  animation: blink 4s infinite;
}
.corchi.sad .cbody {
  animation: none;
  transform: rotate(-8deg);
}
@keyframes bop {
  50% {
    transform: translateY(-6px) rotate(3deg) scaleY(1.03);
  }
}
@keyframes flag {
  to {
    transform: rotate(-12deg) scaleY(0.92);
  }
}
@keyframes blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}

/* ---------- Home ---------- */
.home {
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow-y: auto;
}
.home .topbar {
  position: absolute;
  top: calc(var(--sat) + 10px);
  left: calc(var(--sal) + 12px);
  right: calc(var(--sar) + 12px);
  width: auto;
}
.logo {
  position: relative;
  width: min(92vw, 470px);
  height: 190px;
  flex: none;
  margin-top: 30px;
}
.lstaff {
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.lstaff i {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(160, 250, 255, 0.85) 15%, rgba(160, 250, 255, 0.85) 85%, transparent);
  box-shadow: 0 0 8px var(--c1);
}
.logo .corchi {
  position: absolute;
  width: 92px;
  right: 2%;
  top: -18px;
  filter: drop-shadow(0 0 14px rgba(255, 79, 180, 0.6));
}
.logo h1 {
  position: absolute;
  left: 0;
  right: 0;
  top: 46px;
  margin: 0;
  text-align: center;
  line-height: 0.95;
}
.logo .l1 {
  display: block;
  font-size: clamp(42px, 12.5vw, 64px);
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #eaffff;
  text-shadow: 0 0 6px #fff, 0 0 16px var(--c1), 0 0 34px var(--c1), 0 4px 0 #0d4f73;
  transform: rotate(-3deg);
}
.logo .l2 {
  display: inline-block;
  margin-top: 4px;
  padding: 0 22px 2px;
  font-size: clamp(38px, 10.5vw, 54px);
  font-weight: 800;
  color: #fff;
  border-radius: 18px;
  background: linear-gradient(180deg, #ff6ec7, #d6268f);
  box-shadow: 0 0 24px rgba(255, 79, 180, 0.8), 0 5px 0 #7d1457;
  transform: rotate(-3deg);
  animation: popbadge 2.4s ease-in-out infinite;
}
@keyframes popbadge {
  50% {
    transform: rotate(-1deg) scale(1.06);
  }
}
.how {
  margin: 0;
  max-width: 360px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.big-go {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 360px);
  padding: 12px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, #2ff5e3, #10a9c9);
  color: #06283a;
  box-shadow: 0 7px 0 #0b5a78, 0 0 34px rgba(25, 227, 211, 0.55);
  text-align: left;
}
.big-go .pl {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  font-size: 24px;
  color: #10a9c9;
  flex: none;
}
.big-go b {
  display: block;
  font-size: 28px;
  line-height: 1;
}
.big-go small {
  font-size: 15px;
  font-weight: 700;
  opacity: 0.8;
}
.modes {
  display: flex;
  gap: 10px;
  width: min(100%, 360px);
}
.mode {
  flex: 1;
  min-height: 54px;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.mode.reto {
  background: linear-gradient(180deg, #ffd84d, #ff9f1a);
  color: #4a2600;
  border-color: #fff0b0;
  box-shadow: 0 5px 0 #a65a00, 0 0 18px rgba(255, 190, 40, 0.5);
}
.opts {
  display: flex;
  gap: 10px;
}

/* ---------- Map ---------- */
.map {
  gap: 10px;
}
.wtabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  flex: none;
}
.wtab {
  border-radius: 16px;
  padding: 6px 4px 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
  min-height: 74px;
  justify-content: center;
}
.wtab .wi {
  font-size: 24px;
}
.wtab b {
  font-size: 14px;
}
.wtab small {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.wtab small svg {
  width: 12px;
  height: 12px;
}
.wtab.on {
  border-color: var(--tc);
  background: color-mix(in srgb, var(--tc) 25%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--tc) 60%, transparent);
}
.wtab.locked {
  opacity: 0.6;
}
.wpanel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  border-radius: 24px;
  background: rgba(14, 6, 40, 0.55);
  border: 2px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
.whead {
  text-align: center;
  padding: 10px 10px 0;
}
.whead h2 {
  margin: 0;
  font-size: 26px;
  color: #fff;
  text-shadow: 0 0 14px var(--c1);
}
.whead p {
  margin: 0;
  font-weight: 600;
  opacity: 0.8;
}
.path {
  position: relative;
  margin: 0 8px 20px;
}
.road {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.road path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 18;
  stroke-linecap: round;
}
.road path.dash {
  stroke: var(--c1);
  stroke-width: 3;
  stroke-dasharray: 2 12;
  filter: drop-shadow(0 0 4px var(--c1));
}
.node {
  position: absolute;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0, var(--c1) 30%, var(--c2) 100%);
  border: 3px solid #fff;
  box-shadow: 0 0 18px var(--c1), 0 5px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.node .num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.node .num svg {
  width: 24px;
  height: 24px;
}
.node .srow {
  position: absolute;
  bottom: -18px;
  font-size: 16px;
  letter-spacing: -1px;
  text-shadow: 0 2px 2px #000;
}
.node.locked {
  background: #3a3060;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: none;
}
.node.locked .srow {
  display: none;
}
.node.gold {
  border-color: var(--gold);
  box-shadow: 0 0 22px var(--gold), 0 5px 0 rgba(0, 0, 0, 0.35);
}
.node.boss {
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
}
.node.next {
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 34px var(--c1), 0 5px 0 rgba(0, 0, 0, 0.35);
  }
}
.nlabel {
  position: absolute;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  max-width: 38%;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}
.nlabel.r {
  margin-left: 48px;
}
.nlabel.l {
  margin-left: -48px;
  transform: translate(-100%, -50%);
  text-align: right;
}
.wlock {
  text-align: center;
  padding: 30px 20px;
}
.wlock > svg {
  width: 54px;
  height: 54px;
  opacity: 0.8;
}
.wlock h3 {
  margin: 6px 0 0;
  font-size: 24px;
}
.wlock .meter {
  height: 14px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  max-width: 280px;
  margin: 10px auto;
}
.wlock .meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ff9f1a);
}
.small {
  font-size: 14px;
  opacity: 0.8;
}

/* ---------- Play ---------- */
.play {
  padding-bottom: 0;
  gap: 6px;
}
.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.hud .round {
  width: 42px;
  height: 42px;
}
.hmid {
  flex: 1;
  min-width: 0;
}
.htitle {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}
.hbar {
  height: 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.hbar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  box-shadow: 0 0 10px var(--c1);
  transition: width 0.25s;
}
.hscore {
  text-align: right;
  line-height: 0.95;
  min-width: 64px;
}
.hscore b {
  display: block;
  font-size: 21px;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 216, 77, 0.5);
}
.hscore small {
  font-size: 11px;
  opacity: 0.7;
}
.hlives {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  max-width: 92px;
  justify-content: flex-end;
}
.hlives i {
  width: 15px;
  height: 14px;
  display: block;
}
.hlives svg {
  width: 100%;
  height: 100%;
  fill: rgba(255, 255, 255, 0.18);
}
.hlives i.on svg {
  fill: #ff4f7b;
  filter: drop-shadow(0 0 4px #ff4f7b);
}
.hlives i.pop {
  animation: hpop 0.5s;
}
@keyframes hpop {
  40% {
    transform: scale(1.8);
  }
}
.hlives.clock {
  max-width: none;
  font-size: 18px;
  color: #9ff7ff;
}
.lane {
  flex: 1;
  min-height: 0;
  margin: 0 calc(-12px - var(--sar)) 0 calc(-12px - var(--sal));
}
.lane.hurt {
  animation: hurt 0.35s;
}
@keyframes hurt {
  0% {
    background: rgba(255, 50, 80, 0.25);
  }
  100% {
    background: transparent;
  }
}
.quiz {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: calc(var(--sab) + 12px);
}
.play:not([data-mode="scroll"]) .lane,
.play:not([data-mode="scroll"]) .ctrl,
.play:not([data-mode="quiz"]) .quiz {
  display: none;
}
.play[data-mode="idle"] .hud {
  visibility: hidden;
}

/* ---------- Piano ---------- */
.ctrl {
  flex: none;
  margin: 0 calc(-12px - var(--sar)) 0 calc(-12px - var(--sal));
  padding: 6px max(8px, var(--sar)) calc(var(--sab) + 8px) max(8px, var(--sal));
  background: linear-gradient(180deg, rgba(10, 4, 30, 0.2), rgba(10, 4, 30, 0.85) 30%);
  border-top: 2px solid rgba(255, 255, 255, 0.12);
}
.piano {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 1020px;
  margin: 0 auto;
}
.prow {
  --bw: calc(100% / var(--n) * 0.58);
  position: relative;
  display: flex;
  height: min(118px, 15vh);
  padding: 0;
}
.rows2 .prow {
  height: min(124px, 13.5vh);
}
.rows2 .prow:last-child {
  width: calc(100% * 7 / 8);
  margin: 0 auto;
}
.rows1 .prow {
  height: clamp(90px, 22vh, 150px);
}
.prow .oct {
  position: absolute;
  top: 4px;
  left: -2px;
  transform: translateX(-100%);
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.55);
  display: none;
}
.key {
  position: relative;
  touch-action: none;
}
.wk {
  flex: 1;
  margin: 0 1.5px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #e9e6ff 0%, #ffffff 70%, #dcd8f5 100%);
  box-shadow: 0 5px 0 #8f86c4, 0 0 0 1px rgba(0, 0, 0, 0.25) inset;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
  color: #3b2d7a;
}
.bk {
  position: absolute;
  top: 0;
  width: var(--bw);
  height: 60%;
  z-index: 2;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(180deg, #2a2346 0%, #120d26 85%, #2c2550 100%);
  box-shadow: 0 4px 0 #05030d, 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 5px;
  color: #c9c1ff;
}
.key .nm {
  font-size: clamp(11px, 3.4vw, 17px);
  font-weight: 800;
  line-height: 1;
  display: none;
}
.bk .nm {
  font-size: clamp(8px, 2.4vw, 12px);
}
.names .key .nm {
  display: block;
}
.key .kb {
  display: none;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.55;
  margin-top: 2px;
}
@media (pointer: fine) {
  .key .kb {
    display: block;
  }
}
.wk.down {
  background: linear-gradient(180deg, #d8fffb, #a8f5ff);
  box-shadow: 0 2px 0 #8f86c4, 0 0 18px var(--c1);
  transform: translateY(3px);
}
.bk.down {
  background: linear-gradient(180deg, #3e3a7a, #2a2560);
  transform: translateY(2px);
  box-shadow: 0 2px 0 #05030d, 0 0 14px var(--c1);
}
.key.good {
  background: linear-gradient(180deg, #fff6c2, #ffd84d) !important;
  box-shadow: 0 2px 0 #b38a00, 0 0 24px var(--gold) !important;
}
.key.bad {
  background: linear-gradient(180deg, #ffc2cc, #ff4d6d) !important;
  box-shadow: 0 2px 0 #8a1028, 0 0 20px var(--bad) !important;
}
.pad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  height: clamp(110px, 22vh, 190px);
  border-radius: 28px;
  background: radial-gradient(circle at 50% 40%, #ffb84d, #ff6a2b 60%, #c2361a);
  border: 3px solid #ffe0a8;
  box-shadow: 0 7px 0 #7a2410, 0 0 30px rgba(255, 140, 40, 0.5);
  color: #3a1200;
  flex-direction: column;
  touch-action: none;
}
.pad b {
  font-size: 30px;
  line-height: 1;
}
.pad small {
  font-weight: 700;
  opacity: 0.8;
}
.pad .drum {
  display: none;
}
.pad.hit {
  animation: padhit 0.18s;
}
@keyframes padhit {
  30% {
    transform: scale(0.95) translateY(4px);
    box-shadow: 0 3px 0 #7a2410, 0 0 50px rgba(255, 200, 80, 0.9);
  }
}

/* ---------- Quiz cards ---------- */
.qcard {
  width: min(100%, 640px);
  margin: auto 0;
  padding: 14px 14px 16px;
  border-radius: 26px;
  background: var(--panel);
  border: 2px solid color-mix(in srgb, var(--c1) 55%, transparent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--c1) 30%, transparent), 0 10px 30px rgba(0, 0, 0, 0.4);
  text-align: center;
  backdrop-filter: blur(6px);
}
.qcard.enter {
  animation: enter 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes enter {
  from {
    transform: translateY(24px) scale(0.94);
    opacity: 0;
  }
}
.qnum {
  font-size: 13px;
  font-weight: 700;
  color: var(--c1);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.qprompt {
  font-size: clamp(21px, 5.6vw, 27px);
  font-weight: 800;
  line-height: 1.15;
  margin: 2px 0 8px;
}
.qvis {
  display: flex;
  justify-content: center;
  margin: 4px 0 12px;
}
.qvis svg.bars {
  width: 100%;
  max-width: min(100%, calc(var(--w) * 3.4px));
  height: auto;
  max-height: 160px;
}
.qvis.wide svg.bars {
  max-width: 100%;
}
.bigfig svg.bars {
  width: auto;
  height: 150px;
}
.bars,
.chart {
  color: #fff;
  fill: #fff;
  overflow: visible;
}
.bars .sl,
.chart .sl,
.fig .sl {
  stroke: rgba(200, 245, 255, 0.85);
  stroke-width: 1.1;
}
.bars .bl {
  stroke: rgba(200, 245, 255, 0.85);
  stroke-width: 1.4;
}
.bars g path,
.bars path {
  filter: drop-shadow(0 0 2px var(--c1));
}
.bars .add path {
  fill: var(--gold);
}
.bars .ts {
  font: 800 22px var(--font);
  text-anchor: middle;
  fill: #ffe9a8;
}
.bars .ts.q {
  font-size: 30px;
  fill: var(--pink);
}
.bars .gap {
  fill: color-mix(in srgb, var(--pink) 18%, transparent);
  stroke: var(--pink);
  stroke-width: 1.6;
  stroke-dasharray: 4 3;
  animation: gappulse 1.2s ease-in-out infinite;
}
.bars .gapq {
  font: 800 24px var(--font);
  text-anchor: middle;
  fill: var(--pink);
}
.bars .room {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
}
@keyframes gappulse {
  50% {
    opacity: 0.55;
  }
}
.qopts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qopts.n3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.qopts.wait .opt {
  opacity: 0.5;
  pointer-events: none;
}
.opt {
  position: relative;
  min-height: 62px;
  padding: 8px 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  transition: transform 0.12s, background 0.2s;
}
.opt b {
  font-size: 19px;
}
.opt small {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.8;
}
.opt .oi {
  font-size: 26px;
  line-height: 1;
}
.opt .kn {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 11px;
  opacity: 0.5;
}
.opt svg.fig {
  height: 42px;
  width: auto;
  fill: #fff;
  margin-bottom: 2px;
}
.opt.right {
  background: linear-gradient(180deg, #5cf5a8, #1fbf6f);
  border-color: #c9ffe2;
  color: #04301a;
  box-shadow: 0 4px 0 #0c6e3c, 0 0 22px rgba(46, 230, 138, 0.7);
}
.opt.right svg.fig {
  fill: #04301a;
}
.opt.wrong {
  background: linear-gradient(180deg, #ff8095, #e0304f);
  border-color: #ffc7d1;
  box-shadow: 0 4px 0 #7a0f22;
}
.listen {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  margin: 20px auto 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 40% 35%, #fff, var(--c1) 35%, var(--c2));
  border: 4px solid #fff;
  box-shadow: 0 0 30px var(--c1), 0 6px 0 rgba(0, 0, 0, 0.35);
  color: #1a0838;
}
.listen .ico {
  font-size: 40px;
  line-height: 1;
}
.listen b {
  font-size: 17px;
}
.listen.playing {
  animation: listen 0.5s ease-in-out infinite alternate;
}
.listen::before,
.listen::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid var(--c1);
  opacity: 0;
  pointer-events: none;
}
.listen.playing::before,
.listen.playing::after {
  animation: ripple 1.2s ease-out infinite;
}
.listen.playing::after {
  animation-delay: 0.6s;
}
@keyframes ripple {
  from {
    opacity: 0.9;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.55);
  }
}
@keyframes listen {
  to {
    transform: scale(1.06);
  }
}
.qexp {
  min-height: 0;
}
.qexp p {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  padding: 8px 12px;
  border-radius: 14px;
}
.qexp p.good {
  background: rgba(46, 230, 138, 0.16);
  color: #c9ffe2;
}
.qexp p.bad {
  background: rgba(255, 77, 109, 0.16);
  color: #ffd4dc;
}
.qexp .btn {
  margin-top: 10px;
}
.hint {
  margin: 0 0 12px;
  font-weight: 600;
  opacity: 0.85;
}
.qcard .acts {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.beatmeter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: -4px 0 12px;
}
.beatmeter i {
  width: 18px;
  height: 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
}
.beatmeter i:nth-child(2n) {
  margin-right: 4px;
}
.beatmeter i.on {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.beatmeter span {
  margin-left: 6px;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}
.palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.opt.pal b {
  font-size: 15px;
}
.opt.pal small {
  font-size: 12px;
}
.qcard .row {
  margin-top: 10px;
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sat) + 12px) 14px calc(var(--sab) + 12px);
  background: rgba(8, 3, 24, 0.62);
  backdrop-filter: blur(3px);
  animation: fade 0.25s;
  overflow-y: auto;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.overlay .panel {
  width: min(100%, 520px);
  margin: auto;
  padding: 18px 18px 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(42, 22, 98, 0.96), rgba(20, 10, 52, 0.97));
  border: 2px solid color-mix(in srgb, var(--c1) 60%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--c1) 35%, transparent), 0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: enter 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.panel h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  text-shadow: 0 0 16px var(--c1);
}
.panel .kick {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  padding: 2px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c1) 25%, transparent);
  color: #fff;
  margin-bottom: 6px;
}
.panel .tip,
.panel .sub {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  margin: 8px 0;
  color: rgba(255, 255, 255, 0.92);
}
.panel .tip b {
  color: var(--gold);
}
.aid {
  margin: 8px 0 6px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.25);
}
.aid svg.chart,
.aid svg.bars {
  width: 100%;
  height: auto;
  max-height: 170px;
}
.chart .nm {
  font: 800 11px var(--font);
  text-anchor: middle;
  fill: var(--gold);
}
.chart path,
.chart g path {
  filter: drop-shadow(0 0 2px var(--c1));
}
.aid.figs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.fc {
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}
.fc svg.fig {
  height: 46px;
  fill: #fff;
  filter: drop-shadow(0 0 3px var(--c1));
}
.fc b {
  font-size: 13px;
}
.fc small {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}
.aid.demos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.aid .dl {
  width: 100%;
  margin: 0;
  font-weight: 700;
  font-size: 15px;
  opacity: 0.85;
}
.demo {
  padding: 8px 14px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  background: color-mix(in srgb, var(--c1) 30%, transparent);
  border: 2px solid var(--c1);
}
.kbd-hint {
  font-size: 14px;
  opacity: 0.75;
  margin: 6px 0;
}
.panel .acts {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.panel .acts.col {
  flex-direction: column;
  align-items: stretch;
}
.panel > .toggle {
  margin: 6px 4px 0;
}
.piece h2 {
  font-size: 28px;
}
.pc-badge {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 0 12px var(--gold));
}
.piece .comp {
  margin: 6px 0;
  font-size: 16px;
}
.piece .comp b {
  color: var(--gold);
}
.piece .fact {
  font-size: 16px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 8px 12px;
  margin: 8px 0;
}
.rounds {
  text-align: left;
  margin: 8px auto;
  max-width: 340px;
  font-weight: 700;
  line-height: 1.5;
}
.rmascot .corchi {
  width: 84px;
  margin: -8px auto 0;
}
.bigstars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 8px;
}
.bigstars i {
  font-style: normal;
  font-size: 54px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.16);
}
.bigstars i.on {
  color: var(--gold);
  text-shadow: 0 0 18px var(--gold);
  animation: starin 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) both;
  animation-delay: var(--d);
}
.bigstars i:nth-child(2) {
  font-size: 66px;
  margin-top: -10px;
}
@keyframes starin {
  from {
    transform: scale(0) rotate(-90deg);
    opacity: 0;
  }
}
.stats {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.stats div {
  flex: 1 1 0;
  max-width: 110px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.stats b {
  font-size: 21px;
}
.stats small {
  font-size: 12px;
  opacity: 0.75;
}
.unlock {
  margin: 12px 0 0;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 216, 77, 0.16);
  font-weight: 700;
}

/* Round card of the Reto */
.overlay.round {
  background: rgba(8, 3, 24, 0.4);
}
.round .rays {
  position: absolute;
  inset: -50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--c1) 22%, transparent) 0 10deg, transparent 10deg 20deg);
  animation: spin 9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.round-card {
  position: relative;
  padding: 22px 30px;
  border-radius: 28px;
  background: var(--panel);
  border: 3px solid var(--c1);
  box-shadow: 0 0 40px var(--c1);
  text-align: center;
  animation: enter 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.round-card .r {
  font-size: 18px;
  font-weight: 800;
  color: var(--c1);
}
.round-card .w {
  font-size: 26px;
  font-weight: 800;
}

/* Concert finale */
.overlay.concert {
  background: transparent;
  backdrop-filter: none;
  overflow: hidden;
  z-index: 15;
}
.curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  background: repeating-linear-gradient(90deg, #8e0f2e 0 18px, #c21d45 18px 30px, #a3143a 30px 44px), #a3143a;
  box-shadow: inset 0 -40px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.6);
  animation: curtain-l 0.9s cubic-bezier(0.3, 1.2, 0.5, 1) both;
}
.curtain::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  background: linear-gradient(90deg, #ffcf3a, #b88a10, #ffcf3a);
}
.curtain.l {
  left: 0;
}
.curtain.r {
  right: 0;
  animation-name: curtain-r;
}
@keyframes curtain-l {
  from {
    transform: translateX(-100%);
  }
}
@keyframes curtain-r {
  from {
    transform: translateX(100%);
  }
}
.spot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 70vmin;
  height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 58%, rgba(255, 245, 200, 0.55), rgba(255, 245, 200, 0) 60%);
  animation: fade 0.6s 0.5s both;
}
.bravo {
  position: relative;
  text-align: center;
  animation: enter 0.6s 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.bravo span {
  display: block;
  font-size: clamp(56px, 16vw, 110px);
  font-weight: 800;
  line-height: 1;
  color: #fff7d1;
  text-shadow: 0 0 10px #fff, 0 0 30px var(--gold), 0 6px 0 #8a5a00;
  transform: rotate(-4deg);
}
.bravo small {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 2px 6px #000;
}
.crowd {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
}
.crowd i {
  width: 9%;
  max-width: 70px;
  height: var(--h);
  background: #0a0418;
  border-radius: 50% 50% 0 0 / 34% 34% 0 0;
  position: relative;
  animation: cheer 0.45s ease-in-out infinite alternate;
  animation-delay: calc(var(--k) * -0.13s);
}
.crowd i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -36%;
  width: 60%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: #0a0418;
  border-radius: 50%;
}
.rose {
  position: absolute;
  bottom: -40px;
  font-size: 34px;
  font-style: normal;
  opacity: 0;
  z-index: 2;
  animation: throw 1.5s var(--d) cubic-bezier(0.25, 0.7, 0.5, 1) forwards;
}
@keyframes throw {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 0.6), var(--up)) rotate(220deg);
  }
  100% {
    opacity: 1;
    transform: translate(var(--dx), var(--land)) rotate(400deg);
  }
}
@keyframes cheer {
  to {
    transform: translateY(-14px);
  }
}

/* ---------- Small heights (landscape phones) ---------- */
@media (max-height: 500px) {
  .logo {
    height: 150px;
    margin: -14px 0 -18px;
    transform: scale(0.72);
  }
  .home {
    gap: 8px;
  }
  .how {
    display: none;
  }
  .rows1 .prow {
    height: clamp(80px, 28vh, 120px);
  }
  .qprompt {
    font-size: 20px;
  }
  .listen {
    width: 96px;
    height: 96px;
    margin: 8px auto 12px;
  }
  .qvis svg.bars {
    max-height: 110px;
  }
  .bigfig svg.bars {
    height: 110px;
  }
  .wtab {
    min-height: 56px;
    flex-direction: row;
    gap: 6px;
  }
  .opt {
    min-height: 50px;
  }
  .overlay .panel {
    padding: 12px 16px;
  }
}
@media (min-width: 700px) {
  .qopts.n4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .hlives {
    max-width: none;
  }
  .hlives i {
    width: 20px;
    height: 18px;
  }
}
