:root {
  --bg: #0b0614;
  --bg2: #140a22;
  --card: rgba(28, 14, 48, 0.82);
  --card-border: rgba(255, 80, 200, 0.28);
  --text: #f6edff;
  --muted: #b9a4d4;
  --magenta: #ff2d95;
  --purple: #a855f7;
  --cyan: #22d3ee;
  --violet: #7c3aed;
  --good: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Space Grotesk", var(--font);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #3b0764 0%, transparent 55%),
              radial-gradient(900px 500px at 100% 0%, #831843 0%, transparent 50%),
              linear-gradient(180deg, var(--bg2), var(--bg));
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed; inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 45, 149, 0.22), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.14), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(168, 85, 247, 0.2), transparent 40%);
  pointer-events: none; z-index: 0; animation: pulseGlow 8s ease-in-out infinite alternate;
}
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.12;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}
@keyframes pulseGlow {
  from { transform: scale(1); opacity: 0.85; }
  to { transform: scale(1.08); opacity: 1; }
}

.top, main { position: relative; z-index: 1; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; max-width: 920px; margin: 0 auto;
}
.brand { display: flex; gap: 0.75rem; align-items: center; }
.brand-home {
  appearance: none; background: none; border: 0; color: inherit; font: inherit;
  cursor: pointer; padding: 0; text-align: left;
  display: flex; gap: 0.75rem; align-items: center; min-width: 0;
}
.brand-home:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 999px; }
.top-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.a11y-toggles { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.a11y-toggles .ghost-btn { font-size: 0.78rem; padding: 0.4rem 0.7rem; }
.a11y-toggles .ghost-btn[aria-pressed="true"] {
  color: #fff; border-color: var(--cyan); background: rgba(34, 211, 238, 0.16);
}
.logo-mark {
  width: 44px; height: 44px; border-radius: 50%;
  flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.35rem;
  background: linear-gradient(135deg, var(--magenta), var(--violet), var(--cyan));
  box-shadow: 0 0 24px rgba(255, 45, 149, 0.45);
}
.brand-home > span:last-child { min-width: 0; }
.brand-name {
  display: block; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-sub {
  display: block; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}

main { max-width: 920px; margin: 0 auto; padding: 0.5rem 1.25rem 3rem; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.card.hero { text-align: center; padding: 2rem 1.5rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  background: rgba(255, 45, 149, 0.15);
  border: 1px solid rgba(255, 45, 149, 0.35);
  color: #ffb3d9; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.85rem;
}
h1 {
  font-family: var(--display); font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.1; margin: 0 0 0.75rem; letter-spacing: -0.03em;
}
h1 .grad {
  background: linear-gradient(90deg, var(--magenta), var(--purple), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--muted); margin: 0 auto 1.5rem; max-width: 36rem; line-height: 1.5; }

.field { text-align: left; margin: 1rem 0; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.4rem; }
input[type="text"], input[type="url"], input[type="email"], input[type="password"] {
  width: 100%; padding: 0.85rem 1rem; border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(8, 4, 18, 0.7); color: var(--text);
  font: inherit; outline: none;
}
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.25rem; }
.btn {
  appearance: none; border: none; cursor: pointer; font: inherit; font-weight: 700;
  padding: 0.85rem 1.25rem; border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--magenta), var(--violet));
  box-shadow: 0 8px 28px rgba(255, 45, 149, 0.35);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  color: var(--text);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.4);
}
.btn-ghost, .ghost-btn {
  color: var(--muted); background: transparent;
  border: 1px solid rgba(185, 164, 212, 0.25);
  padding: 0.55rem 0.9rem; border-radius: 999px; cursor: pointer; font: inherit;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.split { display: grid; gap: 0.75rem; margin-top: 1rem; }
@media (min-width: 640px) {
  .split.two { grid-template-columns: 1fr 1fr; }
}

.code-pill {
  font-family: var(--display); font-size: 1.8rem; letter-spacing: 0.2em;
  padding: 0.75rem 1.25rem; border-radius: 14px;
  background: rgba(0,0,0,0.35); border: 1px dashed rgba(255,45,149,0.5);
  display: inline-block; margin: 0.5rem 0;
}
.muted { color: var(--muted); }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  background: rgba(168, 85, 247, 0.2); border: 1px solid rgba(168, 85, 247, 0.35);
}
.pill.online { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.4); color: var(--good); }
.pill.cyan { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.35); color: var(--cyan); }

