/* Earshot — ночной эфир: ультрафиолет на чёрном, золото только для очков и правильных ответов. */
:root {
  --void: #07030f;
  --dusk: #120922;
  --plum: #241339;
  --line: #36204f;
  --uv: #a855f7;
  --uv-hot: #c084fc;
  --lilac: #ede4ff;
  --muted: #9a89b8;
  --gold: #ffc857;
  --rose: #ff5c8a;

  --display: 'Unbounded', 'Arial Black', sans-serif;
  --body: 'Onest', system-ui, sans-serif;
  --r-lg: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--void);
  color: var(--lilac);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* зерно поверх всего — как у старой плёнки */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* подсветка не выходит за экран (иначе на телефоне страница «гуляет» вбок) — двигается сам фон */
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(40vmax 30vmax at 70% 10%, rgba(168, 85, 247, .22), transparent 70%),
    radial-gradient(35vmax 35vmax at 10% 90%, rgba(91, 33, 182, .25), transparent 70%);
  background-size: 130% 130%;
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift { from { background-position: 0% 0%; } to { background-position: 100% 60%; } }

a { color: var(--uv-hot); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--uv-hot); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.gold { color: var(--gold); }
.rose { color: var(--rose); }

/* ---------- верхняя панель ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(var(--void) 40%, transparent);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font: 900 22px/1 var(--display); letter-spacing: -.04em; color: var(--lilac); text-decoration: none;
}
.logo-mark { width: 26px; height: 26px; border-radius: 50%; border: 5px solid var(--uv); position: relative; }
.logo-mark::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--gold); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--lilac); }
.nav a.active { color: var(--lilac); background: var(--plum); }

main { padding: 8px clamp(16px, 4vw, 48px) 120px; max-width: 1180px; margin: 0 auto; outline: none; }

/* ---------- типографика ---------- */
h1, h2, h3 { font-family: var(--display); letter-spacing: -.035em; margin: 0; line-height: 1.04; }
h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 18px; max-width: 58ch; margin: 18px 0 0; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; padding: 28px 0 36px; }
.page-title { font-size: clamp(32px, 7vw, 84px); font-weight: 900; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .25em; overflow-wrap: anywhere; }
.title-glyph { color: var(--uv); font-family: var(--display); font-weight: 900; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 14px; font-weight: 500; }
a.back:hover { color: var(--lilac); }
a.back::before { content: '‹ '; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--dusk); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--lilac);
  transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.btn:hover { border-color: var(--uv); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--uv); border-color: var(--uv); color: #fff; }
.btn-primary:hover { background: var(--uv-hot); border-color: var(--uv-hot); }
.btn-ghost { background: transparent; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1b0f00; }
.btn-gold:hover { border-color: #fff; }
.btn-lg { padding: 17px 30px; font-size: 17px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }

.field { display: grid; gap: 6px; }
.field span { font-size: 14px; color: var(--muted); }
.input {
  width: 100%; padding: 14px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--dusk); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--uv); box-shadow: 0 0 0 4px rgba(168, 85, 247, .18); }
.input::placeholder { color: #6e5d8c; }
.input-lg { padding: 18px 22px; font-size: 18px; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--dusk); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 10px 20px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--plum); color: var(--lilac); }

/* ==================== вводная страница ==================== */
.l-hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 72px);
  align-items: center; min-height: calc(100dvh - 110px); padding: 16px 0 56px;
}
/* размер заголовка привязан к ширине колонки: строки никогда не рвутся посередине */
.l-hero-copy { container-type: inline-size; }
.l-title { margin: 0; display: grid; gap: .1em; }
.l-title .l1 {
  font: 500 7.4cqi/1 var(--body); letter-spacing: -.03em; color: var(--muted); white-space: nowrap;
  animation: hero-in .7s var(--ease) both;
}
.l-title .l2 {
  font: 900 11.2cqi/1 var(--display); letter-spacing: -.055em; white-space: nowrap; color: var(--lilac);
  animation: hero-in .7s .12s var(--ease) both;
}
.l-title .one {
  display: inline-grid; place-items: center; width: 1.08em; height: 1.08em; margin: 0 .04em; vertical-align: -.12em;
  border-radius: 50%; background: var(--gold); color: #1b0f00; font-style: normal; letter-spacing: 0; font-size: .92em;
  box-shadow: 0 0 0 .07em var(--void), 0 0 0 .14em var(--uv), 0 0 50px rgba(255, 200, 87, .35);
}
@keyframes hero-in { from { opacity: 0; transform: translateY(24px); } }
.l-hero .lead { animation: hero-in .7s .24s var(--ease) both; }
.l-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; animation: hero-in .7s .32s var(--ease) both; }

