/* ---- токены ---- */
:root {
  --bg:      #000000;
  --fg:      #ffffff;
  --dim:     #7a7a7a;
  --line:    #2e2e2e;
  --display: "Press Start 2P", "Courier New", monospace;
  --body:    "VT323", "Courier New", monospace;
  --unit:    4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: var(--body);
  -webkit-font-smoothing: none;
  font-smooth: never;
  image-rendering: pixelated;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

::selection { background: var(--fg); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.page {
  width: 100%;
  max-width: 760px;
}

/* ---- заголовок ---- */
.title {
  font-family: var(--display);
  font-size: clamp(34px, 11vw, 84px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin: 0 0 28px;
  text-transform: uppercase;
}

.title__line { display: block; }

.caret {
  display: inline-block;
  width: 0.5em;
  height: 0.9em;
  margin-left: 0.1em;
  background: var(--fg);
  vertical-align: -0.08em;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---- текст ---- */
.text {
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.45;
  max-width: 58ch;
  margin: 0 0 44px;
  color: var(--fg);
}

/* ---- плеер ---- */
.player {
  border: 2px solid var(--fg);
  padding: 18px;
}

.player__head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.play {
  flex: none;
  width: 52px;
  height: 52px;
  background: var(--bg);
  border: 2px solid var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.play:hover { background: var(--fg); }
.play:hover .play__icon { border-left-color: var(--bg); background: var(--bg); }

/* треугольник "play" */
.play__icon[data-state="play"] {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 16px solid var(--fg);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
}

/* две полосы "pause" */
.play__icon[data-state="pause"] {
  width: 16px;
  height: 18px;
  border: 0;
  margin: 0;
  background: transparent;
  border-left: 5px solid var(--fg);
  border-right: 5px solid var(--fg);
}

.play:hover .play__icon[data-state="pause"] {
  border-left-color: var(--bg);
  border-right-color: var(--bg);
  background: transparent;
}

.player__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.player__track {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}

.player__time {
  font-family: var(--display);
  font-size: 10px;
  white-space: nowrap;
}

.dim { color: var(--dim); }

/* эквалайзер */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.eq i {
  width: 4px;
  height: 3px;
  background: var(--dim);
}

.eq.is-playing i {
  background: var(--fg);
  animation: bounce 0.7s steps(4) infinite;
}

.eq.is-playing i:nth-child(2) { animation-duration: 0.5s; }
.eq.is-playing i:nth-child(3) { animation-duration: 0.9s; }
.eq.is-playing i:nth-child(4) { animation-duration: 0.6s; }
.eq.is-playing i:nth-child(5) { animation-duration: 0.8s; }

@keyframes bounce {
  0%, 100% { height: 3px; }
  50%      { height: 14px; }
}

/* полоса перемотки — сегментами, как пиксели */
.bar {
  margin: 18px 0 14px;
  height: 16px;
  border: 2px solid var(--fg);
  cursor: pointer;
  padding: 2px;
}

.bar__fill {
  height: 100%;
  width: 0%;
  background-image: repeating-linear-gradient(
    to right,
    var(--fg) 0 6px,
    transparent 6px 8px
  );
}

/* низ плеера */
.player__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.vol {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vol__label,
.hint {
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--dim);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 10px;
  background: var(--bg);
  border: 2px solid var(--line);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 14px;
  background: var(--fg);
  border: 0;
  border-radius: 0;
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 14px;
  background: var(--fg);
  border: 0;
  border-radius: 0;
}

/* ---- окно разблокировки звука ---- */
.gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  z-index: 10;
}

.gate[hidden] { display: none; }

.gate__btn {
  font-family: var(--display);
  font-size: clamp(12px, 3vw, 18px);
  letter-spacing: 0.06em;
  color: var(--fg);
  background: var(--bg);
  border: 2px solid var(--fg);
  padding: 20px 26px;
  cursor: pointer;
}

.gate__btn:hover { background: var(--fg); color: var(--bg); }

.gate__note {
  font-size: 20px;
  color: var(--dim);
  margin: 0;
}

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

@media (max-width: 520px) {
  .player__time { display: none; }
  .hint { display: none; }
}
