/* Главная страница в стиле «Сукно»: зелёный стол клуба и латунные акценты.
   Разметка повторяет макет 1a — шапка, живой турнир, пульт, архив. */

.felt-page {
  min-height: 100vh;
  padding: clamp(20px, 4vw, 72px) clamp(14px, 4vw, 64px) 96px;
  display: flex;
  justify-content: center;
}

/* Сам «стол»: сукно с бликом сверху и латунным кантом. */
.felt-table {
  width: 100%;
  max-width: 1440px;
  background: radial-gradient(120% 90% at 50% -20%,
    oklch(0.33 0.055 158) 0%, oklch(0.24 0.042 158) 55%, oklch(0.19 0.03 160) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 90px -30px oklch(0.1 0.02 150 / 0.9);
  animation: felt-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes felt-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* -- шапка ----------------------------------------------------------------- */

.felt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding: clamp(24px, 3vw, 40px) clamp(20px, 3vw, 48px) clamp(22px, 2.5vw, 34px);
  border-bottom: 1px solid oklch(0.78 0.11 85 / 0.22);
}

.felt-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.felt-suit {
  font-size: clamp(26px, 3vw, 34px);
  color: var(--accent);
  line-height: 1;
}

.felt-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.felt-lead {
  margin: 10px 0 0;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.5;
  color: oklch(0.76 0.02 150);
  max-width: 520px;
}

.felt-head-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.felt-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--font-mono);
}

.felt-count span {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: oklch(0.68 0.03 150);
}

.felt-count b {
  font-size: 30px;
  font-weight: 500;
  color: oklch(0.94 0.015 90);
}

/* Кто вошёл — над кнопкой выхода, чтобы логин не путали с числом турниров. */
.felt-account {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.felt-who {
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(0.68 0.03 150);
}

/* Латунная кнопка — главное действие страницы. */
.btn-brass {
  cursor: pointer;
  border: none;
  font-family: var(--font-ui);
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 700;
  color: oklch(0.2 0.04 90);
  padding: clamp(14px, 1.6vw, 20px) clamp(20px, 2.4vw, 34px);
  border-radius: 12px;
  background: var(--banner);
  box-shadow: 0 14px 30px -12px oklch(0.7 0.12 85 / 0.7), inset 0 1px 0 oklch(0.98 0.04 95);
  transition: transform 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

.btn-brass:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px -12px oklch(0.75 0.12 85 / 0.8), inset 0 1px 0 oklch(0.98 0.04 95);
}

.felt-body {
  padding: clamp(22px, 3vw, 36px) clamp(20px, 3vw, 48px) clamp(26px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 2.6vw, 32px);
}

/* -- живой турнир ---------------------------------------------------------- */

.live-card {
  border: 1px solid oklch(0.78 0.11 85 / 0.35);
  border-radius: 18px;
  background: linear-gradient(180deg, oklch(0.28 0.05 158) 0%, oklch(0.2 0.035 158) 100%);
  box-shadow: inset 0 1px 0 oklch(0.78 0.11 85 / 0.18);
  overflow: hidden;
}

.live-grid {
  display: grid;
  /* Крайние колонки умеют сжиматься, центральная с таймером — нет. */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 2.4vw, 40px);
  padding: clamp(22px, 2.6vw, 34px) clamp(20px, 3vw, 40px);
}

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

/* Пульсирующая точка «идёт сейчас». */
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bad);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.live-status span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: oklch(0.78 0.14 30);
}

/* Турнир создан, но ещё не начат — спокойный латунный тон вместо тревожного. */
.live-status.is-waiting span {
  color: var(--accent);
}

.live-status.is-waiting .live-dot {
  background: var(--accent);
  animation: none;
}

.live-name {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 38px);
  font-weight: 600;
  color: oklch(0.97 0.015 90);
  line-height: 1.1;
  margin: 16px 0;
}