/* большой логотип — он же кнопка «Играть» */
.hero-play { position: relative; display: grid; justify-items: center; gap: 14px; }
.hero-play .orb { width: min(440px, 78vw, 100%); }
.hero-play .orb-btn {
  width: 40%;
  background: radial-gradient(circle at 35% 30%, #fff1c2, var(--gold) 48%, #b7791f 100%);
  box-shadow: 0 0 0 14px var(--void), 0 0 0 26px var(--uv), 0 0 90px rgba(168, 85, 247, .6), 0 0 60px rgba(255, 200, 87, .35);
}
.hero-play .orb-btn svg { fill: #1b0f00; filter: none; }
.rings { position: absolute; top: 0; left: 50%; width: min(440px, 78vw, 100%); aspect-ratio: 1; transform: translateX(-50%); pointer-events: none; }
.rings i {
  position: absolute; inset: 30%; border-radius: 50%; border: 2px solid var(--uv);
  animation: ring 3.6s cubic-bezier(.2, .6, .3, 1) infinite; opacity: 0;
}
.rings i:nth-child(2) { animation-delay: 1.2s; } .rings i:nth-child(3) { animation-delay: 2.4s; }
@keyframes ring { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }
.play-caption { display: grid; justify-items: center; text-decoration: none; color: var(--lilac); }
.play-caption b { font: 900 30px/1 var(--display); letter-spacing: -.03em; }
.play-caption span { color: var(--muted); font-size: 14px; margin-top: 6px; }
.play-caption:hover b { color: var(--gold); }

.how { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 72px); align-items: center;
  padding: 80px 0; border-top: 1px solid var(--line); scroll-margin-top: 80px; }

.demo {
  position: relative; padding: 22px; border-radius: 26px; background: var(--dusk); border: 1px solid var(--line);
  box-shadow: 0 40px 120px -30px rgba(168, 85, 247, .45); transform: rotate(2deg);
}
.demo-top { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.demo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--uv); box-shadow: 0 0 12px var(--uv); }
.demo-score { margin-left: auto; font: 900 20px/1 var(--display); color: var(--gold); }
.demo-bar { height: 10px; border-radius: 99px; background: var(--plum); margin: 18px 0; overflow: hidden; }
.demo-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--uv), var(--uv-hot)); }
.demo-att { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.demo-att li {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  border: 1px dashed var(--line); font-size: 15px; color: var(--muted); min-height: 46px; transition: background .3s, border-color .3s;
}
.demo-att li.current { border: 2px solid var(--uv); background: var(--plum); color: var(--lilac); box-shadow: 0 0 24px rgba(168, 85, 247, .35); }
.demo-att li.wrong { border-style: solid; background: rgba(255, 92, 138, .08); color: var(--lilac); }
.demo-att li.wrong .num { background: var(--rose); color: #fff; }
.demo-att li.skip { border-style: solid; }
.demo-att li.right { border: 2px solid var(--gold); color: var(--gold); background: rgba(255, 200, 87, .08); }
.demo-att li.right .num { background: var(--gold); color: #1b0f00; }
.demo-att .num, .att .num {
  width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--plum); font: 700 12px/1 var(--display); color: var(--lilac);
}
.demo-att .sec, .att .sec { margin-left: auto; font: 700 12px/1 var(--display); color: var(--muted); }
.demo-att .what b { color: var(--lilac); }
.demo-att li.right .what b { color: var(--gold); }
.demo-win {
  position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%) scale(.6); opacity: 0;
  padding: 12px 22px; border-radius: 999px; background: var(--gold); color: #1b0f00; font: 900 16px/1 var(--display);
  white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; transition: transform .4s var(--ease), opacity .3s;
}
.demo.won .demo-win { opacity: 1; transform: translateX(-50%) scale(1); }


.ladder-row { display: flex; gap: 6px; margin-top: 32px; }
.rung {
  min-width: 64px; display: grid; align-content: end; gap: 4px; height: 150px; padding: 14px;
  border-radius: 14px; background: var(--plum); overflow: hidden;
}
.rung:nth-child(1) { background: var(--gold); color: #1b0f00; height: 190px; }
.rung:nth-child(2) { background: var(--uv-hot); color: #1b0f00; height: 175px; }
.rung:nth-child(3) { background: var(--uv); height: 160px; }
.rung:nth-child(4) { background: #6d28d9; }
.ladder-row { align-items: end; }
.rung b { font: 900 clamp(18px, 2.4vw, 30px)/1 var(--display); }
.rung span { font-size: 13px; opacity: .8; white-space: nowrap; }
.rung span::after { content: " очков"; }
.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: s; }
.steps li { display: grid; gap: 8px; counter-increment: s; }
.steps li::before { content: counter(s); font: 900 44px/1 var(--display); color: var(--uv); }
.steps b { font: 700 20px/1.2 var(--display); }
.steps span { color: var(--muted); }

.l-modes { padding: 72px 0; border-top: 1px solid var(--line); }
.l-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.l-modes-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 32px; border-top: 1px solid var(--line); }
.l-mode {
  display: grid; gap: 8px; align-content: start; padding: 26px 24px 30px; color: var(--lilac); text-decoration: none;
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); transition: background .25s;
}
.l-mode:nth-child(3n) { border-right: 0; }
.l-mode:hover { background: var(--dusk); }
.l-mode .glyph { font: 900 48px/1 var(--display); color: var(--uv); margin-bottom: 10px; }
.l-mode b { font: 700 20px/1.2 var(--display); letter-spacing: -.02em; }
.l-mode span:last-child { color: var(--muted); font-size: 15px; }

.marquee-sec { padding: 72px 0; border-top: 1px solid var(--line); overflow: hidden; }
.marquee-sec > p { margin: 14px 0 34px; max-width: 60ch; }
.marquee { overflow: hidden; margin: 0 calc(-1 * clamp(16px, 4vw, 48px)); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 44px; width: max-content; animation: marquee 90s linear infinite; padding: 6px 0; }
.marquee.reverse .marquee-track { animation-direction: reverse; animation-duration: 110s; }
.marquee-track span { font: 900 clamp(28px, 4vw, 52px)/1.1 var(--display); letter-spacing: -.04em; white-space: nowrap; color: var(--plum); -webkit-text-stroke: 1px var(--uv); }
.marquee-track span:nth-child(3n) { color: var(--lilac); -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

.l-final { padding: 96px 0 40px; border-top: 1px solid var(--line); text-align: center; display: grid; justify-items: center; gap: 18px; }
.l-final h2 { max-width: 18ch; font-size: clamp(32px, 5vw, 60px); font-weight: 900; }
.l-final p { max-width: 54ch; margin: 0 0 12px; }

/* ==================== режимы ==================== */
.mode-group { margin-bottom: 56px; }
.group-title { font-size: 15px; font-family: var(--body); letter-spacing: 0; font-weight: 600; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mode-row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: 30px 20px; border-bottom: 1px solid var(--line); transition: background .25s; scroll-margin-top: 120px;
}
.mode-row:hover, .mode-row:target { background: var(--dusk); }
.mode-glyph { font: 900 84px/1 var(--display); color: var(--uv); text-align: center; transition: transform .35s var(--ease), color .25s; }
.mode-row:hover .mode-glyph { transform: scale(1.08) rotate(-4deg); color: var(--uv-hot); }
.mode-body h3 { font-size: clamp(24px, 3vw, 34px); font-weight: 900; }
.mode-body p { margin: 8px 0 14px; color: var(--muted); max-width: 56ch; }
.rules { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.rules li { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.mode-go { display: grid; justify-items: end; gap: 10px; }
.record { font-size: 14px; color: var(--gold); min-height: 1.2em; }
.join-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 30px 20px; }
.join-row p { margin: 6px 0 0; }
.join-controls { display: flex; gap: 8px; }
.code-field { width: 180px; font: 900 22px/1 var(--display); letter-spacing: .3em; text-transform: uppercase; text-align: center; }

/* ==================== выбор музыки ==================== */
.pick { padding: 32px 0; border-top: 1px solid var(--line); display: grid; gap: 22px; }
.pick-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--dusk); border: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 18px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--uv); color: #fff; }

.countries { display: flex; gap: 8px; flex-wrap: wrap; }
.country {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 600; transition: border-color .2s, background .2s;
}
.country:hover { border-color: var(--uv); }
.country[aria-pressed="true"] { background: var(--lilac); color: var(--void); border-color: var(--lilac); }
.flag { width: 30px; height: 20px; border-radius: 5px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }

.country:disabled { opacity: .3; cursor: not-allowed; }
.step { display: grid; gap: 14px; margin-bottom: 30px; }
.step-title { font: 600 14px/1 var(--body); letter-spacing: 0; color: var(--muted); }

/* плитки жанров: цветной градиент, лица артистов и имена */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 46%), 1fr)); gap: 10px; }
.genre {
  position: relative; display: grid; align-content: end; gap: 4px; min-height: 150px; padding: 16px; border: 0; border-radius: 18px;
  text-align: left; cursor: pointer; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, var(--a), var(--b) 85%);
  outline: 3px solid transparent; outline-offset: 3px; transition: transform .25s var(--ease), outline-color .2s, filter .2s;
}
.genre:hover { transform: translateY(-3px); }
.genre[aria-pressed="true"] { outline-color: var(--gold); }
.genre[aria-pressed="true"]::after {
  content: '✓'; position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold); color: #1b0f00; font-weight: 900;
}
.genre b { font: 800 19px/1.1 var(--display); letter-spacing: -.03em; position: relative; }
.genre .who { font-size: 12.5px; line-height: 1.35; color: rgba(255, 255, 255, .7); position: relative;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.genre .faces { position: absolute; top: 14px; left: 14px; display: flex; }
.genre .faces img {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(7, 3, 15, .7); margin-right: -12px;
  animation: pop-in .4s var(--ease) both;
}
.genre .faces img:nth-child(2) { animation-delay: .06s; } .genre .faces img:nth-child(3) { animation-delay: .12s; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }

/* эпохи и стили внутри жанра */
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.sub {
  display: grid; gap: 3px; text-align: left; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  background: var(--dusk); border: 2px solid var(--line); transition: border-color .2s, background .2s;
}
.sub:hover { border-color: var(--uv); }
.sub[aria-pressed="true"] { border-color: var(--gold); background: var(--plum); }
.sub b { font: 700 16px/1.2 var(--display); letter-spacing: -.02em; }
.sub .hint { font-size: 13px; color: var(--uv-hot); }
.sub .who { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reveal-in { animation: rise .45s var(--ease); }

.artist-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.artist {
  display: grid; gap: 10px; justify-items: center; padding: 16px 10px; border-radius: 16px; border: 2px solid transparent;
  background: var(--dusk); cursor: pointer; text-align: center;
}
.artist:hover { border-color: var(--line); }
.artist[aria-pressed="true"] { border-color: var(--gold); }
.artist img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--plum); }
.artist small { color: var(--muted); }

