:root {
  --bg: #050711;
  --bg-deep: #0b1021;
  --panel: rgba(11, 16, 32, 0.68);
  --panel-strong: rgba(15, 24, 45, 0.84);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f5f7ff;
  --muted: #99a6ca;
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.48);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --transition: 220ms ease;
  --note-accent: #7ee7ff;
  --note-accent-soft: rgba(126, 231, 255, 0.3);
  --note-glow: rgba(126, 231, 255, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(125, 105, 255, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(126, 231, 255, 0.14), transparent 24%),
    radial-gradient(circle at 50% 110%, rgba(124, 255, 189, 0.12), transparent 26%),
    linear-gradient(180deg, #03050c 0%, #09101f 50%, #060913 100%);
  overflow-x: hidden;
}

button,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 36px 20px 172px;
  overflow: hidden;
}

.stage-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 88%);
  opacity: 0.3;
  pointer-events: none;
}

.stage-beam {
  position: absolute;
  width: 42vw;
  height: 52vh;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.36;
  pointer-events: none;
}

.stage-beam-a {
  top: -8vh;
  left: -6vw;
  transform: rotate(-16deg);
  background: linear-gradient(180deg, var(--note-accent-soft), transparent 76%);
}

.stage-beam-b {
  top: 8vh;
  right: -10vw;
  transform: rotate(18deg);
  background: linear-gradient(180deg, rgba(183, 146, 255, 0.22), transparent 76%);
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.65;
  pointer-events: none;
}

.ambient-a {
  top: -120px;
  left: -110px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(183, 146, 255, 0.44), transparent 65%);
  animation: drift 18s ease-in-out infinite alternate;
}

.ambient-b {
  top: 16%;
  right: -140px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, var(--note-accent-soft), transparent 64%);
  animation: drift 20s ease-in-out infinite alternate-reverse;
}

.ambient-c {
  bottom: -160px;
  left: 50%;
  width: 520px;
  height: 320px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(124, 255, 189, 0.22), transparent 70%);
  animation: pulseGlow 10s ease-in-out infinite;
}

.particle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle-field span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.22));
  opacity: 0.35;
  box-shadow: 0 0 20px var(--note-glow);
  animation: floatParticle linear infinite;
}

.particle-field span:nth-child(1) { left: 6%; top: 86%; animation-duration: 16s; animation-delay: -2s; }
.particle-field span:nth-child(2) { left: 14%; top: 64%; animation-duration: 19s; animation-delay: -6s; }
.particle-field span:nth-child(3) { left: 23%; top: 92%; animation-duration: 14s; animation-delay: -4s; }
.particle-field span:nth-child(4) { left: 31%; top: 72%; animation-duration: 18s; animation-delay: -8s; }
.particle-field span:nth-child(5) { left: 43%; top: 88%; animation-duration: 13s; animation-delay: -1s; }
.particle-field span:nth-child(6) { left: 52%; top: 68%; animation-duration: 20s; animation-delay: -9s; }
.particle-field span:nth-child(7) { left: 61%; top: 91%; animation-duration: 17s; animation-delay: -7s; }
.particle-field span:nth-child(8) { left: 72%; top: 70%; animation-duration: 15s; animation-delay: -3s; }
.particle-field span:nth-child(9) { left: 81%; top: 84%; animation-duration: 21s; animation-delay: -10s; }
.particle-field span:nth-child(10) { left: 89%; top: 63%; animation-duration: 16s; animation-delay: -5s; }
.particle-field span:nth-child(11) { left: 94%; top: 90%; animation-duration: 19s; animation-delay: -11s; }
.particle-field span:nth-child(12) { left: 37%; top: 58%; animation-duration: 22s; animation-delay: -12s; }

.backstage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.host-avatar {
  position: absolute;
  top: 112px;
  right: max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 180ms ease, filter 180ms ease;
}

.host-avatar[data-state="warming"],
.host-avatar[data-state="speaking"],
.host-avatar[data-state="ready"] {
  filter: drop-shadow(0 0 18px var(--note-glow));
}

.host-avatar[data-state="speaking"] {
  transform: translateY(-4px) scale(1.01);
}

