/* Mini App Kompas FM — оформление под сайт kompasfm.by:
   графит #293133, оранжевый #e06500, заголовки 900, текст 500, радиус 10px,
   карточки с тенью 0 0 10px 1px rgba(0,0,0,.15) (как .stock-item_container).
   Шрифт Montserrat (variable, cyrillic + latin) лежит рядом — без внешних CDN. */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('./fonts/montserrat-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('./fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --brand: #e06500;
  --brand-hover: #d05a06;
  --brand-press: #ec7d2e;
  --brand-soft: rgba(224, 101, 0, 0.08);
  --brand-line: rgba(224, 101, 0, 0.45);
  --ink: #293133;
  --ink-2: #5b6466;
  --muted: #8a9295;
  --paper: #ffffff;
  --paper-2: #f4f5f5;
  --line: rgba(41, 49, 51, 0.14);
  --line-soft: rgba(41, 49, 51, 0.08);
  --warn: #7d8688;
  --error: #c0392b;
  --radius: 10px;
  --shadow: 0 0 10px 1px rgba(0, 0, 0, 0.15), inset 0 0 1px rgba(0, 0, 0, 0.25);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* важнее, чем .cover img { display: block }: иначе скрытая обложка остаётся видимой */
[hidden] {
  display: none !important;
}

.sprite {
  display: none;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Montserrat', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

body {
  padding-bottom: calc(16px + var(--safe-bottom));
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --------------------------------------------------------------- шапка */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -14px;
  padding: 10px 14px 9px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: block;
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__name {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__fm {
  color: var(--brand);
}

.brand__tagline {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 300;
  line-height: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(224, 101, 0, 0.5);
  animation: pulse 2.4s infinite;
  flex: 0 0 auto;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(224, 101, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(224, 101, 0, 0);
  }
}

/* -------------------------------------------------------------- плеер */

/* Белая карточка в оранжевой рамке — как .player_header на сайте. */
.player {
  background: var(--paper);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* пока нет обложки — фирменный знак водяным знаком */
.cover-mark {
  width: 96px;
  height: 96px;
  opacity: 0.18;
}

.live {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.14em;
  padding: 5px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

.live.stale {
  background: var(--warn);
}

.meta {
  text-align: center;
  min-height: 52px;
}

.title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.artist {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.secondary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.play {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(224, 101, 0, 0.3);
  transition: transform 0.18s ease, background 0.18s ease;
}

.play:hover {
  background: var(--brand-hover);
  transform: scale(1.04);
}

.play:active {
  background: var(--brand-press);
  transform: scale(0.97);
}

/* Кнопка-контур: как .main-button на сайте — оранжевый ховер. */
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ghost:hover {
  color: var(--brand);
  border-color: var(--brand-line);
}

.ghost:active {
  background: var(--brand-soft);
}

.ghost--icon {
  padding: 8px 11px;
  font-size: 14px;
}

.status {
  margin: 0;
  min-height: 16px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
  color: var(--muted);
}

.status.ok {
  color: var(--ink-2);
}

.status.error {
  color: var(--error);
}

/* ------------------------------------------------------------- вкладки */

/* Навигация сайта: капс, графит, активный пункт — оранжевый. */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 1;
  padding: 11px 4px 9px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tab:hover {
  color: var(--brand);
}

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ------------------------------------------------------------ контент */

/* Карточки как на сайте: белые, радиус 10px, мягкая тень. */
.panel {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.history li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.history li:first-child {
  padding-top: 0;
}

.history li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.history .time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.history .now {
  color: var(--brand);
  font-weight: 700;
}

/* «История пока пуста» — одна колонка, без сетки времени */
.history li.empty,
.history li.empty:first-child {
  display: block;
  padding: 6px 0;
  border-bottom: none;
}

.schedule {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.schedule ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  font-size: 13px;
}

.schedule .when {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.schedule .active-program {
  font-weight: 700;
  color: var(--brand);
}

/* ---------------------------------------------------------- статистика */

/* Строка «подпись — число — пояснение»: как в /stats бота, только крупнее. */
.stats {
  display: flex;
  flex-direction: column;
}

.stat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.stat:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat__label {
  font-size: 13px;
  font-weight: 500;
}

.stat__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.stat__hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

/* -------------------------------------------------------- предложение */

.label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.chip:hover {
  color: var(--brand);
  border-color: var(--brand-line);
}

.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 19px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
}

textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.primary {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 25px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease, opacity 0.2s ease;
}

.primary:hover {
  background: var(--brand-hover);
}

.primary:active {
  background: var(--brand-press);
  transform: scale(0.99);
}

.primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.hint {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  color: var(--muted);
}

/* ловушка для ботов: поле есть в разметке, но человек его не видит */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------- контакт редакции */

.contact {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.contact__title {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact__link {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--brand);
  text-decoration: none;
}

.contact__link:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

.contact__hours {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: var(--ink-2);
}

.contact__note {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  color: var(--muted);
}

.empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  text-align: center;
}

/* ---------------------------------------------------- подвал (графит) */

.footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
}

.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
}

.footer__row span {
  color: rgba(255, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
}

.footer .ghost {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
}

.footer .ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.footer__tagline {
  margin: 0;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .dot {
    animation: none;
  }

  .play,
  .ghost,
  .chip,
  .primary,
  .tab,
  textarea {
    transition: none;
  }
}
