:root {
  --bg: #070708;
  --panel: #121316;
  --steel: #d9d3c8;
  --muted: #8a847a;
  --line: #2a2c31;
  --ember: #ff7a1a;
  --ember-deep: #d84312;
  --rust: #b5622f;
  --hot: #ff3d1a;
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 22px 20px;
  display: grid;
  place-items: center;
  color: var(--steel);
  background:
    radial-gradient(70% 55% at 50% -8%, rgba(190, 80, 20, 0.22), transparent 62%),
    radial-gradient(60% 45% at 88% 108%, rgba(150, 40, 15, 0.14), transparent 60%),
    var(--bg);
  font-family: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  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='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

::selection {
  background: rgba(255, 122, 26, 0.35);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ---------- brand ---------- */

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.logo {
  position: relative;
  width: clamp(220px, 36vh, 340px);
  max-width: 76vw;
  padding: 5px;
  border-radius: 20px;
  background: linear-gradient(155deg, #34353b 0%, #111214 30%, #08090a 70%, #232428 100%);
  box-shadow:
    0 0 60px -14px rgba(255, 90, 20, 0.18),
    0 30px 60px -30px #000,
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.65);
}

.logo::before {
  content: "";
  position: absolute;
  inset: 14%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 105, 25, 0.2), transparent 65%);
  filter: blur(28px);
}

.logo img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 15px;
  filter: saturate(1.04) contrast(1.02);
}

.tagline {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  color: #948b7e;
}

.tagline::before,
.tagline::after {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(181, 98, 47, 0.6));
}

.tagline::after {
  transform: scaleX(-1);
}

/* ---------- player ---------- */

.player {
  position: relative;
  width: 100%;
  padding: 16px 20px 14px;
  border-radius: var(--radius);
  border: 1px solid #2c2e33;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05), transparent 30%),
    repeating-linear-gradient(92deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 5px),
    radial-gradient(120% 100% at 20% 0%, #1b1c20, #0c0d0f 62%, #101114);
  box-shadow:
    0 34px 70px -34px #000,
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.player::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 138, 60, 0.4), transparent);
}

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

/* cover */

.art {
  position: relative;
  flex: 0 0 146px;
  width: 146px;
  height: 146px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #3b3d43;
  background: #0a0a0c;
  box-shadow:
    0 16px 30px -18px #000,
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

.art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 42%);
  mix-blend-mode: overlay;
}

.art__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}

.art__img[hidden] {
  display: none;
}

.art__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(90% 70% at 25% 0%, rgba(255, 120, 30, 0.22), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 7px),
    linear-gradient(150deg, #1b1c20, #09090b 70%);
  transition: opacity 0.25s ease, visibility 0.25s;
}

.art.has-cover .art__fallback {
  opacity: 0;
  visibility: hidden;
}

.art__fallback::before {
  content: "";
  position: absolute;
  width: 76%;
  height: 76%;
  border-radius: 50%;
  border: 1px solid rgba(196, 152, 112, 0.16);
  box-shadow: inset 0 0 0 7px rgba(0, 0, 0, 0.18);
}

.art__initials {
  position: relative;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  background: linear-gradient(180deg, #f5f1e9 0%, #c6beb1 42%, #6c665c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.55));
  user-select: none;
}

/* info */

.info {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 18px;
}

.dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b6459;
  transition: background 0.3s;
}

.is-playing .dot {
  background: var(--ember);
  animation: dot-pulse 2.2s ease-out infinite;
}

.is-loading .dot {
  background: #b8862f;
  animation: dot-pulse 1.3s ease-out infinite;
}

.is-error .dot {
  background: #6b6459;
}

@keyframes dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(255, 122, 26, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 122, 26, 0);
  }
}

.status__text {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ded8cd;
  white-space: nowrap;
}

.is-paused .status__text,
.is-error .status__text {
  color: #8f887d;
}

.status__note {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #7d766c;
}

.is-error .status__note,
.is-silent .status__note {
  display: none;
}

.unmute {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 138, 60, 0.36);
  background: rgba(255, 120, 30, 0.1);
  color: #e0a06a;
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.unmute[hidden] {
  display: none;
}

.unmute svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.unmute:hover {
  background: rgba(255, 120, 30, 0.2);
  border-color: rgba(255, 138, 60, 0.6);
}