.song-grid {
  display: grid; gap: 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin: 1rem 0;
}
.song-card {
  text-align: left; padding: 0.9rem; border-radius: 14px; cursor: pointer;
  background: rgba(0,0,0,0.28); border: 1px solid rgba(168, 85, 247, 0.25);
  color: inherit; font: inherit; transition: border-color 0.15s, transform 0.15s;
}
.song-card:hover { border-color: var(--magenta); transform: translateY(-2px); }
.song-card strong { display: block; font-size: 0.92rem; margin-bottom: 0.2rem; }
.song-card span { font-size: 0.78rem; color: var(--muted); }
.era-filter { margin: 1rem 0 0.75rem; text-align: left; }
.era-filter-label { display: block; font-size: 0.8rem; margin-bottom: 0.4rem; }
.era-filter-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.era-filter-btn {
  appearance: none; cursor: pointer; border-radius: 999px; padding: 0.35rem 0.75rem;
  border: 1px solid rgba(168, 85, 247, 0.35); background: rgba(8, 4, 18, 0.55);
  color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 600;
}
.era-filter-btn.selected, .era-filter-btn[aria-pressed="true"] {
  color: #fff; border-color: var(--cyan); background: rgba(34, 211, 238, 0.18);
}
.era-tag {
  display: inline-block; margin-top: 0.35rem; padding: 0.12rem 0.45rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255,255,255,0.28);
}
.song-card .era-tag { color: #fff; font-size: 0.72rem; }
.song-note {
  margin: 0.35rem 0 0; color: var(--text); line-height: 1.45; font-size: 0.92rem;
}
.tone-panel {
  margin: 1rem 0; padding: 0.9rem 1rem; text-align: left;
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
}
.tone-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.tone-help, .tone-status { font-size: 0.85rem; margin: 0.45rem 0; line-height: 1.4; }
.tone-choices { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tone-btn {
  appearance: none; cursor: pointer; font: inherit; font-weight: 700;
  padding: 0.55rem 0.9rem; border-radius: 999px; color: var(--text);
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.18);
}
.tone-btn.selected { color: #fff; border-color: var(--cyan); background: rgba(34, 211, 238, 0.18); }
.check-line { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.9rem; margin-top: 0.35rem; }
.check-line.is-disabled { opacity: 0.55; }
.prompt-tools { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.prompt-tools .btn, .prompt-tools .ghost-btn { font-size: 0.82rem; padding: 0.4rem 0.75rem; }
.trust-note { font-size: 0.85rem; line-height: 1.45; margin: 1rem auto 0; max-width: 38rem; }
.learned-card, .notice-card, .patterns-card, .starter-card {
  text-align: left; margin-top: 1.1rem; padding: 1rem 1rem 1.1rem;
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.14); background: rgba(0,0,0,0.22);
}
.learned-card h3, .notice-card h3, .patterns-card h3, .starter-card h3 {
  margin: 0 0 0.35rem; font-family: var(--display); font-size: 1.05rem;
}
.learned-card input, .notice-card input, .learned-card textarea {
  width: 100%; margin: 0.2rem 0 0.55rem; padding: 0.65rem 0.75rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16); background: rgba(0,0,0,0.35); color: var(--text); font: inherit;
}
.starter-card li { margin: 0.35rem 0; }

.player-wrap {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 2px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box,
              linear-gradient(135deg, var(--magenta), var(--cyan)) border-box;
  box-shadow: 0 0 40px rgba(255, 45, 149, 0.25);
  aspect-ratio: 16 / 9; margin: 1rem 0;
}
#yt-player { width: 100%; height: 100%; }
.player-shield {
  position: absolute; inset: 0; z-index: 2;
  cursor: default; background: transparent;
}
.player-overlay {
  position: absolute; inset: auto 0 0 0; padding: 0.75rem 1rem; z-index: 3;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  display: flex; justify-content: space-between; align-items: flex-end;
  pointer-events: none; font-size: 0.85rem;
}

.prompt-card {
  margin-top: 1rem; padding: 1.25rem; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,45,149,0.18), rgba(34,211,238,0.12));
  border: 1px solid rgba(255,45,149,0.4);
  animation: popIn 0.35s cubic-bezier(.2,1.2,.4,1);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.prompt-card h3 { margin: 0 0 0.85rem; font-family: var(--display); }
