/* Музыкальный адвент 2026 — современная рождественская ночь над Прагой.
   Структура: шрифты → переменные → фон → шапка → общие элементы →
   главная (hero, окошки) → модальное окно → вход → «Мой плейлист» → админка → мобильные. */

/* Playfair Display (OFL): праздничный шрифт с засечками и обычными цифрами. */
@font-face {
  font-family: "Playfair";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/playfair-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Playfair";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/playfair-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Угол для вращающейся подсветки готового окошка. */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg-0: #060a15;
  --bg-1: #0c1430;
  --bg-2: #141f45;
  --text: #f5f2ea;
  --muted: #9ba7c4;
  --line: rgba(255, 255, 255, .11);
  --glass: rgba(18, 26, 56, .55);
  --gold: #e9b95c;
  --gold-2: #ffdc8f;
  --gold-deep: #b9822f;
  --ruby-1: #5e1027; --ruby-2: #a8233f;
  --pine-1: #0b3a2e; --pine-2: #17725a;
  --navy-1: #18265a; --navy-2: #2f4aa0;
  --ok: #8be3b0;
  --danger: #ffb0b8;
  --spotify: #1ed760;
  --radius: 20px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .75);
  --serif: "Playfair", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg-0); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 600px at 12% -8%, rgba(84, 112, 255, .22), transparent 62%),
    radial-gradient(900px 520px at 92% -4%, rgba(233, 185, 92, .14), transparent 60%),
    radial-gradient(900px 700px at 50% 112%, rgba(40, 170, 150, .12), transparent 62%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 55%, var(--bg-2) 100%);
  background-attachment: fixed;
  padding-bottom: 190px; /* место для силуэта Праги */
}

/* Звёзды: несколько слоёв точек, медленно мерцают. */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent 60%),
    radial-gradient(1px 1px at 120px 80px, rgba(255, 255, 255, .8), transparent 60%),
    radial-gradient(1.5px 1.5px at 200px 160px, #fff, transparent 60%),
    radial-gradient(1px 1px at 260px 40px, rgba(255, 255, 255, .7), transparent 60%),
    radial-gradient(1px 1px at 330px 210px, rgba(255, 255, 255, .6), transparent 60%),
    radial-gradient(1.5px 1.5px at 60px 250px, rgba(255, 236, 190, .9), transparent 60%);
  background-size: 360px 300px;
  opacity: .5;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .6) 55%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .6) 55%, transparent 85%);
  animation: twinkle 7s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35; } to { opacity: .6; } }

#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.skyline {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  background: url("/static/img/prague-skyline.svg") center bottom / auto 100% repeat-x;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 -12px 40px rgba(233, 185, 92, .12));
}

.topbar, main, .footer { position: relative; z-index: 2; }

