/**
 * Общие стили: мобильный UX, простой десктоп.
 */
:root {
  --bg: #0b1220;
  --surface: #111827;
  --surface2: #1e293b;
  --card: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --primary: #059669;
  --primary-hover: #047857;
  --secondary: #475569;
  --secondary-hover: #64748b;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --link: #60a5fa;
  --accent: #3b82f6;
}

/* Базовый фон (как рейтинг клуба); страницы с классом на body переопределяют сами */
body {
  margin: 0;
  min-height: 100dvh;
  background: #0f172a;
  background-image: radial-gradient(
    ellipse at 50% 0%,
    rgba(30, 58, 95, 0.4) 0%,
    transparent 50%
  );
  color: #f1f5f9;
}

/* Карточки рейтинга (клуб/админка): премиальный тёмно-синий стиль */
.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #0f172a, #020617);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.player-item:hover {
  transform: translateY(-2px);
  border-color: rgba(250, 204, 21, 0.5);
}

.player-name {
  font-size: 15px;
  font-weight: 500;
}

.player-score {
  font-weight: 600;
  color: #facc15;
}

.site-shell {
  width: 100%;
}

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

body.app {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding: 16px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

body.app.session-flow {
  background: linear-gradient(180deg, #0b1a2a 0%, #050d18 100%);
  color: #e6edf3;
}

/* Горизонтальные «безопасные» отступы контейнера */
.container {
  padding-left: 12px;
  padding-right: 12px;
  box-sizing: border-box;
}

/* body.app задаёт padding шортхэндом — уточняем боковые для страницы с body.container */
body.app.container {
  padding-left: 12px;
  padding-right: 12px;
}

#status.status-error {
  color: #fecaca;
  border-left: 3px solid #ef4444;
  padding: 8px 0 8px 12px;
  margin-top: 8px;
}

#status.status-ok {
  color: #86efac;
  border-left: 3px solid #22c55e;
  padding: 8px 0 8px 12px;
  margin-top: 8px;
}

/* Пакетный ввод: счётчик сессии (session.html) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

.date-nav button {
  margin-bottom: 0;
}

button.date-nav-arrow {
  width: 44px;
  min-width: 44px;
  flex: 0 0 auto;
  padding: 10px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e6edf3;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

@media (hover: hover) {
  button.date-nav-arrow:hover {
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(255, 255, 255, 0.08);
  }
}

button.date-nav-arrow:active {
  transform: scale(0.96);
}

.date-nav-main {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.date-nav-label {
  flex: 0 0 auto;
  color: #e6edf3;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: default;
}

input.date-nav-date-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: #d4af37;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.25;
  color-scheme: dark;
  cursor: pointer;
}

input.date-nav-date-input:focus {
  outline: 2px solid rgba(212, 175, 55, 0.45);
  outline-offset: 2px;
}

input.date-nav-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.75;
}

/* Полоса игр + кнопка удаления */
.session-games-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 14px;
}