.diff-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.diff {
  display: grid; gap: 6px; text-align: left; padding: 20px; border-radius: 18px; border: 2px solid var(--line);
  background: transparent; cursor: pointer; transition: border-color .2s, background .2s;
}
.diff:hover { border-color: var(--uv); }
.diff[aria-checked="true"] { border-color: var(--uv); background: var(--dusk); box-shadow: 0 0 40px -10px rgba(168, 85, 247, .5); }
.diff b { font: 700 20px/1.2 var(--display); }
.diff > span:last-child { color: var(--muted); font-size: 14px; }
.bars { display: flex; gap: 4px; align-items: end; height: 22px; margin-bottom: 8px; }
.bars i { width: 8px; border-radius: 2px; background: var(--line); }
.bars i:nth-child(1) { height: 40%; } .bars i:nth-child(2) { height: 70%; } .bars i:nth-child(3) { height: 100%; }
.bars i.on { background: var(--uv); }
.diff[aria-checked="true"] .bars i.on { background: var(--gold); }

.start-bar {
  position: sticky; bottom: 16px; z-index: 15; margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 14px 14px 24px; border-radius: 999px; background: rgba(18, 9, 34, .88); border: 1px solid var(--line);
  backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.summary { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary b { color: var(--lilac); }

/* ==================== игра ==================== */
.play .hud { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; max-width: 760px; margin: 0 auto 10px; }
.hud-src { display: grid; gap: 2px; color: var(--muted); font-size: 15px; }
.hud-mode { font: 700 14px/1 var(--display); color: var(--uv-hot); }
.hud-src b { color: var(--lilac); font-weight: 600; }
.hud-stats { display: flex; gap: 22px; align-items: center; }
.stat { display: grid; justify-items: end; line-height: 1.1; }
.stat b { font: 700 22px/1 var(--display); }
.stat small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat.gold b { color: var(--gold); }
.hearts { display: flex; gap: 4px; font-size: 26px; line-height: 1; }
.hearts i { font-style: normal; color: var(--line); transition: color .3s, transform .3s; }
.hearts i.full { color: var(--rose); text-shadow: 0 0 14px rgba(255, 92, 138, .6); }
.mountain { display: flex; gap: 3px; align-items: end; height: 46px; }
.mountain i {
  width: 12px; border-radius: 3px 3px 0 0; background: var(--line); font: 900 10px/1 var(--display); font-style: normal;
  display: grid; justify-items: center; color: var(--gold);
}
.mountain i.done { background: var(--uv); }
.mountain i.now { background: var(--gold); box-shadow: 0 0 14px rgba(255, 200, 87, .6); }
.mountain i.fell { background: var(--rose); }

.stage-wrap { display: grid; justify-items: center; gap: 14px; max-width: 760px; margin: 0 auto; }
.player-row { position: relative; display: grid; justify-items: center; }
.volume {
  position: absolute; right: -150px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer;
}
.volume svg { width: 22px; height: 22px; }
.volume input { width: 100px; accent-color: var(--uv); }

.orb { position: relative; width: min(230px, 58vw); aspect-ratio: 1; display: grid; place-items: center; }
.orb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb-btn {
  position: relative; width: 46%; aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #d8b4fe, var(--uv) 45%, #4c1d95 100%);
  box-shadow: 0 0 60px rgba(168, 85, 247, .55), inset 0 -10px 30px rgba(30, 0, 60, .5);
  display: grid; place-items: center; transition: transform .2s var(--ease);
}
.orb-btn:hover { transform: scale(1.04); }
.orb-btn:active { transform: scale(.96); }
.orb-btn svg { width: 34%; height: 34%; fill: #fff; filter: drop-shadow(0 2px 6px rgba(40, 0, 80, .6)); }
.orb-time { position: absolute; bottom: 4%; font: 700 14px/1 var(--display); color: var(--muted); }

.timeline { width: 100%; }
.track-bar { position: relative; height: 14px; border-radius: 999px; background: var(--dusk); overflow: hidden; border: 1px solid var(--line); }
.track-bar .unlocked { position: absolute; inset: 0 auto 0 0; background: var(--plum); transition: width .5s var(--ease); }
.track-bar .played { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--uv), var(--uv-hot)); }
.track-bar .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--void); }
.tick-labels { position: relative; height: 20px; margin-top: 4px; font: 700 12px/1 var(--display); color: var(--muted); }
.tick-labels span { position: absolute; transform: translateX(-100%); padding-top: 4px; }
.tick-labels span.on { color: var(--lilac); }