.host-orb {
  position: relative;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), transparent 30%),
    linear-gradient(180deg, color-mix(in srgb, var(--note-accent) 34%, #ffffff), rgba(10, 16, 32, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 32px color-mix(in srgb, var(--note-accent) 18%, transparent);
}

.host-orb-ring {
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.host-orb-ring:last-of-type {
  inset: -13px;
  border-color: color-mix(in srgb, var(--note-accent) 30%, transparent);
}

.host-glyph {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.45);
  animation: pulseDot 2.4s ease-in-out infinite;
}

.host-bubble {
  max-width: 280px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 24, 0.82);
  color: rgba(245, 247, 255, 0.92);
  font-size: 0.92rem;
  line-height: 1.45;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.audience {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 130px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  padding: 0 30px;
}

.audience-member {
  --crowd-bounce: 14px;
  --crowd-delay: 0ms;
  position: relative;
  width: clamp(38px, 4vw, 54px);
  height: clamp(88px, 12vw, 132px);
  opacity: 0.52;
  transform-origin: center bottom;
}

.audience-member.is-featured {
  opacity: 0.74;
}

.audience-member.is-vibing {
  animation: audienceBounce 540ms ease var(--crowd-delay);
}

.audience-member.is-cheering .audience-body {
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--note-accent) 18%, transparent));
}

.audience-head,
.audience-body {
  display: block;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.audience-head {
  width: 36%;
  height: 20%;
  border-radius: 999px;
}

.audience-body {
  width: 100%;
  height: 72%;
  margin-top: 8%;
  border-radius: 20px 20px 10px 10px;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--note-accent) 16%, transparent), transparent 46%),
    rgba(255, 255, 255, 0.05);
}

.app {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.glass-panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(12, 17, 34, 0.88), rgba(6, 10, 22, 0.72));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
}

.hero,
.score-panel,
.energy-panel,
.typing-card,
.piano-dock {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.76fr);
  gap: 24px;
  padding: 30px;
  border-radius: var(--radius-xl);
}

.hero::before,
.score-panel::before,
.energy-panel::before,
.typing-card::before,
.piano-dock::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, var(--note-accent-soft), transparent 36%),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.hero-primary {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.brand-mark {
  position: relative;
  width: 102px;
  height: 102px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(183, 146, 255, 0.22), rgba(10, 18, 36, 0.8));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 44px rgba(0, 0, 0, 0.3),
    0 0 36px rgba(126, 231, 255, 0.12);
}

.brand-ring {
  position: absolute;
  inset: 10px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-ring:last-of-type {
  inset: 20px;
  border-radius: 18px;
  border-color: var(--note-accent-soft);
}

.brand-glyph {
  position: relative;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.3rem;
  color: var(--text);
  text-shadow: 0 0 26px var(--note-glow);
  animation: bob 4s ease-in-out infinite;
}

.hero-copy h1,
.showcase-strip h2,
.typing-card h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(3rem, 6vw, 5.6rem);
  line-height: 0.94;
}

.eyebrow,
.panel-label,
.current-note-label,
.stat-label,
.footer-note,
#hint-text,
#history-caption,
#scene-description,
#phrase-text {
  color: var(--muted);
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
}

.subtitle {
  margin: 12px 0 0;
  font-size: 1.14rem;
  color: rgba(245, 247, 255, 0.86);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 247, 255, 0.92);
  font-size: 0.92rem;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--note-accent), #ffffff);
  box-shadow: 0 0 16px var(--note-glow);
  animation: pulseDot 2.6s ease-in-out infinite;
}

#hint-text {
  margin: 0;
  font-size: 0.96rem;
}

.scene-card {
  width: 100%;
  padding: 18px 18px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.scene-card strong {
  display: block;
  font-size: 1.12rem;
  margin-bottom: 8px;
}

#scene-description {
  margin: 0;
  line-height: 1.5;
  font-size: 0.94rem;
}

.scene-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.scene-status-label {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ai-pack-status {
  font-size: 0.9rem;
}

.ai-pack-status[data-state="warming"] {
  color: rgba(255, 210, 111, 0.94);
}

.ai-pack-status[data-state="ready"] {
  color: var(--note-accent);
}

.ai-pack-status[data-state="fallback"] {
  color: rgba(255, 159, 201, 0.94);
}

.showcase-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 20px;
  margin-top: 22px;
}

.score-panel,
.energy-panel {
  padding: 24px;
  border-radius: 30px;
}

.strip-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.showcase-strip h2,
.typing-card h2 {
  font-size: clamp(1.55rem, 2vw, 2.3rem);
}

.score-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

#phrase-text,
#streak-value {
  white-space: nowrap;
}