a { color: var(--gold-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 6px; }

/* --- шапка: стеклянная, прилипает к верху --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(6, 10, 21, .55);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: .6rem 1.1rem;
  padding-top: max(.6rem, env(safe-area-inset-top));
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--text);
  text-decoration: none;
  min-height: 2.75rem;
  font: 600 1.25rem/1 var(--serif);
}
.brand:hover { color: var(--text); }
.brand-star { width: 1.15rem; height: 1.15rem; fill: var(--gold); filter: drop-shadow(0 0 6px rgba(233, 185, 92, .6)); }
.brand-year { color: var(--gold); }

.nav { display: flex; align-items: center; gap: .5rem; }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .92rem; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  font-weight: 700;
  font-size: .9rem;
  color: #2a1a05;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .08);
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: 999px;
  font: 600 .92rem var(--sans);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.pill:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.pill.ghost { background: transparent; color: var(--muted); }
.logout { gap: .4rem; }
.logout svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
form.inline { display: inline; margin: 0; }

main { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.1rem 2rem; }

.footer { text-align: center; color: rgba(155, 167, 196, .6); font-size: .8rem; padding: 1rem; }

/* --- типографика --- */
/* Цифры одинаковой ширины — таймер и счётчики не «прыгают». */
.stat-num, .tile-num, .countdown-value { font-variant-numeric: lining-nums tabular-nums; }
.display {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: 0;
  background: linear-gradient(180deg, #fff6df 10%, var(--gold-2) 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h1.display { font-size: clamp(2.2rem, 6vw, 3.7rem); }
h2 { font: 600 1.4rem/1.2 var(--serif); color: var(--gold-2); margin: 0 0 .75rem; }
.eyebrow {
  margin: 0 0 .5rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}
.lead { color: var(--muted); font-size: 1.08rem; max-width: 36rem; margin: .8rem 0 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; margin: .75rem 0 0; }
.ok { color: var(--ok); font-weight: 650; margin: 0; }
.notice { color: var(--gold-2); margin: 0; }
.center { text-align: center; }

/* --- карточки, кнопки, поля --- */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 14px;
  font: 650 1rem var(--sans);
  color: #2a1a05;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 10px 24px -10px rgba(233, 185, 92, .8), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .15s, filter .2s, box-shadow .2s;
}
.btn:hover { filter: brightness(1.06); color: #2a1a05; }
.btn:active { transform: scale(.98); }
.btn.wide { width: 100%; }
.btn.spotify {
  width: 100%;
  color: #04170b;
  background: linear-gradient(180deg, #3be37b, var(--spotify));
  box-shadow: 0 10px 24px -12px rgba(30, 215, 96, .9), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn.spotify:hover { color: #04170b; }

button.link {
  font: inherit;
  color: var(--gold-2);
  background: none;
  border: 0;
  padding: .3rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
button.link.danger { color: var(--danger); }

.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .4rem; font-size: .9rem; font-weight: 550; color: var(--muted); }
input, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* меньше 16px — и iPhone приближает страницу при касании поля */
  color: var(--text);
  background: rgba(4, 8, 20, .55);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  padding: .8rem .95rem;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: rgba(155, 167, 196, .55); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(233, 185, 92, .18);
}
textarea { resize: vertical; min-height: 7rem; line-height: 1.45; }
input.pin { font-size: 1.5rem; letter-spacing: .6em; text-align: center; padding-left: 1.6em; }

.error {
  margin: 0;
  color: var(--danger);
  background: rgba(168, 35, 63, .18);
  border: 1px solid rgba(255, 176, 184, .28);
  border-radius: 14px;
  padding: .8rem 1rem;
}
.error ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.error p { margin: 0; }
.card > .error, main > .error { margin-bottom: 1rem; }

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  margin: 1.4rem 0 0;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  background: rgba(233, 185, 92, .08);
  border: 1px solid rgba(233, 185, 92, .28);
}
.callout p { margin: 0; }
.callout .count { font-weight: 650; }
.callout .btn { margin-left: auto; min-height: 2.6rem; }
p.callout.notice { margin: 0 0 1rem; }

.chip {
  display: inline-block;
  padding: .1rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
}
.chip-ok { color: var(--ok); background: rgba(139, 227, 176, .1); border-color: rgba(139, 227, 176, .3); }

/* Списки песен. */
ol.tracks { list-style: none; counter-reset: t; margin: 1rem 0 0; padding: 0; display: grid; gap: .1rem; }
ol.tracks li {
  counter-increment: t;
  display: grid;
  grid-template-columns: 2rem 1fr;
  column-gap: .6rem;
  padding: .5rem .25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
ol.tracks li::before {
  content: counter(t);
  grid-row: span 2;
  align-self: center;
  color: var(--muted);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.t-title { font-weight: 600; overflow-wrap: anywhere; }
.t-artist { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
ol.tracks.checked li { grid-template-columns: 2rem 1.4rem 1fr; }
ol.tracks.checked .mark { grid-row: span 2; align-self: center; font-weight: 700; }
ol.tracks.checked .t-artist { grid-column: 3; }
ol.tracks.checked li.good .mark { color: var(--ok); }
ol.tracks.checked li.bad .mark, ol.tracks.checked li.bad .t-title { color: var(--danger); }
@media (min-width: 760px) {
  ol.tracks.two-col { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
}

/* --- главная: hero --- */
.hero { padding: .5rem 0 1.75rem; }
.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .75rem;
  margin-top: 1.5rem;
}
.stats { display: flex; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.stats li, .countdown {
  display: grid;
  align-content: center;
  padding: .7rem 1.1rem;
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
}
.stat-num { font: 600 1.6rem/1 var(--serif); color: var(--text); }
.stats li.hot .stat-num { color: var(--gold-2); }
.stat-label { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.countdown { flex: 1 1 15rem; }
.countdown-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 650; }
.countdown-value { font: 600 1.6rem/1.15 var(--serif); color: var(--gold-2); }

/* --- главная: окошки --- */
.calendar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 94px;
  grid-auto-flow: dense;
  gap: 10px;
}
@media (min-width: 700px) {
  .calendar { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 124px; gap: 14px; }
}
.window.big { grid-column: span 2; grid-row: span 2; }
.window.wide { grid-column: span 2; }
.window.tall { grid-row: span 2; }

.window {
  --c1: var(--ruby-1);
  --c2: var(--ruby-2);
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #050812;
  perspective: 800px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  isolation: isolate;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .9);
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
  animation: rise .6s cubic-bezier(.2, .8, .2, 1) backwards;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.window:nth-of-type(3n+2) { --c1: var(--pine-1); --c2: var(--pine-2); }
.window:nth-of-type(3n) { --c1: var(--navy-1); --c2: var(--navy-2); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); } }

@media (hover: hover) {
  .window:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -16px rgba(0, 0, 0, .95); }
}
.window:active { transform: scale(.98); }

/* Что за створками: тёплый свет и пластинка. */
.window .inside {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 35%, #fff3cf 0%, var(--gold-2) 38%, var(--gold) 70%, var(--gold-deep) 100%);
}
.vinyl {
  width: min(58%, 74px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--gold-2) 0 13%, #1a1208 14% 16%, transparent 17%),
    repeating-radial-gradient(circle, #1d150b 0 2px, #2b2010 2px 4px);
  box-shadow: 0 6px 18px -6px rgba(60, 30, 0, .7);
}
.window:not(.big) .inside { padding-bottom: 1.5rem; }
.window:not(.big):not(.tall) .vinyl { width: min(46%, 58px); }
.window.big .vinyl { width: min(50%, 120px); }
.window[data-state="opened"] .vinyl { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Две створки: насыщенный цвет, мягкий блик, золотой шов и ручки. */
.window .door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% + 1px);
  backface-visibility: hidden;
  background:
    radial-gradient(140% 80% at 30% 0%, rgba(255, 255, 255, .16), transparent 55%),
    linear-gradient(160deg, var(--c2), var(--c1));
  transition: transform .95s cubic-bezier(.3, .75, .2, 1), filter .3s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.window .door-left { left: 0; transform-origin: left center; border-radius: 18px 0 0 18px; }
.window .door-right { right: 0; transform-origin: right center; border-radius: 0 18px 18px 0; }
.window .door-left::after, .window .door-right::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 14px;
  margin-top: -7px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-deep));
  opacity: .9;
}
.window .door-left::after { right: 6px; }
.window .door-right::after { left: 6px; }
.window .door-left::before {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 220, 143, .55), transparent);
}