/* табло попыток: текущая строка и есть поле ответа */
.board { width: 100%; padding: 18px; border-radius: var(--r-lg); background: rgba(18, 9, 34, .7); border: 1px solid var(--line); }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.board-title { font: 700 16px/1 var(--display); letter-spacing: -.01em; }
.reward { margin-right: auto; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 200, 87, .35);
  color: var(--gold); font: 700 14px/1 var(--display); white-space: nowrap; }
.reward small { font: 500 11px/1 var(--body, inherit); color: var(--muted); margin-right: 4px; }
.reward[hidden] { display: none; }
.attempts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.att {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; border-radius: 14px;
  border: 1px dashed var(--line); color: var(--muted); font-size: 15px;
}
.att .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .what b { color: var(--lilac); font-weight: 600; }
.att.future { opacity: .55; }
.att.skip { border-style: solid; background: var(--dusk); }
.att.wrong { border: 1px solid rgba(255, 92, 138, .5); background: rgba(255, 92, 138, .07); }
.att.wrong .num { background: var(--rose); color: #fff; }
/* «близко»: трек не тот, артист верный — жёлтая, но мягче угаданной */
.att.close { border: 1px dashed rgba(255, 200, 87, .75); background: rgba(255, 200, 87, .06); }
.att.close .num { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.close-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font: 600 12px/1.4 var(--body);
  font-style: normal; color: #1b0f00; background: var(--gold); white-space: nowrap; }
.att.right { border: 2px solid var(--gold); background: rgba(255, 200, 87, .08); }
.att.right .num { background: var(--gold); color: #1b0f00; }
.att.right .what b { color: var(--gold); }
.att.current {
  border: 2px solid var(--uv); background: var(--plum); padding: 10px 14px; align-items: flex-start;
  box-shadow: 0 0 0 5px rgba(168, 85, 247, .12), 0 0 40px -6px rgba(168, 85, 247, .55);
}
.att.current .num { background: var(--uv); margin-top: 22px; }
.att.current .sec { margin-top: 30px; color: var(--uv-hot); }
.answer-box { position: relative; flex: 1; min-width: 0; display: grid; gap: 4px; }
.answer-label { font-size: 12px; font-weight: 600; color: var(--uv-hot); }
.answer-input {
  width: 100%; border: 0; background: transparent; outline: none; padding: 4px 0 6px;
  font: 600 19px/1.3 var(--body); color: var(--lilac);
}
.answer-input::placeholder { color: #8a77ab; font-weight: 400; }
.suggest {
  position: absolute; left: -54px; right: -60px; top: calc(100% + 12px); z-index: 30;
  list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow-y: auto;
  border-radius: 16px; border: 1px solid var(--uv); background: #160b29; box-shadow: 0 24px 70px rgba(0, 0, 0, .7);
}
.suggest li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--plum); }
.suggest img { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--plum); flex: none; }
.suggest .t { font-weight: 600; line-height: 1.2; color: var(--lilac); }
.suggest .a { font-size: 13px; color: var(--muted); }
.suggest .empty { color: var(--muted); padding: 12px; cursor: default; }
.kbd-hint { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }

.reveal-slot { width: 100%; }
.reveal {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: center; width: 100%;
  padding: 20px; border-radius: var(--r-lg); background: var(--dusk); border: 1px solid var(--line);
  animation: rise .5s var(--ease);
}
.reveal.win { border-color: var(--gold); box-shadow: 0 0 80px rgba(255, 200, 87, .12); }
.reveal img { width: 180px; height: 180px; border-radius: 14px; object-fit: cover; background: var(--plum); }
.reveal .verdict { font: 900 28px/1 var(--display); letter-spacing: -.03em; }
.reveal.win .verdict { color: var(--gold); }
.reveal.lose .verdict { color: var(--rose); }
.reveal .song { font: 700 22px/1.15 var(--display); margin-top: 14px; letter-spacing: -.02em; }
.reveal .by { color: var(--muted); margin-top: 6px; }
.reveal .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.burst { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.points-pop {
  position: fixed; left: 50%; top: 38%; z-index: 61; pointer-events: none; white-space: nowrap;
  font: 900 clamp(44px, 8vw, 88px)/1 var(--display); color: var(--gold); letter-spacing: -.04em;
  text-shadow: 0 0 40px rgba(255, 200, 87, .5); animation: pop 1.1s var(--ease) forwards;
}
@keyframes pop {
  0% { transform: translate(-50%, 0) scale(2.2); opacity: 0; }
  25% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -80px) scale(1); opacity: 0; }
}
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.final { text-align: center; display: grid; gap: 16px; justify-items: center; padding: 40px 0; }
.final h1 { font-size: clamp(36px, 7vw, 76px); font-weight: 900; }
.final-num { font: 900 clamp(64px, 12vw, 140px)/1 var(--display); color: var(--gold); letter-spacing: -.05em; }
.final-stats { display: flex; gap: 2px; border-radius: 18px; overflow: hidden; margin: 12px 0; }
.final-stats div { padding: 16px 26px; background: var(--dusk); display: grid; }
.final-stats b { font: 700 24px/1 var(--display); }
.final-stats span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.row-center { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ==================== комнаты ==================== */
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.panel { padding: 26px; border-radius: var(--r-lg); background: var(--dusk); border: 1px solid var(--line); display: grid; gap: 16px; align-content: start; }
.code-big {
  font: 900 clamp(56px, 10vw, 104px)/1 var(--display); letter-spacing: .08em; color: var(--lilac);
  background: none; border: 0; padding: 0; cursor: copy; text-align: left;
}
.players { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.players li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--plum); }
.players li.empty-slot { background: transparent; border: 1px dashed var(--line); }
.players .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; }
.players .dot.off { background: var(--muted); }
.players .host { margin-left: auto; font-size: 12px; color: var(--uv-hot); }