.session-games-toolbar .session-games-strip {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

button.btn-delete-game {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

button.btn-delete-game:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.session-games-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 0 14px;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.session-games-strip::-webkit-scrollbar {
  height: 6px;
}

.session-games-strip::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 4px;
}

button.session-game-chip {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 8px 12px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #e6edf3;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

button.session-game-chip--active {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.22);
  color: #0b1a2a;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}

@media (hover: hover) {
  button.session-game-chip:hover:not(.session-game-chip--active) {
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(255, 255, 255, 0.08);
  }
}

button.session-game-chip--add {
  border-style: dashed;
  color: #d4af37;
}

button.session-game-chip:active {
  transform: scale(0.97);
}

/* Панель вечера (session.html) */
.evening-panel {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.evening-panel-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}

body.app.session-flow .evening-panel-title {
  color: rgba(212, 175, 55, 0.85);
}

.evening-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px 12px;
}

.evening-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.evening-metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.app.session-flow .evening-metric-label {
  color: rgba(230, 237, 243, 0.55);
}

.evening-metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

body.app.session-flow .evening-metric-value {
  color: #e6edf3;
}

.evening-metric-value--accent {
  color: #d4af37;
}

/* Полный рейтинг вечера под панелью (session.html) */
body.app.session-flow .evening-rating {
  margin: 0 0 16px;
  padding: 0 2px;
}

body.app.session-flow .evening-rating .rating-title {
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(230, 237, 243, 0.92);
}

body.app.session-flow .evening-rating .rating-list {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  padding: 8px 12px 10px;
}

body.app.session-flow .evening-rating .rating-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.app.session-flow .evening-rating .rating-item:last-child {
  border-bottom: none;
}

body.app.session-flow .evening-rating .rating-item .rank {
  flex: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

body.app.session-flow .evening-rating .rating-item .name {
  flex: 1;
  min-width: 0;
  text-align: left;
}

body.app.session-flow .evening-rating .rating-item .score {
  flex: 0 0 auto;
  font-weight: 600;
  color: #e6edf3;
}

body.app.session-flow .evening-rating .top-player {
  font-weight: bold;
  color: #ffd700;
}

/* Завершённый вечер: затемнение рабочей области */
.session-work-area.session-evening-locked {
  position: relative;
  opacity: 0.52;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.session-work-area.session-evening-locked .session-game-chip:not(.session-game-chip--add) {
  pointer-events: auto;
  cursor: default;
}

.batch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.batch-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.batch-counter {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}

button.btn-reset-series,
button.btn-end-evening {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  button.btn-reset-series:hover,
  button.btn-end-evening:hover {
    color: var(--text);
    border-color: var(--muted);
  }
}

button.btn-reset-series:active,
button.btn-end-evening:active {
  opacity: 0.88;
  transform: scale(0.98);
}

h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 12px;
}

body.app.session-flow h1 {
  color: #d4af37;
  font-weight: 700;
}

body.app.session-flow .club-slug-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 14px;
  max-width: 42rem;
}

body.app.session-flow .club-slug-hint code {
  font-size: 0.85em;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 16px 0 10px;
  color: #e2e8f0;
}

body.app.session-flow h2 {
  color: #d4af37;
}

.block {
  margin-bottom: 14px;
}

.hint {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 16px;
}

a {
  color: var(--link);
}

code {
  font-size: 0.9em;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Поля ввода */
/* Промежуточный текст Web Speech (не в textarea) */
.dictation-interim {
  margin: 8px 0 0;
  min-height: 1.35em;
  font-size: 0.9375rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--muted);
}

body.app.session-flow .dictation-interim {
  color: rgba(230, 237, 243, 0.42);
}

.textarea-wrapper {
  position: relative;
}

body.app.session-flow .textarea-wrapper .input-text {
  padding-right: 42px;
}

#btn-clear-input {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0.6;
  padding: 4px;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

#btn-clear-input:hover {
  opacity: 1;
}

#btn-clear-input:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

textarea.input-text {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  margin-bottom: 4px;
  resize: none;
  overflow-y: hidden;
  box-sizing: border-box;
}

body.app.session-flow textarea.input-text {
  min-height: 48px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
  color: #e6edf3;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: height 0.1s ease-out;
}

textarea.input-text:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

body.app.session-flow textarea.input-text:focus {
  outline: 2px solid rgba(212, 175, 55, 0.55);
  outline-offset: 1px;
  border-color: rgba(212, 175, 55, 0.22);
}

body.app.session-flow textarea.input-text::placeholder {
  color: rgba(230, 237, 243, 0.38);
}

/* Кнопки: мобильные — на всю ширину */
button.btn-primary,
button.btn-secondary,
button.btn-danger {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
}

button.btn-primary {
  background: var(--primary);
  color: #fff;
}

body.app.session-flow button.btn-primary {
  background: #d4af37;
  color: #0b1a2a;
  border-radius: 12px;
  font-weight: 600;
}

button.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

body.app.session-flow button.btn-secondary,
body.app.session-flow button.btn-reset-series,
body.app.session-flow button.btn-end-evening {
  background: rgba(255, 255, 255, 0.05);
  color: #e6edf3;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

button.btn-danger {
  background: var(--danger);
  color: #fff;
}

@media (hover: hover) {
  button.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
  }
  button.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
  }
  button.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
  }
}

button.btn-primary:active:not(:disabled),
button.btn-secondary:active:not(:disabled),
button.btn-danger:active:not(:disabled) {
  transform: scale(0.98);
  opacity: 0.92;
}

button.btn-primary:disabled,
button.btn-secondary:disabled,
button.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Ряд кнопок на десктопе */
.btn-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.btn-voice-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}

.voice-recording-hint {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--danger, #c0392b);
}

/* session.html: голосовая кнопка на всю ширину */
.session-actions-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.session-actions-block .btn-voice-wrap .btn-primary {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  body.app {
    max-width: 800px;
    padding: 20px 24px;
  }

  .btn-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .btn-row .btn-primary,
  .btn-row .btn-secondary,
  .btn-row .btn-danger {
    width: auto;
    flex: 1;
    min-width: 160px;
    margin-bottom: 0;
  }
}