.window .num {
  position: absolute;
  top: .55rem;
  left: .75rem;
  z-index: 2;
  font: 600 clamp(1.35rem, 4.4vw, 2rem)/1 var(--serif);
  color: #fff7e4;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  pointer-events: none;
  transition: color .5s, text-shadow .5s;
}
.window.big .num { font-size: clamp(2.1rem, 8vw, 3.3rem); }

.window .badge {
  position: absolute;
  right: .55rem;
  bottom: .55rem;
  z-index: 2;
  display: inline-flex;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  pointer-events: none;
}
.badge > span { display: none; align-items: center; gap: .25rem; }
.badge svg { width: .85rem; height: .85rem; fill: currentColor; }
.window[data-state="locked"] .b-locked,
.window[data-state="ready"] .b-ready,
.window[data-state="opening"] .b-opened,
.window[data-state="opened"] .b-opened { display: inline-flex; }
.b-locked { color: rgba(255, 255, 255, .55); }
.b-ready {
  padding: .25rem .6rem;
  border-radius: 999px;
  color: #2a1a05;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 4px 12px -4px rgba(233, 185, 92, .9);
}
.b-opened {
  padding: .25rem .6rem;
  border-radius: 999px;
  color: #fff7e4;
  background: rgba(40, 24, 4, .72);
}