.room-frame { display: grid; gap: 18px; }
.sb { max-width: 760px; width: 100%; margin: 0 auto; }
.board-top { display: flex; justify-content: space-between; font: 700 13px/1 var(--display); color: var(--muted); margin-bottom: 8px; }
.board-top .clock { color: var(--lilac); font-size: 18px; }
.board-top .clock.low { color: var(--rose); }
.scoreboard { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.scoreboard li { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(110px, auto) 56px; gap: 12px; align-items: center; padding: 8px 14px; border-radius: 10px; background: var(--dusk); }
.scoreboard li.me { outline: 1px solid var(--uv); }
.scoreboard li.out { opacity: .45; }
.scoreboard .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard .status { font-size: 13px; color: var(--muted); }
.scoreboard b { font: 900 18px/1 var(--display); text-align: right; }
.pips { display: flex; gap: 3px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.pips i.used { background: var(--uv); }
.pips.solved i.used:last-of-type { background: var(--gold); }
.pips.failed i { background: var(--rose); opacity: .6; }
.room-results { max-width: 760px; width: 100%; margin: 0 auto; }
.results { display: grid; gap: 6px; }
.results div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--plum); }
.results div.out { background: rgba(255, 92, 138, .12); }
.results b { font-family: var(--display); }
.spectate { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 40px 0; }
.spectate .title-glyph { font-size: 64px; }
.standings { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; width: min(420px, 100%); }
.standings li { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 12px; background: var(--dusk); text-align: left; }
.standings li.me { outline: 1px solid var(--uv); }
.standings .place { width: 28px; font: 900 18px/1 var(--display); color: var(--muted); }
.standings li:first-child .place { color: var(--gold); }
.standings b { font: 900 18px/1 var(--display); }
.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================== достижения ==================== */
.ach-meter { display: grid; justify-items: end; }
.ach-meter b { font: 900 clamp(40px, 6vw, 64px)/1 var(--display); color: var(--gold); }
.ach-meter span { color: var(--muted); }
.ach-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ach { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 18px; background: var(--dusk); border: 1px solid var(--line); }
.ach .medal, .ach-pop .medal {
  width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font: 900 22px/1 var(--display); color: var(--muted); background: var(--plum); border: 2px dashed var(--line);
}
.ach.got { border-color: rgba(255, 200, 87, .4); }
.ach.got .medal, .ach-pop .medal {
  color: #1b0f00; border: 0; background: radial-gradient(circle at 35% 30%, #fff1c2, var(--gold) 50%, #b7791f);
  box-shadow: 0 0 30px rgba(255, 200, 87, .35);
}
.ach-text { display: grid; gap: 3px; min-width: 0; }
.ach-text b { font: 700 16px/1.2 var(--display); letter-spacing: -.01em; }
.ach-text > span { color: var(--muted); font-size: 14px; }
.ach-text small { color: var(--muted); font-size: 12px; }
.ach.got .ach-text small { color: var(--gold); }
.progress { display: block; height: 6px; border-radius: 3px; background: var(--plum); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--uv); }

#ach-stack { position: fixed; right: 16px; top: 84px; z-index: 95; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.ach-pop {
  display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; text-decoration: none; color: var(--lilac);
  background: #1a0d2e; border: 1px solid var(--gold); box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  animation: slide-in .5s var(--ease) both; transition: opacity .5s, transform .5s;
}
.ach-pop .medal { width: 52px; height: 52px; font-size: 18px; }
.ach-pop > span:last-child { display: grid; gap: 2px; }
.ach-pop small { color: var(--gold); font-size: 12px; font-weight: 600; }
.ach-pop b { font: 700 16px/1.2 var(--display); }
.ach-pop span span { color: var(--muted); font-size: 13px; }
.ach-pop.gone { opacity: 0; transform: translateX(40px); }
@keyframes slide-in { from { opacity: 0; transform: translateX(60px); } }

/* ==================== профиль, рейтинг, вход ==================== */
.big-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; border-radius: var(--r-lg); overflow: hidden; }
.big-stats div { padding: 22px; background: var(--dusk); }
.big-stats b { display: block; font: 900 clamp(28px, 4vw, 44px)/1 var(--display); }
.big-stats span { color: var(--muted); font-size: 14px; }
.big-stats .gold b { color: var(--gold); }
.dist { display: grid; gap: 8px; margin-top: 20px; }
.dist .bar { display: grid; grid-template-columns: 44px 1fr 40px; align-items: center; gap: 10px; font: 700 13px/1 var(--display); }
.dist .fill { height: 26px; border-radius: 6px; background: var(--uv); min-width: 4px; transition: width .8s var(--ease); }
.dist .bar.fail .fill { background: var(--rose); opacity: .7; }
.dist .n { color: var(--muted); }
.records { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 2px; }
.records li { display: flex; justify-content: space-between; padding: 12px 16px; background: var(--dusk); }
.records li:first-child { border-radius: 12px 12px 0 0; } .records li:last-child { border-radius: 0 0 12px 12px; }
.records b { font-family: var(--display); font-size: 15px; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.list li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--dusk); }
.list li:first-child { border-radius: 14px 14px 0 0; }
.list li:last-child { border-radius: 0 0 14px 14px; }
.list li:only-child { border-radius: 14px; }
.list .rank { width: 32px; font: 900 18px/1 var(--display); color: var(--muted); }
.list li:nth-child(1) .rank { color: var(--gold); }
.list .num { font: 700 16px/1 var(--display); }
.list .me { outline: 1px solid var(--uv); }