/* Карточки результата / строки */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 16px;
}

body.app.session-flow .result-card,
body.app.session-flow .result-edit-row {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px;
}

/* Inline-редактирование строки результата (session.html) */
.result-edit-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  align-items: stretch;
}

body.app.session-flow .result-edit-row--unmatched {
  border: 1px solid rgba(220, 160, 40, 0.55);
  background: rgba(220, 160, 40, 0.08);
}

body.app.session-flow .result-edit-row--ambiguous {
  border: 1px solid rgba(200, 180, 80, 0.45);
  background: rgba(200, 180, 80, 0.06);
}

body.app.session-flow .result-edit-row--force-new {
  border: 1px solid rgba(80, 200, 120, 0.45);
  background: rgba(80, 200, 120, 0.07);
}

.result-match-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0;
}

body.app.session-flow .result-match-meta {
  color: rgba(230, 237, 243, 0.75);
}

button.btn-create-player-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.15);
  color: #e6edf3;
  cursor: pointer;
}

.result-edit-row .input-name-row,
.result-edit-row .input-score-row {
  width: 100%;
  padding: 14px 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-height: 48px;
}

.result-edit-row .input-name-row:focus,
.result-edit-row .input-score-row:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.result-edit-row .input-score-row {
  max-width: 100%;
}

.result-edit-row-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.result-edit-row-actions .input-name-row {
  width: 100%;
}

.result-edit-row-score-del {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.result-edit-row-score-del .input-score-row {
  flex: 1;
  min-width: 0;
  max-width: none;
}

button.btn-remove-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  margin-bottom: 0;
  border: none;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  button.btn-remove-inline:hover {
    background: var(--border);
  }
}

button.btn-remove-inline:active {
  transform: scale(0.96);
  opacity: 0.9;
}

@media (min-width: 768px) {
  .result-edit-row {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .result-edit-row-actions {
    flex: 1;
    flex-direction: row;
    align-items: center;
    min-width: 0;
  }

  .result-edit-row-score-del {
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    gap: 12px;
  }

  .result-edit-row-actions .input-name-row {
    flex: 1;
    min-width: 0;
  }

  .result-edit-row-score-del .input-score-row {
    width: 120px;
    flex: 0 0 120px;
    max-width: 120px;
  }
}

.preview-empty {
  color: #64748b;
  margin: 8px 0;
}

/* Живой превью парсинга (session.html): только ответ API, не textarea */
body.app.session-flow .parse-result-preview {
  margin-top: 4px;
}

.parse-preview-loading {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  color: rgba(212, 175, 55, 0.85);
}

.parse-preview-soft-error {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Подсказка при «Готово» с пустым полем: без красной рамки и нативных ошибок */
body.app.session-flow .empty-hint {
  margin: 10px 0 0;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--muted, #94a3b8);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.45;
}

body.app.session-flow .parse-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.app.session-flow .parse-preview-line {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font-size: 1rem;
}

body.app.session-flow .parse-preview-line .result-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

body.app.session-flow .parse-preview-line .result-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

body.app.session-flow .parse-preview-line .result-main .name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

body.app.session-flow .parse-preview-line .result-main .score {
  flex: 0 0 auto;
  font-weight: 600;
  white-space: nowrap;
}

body.app.session-flow .replace-btn {
  align-self: flex-start;
  margin: 0;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(230, 237, 243, 0.65);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
}

@media (hover: hover) {
  body.app.session-flow .replace-btn:hover {
    color: #e6edf3;
    border-color: rgba(212, 175, 55, 0.4);
  }
}

@media (max-width: 600px) {
  body.app.session-flow .parse-preview-line .result-item {
    padding: 10px;
  }

  body.app.session-flow .replace-btn {
    width: 100%;
    text-align: left;
  }
}

/* Список сессий */
#session-cards {
  margin-top: 8px;
}

.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}

.session-card-id {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.session-card-date {
  font-size: 1rem;
  margin-bottom: 6px;
}

.session-card-score {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 14px;
}

.session-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 768px) {
  .session-card-actions {
    flex-direction: row;
  }

  .session-card-actions .btn-primary,
  .session-card-actions .btn-secondary,
  .session-card-actions .btn-danger {
    flex: 1;
    width: auto;
    margin-bottom: 0;
  }
}