.choices { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.choice {
  flex: 1 1 auto; min-width: 100px; padding: 0.75rem 1rem; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(0,0,0,0.35);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.choice:hover { border-color: var(--cyan); }
.choice.selected {
  border-color: var(--magenta);
  background: rgba(255, 45, 149, 0.25);
  box-shadow: 0 0 16px rgba(255, 45, 149, 0.3);
}
.choice.mate-selected {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.22);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
}
.choice.selected.mate-selected,
.choice.sync-match {
  border-color: #fff59d;
  background: linear-gradient(135deg, rgba(255,45,149,0.35), rgba(34,211,238,0.35));
  box-shadow: 0 0 28px rgba(255, 214, 102, 0.55);
  animation: syncPulse 0.7s ease;
}
.choice:disabled { opacity: 0.85; cursor: default; }
.prompt-card.celebrate {
  position: relative;
  animation: celebratePop 0.65s cubic-bezier(.2,1.2,.4,1);
}
.prompt-card.celebrate::after {
  content: "✨ In sync!";
  position: absolute; top: -0.65rem; right: 0.85rem;
  font-size: 0.85rem; font-weight: 800; color: #fff59d;
  text-shadow: 0 0 12px rgba(255,214,102,0.8);
  animation: floatSpark 1.2s ease-out;
}
.celebrate-burst {
  pointer-events: none; position: fixed; inset: 0; z-index: 50;
  overflow: hidden;
}
.celebrate-burst i {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  animation: confettiFall 1.1s ease-out forwards;
}
@keyframes syncPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes celebratePop {
  0% { transform: scale(0.98); }
  50% { transform: scale(1.02); }
  100% { transform: none; }
}
@keyframes floatSpark {
  0% { opacity: 0; transform: translateY(6px); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}
@keyframes confettiFall {
  0% { transform: translate3d(0,0,0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--dx), 110vh, 0) rotate(540deg); opacity: 0; }
}

.score-ring {
  width: 160px; height: 160px; margin: 1rem auto; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--magenta) calc(var(--pct) * 1%), rgba(255,255,255,0.08) 0);
  position: relative;
}
.score-ring::after {
  content: ""; position: absolute; inset: 12px; border-radius: 50%;
  background: var(--bg2);
}
.score-ring .val {
  position: relative; z-index: 1; font-family: var(--display);
  font-size: 2.4rem; font-weight: 700;
}
.why { color: var(--muted); max-width: 28rem; margin: 0.5rem auto 1rem; line-height: 1.45; }
.breakdown { text-align: left; margin: 1rem 0; }
.breakdown li { margin: 0.4rem 0; color: var(--muted); }
.breakdown li.ok { color: var(--good); }
.breakdown li.no { color: var(--danger); }

.mates-list { display: grid; gap: 0.65rem; margin-top: 1rem; }
.mate-row {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1rem; border-radius: 14px;
  background: rgba(0,0,0,0.28); border: 1px solid rgba(168, 85, 247, 0.25);
}
.mate-row h4 { margin: 0 0 0.2rem; font-size: 1rem; }
.mate-meta { font-size: 0.8rem; color: var(--muted); }

.toasts {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50;
  display: flex; flex-direction: column; gap: 0.5rem; max-width: min(360px, calc(100vw - 2rem));
}
.toast {
  padding: 0.75rem 1rem; border-radius: 12px;
  background: rgba(20, 8, 36, 0.92); border: 1px solid rgba(34, 211, 238, 0.4);
  box-shadow: var(--shadow); animation: popIn 0.3s ease;
  font-size: 0.9rem;
}
.toast.heart { border-color: rgba(255, 45, 149, 0.55); }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 10px var(--good); animation: blink 1.2s infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }

.hidden { display: none !important; }
.waiting-spin {
  width: 48px; height: 48px; margin: 1rem auto;
  border-radius: 50%; border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--magenta); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.linkish { color: var(--cyan); cursor: pointer; text-decoration: underline; background: none; border: none; font: inherit; }

.auth-gate { margin-top: 1rem; text-align: left; }
.auth-card {
  padding: 1.1rem 1.2rem; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,45,149,0.16), rgba(34,211,238,0.12));
  border: 1px solid rgba(255,45,149,0.35);
}
.auth-card h3 { margin: 0 0 0.35rem; font-family: var(--display); }


/* Avatars + player chips */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.35rem 0 0.85rem;
}
@media (max-width: 520px) {
  .avatar-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.4rem; }
  .avatar-option span { font-size: 0.55rem; }
}
.avatar-option {
  appearance: none; border: 2px solid transparent; border-radius: 16px;
  background: rgba(0,0,0,0.28); padding: 0.35rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  color: var(--muted); font-size: 0.65rem; font-weight: 600;
}
.avatar-option:hover { border-color: rgba(34,211,238,0.45); }
.avatar-option.selected {
  border-color: var(--magenta);
  box-shadow: 0 0 0 1px rgba(255,45,149,0.35), 0 0 18px rgba(255,45,149,0.25);
  color: var(--text);
}
.avatar-svg, .avatar-img {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #f4e7c3;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}
/* Lobby picker cells size the face; don't blow up to the JPG's 1024px */
.avatar-option .avatar-svg,
.avatar-option .avatar-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1 / 1;
}
.avatar-bubble .avatar-svg,
.avatar-bubble .avatar-img {
  width: 40px;
  height: 40px;
}
.players-row {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: stretch;
  margin: 0.75rem 0 1rem;
}
.player-chip {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.55rem 0.85rem 0.55rem 0.55rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  min-width: 0;
}
.player-chip.compact { padding: 0.35rem 0.65rem 0.35rem 0.35rem; }
.avatar-bubble { flex: 0 0 auto; line-height: 0; }
.player-chip-meta { display: flex; flex-direction: column; min-width: 0; }
.player-chip-meta strong {
  font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-loc {
  font-size: 0.72rem; color: var(--cyan); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
.player-loc.muted { color: var(--muted); }
.choice.mate-selected:not(.selected) {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}
.mate-pick-badge {
  display: inline-block; margin-left: 0.35rem; padding: 0.1rem 0.45rem;
  border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  background: rgba(34,211,238,0.2); color: var(--cyan);
  border: 1px solid rgba(34,211,238,0.45);
}


/* Location searchable dropdown */
.loc-combo { position: relative; }
.loc-dropdown {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 220px; overflow: auto;
  background: #160b24; border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  padding: 0.35rem;
}
.loc-option {
  appearance: none; display: block; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text);
  padding: 0.55rem 0.7rem; border-radius: 8px; cursor: pointer; font: inherit;
}
.loc-option:hover, .loc-option.selected { background: rgba(34,211,238,0.16); color: var(--cyan); }
.loc-empty { padding: 0.7rem; color: var(--muted); font-size: 0.85rem; }


/* Site footer + feedback modal + song intro */
.site-footer {
  position: relative; z-index: 1;
  max-width: 920px; margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  color: var(--muted); font-size: 0.78rem;
  border-top: 1px solid rgba(255, 80, 200, 0.12);
}
.footer-copy { letter-spacing: 0.02em; }
.footer-link {
  background: none; border: none; color: var(--cyan);
  font: inherit; cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.footer-link:hover { color: #fff; }
.site-footer.compact { padding: 0.65rem 1.25rem 1rem; opacity: 0.85; }

.modal {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: rgba(5, 2, 12, 0.72);
  backdrop-filter: blur(6px);
  padding: 1rem;
}
.modal[hidden] { display: none !important; }
.modal-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.modal-card h2 { margin: 0 0 0.35rem; font-family: var(--display); }
.modal-card label { display: block; margin: 0.75rem 0 0.3rem; font-size: 0.85rem; }
.modal-card input,
.modal-card textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.28);
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font: inherit;
}
.modal-card textarea { resize: vertical; min-height: 110px; }

.song-intro {
  margin-top: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(255, 45, 149, 0.1));
  animation: celebratePop 0.55s cubic-bezier(.2,1.2,.4,1);
}
.song-intro h3 {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-size: 1.05rem;
}
.song-intro ul {
  margin: 0; padding-left: 1.1rem;
  color: var(--text);
  line-height: 1.55;
}
.song-intro .intro-actions { margin-top: 0.85rem; }