.auth { max-width: 440px; margin: 40px auto 0; display: grid; gap: 22px; }
.auth form { display: grid; gap: 14px; }
.auth .switch { color: var(--muted); }
.auth .switch button { background: none; border: 0; color: var(--uv-hot); cursor: pointer; padding: 0; text-decoration: underline; }
.code-input { font: 900 34px/1 var(--display); letter-spacing: .4em; text-align: center; }
.error { color: var(--rose); font-size: 15px; min-height: 1.2em; margin: 0; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin-top: 40px; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-lg); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 90; visibility: hidden;
  padding: 12px 20px; border-radius: 999px; background: var(--lilac); color: var(--void); font-weight: 600;
  transition: transform .35s var(--ease), visibility .35s; max-width: calc(100vw - 32px);
}
#toast.show { transform: translate(-50%, 0); visibility: visible; }

.loader { display: grid; place-items: center; padding: 80px 0; color: var(--muted); gap: 16px; }
.eq { display: flex; gap: 4px; height: 28px; align-items: flex-end; }
.eq i { width: 5px; background: var(--uv); border-radius: 3px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.2s; } .eq i:nth-child(3) { animation-delay: -.4s; } .eq i:nth-child(4) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }

/* ==================== адаптив ==================== */
@media (max-width: 980px) {
  .volume { position: static; transform: none; margin-top: 4px; }
}
@media (max-width: 900px) {
  .l-hero, .how { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-play { margin-top: 8px; }
  .demo { transform: none; }
  .l-modes-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-mode:nth-child(3n) { border-right: 1px solid var(--line); }
  .l-mode:nth-child(2n) { border-right: 0; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .lobby-grid, .two-col { grid-template-columns: 1fr; }
  .big-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-row { grid-template-columns: 80px minmax(0, 1fr); }
  .mode-glyph { font-size: 56px; }
  .mode-go { grid-column: 2; justify-items: start; }
  .diff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* иконки в меню нужны только в нижней панели телефона */
.nav i { display: none; font-style: normal; }

/* ==================== телефон ==================== */
@media (max-width: 640px) {
  :root { --tabbar: 64px; }
  html, body { overflow-x: clip; }
  body { -webkit-tap-highlight-color: transparent; }
  main { padding: 4px 16px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); }

  /* сверху — только логотип, меню уезжает в нижнюю панель, как в приложениях */
  .topbar { position: static; padding: 14px 16px 8px; padding-top: max(14px, env(safe-area-inset-top)); }
  .logo { font-size: 20px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom);
    background: rgba(12, 6, 24, .92); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  }
  .nav a {
    display: grid; justify-items: center; align-content: center; gap: 3px; padding: 6px 2px; border-radius: 14px;
    font-size: 11px; font-weight: 600; min-width: 0;
  }
  .nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav i { display: block; font-size: 19px; line-height: 1; }
  .nav a.active { background: transparent; color: var(--lilac); }
  .nav a.active i { color: var(--gold); }
  #toast { bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); }
  #ach-stack { top: 12px; right: 12px; }

  .page-head { padding: 12px 0 22px; }
  .lead { font-size: 16px; margin-top: 12px; }
  h2 { font-size: 26px; }

  /* главная: заголовок → большая кнопка Play → текст → кнопки */
  .l-hero { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 36px; min-height: 0; }
  .l-hero-copy { display: contents; }
  .l-title { order: 1; }
  .l-title .l1 { font-size: 26px; }
  .l-title .l2 { font-size: min(10.4vw, 46px); }
  .hero-play { order: 2; margin: 18px 0 6px; }
  .hero-play .orb, .rings { width: min(260px, 68vw); }
  .play-caption b { font-size: 24px; }
  .l-hero .lead { order: 3; margin-top: 18px; }
  .l-cta { order: 4; flex-wrap: nowrap; margin-top: 22px; }
  .l-cta .btn { flex: 1; padding: 14px 12px; font-size: 15px; }
  .how { padding: 48px 0; gap: 28px; }
  .ladder-row { gap: 4px; }
  .rung { min-width: 48px; height: 120px; padding: 10px 8px; border-radius: 12px; }
  .rung:nth-child(1) { height: 150px; } .rung:nth-child(2) { height: 140px; } .rung:nth-child(3) { height: 130px; }
  .rung b { font-size: 15px; white-space: nowrap; }
  .rung span { display: none; }
  .steps { margin-top: 32px; gap: 18px; }
  .steps li { grid-template-columns: 38px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; }
  .steps li::before { grid-row: span 2; font-size: 32px; }
  .steps b { font-size: 17px; }
  .demo { padding: 16px; }
  .l-modes, .marquee-sec { padding: 48px 0; }
  .l-modes-row { grid-template-columns: 1fr; }
  .l-mode { border-right: 0 !important; grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; padding: 18px 4px; }
  .l-mode .glyph { grid-row: span 2; font-size: 34px; margin: 0; }
  .l-final { padding: 56px 0 24px; }

  /* режимы: компактные строки — значок, название, описание и кнопка */
  .mode-group { margin-bottom: 36px; }
  .mode-row { grid-template-columns: 52px minmax(0, 1fr); gap: 4px 14px; padding: 20px 2px; align-items: start; }
  .mode-glyph { font-size: 40px; text-align: center; grid-row: span 2; }
  .mode-body h3 { font-size: 22px; }
  .mode-body p { font-size: 14.5px; margin: 6px 0 10px; }
  .rules li { font-size: 12px; padding: 4px 10px; }
  .mode-go { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-items: start; margin-top: 6px; }
  .mode-go .btn { padding: 11px 20px; }
  .join-row { padding: 22px 2px; gap: 14px; }
  .join-controls { width: 100%; }
  .code-field { flex: 1; width: auto; min-width: 0; }

  /* выбор музыки */
  .pick { padding: 24px 0; gap: 16px; }
  .pick-head { gap: 12px; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 10px 8px; font-size: 14px; }
  /* страны — лентой с прокруткой вбок вместо восьми строк */
  .countries { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .countries::-webkit-scrollbar { display: none; }
  .country { flex: none; scroll-snap-align: start; }
  .step { margin-bottom: 22px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .genre { min-height: 118px; padding: 12px; border-radius: 16px; }
  .genre b { font-size: 15px; }
  .genre .who { font-size: 11.5px; }
  .genre .faces img { width: 34px; height: 34px; }
  .sub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sub { padding: 12px; }
  .sub b { font-size: 14px; }
  .sub .who { display: none; }
  .diff { padding: 14px; }
  .diff b { font-size: 16px; }
  .diff > span:last-child { font-size: 12.5px; }
  .artist-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-bar {
    bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom)); border-radius: 20px; padding: 10px 10px 10px 16px;
  }
  .start-bar .btn-lg { padding: 12px 20px; font-size: 16px; flex: none; }
  .summary { white-space: normal; font-size: 13px; line-height: 1.35; }

  /* игра: круг поменьше, чтобы табло и поле ответа были на первом экране */
  .play .hud { margin-bottom: 4px; }
  .hud-src { font-size: 13.5px; }
  .hud-stats { gap: 12px; }
  .stat b { font-size: 19px; }
  .hearts { font-size: 22px; }
  .stage-wrap { gap: 10px; }
  .stage-wrap .orb { width: min(190px, 52vw); }
  .volume input { width: 120px; }
  .tick-labels span:nth-child(2) { display: none; } /* «2с» налезает на «1с» */
  .board { padding: 12px; border-radius: 18px; }
  .board-head { margin-bottom: 10px; }
  .board-title { font-size: 14px; }
  .board-head .btn-sm { padding: 8px 12px; font-size: 13px; }
  .att { min-height: 42px; padding: 6px 10px; gap: 10px; font-size: 14px; }
  .att.current { padding: 8px 10px; }
  .att.current .num { margin-top: 18px; }
  .answer-input { font-size: 17px; }
  .att .sec { display: none; }
  .suggest { left: -46px; right: -10px; max-height: 46vh; }
  .reveal { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 18px; gap: 16px; }
  .reveal img { width: 160px; height: 160px; }
  .reveal .verdict { font-size: 24px; }
  .reveal .song { font-size: 19px; }
  .reveal .row { justify-content: center; }
  .reveal .row .btn { flex: 1 1 100%; }
  .final-num { font-size: 72px; }
  .final-stats div { padding: 14px 16px; }

  /* комнаты, рейтинг, профиль */
  .panel { padding: 20px; }
  .code-big { font-size: 56px; }
  .scoreboard li { grid-template-columns: minmax(0, 1fr) auto 44px; padding: 8px 12px; }
  .scoreboard .status { display: none; }
  .big-stats div { padding: 16px; }
  .ach { padding: 14px; gap: 12px; }
  .ach .medal { width: 52px; height: 52px; font-size: 18px; }
  .ach-grid { grid-template-columns: 1fr; }
  .list li { padding: 12px; gap: 10px; }
  .auth { margin-top: 8px; }
}

/* на сенсорных экранах подсказки про клавиатуру ни к чему */
@media (hover: none) and (pointer: coarse) {
  .stage-wrap > .kbd-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* вход: ссылка «Забыли пароль?» справа от подписи поля */
.pass-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pass-label small { color: var(--muted); font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--uv-hot); cursor: pointer; font-size: 13px; text-decoration: underline; }

/* живые подборки: хиты сейчас, TikTok, новинки */
.live-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.live-daily { background: radial-gradient(120% 140% at 100% 0%, rgba(255, 92, 138, .22), transparent 55%), var(--dusk); }
@media (max-width: 1080px) { .live-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.live {
  position: relative; display: grid; align-content: start; gap: 6px; padding: 18px 18px 20px; border-radius: 18px; text-align: left;
  cursor: pointer; color: var(--lilac); border: 2px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255, 200, 87, .16), transparent 55%), var(--dusk);
  transition: border-color .2s, transform .25s var(--ease);
}
.live:hover { border-color: var(--uv); transform: translateY(-2px); }
.live[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 40px -12px rgba(255, 200, 87, .6); }
.live-tiktok { background: radial-gradient(120% 140% at 100% 0%, rgba(192, 132, 252, .3), transparent 55%), var(--dusk); }
.live-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--plum); color: var(--gold); font: 900 18px/1 var(--display); }
.live b { font: 800 19px/1.15 var(--display); letter-spacing: -.02em; margin-top: 4px; }
.live > span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.sub-live { background: linear-gradient(135deg, rgba(255, 200, 87, .1), transparent 60%), var(--dusk); }
.sub-live .hint { color: var(--gold); }
.dimmed { opacity: .4; transition: opacity .2s; }
.dimmed:hover { opacity: .75; }