/* Ещё рано: створки приглушены. */
.window[data-state="locked"] { cursor: not-allowed; }
.window[data-state="locked"] .door { filter: saturate(.55) brightness(.62); }
.window[data-state="locked"] .num { color: rgba(255, 247, 228, .55); text-shadow: none; }

/* Можно открыть: вокруг бежит золотой свет. */
.window[data-state="ready"]::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 20px;
  background: conic-gradient(from var(--angle), transparent 0 55%, var(--gold-2) 75%, #fff 80%, var(--gold) 88%, transparent 100%);
  animation: orbit 3s linear infinite;
}
.window[data-state="ready"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: 18px;
  box-shadow: 0 0 34px 2px rgba(233, 185, 92, .45);
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes orbit { to { --angle: 360deg; } }
@keyframes breathe { 50% { box-shadow: 0 0 46px 8px rgba(233, 185, 92, .6); } }

/* Открывается и открыто. */
.window[data-state="opening"] .door-left,
.window[data-state="opened"] .door-left { transform: rotateY(-105deg); }
.window[data-state="opening"] .door-right,
.window[data-state="opened"] .door-right { transform: rotateY(105deg); }
.window[data-state="opened"] .num,
.window[data-state="opening"] .num { color: rgba(58, 34, 6, .85); text-shadow: none; }

.window.shake { animation: shake .45s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-1deg); }
  40% { transform: translateX(5px) rotate(1deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* --- модальное окно с плеером (на телефоне — панель снизу) --- */
dialog#modal {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 1.5rem;
  color: var(--text);
  background: linear-gradient(180deg, rgba(20, 30, 64, .97), rgba(10, 15, 34, .98));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 26px;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .08);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog#modal[open] { animation: pop .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
dialog#modal::backdrop { background: rgba(3, 6, 14, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog#modal h2 { font-size: 2rem; margin: 0 0 1rem; }
dialog#modal .eyebrow { margin-bottom: .2rem; }
dialog .grabber { display: none; }
dialog .close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  cursor: pointer;
}
dialog .close svg { width: 1rem; height: 1rem; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
iframe.player { width: 100%; height: 352px; border: 0; border-radius: 16px; margin-bottom: 1rem; background: rgba(0, 0, 0, .25); }

#toast {
  position: fixed;
  left: 50%;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  z-index: 30;
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: .8rem 1.2rem;
  border-radius: 16px;
  text-align: center;
  font-weight: 600;
  color: var(--text);
  background: rgba(20, 30, 64, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(233, 185, 92, .45);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8);
  transform: translate(-50%, 160%);
  opacity: 0;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* --- вход --- */
.auth { max-width: 440px; margin: 0 auto; }
.auth-hero { text-align: center; padding: 1rem 0 1.5rem; }
.auth-hero h1.display { font-size: clamp(2.1rem, 8vw, 2.9rem); }
.auth-hero .lead { margin: .8rem auto 0; }
.auth-star { width: 2.6rem; height: 2.6rem; fill: var(--gold); filter: drop-shadow(0 0 14px rgba(233, 185, 92, .7)); margin-bottom: .6rem; }
.auth-card h1.display { font-size: 2.1rem; margin-bottom: 1rem; }

.segmented {
  display: none; /* без JS обе формы видны друг под другом */
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: rgba(4, 8, 20, .55);
  border: 1px solid var(--line);
}
.segmented button {
  min-height: 2.6rem;
  border: 0;
  border-radius: 10px;
  font: 600 .92rem var(--sans);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.pane + .pane { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.pane-title { font-size: 1.25rem; margin: 0; }
.js .segmented { display: grid; }
.js .pane-title { display: none; }
.js .pane + .pane { margin-top: 0; padding-top: 0; border-top: 0; }
.js .auth-card[data-tab="login"] [data-pane="register"],
.js .auth-card[data-tab="register"] [data-pane="login"] { display: none; }
.auth-card[data-tab="login"] [data-show="login"],
.auth-card[data-tab="register"] [data-show="register"] {
  color: #2a1a05;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

/* --- «Мой плейлист» --- */
.page-head { padding: .5rem 0 1.5rem; }
.steps { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
}
.steps li div { display: grid; gap: .15rem; }
.steps li span:not(.step-num) { color: var(--muted); font-size: .9rem; }
.step-num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  font-weight: 700;
  color: #2a1a05;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
}
.success-head { display: flex; align-items: center; gap: 1rem; }
.success-head p { margin: 0; }
.check-circle {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: 50%;
  background: rgba(139, 227, 176, .14);
  border: 1px solid rgba(139, 227, 176, .4);
}
.check-circle svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- админка --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tile {
  display: grid;
  gap: .2rem;
  align-content: start;
  padding: 1.1rem 1.2rem;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
}
.tile-num { font: 600 1.9rem/1 var(--serif); color: var(--text); }
.tile-num small { font-size: 1rem; color: var(--muted); }
.tile-label { color: var(--muted); font-size: .85rem; }
.tile-ok .tile-num { color: var(--ok); }
.tile-warn .tile-num { color: var(--gold-2); }
.tile-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  margin-top: .4rem;
  padding: 0 .9rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  background: rgba(233, 185, 92, .14);
  border: 1px solid rgba(233, 185, 92, .35);
}

progress {
  display: block;
  width: 100%;
  height: 10px;
  margin: .25rem 0 1rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
  -webkit-appearance: none;
  appearance: none;
}
progress::-webkit-progress-bar { background: rgba(255, 255, 255, .08); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 999px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 999px; }

table.admin { width: 100%; border-collapse: collapse; margin-top: .5rem; }
table.admin th, table.admin td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.admin th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.user-chip.small { color: var(--text); font-size: 1rem; }
.user-chip.small .avatar { width: 1.8rem; height: 1.8rem; font-size: .8rem; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form + form { margin-left: .9rem; }

/* --- телефоны --- */
@media (max-width: 699px) {
  body { padding-bottom: 120px; }
  .skyline { height: 96px; }
  main { padding-top: 1rem; }
  .hello { display: none; }
  .nav { gap: .35rem; }
  .pill { padding: 0 .8rem; }
  .logout { width: 2.5rem; padding: 0; justify-content: center; }
  .logout .label { display: none; }
  .nav .user-chip { display: none; }
  /* В маленьком открытом окошке пластинка не помещается рядом с номером — только свет и ▶. */
  .window:not(.big):not(.tall):not(.wide) .vinyl { display: none; }
  .topbar-inner { padding-left: .9rem; padding-right: .9rem; }
  .brand { font-size: 1.3rem; }
  .stats { flex: 1 1 100%; }
  .stats li { flex: 1; }
  .callout .btn { margin-left: 0; width: 100%; }
  .window .badge { right: .4rem; bottom: .4rem; }
  .b-ready { font-size: .62rem; padding: .2rem .45rem; }
  .window[data-state="ready"] .badge { right: 50%; transform: translateX(50%); }
  .b-opened { font-size: 0; padding: .4rem; }
  .b-opened svg { width: .75rem; height: .75rem; }

  /* Окошко с плеером выезжает снизу. */
  dialog#modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
    padding: 1.6rem 1.1rem max(1.25rem, env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
    border-bottom: 0;
  }
  dialog#modal[open] { animation: sheet .4s cubic-bezier(.2, .8, .2, 1); }
  dialog .grabber {
    display: block;
    width: 42px;
    height: 5px;
    margin: -.8rem auto .9rem;
    border-radius: 3px;
    background: rgba(255, 255, 255, .22);
  }

  table.admin thead { display: none; }
  table.admin, table.admin tbody, table.admin tr, table.admin td { display: block; width: 100%; }
  table.admin tr { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  table.admin td { border: 0; padding: .15rem 0; text-align: left; }
  td.actions { white-space: normal; }
  td.actions form, td.actions form + form { display: inline-block; margin: 0 1rem 0 0; }
  td.actions button.link { padding: .55rem 0; }
}
@keyframes sheet { from { transform: translateY(100%); } }

/* Совсем узкие телефоны (iPhone SE первого поколения). */
@media (max-width: 359px) {
  .brand-year { display: none; }
  main { padding-left: .8rem; padding-right: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