.live-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-brass {
  font-size: 13px;
  font-weight: 600;
  color: oklch(0.9 0.05 88);
  border: 1px solid oklch(0.78 0.11 85 / 0.4);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.live-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(0px, 1.5vw, 20px);
  min-width: 0;
}

.live-level {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: oklch(0.7 0.03 150);
  text-align: center;
}

.live-timer {
  font-family: var(--font-mono);
  font-size: clamp(56px, 9vw, 132px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--timer-color);
  text-shadow: 0 0 60px oklch(0.78 0.11 85 / 0.35);
  font-variant-numeric: tabular-nums;
}

/* В последнюю минуту уровня таймер наливается тревожным цветом. */
.live-timer.is-final {
  color: oklch(0.78 0.16 30);
  text-shadow: 0 0 60px oklch(0.72 0.19 25 / 0.5);
}

.live-timer.is-paused {
  opacity: 0.5;
}

.live-progress {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: oklch(0.16 0.02 155);
  overflow: hidden;
}

.live-progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, oklch(0.66 0.11 78), oklch(0.9 0.09 92));
  transition: width 0.5s linear;
}

.live-blinds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 2vw, 26px);
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.4vw, 17px);
  color: oklch(0.9 0.03 90);
}

.live-blinds .dim {
  color: oklch(0.68 0.03 150);
}

.live-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-end;
}

.live-stats {
  display: flex;
  gap: 12px;
}

.live-stat {
  text-align: right;
  min-width: 108px;
}

.live-stat + .live-stat {
  min-width: 132px;
}

.live-stats .live-stat:first-child {
  border-right: 1px solid oklch(0.78 0.11 85 / 0.22);
  padding-right: 16px;
}

.live-stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 500;
  color: oklch(0.96 0.015 90);
  /* Сумма с валютой не должна разрываться между строками. */
  white-space: nowrap;
}

.live-stat b i {
  font-style: normal;
  font-size: 0.6em;
  color: oklch(0.66 0.03 150);
}

.live-stat span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.68 0.03 150);
  margin-top: 4px;
}

.live-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-solid {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  color: oklch(0.2 0.04 90);
  background: oklch(0.86 0.1 90);
  border: none;
  padding: 14px 22px;
  border-radius: 10px;
  transition: background 150ms ease;
  white-space: nowrap;
}

.btn-solid:hover {
  background: oklch(0.92 0.09 92);
}

.btn-outline {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: oklch(0.93 0.02 90);
  background: transparent;
  border: 1px solid oklch(0.78 0.11 85 / 0.45);
  padding: 14px 22px;
  border-radius: 10px;
  transition: background 150ms ease;
  white-space: nowrap;
}

.btn-outline:hover {
  background: oklch(0.78 0.11 85 / 0.12);
}

/* -- пульт и сеть ---------------------------------------------------------- */

.net-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(18px, 2.4vw, 32px);
  align-items: center;
  padding: clamp(18px, 2vw, 26px) clamp(18px, 2.4vw, 32px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: oklch(0.21 0.03 158);
}

.net-qr {
  width: 130px;
  height: 130px;
  border-radius: 12px;
  background: oklch(0.95 0.015 90);
  box-shadow: 0 0 0 6px oklch(0.95 0.015 90);
}

.net-title {
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 700;
  color: oklch(0.96 0.015 90);
}

.net-sub {
  font-size: 15px;
  color: oklch(0.74 0.02 150);
  margin-top: 4px;
}

.net-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.net-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 18px;
  border-radius: 10px;
  background: oklch(0.17 0.025 158);
  border: 1px solid oklch(0.78 0.11 85 / 0.28);
}

.net-item b {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 400;
  color: oklch(0.94 0.03 90);
}

.net-item span {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--good);
}

/* Виртуальный адаптер отмечен пунктиром — по нему телефон не зайдёт. */
.net-item.is-virtual {
  border: 1px dashed oklch(0.45 0.03 150);
}

.net-item.is-virtual b {
  color: oklch(0.7 0.02 150);
}