#streak-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.08rem;
}

.score-track {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  min-height: 146px;
}

.score-pill {
  min-height: 64px;
  padding: 14px 14px 12px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--score-accent) 28%, transparent), transparent 60%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: chipPop 280ms ease;
}

.score-pill strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.score-pill span {
  color: var(--muted);
  font-size: 0.88rem;
}

.energy-head {
  align-items: center;
}

#energy-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.15rem;
}

.energy-meter {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.energy-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.92), var(--note-accent));
  box-shadow: 0 0 18px var(--note-glow);
  transition: width 160ms ease;
}

.visualizer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 126px;
  margin-top: 20px;
}

.viz-bar {
  --bar-level: 18%;
  display: block;
  width: 100%;
  height: max(18%, var(--bar-level));
  border-radius: 999px 999px 16px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), var(--note-accent));
  box-shadow: 0 0 14px var(--note-glow);
  transition: height 150ms ease, box-shadow 180ms ease, opacity 180ms ease;
  opacity: 0.88;
}

.typing-card {
  margin-top: 24px;
  border-radius: 34px;
  padding: 28px;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.typing-card.is-focused {
  border-color: color-mix(in srgb, var(--note-accent) 32%, rgba(255, 255, 255, 0.1));
  box-shadow:
    0 26px 90px rgba(0, 0, 0, 0.46),
    0 0 0 1px color-mix(in srgb, var(--note-accent) 16%, transparent),
    0 0 52px color-mix(in srgb, var(--note-accent) 18%, transparent);
  transform: translateY(-2px);
}

.typing-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.current-note-wrap {
  min-width: 144px;
  text-align: right;
}

.current-note-label {
  display: block;
  font-size: 0.84rem;
  margin-bottom: 10px;
}

.current-note-badge {
  display: inline-grid;
  place-items: center;
  min-width: 92px;
  padding: 16px 18px;
  border-radius: 24px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--note-accent) 36%, transparent), transparent 62%),
    linear-gradient(145deg, rgba(183, 146, 255, 0.22), rgba(8, 12, 24, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 14px 30px rgba(0, 0, 0, 0.28),
    0 0 28px color-mix(in srgb, var(--note-accent) 18%, transparent);
}

.current-note-badge.is-updating {
  animation: noteBadgeKick 360ms ease;
}

.typing-zone {
  width: 100%;
  min-height: 274px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 30px;
  padding: 24px 24px 26px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--note-accent) 16%, transparent), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: var(--text);
  line-height: 1.7;
  font-size: 1.08rem;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.typing-zone:focus {
  border-color: color-mix(in srgb, var(--note-accent) 32%, rgba(255, 255, 255, 0.1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 3px color-mix(in srgb, var(--note-accent) 14%, transparent),
    0 0 36px color-mix(in srgb, var(--note-accent) 12%, transparent);
}

.typing-zone::placeholder {
  color: rgba(153, 166, 202, 0.86);
}

.stats-row,
.controls-row,
.history-row {
  margin-top: 22px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stat-value {
  display: inline-block;
  margin-top: 10px;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1;
  font-family: "Space Grotesk", sans-serif;
  transition: transform 180ms ease, color 180ms ease;
}

.stat-value.bump {
  transform: translateY(-2px) scale(1.04);
  color: var(--note-accent);
}

.stat-value-text {
  font-family: "Manrope", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.34;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.toggle-btn,
.action-btn,
.ghost-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 22px rgba(0, 0, 0, 0.22);
  transition:
    transform 110ms ease,
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.toggle-btn:hover,
.action-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--note-accent) 24%, rgba(255, 255, 255, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 14px 26px rgba(0, 0, 0, 0.28);
}

.toggle-btn:active,
.action-btn:active,
.ghost-btn:active {
  transform: translateY(1px) scale(0.985);
}

.toggle-btn.is-active {
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--note-accent) 22%, transparent), transparent 52%),
    rgba(255, 255, 255, 0.06);
}

.toggle-indicator {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.03);
}

.toggle-btn.is-active .toggle-indicator {
  background: linear-gradient(180deg, var(--note-accent), #ffffff);
  box-shadow: 0 0 18px var(--note-glow);
}

.action-btn {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--note-accent) 24%, rgba(183, 146, 255, 0.22)), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.03);
}

.history-row {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  align-items: center;
}

#history-caption {
  font-size: 0.92rem;
}

