:root {
  --bg0: #0b1220;
  --bg1: #152238;
  --accent: #ff9d59;
  --text: #f6f3ee;
  --muted: rgba(246, 243, 238, 0.7);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255, 157, 89, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(123, 165, 247, 0.14), transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
  color: var(--text);
}

.fm {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
  padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom, 0px));
}

.fm__logo-btn {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.fm__logo-btn:focus-visible {
  outline: 3px solid #7ba5f7;
  outline-offset: 8px;
  border-radius: 50%;
}

.fm__spin {
  display: block;
  width: min(168px, 42vw);
  aspect-ratio: 1;
  transform-origin: 50% 50%;
}

.fm__mark {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* Явная кнопка play поверх знака — без подложки под лого */
.fm__glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.fm__glyph-play,
.fm__glyph-pause {
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.fm__logo-btn:hover .fm__glyph {
  transform: scale(1.08);
}

.fm__logo-btn.is-playing .fm__spin {
  animation: fm-spin 8s linear infinite;
}

.fm__logo-btn.is-playing .fm__glyph-play {
  display: none;
}

.fm__logo-btn:not(.is-playing) .fm__glyph-pause {
  display: none;
}

.fm__logo-btn.is-playing .fm__glyph-pause {
  display: block;
  opacity: 0.92;
}

.is-hidden {
  display: none !important;
}

@keyframes fm-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fm__logo-btn.is-playing .fm__spin {
    animation: none;
  }
}

.fm__vol {
  width: min(200px, 64vw);
  accent-color: var(--accent);
}

.fm__now {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  max-width: min(420px, 92vw);
  text-align: center;
}

.fm__now-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.fm__now-track {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  min-height: 1.35em;
}

.fm__votes {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.fm__vote {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(246, 243, 238, 0.18);
  border-radius: 999px;
  background: rgba(11, 18, 32, 0.45);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.fm__vote:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 157, 89, 0.55);
}

.fm__vote:disabled {
  opacity: 0.45;
  cursor: default;
}

.fm__vote.is-active {
  background: rgba(255, 157, 89, 0.22);
  border-color: rgba(255, 157, 89, 0.8);
  color: #ffe6d2;
}

.fm__toast {
  margin: 0.15rem 0 0;
  min-height: 1.1em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.fm__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  max-width: min(420px, 92vw);
}

.fm__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  padding: 0.42rem 0.85rem;
  border: 1.5px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.fm__btn:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

.fm__btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.fm__btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.fm__btn--orange {
  background: linear-gradient(180deg, #ffb06f 0%, #ff9d59 45%, #ef7d2c 100%);
  border-color: #c85e12;
  color: #1a120c;
}

.fm__btn--blue {
  background: linear-gradient(180deg, #6ea0ff 0%, #3d7dff 45%, #2a63d6 100%);
  border-color: #1d4fb8;
  color: #ffffff;
}

.fm__btn--ghost {
  background: rgba(11, 18, 32, 0.35);
  border-color: rgba(246, 243, 238, 0.28);
  color: var(--text);
  box-shadow: none;
  width: 100%;
}

.fm__btn--install {
  background: rgba(255, 157, 89, 0.14);
  border-color: rgba(255, 157, 89, 0.75);
  color: #ffe6d2;
  box-shadow: 0 4px 14px rgba(255, 157, 89, 0.18);
  width: 100%;
  order: -1;
}

.fm__btn--install:hover {
  border-color: rgba(255, 157, 89, 0.95);
  filter: none;
}

.fm__btn--ghost:hover {
  border-color: rgba(255, 157, 89, 0.65);
  filter: none;
}

.fm-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

.fm-sheet.is-hidden,
.fm-sheet[hidden] {
  display: none !important;
}

.fm-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 18, 0.72);
}

.fm-sheet__panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 1.25rem 1.2rem 1.15rem;
  border-radius: 16px 16px 14px 14px;
  background: linear-gradient(165deg, #1a2740 0%, #101a2c 100%);
  border: 1px solid rgba(246, 243, 238, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.fm-sheet__title {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.fm-sheet__steps {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 600;
}

.fm-sheet__steps li + li {
  margin-top: 0.45rem;
}

.fm-sheet__steps strong {
  color: var(--text);
  font-weight: 800;
}

.fm-sheet__share {
  display: inline-flex;
  vertical-align: -0.25em;
  color: #7ba5f7;
}

.fm-sheet__note {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(246, 243, 238, 0.55);
  font-weight: 600;
}

.fm-sheet__panel .fm__btn {
  width: 100%;
}

body.fm--sheet-open {
  overflow: hidden;
}

.fm-install {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border: 1.5px solid #c85e12;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb06f 0%, #ff9d59 45%, #ef7d2c 100%);
  color: #1a120c;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}

.fm-install svg {
  flex-shrink: 0;
}

.fm-install.is-hidden,
.fm-install[hidden] {
  display: none !important;
}

.fm {
  padding-bottom: calc(3.25rem + env(safe-area-inset-bottom, 0px));
}

.fm__now-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
}

.fm__now-track {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  min-height: 1.35em;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.fm__react {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  position: relative;
  z-index: 2;
}

.fm__heart {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0.4rem;
  border: 0;
  background: rgba(11, 18, 32, 0.35);
  color: rgba(246, 243, 238, 0.45);
  cursor: pointer;
  line-height: 0;
  border-radius: 999px;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.fm__heart svg {
  display: block;
  pointer-events: none;
}

.fm__heart:hover:not(:disabled) {
  transform: scale(1.08);
  color: rgba(246, 243, 238, 0.85);
}

.fm__heart:focus-visible {
  outline: 2px solid #7ba5f7;
  outline-offset: 2px;
}

.fm__heart:disabled {
  cursor: default;
  opacity: 0.45;
}

.fm__heart--like.is-active {
  color: #ff5a7a;
  background: rgba(255, 90, 122, 0.18);
}

.fm__heart--dislike.is-active {
  color: #9bb0c4;
  background: rgba(155, 176, 196, 0.18);
}

.fm__heart.is-busy {
  pointer-events: none;
  opacity: 0.7;
}