.net-item.is-virtual span {
  color: oklch(0.62 0.02 150);
}

/* -- архив ----------------------------------------------------------------- */

.arch-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid oklch(0.78 0.11 85 / 0.2);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.arch-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  color: oklch(0.94 0.015 90);
}

.arch-head span {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.68 0.03 150);
  white-space: nowrap;
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.arch-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
  padding: 24px 26px;
  border-radius: 16px;
  background: oklch(0.23 0.035 158);
  border: 1px solid oklch(0.42 0.05 150 / 0.45);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  animation: felt-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.arch-card:hover {
  transform: translateY(-3px);
  border-color: oklch(0.78 0.11 85 / 0.55);
  background: oklch(0.25 0.04 158);
}

.arch-card:nth-child(2) { animation-delay: 60ms; }
.arch-card:nth-child(3) { animation-delay: 120ms; }
.arch-card:nth-child(4) { animation-delay: 180ms; }
.arch-card:nth-child(n+5) { animation-delay: 240ms; }

.arch-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.arch-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: oklch(0.96 0.015 90);
}

.arch-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: oklch(0.68 0.03 150);
  margin-top: 5px;
}

.arch-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.72 0.02 150);
  border: 1px solid oklch(0.45 0.03 150);
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.arch-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
}

.arch-stats b {
  display: block;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 400;
  color: oklch(0.93 0.02 90);
}

.arch-stats b.gold {
  color: oklch(0.9 0.06 88);
}

.arch-stats b i {
  font-style: normal;
  font-size: 0.75em;
  color: var(--good);
}

/* Название формата — интерфейсным шрифтом: «Mystery Bounty» моноширинным
   переносится на две строки и ломает высоту карточек. */
.arch-stats b.fmt {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
}

.arch-stats span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: oklch(0.66 0.02 150);
  margin-top: 2px;
}

/* Подпись сверху, кнопки под ней: пять действий в узкую карточку одной
   строкой не помещаются и раньше вылезали за её край. */
.arch-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid oklch(0.42 0.05 150 / 0.45);
  margin-top: auto;
  min-width: 0;
}

.arch-foot > span {
  font-size: 14px;
  color: oklch(0.78 0.02 150);
  min-width: 0;
}

.arch-foot b {
  color: oklch(0.94 0.02 90);
  font-weight: 600;
}

.arch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Кнопки делят строку и сжимаются, но не уже читаемого минимума. */
.arch-actions > * {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.btn-sm {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: oklch(0.2 0.04 90);
  background: oklch(0.84 0.1 90);
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 150ms ease;
}

.btn-sm:hover {
  background: oklch(0.92 0.09 92);
}

.btn-sm-ghost {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: oklch(0.88 0.02 150);
  background: transparent;
  border: 1px solid oklch(0.5 0.03 150);
  padding: 9px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: border-color 150ms ease, color 150ms ease;
}

.btn-sm-ghost:hover {
  border-color: oklch(0.78 0.11 85 / 0.6);
}

.btn-sm-ghost.is-danger:hover {
  border-color: var(--bad);
  color: var(--bad);
}

.felt-empty {
  padding: 30px 0;
  color: oklch(0.72 0.02 150);
  font-size: 16px;
}

/* -- адаптив --------------------------------------------------------------- */

/* Три колонки живут только на широком экране: ниже таймер уезжает наверх,
   а цифры и кнопки встают в строку под ним. */
@media (max-width: 1320px) {
  .live-grid {
    grid-template-columns: 1fr;
  }

  .live-side {
    align-items: flex-start;
  }

  .live-actions {
    justify-content: flex-start;
  }

  .live-stats .live-stat:first-child {
    padding-right: 16px;
  }

  .live-stat {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .net-card {
    grid-template-columns: 1fr;
  }

  .net-qr {
    width: 100%;
    max-width: 220px;
    height: auto;
    aspect-ratio: 1;
  }

  .felt-head-right {
    width: 100%;
    justify-content: space-between;
  }
}