.note-history {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 52px;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(245, 247, 255, 0.92);
  font-size: 0.95rem;
  animation: chipPop 280ms ease;
}

.history-chip strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.footer-row {
  margin-top: 18px;
  text-align: center;
}

.footer-note {
  font-size: 0.96rem;
  letter-spacing: 0.05em;
}

.piano-dock-wrap {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 3;
}

.piano-dock {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 16px;
  border-radius: 30px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.piano-key {
  position: relative;
  min-height: 96px;
  border-radius: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(245, 247, 255, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    linear-gradient(180deg, rgba(14, 20, 37, 0.92), rgba(5, 8, 17, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 180ms ease;
}

.piano-key::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, color-mix(in srgb, var(--note-accent) 28%, transparent), transparent 45%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.piano-key.is-active::before {
  opacity: 1;
}

.piano-key.is-active {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--note-accent) 24%, rgba(255, 255, 255, 0.1)),
    0 0 30px color-mix(in srgb, var(--note-accent) 20%, transparent);
  transform: translateY(2px);
}

.floating-layer {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.floating-note {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 18px;
  color: rgba(245, 247, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--float-accent) 34%, transparent), transparent 50%),
    linear-gradient(145deg, rgba(183, 146, 255, 0.2), rgba(12, 18, 38, 0.84));
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.25), 0 0 32px color-mix(in srgb, var(--float-accent) 14%, transparent);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  animation: floatNote var(--float-duration, 1600ms) cubic-bezier(0.18, 0.74, 0.24, 1) forwards;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 136px;
  transform: translate(-50%, 18px);
  z-index: 5;
  max-width: min(92vw, 540px);
  padding: 12px 16px;
  border-radius: 999px;
  color: rgba(245, 247, 255, 0.94);
  background: rgba(7, 12, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.2); opacity: 1; }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(36px, 26px, 0) scale(1.08); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulseGlow {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.58; }
  50% { transform: translateX(-50%) scale(1.08); opacity: 0.82; }
}

@keyframes floatParticle {
  from {
    transform: translate3d(0, 0, 0) scale(0.8);
    opacity: 0;
  }
  15% {
    opacity: 0.42;
  }
  100% {
    transform: translate3d(0, -120vh, 0) scale(1.25);
    opacity: 0;
  }
}

@keyframes noteBadgeKick {
  0% { transform: scale(1); }
  40% { transform: scale(1.08) translateY(-2px); }
  100% { transform: scale(1); }
}

@keyframes chipPop {
  from {
    transform: translateY(8px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes audienceBounce {
  0% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(calc(var(--crowd-bounce) * -1));
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes floatNote {
  0% {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(0.74) rotate(var(--rotation, 0deg));
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x, 0px), var(--drift-y, -180px), 0) scale(var(--end-scale, 1.18)) rotate(calc(var(--rotation, 0deg) + 8deg));
  }
}

@media (max-width: 1040px) {
  .hero,
  .showcase-strip {
    grid-template-columns: 1fr;
  }

  .hero-side,
  .score-meta {
    align-items: flex-start;
  }

  .host-avatar {
    top: 92px;
    right: 24px;
  }
}

@media (max-width: 820px) {
  .page-shell {
    padding-top: 22px;
    padding-bottom: 196px;
  }

  .hero,
  .score-panel,
  .energy-panel,
  .typing-card {
    padding: 22px;
    border-radius: 28px;
  }

  .hero-primary {
    flex-direction: column;
  }

  .typing-card-head,
  .history-head,
  .strip-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .current-note-wrap {
    text-align: left;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .host-avatar {
    position: relative;
    top: auto;
    right: auto;
    margin: 0 auto 18px;
    justify-content: center;
  }

  .backstage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 12px;
  }

  .audience {
    left: 0;
    right: 0;
    bottom: 148px;
    gap: 8px;
  }
}

@media (max-width: 620px) {
  .hero-copy h1 {
    font-size: 2.7rem;
  }

  .typing-zone {
    min-height: 236px;
    padding: 20px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .controls-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .score-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visualizer {
    gap: 7px;
  }

  .piano-dock-wrap {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .piano-dock {
    gap: 8px;
    padding: 12px;
  }

  .piano-key {
    min-height: 72px;
    border-radius: 18px;
    font-size: 0.82rem;
  }

  .host-bubble {
    max-width: 220px;
    font-size: 0.84rem;
  }

  .audience-member {
    width: 30px;
    height: 74px;
  }
}