/* Homepage emphasis — white bold */
.hl-strong {
  color: #fff;
  font-weight: 700;
}

.ghost-btn.hl-mates,
#btn-mates {
  color: #fff;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.35);
}
#btn-mates:hover {
  color: #fff;
  border-color: rgba(34, 211, 238, 0.55);
}

.auth-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.85rem 0 0.5rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-tab {
  flex: 1;
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}
.auth-tab.active {
  color: #fff;
  background: rgba(255, 45, 149, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 45, 149, 0.35);
}
.auth-panel { margin-top: 0.25rem; }
.auth-links { margin: 0.75rem 0 0; font-size: 0.85rem; }
.auth-card .actions { justify-content: flex-start; }

/* Song rating (after 10th prompt) */
.rate-card h3 { margin: 0.25rem 0 0; }
.rate-slider-wrap { margin-top: 0.5rem; }
.rate-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: #fbbf24;
  height: 1.5rem;
  cursor: pointer;
}
.rate-stars {
  text-align: center;
  font-size: 1.75rem;
  letter-spacing: 0.15em;
  color: #fbbf24;
  margin: 0.5rem 0 0.25rem;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.45);
}
.rate-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 0.15rem;
}

/* Larger type + high contrast. Persisted on body from localStorage. */
body.a11y-large { font-size: 1.125rem; }
body.a11y-large h1 { font-size: clamp(2rem, 5.4vw, 3rem); }
body.a11y-large .prompt-card h3,
body.a11y-large .song-intro h3 { font-size: 1.35rem; }
body.a11y-large .choice { font-size: 1.05rem; padding: 0.95rem 1.05rem; }
body.a11y-large .lead,
body.a11y-large .muted,
body.a11y-large .trust-note { font-size: 1.02rem; }
body.a11y-large .brand-sub { font-size: 0.85rem; }

body.a11y-contrast {
  --bg: #000;
  --bg2: #000;
  --card: #0a0a0a;
  --card-border: #fff;
  --text: #fff;
  --muted: #f2f2f2;
  --magenta: #ff4faa;
  --cyan: #7ef0ff;
  --good: #5dffa8;
  --warn: #ffe08a;
}
body.a11y-contrast {
  background: #000;
}
body.a11y-contrast .bg-glow,
body.a11y-contrast .bg-grid { display: none; }
body.a11y-contrast .card,
body.a11y-contrast .prompt-card,
body.a11y-contrast .song-intro,
body.a11y-contrast .tone-panel,
body.a11y-contrast .learned-card,
body.a11y-contrast .modal-card {
  background: #000;
  border: 2px solid #fff;
  box-shadow: none;
  backdrop-filter: none;
}
body.a11y-contrast .choice,
body.a11y-contrast input,
body.a11y-contrast textarea,
body.a11y-contrast .song-card,
body.a11y-contrast .tone-btn,
body.a11y-contrast .ghost-btn,
body.a11y-contrast .btn-ghost {
  background: #000;
  color: #fff;
  border: 2px solid #fff;
}
body.a11y-contrast .btn-primary {
  background: #fff;
  color: #000;
  box-shadow: none;
}
body.a11y-contrast .choice.selected { outline: 3px solid #ffeb3b; }
body.a11y-contrast .choice.mate-selected { outline: 3px solid #7ef0ff; }
body.a11y-contrast .hl-strong,
body.a11y-contrast .brand-name,
body.a11y-contrast h1,
body.a11y-contrast h2,
body.a11y-contrast h3 { color: #fff; }
body.a11y-contrast .grad {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #fff;
  color: #fff;
}

@media (max-width: 720px) {
  .top { align-items: flex-start; }
  .top-actions { width: 100%; }
  .a11y-toggles { width: 100%; }
}
