/* Караоке — общий стиль. Мобильный-first, тёмная «музыкальная» тема. */
:root {
  --panel: rgba(255, 255, 255, 0.055);
  --panel-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f3efff;
  --muted: #a49bc6;
  --pink: #ff2e93;
  --violet: #8b5cff;
  --cyan: #25d0ff;
  --radius: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0a0714;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Мягкое «световое шоу» на фоне */
body::before {
  content: "";
  position: fixed;
  inset: -20vh -20vw;
  z-index: -1;
  background:
    radial-gradient(45% 35% at 18% 8%, rgba(139, 92, 255, 0.55), transparent 70%),
    radial-gradient(40% 30% at 88% 4%, rgba(255, 46, 147, 0.42), transparent 70%),
    radial-gradient(55% 40% at 50% 102%, rgba(37, 208, 255, 0.3), transparent 72%),
    #0a0714;
  animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.09); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 26px 16px calc(34px + env(safe-area-inset-bottom));
}

/* ---------- шапка ---------- */
.hero {
  text-align: center;
  padding: 6px 0 20px;
}

.vinyl {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 16px;
  user-select: none;
  /* по этой пластинке пять тапов открывают админку; курсор намеренно обычный */
}

.disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, #1a1130 0 2px, #251738 2px 4px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 20px 44px -14px rgba(255, 46, 147, 0.6),
    inset 0 0 26px rgba(0, 0, 0, 0.65);
  animation: spin 12s linear infinite;
}

.vinyl .label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.vinyl .label span {
  width: 54%;
  height: 54%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 22px;
  background: conic-gradient(from 0deg, var(--pink), var(--violet), var(--cyan), var(--pink));
  box-shadow: 0 0 26px rgba(255, 46, 147, 0.5);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .disc { animation: none; }
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #ffffff 0%, #ffd6ee 40%, #c9b8ff 70%, #9ff0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1.small {
  font-size: clamp(26px, 7vw, 32px);
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.eq {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 26px;
  margin-top: 14px;
}

.eq i {
  width: 4px;
  height: 100%;
  border-radius: 3px;
  transform-origin: bottom;
  background: linear-gradient(180deg, var(--cyan), var(--violet) 55%, var(--pink));
  animation: bounce 1.1s ease-in-out infinite;
}

.eq i:nth-child(1) { animation-delay: 0s;    height: 40%; }
.eq i:nth-child(2) { animation-delay: 0.14s; height: 75%; }
.eq i:nth-child(3) { animation-delay: 0.28s; height: 100%; }
.eq i:nth-child(4) { animation-delay: 0.42s; height: 65%; }
.eq i:nth-child(5) { animation-delay: 0.56s; height: 45%; }

@keyframes bounce {
  0%, 100% { transform: scaleY(0.35); }
  50%      { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .eq i { animation: none; }
}

/* ---------- карточки ---------- */
.card {
  position: relative; /* нужно, чтобы карточку можно было поднять над соседней */
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 26px 54px -34px rgba(0, 0, 0, 0.95);
}

/* пока открыт список подсказок, карточка формы рисуется поверх очереди:
   backdrop-filter у карточек создаёт собственные стек-контексты, и без этого
   список уезжал под блок «Сейчас в очереди» */
.card.raised {
  z-index: 40;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pill {
  min-width: 26px;
  padding: 2px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 46, 147, 0.18);
  color: #ffd9ee;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-transform: none;
}

/* ---------- форма ---------- */
.field {
  display: block;
  margin-bottom: 12px;
}

.field > span,
.field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.catalog-note {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* поле с подсказками */
.combo {
  position: relative;
}

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 50;
  max-height: 264px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: #191129;
  box-shadow: 0 26px 54px -14px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(0, 0, 0, 0.4);
  -webkit-overflow-scrolling: touch;
}

.suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.suggest-item.active,
.suggest-item:active {
  background: rgba(255, 46, 147, 0.2);
}

.suggest::-webkit-scrollbar {
  width: 6px;
}

.suggest::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.22);
}

.suggest-title {
  font-size: 15.5px;
  font-weight: 650;
}

.suggest-artist {
  font-size: 13px;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 7, 20, 0.55);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* что бы iOS не зумил при фокусе */
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

input::placeholder {
  color: #7d7599;
}

input:focus {
  outline: none;
  border-color: rgba(255, 46, 147, 0.65);
  background: rgba(10, 7, 20, 0.78);
  box-shadow: 0 0 0 4px rgba(255, 46, 147, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 15px 18px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  background: linear-gradient(100deg, var(--pink), var(--violet) 55%, var(--cyan));
  box-shadow: 0 16px 34px -16px rgba(255, 46, 147, 0.95);
  transition: transform 0.12s ease, filter 0.18s ease;
}

.btn:active {
  transform: scale(0.975);
  filter: brightness(1.06);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.btn.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  box-shadow: none;
}

/* ---------- списки песен ---------- */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.song {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.song .num {
  flex: 0 0 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(255, 46, 147, 0.9), rgba(139, 92, 255, 0.9));
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.song .info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.song .title {
  font-weight: 650;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song .artist {
  font-size: 13.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song .time {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* кликабельная строка в админке */
.song.tap {
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.14s ease, background 0.18s, border-color 0.18s;
}

.song.tap:active {
  transform: scale(0.98);
  background: rgba(255, 46, 147, 0.16);
  border-color: rgba(255, 46, 147, 0.5);
}

.song.leaving {
  opacity: 0;
  transform: translateX(38px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.song .done-hint {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.restore {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.18s;
}

.restore:active {
  background: rgba(37, 208, 255, 0.22);
}

.empty {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 10px 0 2px;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12.5px;
}

.foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

a {
  color: #ffb3dd;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 179, 221, 0.35);
}

a:active {
  color: #fff;
}

/* ---------- всплывающее сообщение ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(520px, calc(100vw - 32px));
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(24, 16, 42, 0.94);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.hidden {
  display: none !important;
}
