@font-face {
  font-family: 'Medeo Sans';
  src: url('/fonts/MedeoSansVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: block;
}
@font-face {
  font-family: 'Medeo Mono';
  src: url('/fonts/MedeoMonoVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: block;
}

/* ТВ-экран. Все размеры в vmin: 1080p, 4K и 8K выглядят одинаково, меняется только чёткость.
   Без filter, backdrop-filter и blur: браузеры телевизоров слабые.
   Цвета шапки и легенды берутся из темы карты через --ink и --plate. */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--ink, #fff);
  font-family: 'Medeo Sans', system-ui, sans-serif;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}
body { display: flex; flex-direction: column; }
[hidden] { display: none !important; }

#bg, #dim { position: fixed; inset: 0; pointer-events: none; }
#bg { background-size: cover; background-position: center; }
#dim { background: #000; opacity: 0; }

#top, #stage, #legend { position: relative; }

/* служебное сообщение — в шапке, на месте сводки: не закрывает карту и легенду */
#status {
  flex: none;
  max-width: 60vw;
  overflow: hidden;
  padding: 1.2vmin 2.2vmin;
  border-radius: 999px;
  background: #1c1c1c;
  color: #fbbf24;
  font-size: 2vmin;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* шапка: название · сводка · часы */
#top {
  display: flex;
  align-items: center;
  gap: 3vmin;
  padding: 2.6vmin 3.6vmin 0;
}
#title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 3.6vmin;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#counts { display: flex; flex: none; gap: 1.2vmin; }
.count {
  display: inline-flex;
  align-items: center;
  gap: 1vmin;
  height: 5.4vmin;
  padding: 0 2vmin 0 1.6vmin;
  border-radius: 999px;
  background: var(--plate, rgba(255, 255, 255, 0.08));
  font-size: 2vmin;
  font-weight: 600;
}
.count i { width: 1.5vmin; height: 1.5vmin; border-radius: 50%; background: currentColor; }
.count b { font-size: 2.8vmin; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.count span { opacity: 0.75; }
#clock {
  flex: none;
  min-width: 11vmin;
  font-size: 3.6vmin;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

#stage { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); padding: 2vmin 3vmin; }
#map { width: 100%; height: 100%; display: block; shape-rendering: geometricPrecision; text-rendering: geometricPrecision; }

/* легенда: залы или статусы + пояснение «рамка / заливка» */
#legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.2vmin 3vmin;
  padding: 0 3.6vmin 2.6vmin;
  font-size: 1.9vmin;
  font-weight: 600;
}
#legend span { display: inline-flex; align-items: center; gap: 1vmin; white-space: nowrap; }
#legend i { display: inline-block; width: 1.6vmin; height: 1.6vmin; border-radius: 0.4vmin; }
#legend .sep { width: 0.15vmin; height: 2.4vmin; background: currentColor; opacity: 0.25; }
#legend .key-free { box-sizing: border-box; border: 0.3vmin solid currentColor; }
#legend .key-busy { background: currentColor; }
#legend .muted { opacity: 0.75; }


/* экран без доступа (нет подписки / устаревшая ссылка) */
#locked { position: fixed; inset: 0; display: grid; place-items: center; background: #0a0a09; color: #f6f5f2; }
.locked-card { max-width: 70vmin; text-align: center; }
#locked-title { font-size: 4.4vmin; font-weight: 700; letter-spacing: -0.03em; }
#locked p { margin: 1.6vmin 0 0; color: #a1a1a8; font-size: 2.2vmin; line-height: 1.4; }