.artist {
  margin: 3px 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d9904e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist[hidden] {
  display: none;
}

.title {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.12;
  color: #f1ede5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.album {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.3;
  color: #8b857b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album[hidden] {
  display: none;
}

/* шкала прогресса: силуэт громкости трека, некликабельная */

.wave {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  margin: 12px 0 4px;
  pointer-events: none;
  user-select: none;
}

.wave span {
  flex: 0 0 auto;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: #463930;
  transform: scaleY(0.12);
  transform-origin: center;
  transition: transform 0.7s var(--ease), background-color 0.4s, opacity 0.4s;
  will-change: transform;
}

.wave span.on {
  background: linear-gradient(180deg, #ffb15c 0%, #ff5a1f 55%, #c02a0d 100%);
}

.wave span.cur {
  background: #ffd29a;
}

.ptime {
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
  font-size: 11.5px;
  color: #8b857b;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  pointer-events: none;
  user-select: none;
}

.is-jingle .wave span {
  opacity: 0.35;
}

.is-paused .wave span {
  opacity: 0.45;
}

.is-error .wave span {
  opacity: 0.22;
}

/* controls */

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.play {
  position: relative;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff4ea;
  background:
    radial-gradient(circle at 34% 24%, #ffb264 0%, #ff7a1a 34%, #d84312 66%, #8f1d08 100%);
  box-shadow:
    0 0 0 1px rgba(255, 150, 90, 0.22),
    0 0 26px rgba(255, 90, 20, 0.22),
    0 14px 26px -14px rgba(255, 70, 20, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, opacity 0.2s;
}

.play:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    0 0 0 1px rgba(255, 150, 90, 0.32),
    0 0 34px rgba(255, 90, 20, 0.3),
    0 18px 30px -14px rgba(255, 70, 20, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.play:active:not(:disabled) {
  transform: scale(0.97);
}

.play:disabled {
  opacity: 0.4;
  cursor: default;
}

.play .icon {
  grid-area: 1 / 1;
  width: 23px;
  height: 23px;
  fill: currentColor;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.2s var(--ease);
}

.play .icon--play {
  opacity: 1;
  transform: none;
  margin-left: 2px;
}

.is-playing .play .icon--play {
  opacity: 0;
  transform: scale(0.6);
}

.is-playing .play .icon--pause {
  opacity: 1;
  transform: none;
}

.is-silent .play .icon--play,
.is-silent .play .icon--pause {
  opacity: 0;
  transform: scale(0.6);
}

.is-silent .play .icon--sound {
  opacity: 1;
  transform: none;
}

.player::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35);
}

.play::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 122, 26, 0.4);
  opacity: 0;
  transform: scale(0.9);
}

.is-silent .play::before {
  opacity: 1;
  animation: ring-pulse 2.4s ease-out infinite;
}

@keyframes ring-pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.16);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.play::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(255, 122, 26, 0.55);
  opacity: 0;
  transition: opacity 0.2s;
}

.is-buffering .play::after {
  opacity: 1;
  animation: spin 0.9s linear infinite;
}

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

.volume {
  display: flex;
  align-items: center;
  gap: 4px;
}

.volume .icon--muted {
  display: none;
}

.is-muted .volume .icon--muted {
  display: block;
}

.is-muted .volume .icon--vol {
  display: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #8f887d;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s var(--ease);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.icon-btn:hover {
  background: rgba(255, 122, 26, 0.12);
  color: #ded8cd;
}

.icon-btn:active {
  transform: scale(0.93);
}

.range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background:
    linear-gradient(90deg, #ff8a2a, #d84312) 0 0 / var(--p, 0%) 100% no-repeat,
    #2b2c30;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4px;
  border-radius: 50%;
  border: 2px solid #ff8a2a;
  background: #141518;
  box-shadow: 0 0 10px rgba(255, 122, 26, 0.4);
  transition: transform 0.15s var(--ease);
}

.range:hover::-webkit-slider-thumb,
.range:focus-visible::-webkit-slider-thumb {
  transform: scale(1.18);
}

.range::-moz-range-track {
  height: 3px;
  border-radius: 99px;
  background: #2b2c30;
}

.range::-moz-range-progress {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff8a2a, #d84312);
}

.range::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #ff8a2a;
  background: #141518;
}

/* footer */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 11px;
  color: #6f6a62;
  letter-spacing: 0.02em;
}

.footer a {
  color: #8f877a;
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: #d9904e;
}

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

/* focus */

:focus-visible {
  outline: 2px solid rgba(255, 122, 26, 0.7);
  outline-offset: 3px;
}

.range:focus-visible {
  outline-offset: 6px;
  border-radius: 99px;
}

/* entrance */

@media (prefers-reduced-motion: no-preference) {
  .brand,
  .player,
  .footer {
    animation: rise 0.8s var(--ease) both;
  }

  .player {
    animation-delay: 0.08s;
  }

  .footer {
    animation-delay: 0.16s;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* small screens */

@media (max-width: 460px) {
  body {
    padding: 20px 14px;
  }

  .stage {
    gap: 16px;
  }

  .logo {
    width: 250px;
  }

  .tagline {
    font-size: 8px;
    letter-spacing: 0.24em;
    text-indent: 0.24em;
  }

  .tagline::before,
  .tagline::after {
    width: 22px;
  }

  .player {
    padding: 16px 16px 14px;
  }

  .now {
    gap: 12px;
  }

  .art {
    flex-basis: 112px;
    width: 112px;
    height: 112px;
  }

  .art__initials {
    font-size: 44px;
  }

  .title {
    font-size: 19px;
  }

  .artist {
    font-size: 9.5px;
  }

  .wave {
    height: 38px;
    margin: 12px 0 4px;
  }

  .play {
    width: 50px;
    height: 50px;
  }

  .range {
    width: 84px;
  }
}

@media (max-width: 380px) {
  .logo {
    width: 220px;
  }

  .art {
    flex-basis: 96px;
    width: 96px;
    height: 96px;
  }

  .title {
    font-size: 17px;
  }

  .unmute {
    padding: 5px;
  }

  .unmute span {
    display: none;
  }

  .status__note {
    display: none;
  }

  .range {
    width: 70px;
  }
}

@media (max-height: 640px) and (min-width: 461px) {
  .logo {
    width: 210px;
  }

  .tagline {
    margin-top: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