/* Детали сессии: строки имя — очки */
.detail-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.detail-score-name {
  font-size: 16px;
}

.detail-score-val {
  font-weight: 600;
  font-size: 16px;
  color: #e2e8f0;
}

.detail-actions {
  margin-top: 8px;
}

@media (min-width: 768px) {
  .detail-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
  }

  .detail-actions .btn-danger,
  .detail-actions .btn-secondary {
    flex: 1;
    width: auto;
    margin-bottom: 0;
  }
}

/* Конфликты имён */
#conflicts {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

#conflicts.visible {
  display: block;
}

.conflict-block {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.conflict-block:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.conflict-block .meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.conflict-block label {
  display: block;
  margin: 10px 0;
  cursor: pointer;
  font-size: 0.95rem;
}

.conflict-block input {
  margin-right: 8px;
  vertical-align: middle;
}

.conflict-actions {
  margin-top: 16px;
}

@media (min-width: 768px) {
  .conflict-actions {
    display: flex;
    gap: 12px;
  }

  .conflict-actions .btn-primary,
  .conflict-actions .btn-secondary {
    flex: 1;
    width: auto;
    margin-bottom: 0;
  }
}

#status {
  margin-top: 14px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.nav-footer {
  margin-top: 20px;
  font-size: 0.9375rem;
}

.msg-error {
  color: #f87171;
  margin: 12px 0;
}

.meta-muted {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 16px;
}

/* Итоги вечера (/series/{id}) */
.series-evening-page {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.series-evening-header {
  margin-bottom: 1.25rem;
}

.series-evening-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.series-evening-meta {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.series-evening-id {
  color: var(--text);
  font-weight: 600;
}

.series-winner-hero {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--surface2), var(--surface));
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.series-winner-badge {
  font-size: 2.5rem;
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
}

.series-winner-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.series-winner-score {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  color: #fbbf24;
  letter-spacing: -0.03em;
}

.series-winner-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.series-empty-hint {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 1.25rem;
}

.series-rank-heading {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.series-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.series-rank-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 1.0625rem;
}

.series-rank-card--top {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), var(--surface2));
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.08);
}

.series-rank-pos {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9375rem;
  min-width: 2.5rem;
}

.series-rank-card--top .series-rank-pos {
  color: #fbbf24;
}

.series-rank-name {
  font-weight: 600;
  font-size: 1.125rem;
}

.series-rank-score {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
}

.series-evening-nav {
  margin-top: 2rem;
}

/* Главная / */
.landing-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.landing-body .site-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.landing-hero {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-logo {
  width: min(100%, 420px);
  height: auto;
  display: block;
}

.landing-title {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  font-size: clamp(2rem, 6vw, 3.1rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

/* Страницы клуба */
.club-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.club-body .site-shell {
  padding: 12px 16px 28px;
}

.club-page {
  max-width: 820px;
  margin: 0 auto;
}

.club-header {
  text-align: center;
  margin-bottom: 14px;
}

.club-logo {
  width: min(220px, 48vw);
  height: auto;
  display: block;
  margin: 0 auto;
}

.club-title {
  margin: 8px 0 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.club-subtitle {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.club-admin-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--link);
  font-size: 0.95rem;
  text-decoration: none;
}

.club-admin-link:hover {
  text-decoration: underline;
}

.club-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.club-card-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.club-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.club-status-error {
  color: #f87171;
}

.club-table-wrap {
  overflow-x: auto;
}

.club-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
}

.club-table th,
.club-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.club-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.club-table td:nth-child(3),
.club-table th:nth-child(3) {
  text-align: right;
}

.club-table tr.is-top td {
  font-weight: 700;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.game-item {
  background: #2a3647;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.game-item:hover {
  background: #35455c;
}

.game-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.game-score {
  font-size: 18px;
  font-weight: bold;
}

.game-day-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.game-day-card:hover {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.game-day-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.game-day-score {
  font-size: 1.1rem;
  font-weight: 700;
}

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.7);
}

.game-modal.hidden {
  display: none;
}

.game-modal-content {
  width: min(420px, 100%);
  max-height: 80dvh;
  overflow: auto;
  border-radius: 14px;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.game-modal-content h3 {
  margin: 0 0 4px;
  text-align: center;
}

.game-modal-date {
  margin: 0 0 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.game-evening-block {
  margin-bottom: 14px;
}

.game-evening-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.game-result-row {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.game-result-row.is-top {
  font-weight: 700;
}