.flag-icon { display: grid; place-items: center; background: none; box-shadow: none; font-size: 18px; line-height: 1; width: 30px; }

/* фон главной: эквалайзер из точек — под контентом, полупрозрачный, не ловит клики */
.bg-eq {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: .5;
  -webkit-mask-image: linear-gradient(to bottom, transparent 30%, #000 75%);
  mask-image: linear-gradient(to bottom, transparent 30%, #000 75%);
}
.landing > section { position: relative; }

/* пока звук грузится — по кругу бежит дуга */
.orb.loading::after {
  content: ''; position: absolute; width: 58%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  border: 3px solid transparent; border-top-color: var(--gold); border-right-color: var(--gold);
  animation: orb-spin .8s linear infinite;
}
@keyframes orb-spin { to { transform: rotate(360deg); } }

/* «Назад» в игре — тихая серая ссылка */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 6px 10px 6px 4px; border-radius: 999px; transition: color .2s, background .2s;
}
.back-link:hover { color: var(--lilac); background: var(--dusk); }
.back-link::before { content: '‹'; font-size: 20px; line-height: 1; margin-top: -2px; }
.play-top { max-width: 760px; margin: 0 auto 4px; }

.answer-box { scroll-margin-top: 12px; }

/* телефон: живые подборки строкой «значок + название» (правила здесь, потому что базовые стили карточек выше) */
@media (max-width: 640px) {
  .live-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .live { grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px; border-radius: 16px; }
  .live:hover { transform: none; }
  .live-icon { width: 32px; height: 32px; font-size: 15px; border-radius: 10px; }
  .live b { font-size: 13.5px; margin: 0; line-height: 1.2; }
  .live > span:last-child { display: none; }
  .back-link { margin-left: -4px; }
}

/* новый трек ждёт нажатия: круг мягко «дышит» */
.orb.awaiting .orb-btn { animation: orb-breathe 2.4s ease-in-out infinite; }
.orb.awaiting .orb-time { color: var(--gold); }
@keyframes orb-breathe {
  0%, 100% { box-shadow: 0 0 60px rgba(168, 85, 247, .55), inset 0 -10px 30px rgba(30, 0, 60, .5); transform: scale(1); }
  50% { box-shadow: 0 0 90px rgba(192, 132, 252, .85), inset 0 -10px 30px rgba(30, 0, 60, .5); transform: scale(1.045); }
}

/* ответ своим текстом, подсказки лёгкого уровня */
.answer-line { display: flex; align-items: center; gap: 8px; }
.answer-line .answer-input { flex: 1; min-width: 0; }
.answer-send {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--uv); background: rgba(168, 85, 247, .18);
  color: var(--lilac); font-size: 17px; cursor: pointer; display: grid; place-items: center; transition: background .15s;
}
.answer-send:hover, .answer-send:focus-visible { background: var(--uv); color: #fff; }
/* пропуск и подсказка — крупно под табло: в шапке их не замечали */
.round-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.round-actions[hidden], .round-actions .btn[hidden] { display: none; }
.round-actions .btn { min-width: 220px; white-space: nowrap; }
.round-actions .cost { font: 600 .78em/1 var(--body); opacity: .8; margin-left: 4px; }
.round-actions .skip { box-shadow: 0 10px 40px -12px rgba(168, 85, 247, .7); }
.btn-hint { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn-hint:hover:not(:disabled) { background: var(--gold); color: #1b0f00; border-color: var(--gold); }
.btn-hint:disabled { border-color: var(--line); color: var(--muted); opacity: 1; }
.answer-send.as-skip { color: var(--muted); }
@media (max-width: 640px) {
  /* на телефоне — друг под другом во всю ширину, пропуск (главное действие) сверху */
  .round-actions { flex-direction: column; gap: 10px; align-self: stretch; width: 100%; }
  .round-actions .btn { min-width: 0; width: 100%; padding: 16px; font-size: 16px; }
  .round-actions .skip { order: -1; }
}
.hints { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.hints li {
  padding: 7px 12px; border-radius: 999px; background: rgba(255, 200, 87, .09); border: 1px solid rgba(255, 200, 87, .45);
  color: var(--lilac); font-weight: 600; font-size: 14px; letter-spacing: .02em;
}
.hints li span { color: var(--gold); font-weight: 500; margin-right: 4px; }
@media (max-width: 640px) {
  .answer-send { width: 42px; height: 42px; }
  .board-head { flex-wrap: wrap; }
}

/* ---------- аватары и профиль ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover; background: var(--plum); }
.avatar-letter { font-family: var(--display); font-weight: 900; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 80% 58%), hsl(calc(var(--h) + 50) 75% 38%)); }
#nav-user i.has-avatar { display: inline-grid; place-items: center; margin-right: 8px; }
#nav-user i.has-avatar .avatar { box-shadow: 0 0 0 2px var(--line); }

.profile-head { display: flex; align-items: center; gap: 22px; padding: 28px 0 26px; flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 0; }
.profile-name { overflow-wrap: anywhere; }
.profile-sub { margin: 6px 0 0; }
.avatar-edit { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.avatar-edit .avatar, .avatar-static .avatar { box-shadow: 0 0 0 3px var(--uv), 0 0 40px rgba(168, 85, 247, .35); }
.avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--uv); color: #fff; font-size: 15px; border: 3px solid var(--void); transition: transform .2s var(--ease); }
.avatar-edit:hover .avatar-cam, .avatar-edit:focus-visible .avatar-cam { transform: scale(1.12); }
.friend-badge { color: var(--gold); font-weight: 700; }

.profile-tabs { margin-bottom: 28px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.profile-tabs button { white-space: nowrap; }
.profile-body h3 { margin: 32px 0 14px; display: flex; align-items: center; gap: 10px; }
.profile-body h3:first-child { margin-top: 0; }
.count { font: 600 13px/1 var(--body); color: var(--muted); padding: 4px 9px; border-radius: 999px; background: var(--plum); }

.person-link { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; min-width: 0; }
.person-link:hover b { color: var(--uv-hot); }
.list li.person { gap: 10px; }
.person .person-link { flex: 1; }
.person-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.rank-chip { font: 700 14px/1 var(--display); color: var(--muted); }
.friend-search { margin-bottom: 10px; }
.search-results { margin-bottom: 8px; }

.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.card-form { display: grid; gap: 14px; padding: 22px; border-radius: var(--r-lg); background: var(--dusk); border: 1px solid var(--line); }
.card-form h3 { margin: 0; }
.card-form > .btn { justify-self: start; }
.card-form[hidden] { display: none; }
.avatar-row { display: flex; align-items: center; gap: 16px; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 640px) {
  #nav-user i.has-avatar { margin-right: 0; } /* в нижней панели значок стоит над подписью */
  .profile-head { gap: 16px; padding-top: 16px; }
  .profile-head .avatar { width: 72px !important; height: 72px !important; }
  .profile-head > .btn, .profile-action { width: 100%; }
  .profile-action .btn { width: 100%; }
  .settings { grid-template-columns: 1fr; }
  .person-link .muted { display: block; font-size: 13px; }
}

/* ---------- плавные переходы ---------- */
/* всё, что появляется на странице (новая страница, загруженный раунд, вкладка профиля), мягко всплывает */
@keyframes page-in { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
#app > *, #round > *, .profile-body > * { animation: page-in .45s var(--ease) both; }
#round > .stage-wrap { animation-duration: .55s; }
/* табло и кнопки раунда собираются по очереди */
.stage-wrap > * { animation: page-in .5s var(--ease) both; }
.stage-wrap > :nth-child(2) { animation-delay: .06s; }
.stage-wrap > :nth-child(3) { animation-delay: .12s; }
.stage-wrap > :nth-child(4) { animation-delay: .18s; }
.stage-wrap > :nth-child(5) { animation-delay: .24s; }
/* ответ раунда выезжает, а не появляется рывком */
.reveal { animation: page-in .5s var(--ease) both; }
/* вошёл в аккаунт — аватар в меню «здоровается» */
@keyframes hello { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: none; } }
#nav-user.hello i { animation: hello .6s var(--ease) both; }
