/* =========================
   Экран поколений — unified UI stylesheet
   (оптимизированная версия со всеми улучшениями)
   ========================= */

:root {
  --bg: #2B3034;
  --panel: #343b40;
  --panel-soft: rgba(255, 255, 255, 0.03);
  --panel-strong: rgba(0, 0, 0, 0.28);

  --gold: #EFD146;
  --blue: #627C8C;
  --red: #E93C35;

  --text: #B9C7D2;
  --muted: #989398;
  --white: #F5F7F8;
  --chip-text: #D7D7D7;

  --success: #7BD88F;
  --danger: #FF857F;

  --line: rgba(98, 124, 140, 0.55);
  --line-soft: rgba(98, 124, 140, 0.35);
  --line-gold: rgba(239, 209, 70, 0.24);

  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --radius-xs: 10px;

  --sticky-score-top: 0px;
  --sticky-ribbon-top: 84px;

  --container-width: 1180px;
  --game-width: 860px;
}

/* =========================
   Reset
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  min-height: 100%;
}
body {
  background:
    radial-gradient(circle at top, rgba(239, 209, 70, 0.1), transparent 28%),
    linear-gradient(180deg, #2b3034 0%, #262a2e 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block;     border-radius: 24px; }
a { color: inherit; }

.hidden { display: none !important; }
.fade-in {
  animation: fadeIn 0.45s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================
   Layout
   ========================= */
.container {
  width: min(100%, var(--container-width));
  margin: 0 auto;
  padding: 28px 20px 40px;
}
.landing-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing, .setup-page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.game-layout-v2 { position: relative; }

/* =========================
   Shared surfaces
   ========================= */
.character-card,{
  background: linear-gradient(180deg, rgba(255,255,255,0.0), rgba(255,255,255,0.0));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.landing-actions,
.pass-device-panel,
.game-card,
.modal {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.landing-actions,
.pass-device-panel,
.modal {
  border-radius: var(--radius-xl);
  padding: 12px;
}
.game-card,
.character-card {
  border-radius: var(--radius-xl);
  padding: 0px;
}

.setup-card,{
  background: linear-gradient(180deg, rgba(255,255,255,0.0), rgba(255,255,255,0.0));
  border: 0px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.setup-card,
 {
  border-radius: var(--radius-xl);
  padding: 28px;
}

/* =========================
   Typography — все заголовки с тенями
   ========================= */
.game-title,
.modal-title,
.char-name,
.final-title,
.card-title,
.chronotope-title,
.task-banner-title,
.vote-board-question,
.result-text,
.final-player-name {
  color: var(--gold);
  text-shadow:
    0 1px 0 rgba(239, 209, 70, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Индивидуальные размеры и отступы */
.game-title {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
}
.modal-title {
  font-size: 1.8rem;
  margin-bottom: 18px;
}
.char-name {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.final-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 12px;
}
.card-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.06;
  margin-bottom: 14px;
}
.chronotope-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.task-banner-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}
.vote-board-question {
  font-size: 18px;
  line-height: 1.45;
  margin-bottom: 12px;
  color: var(--white);
}
.result-text {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.final-player-name {
  font-size: 16px;
  font-weight: 700;
}

/* =========================
   Подписи с мягкой тенью
   ========================= */
.chronotope-btn .sub,
.task-banner-label,
.landing-text,
.landing-rules-text,
.char-role,
.card-meta-line,
.card-text-long,
.tiebreaker-text,
.debuff-box,
.final-description,
.final-narrative,
.stat-row span:first-child {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
/* Дополнительная мягкая тень для task-banner-label (у него фон золотой, поэтому тень на тексте) */
.task-banner-label {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.landing-header {
  text-align: center;
  margin-bottom: 28px;
}
.landing-divider {
  width: 210px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  margin: 0 auto 20px;
}
.landing-text {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text);
  font-size: 1.05rem;
}

.char-role {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.char-section {
  color: var(--text);
  font-size: 1rem;
  margin: 14px 0;
}
.char-label {
  color: var(--gold);
  font-weight: 700;
}

/* =========================
   Buttons
   ========================= */
.landing-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid transparent;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}
.landing-btn:hover { transform: translateY(-1px); }
.landing-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.landing-btn-primary {
  margin-top: 10px;
  background: var(--red);
  color: var(--white);
  box-shadow: 0 0 20px rgba(233, 60, 53, 0.5), 0 14px 30px rgba(233, 60, 53, 0.25);
}
.landing-btn-primary:hover {
  box-shadow: 0 0 40px rgba(233, 60, 53, 0.7), 0 18px 36px rgba(233, 60, 53, 0.32);
  transform: translateY(-2px) scale(1.02);
}
.landing-btn-secondary {
  background: rgba(255,255,255,0.02);
  color: var(--text);
  border-color: rgba(98,124,140,0.65);
}
.landing-btn-secondary:hover {
  background: rgba(98,124,140,0.12);
  border-color: var(--gold);
  color: var(--white);
}
.landing-link-btn {
  align-self: center;
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 6px 10px;
  font-size: 0.98rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
/* Ссылка как кнопка */
a.landing-btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  line-height: 1.2;
}

/* =========================
   Form controls
   ========================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-label {
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.form-input {
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(98,124,140,0.55);
  background: rgba(255,255,255,0.03);
  color: var(--white);
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  appearance: none;
}
.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(239,209,70,0.12);
  background: rgba(255,255,255,0.05);
}
.form-input::placeholder { color: rgba(185,199,210,0.55); }
select.form-input, #chronotope-select.form-input {
  background-color: var(--panel);
  color: var(--white);
}
select.form-input option, #chronotope-select.form-input option {
  background-color: var(--panel);
  color: var(--white);
}
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* =========================
   Setup (регистрация)
   ========================= */
.setup-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.player-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.player-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.player-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239,209,70,0.16);
  color: var(--gold);
  font-weight: 700;
  border: 1px solid rgba(239,209,70,0.25);
}
.setup-error {
  border-radius: 16px;
  background: rgba(233,60,53,0.12);
  border: 1px solid rgba(233,60,53,0.28);
  color: #ffd3d1;
  padding: 14px 16px;
}

/* =========================
   Range slider (для setup.htm)
   ========================= */
.range-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.range-display {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(239, 209, 70, 0.12);
  border: 2px solid rgba(239, 209, 70, 0.3);
  box-shadow: 0 0 20px rgba(239, 209, 70, 0.1);
  margin-bottom: 4px;
}
.range-number {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(239, 209, 70, 0.2);
  line-height: 1;
}
.range-slider {
  width: 100%;
  max-width: 360px;
  padding: 0 10px;
}
.range-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(239, 209, 70, 0.3), rgba(239, 209, 70, 0.6));
  outline: none;
  transition: background 0.2s;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 20px rgba(239, 209, 70, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
.range-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 30px rgba(239, 209, 70, 0.6);
}
.range-slider input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(239, 209, 70, 0.4);
}
.range-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 360px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* =========================
   Chronotope screen
   ========================= */
.chronotope-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.chronotope-badge-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.chronotope-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(239,209,70,0.12);
  color: var(--gold);
  border: 1px solid rgba(239,209,70,0.22);
  font-size: 0.92rem;
  font-weight: 700;
}
.chronotope-badge-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(239,209,70,0.12);
  color: var(--gold);
  border: 1px solid rgba(239,209,70,0.22);
  font-size: 0.92rem;
  font-weight: 700;
}
#chronotope-culture {
  text-align: center;
  width: auto !important;
  font-size: 1.3rem;
  padding: 10px 20px;
  display: inline-block;
  margin: 0 auto;
}
.chronotope-summary { text-align: left; max-width: none; }
.chronotope-rule-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(98,124,140,0.45);
  border-radius: 20px;
  padding: 18px;
}
.chronotope-rule-title {
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0px;
}

/* =========================
   Pass / reveal
   ========================= */
.pass-device {
  background: radial-gradient(rgba(239, 209, 70, 0.12), rgba(239, 209, 70, 0.04));
  border: 1px solid rgba(239, 209, 70, 0.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 40px rgba(239, 209, 70, 0.08);
  border-radius: var(--radius-xl);
  padding: 10px 10px;
  text-align: center;
  backdrop-filter: blur(6px);
  margin-bottom: 0px;
}
.pass-device h2 {
  color: var(--gold);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 4px;
  text-shadow: 0 1px 0 rgba(239,209,70,0.3), 0 2px 4px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.3);
}
.pass-device p {
  color: var(--text);
  max-width: 460px;
  margin: 0 auto 14px;
  font-size: 1rem;
  line-height: 1.4;
}
#player-name {
  color: var(--gold);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 8px;
  text-shadow: 0 1px 0 rgba(239,209,70,0.3), 0 2px 4px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.3);
}
.reveal-actions, .game-nav, .result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.char-portrait-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.char-portrait {
  width: min(220px, 100%);
  max-height: 260px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(239,209,70,0.35);
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
  background: rgba(255,255,255,0.03);
}
.reveal-card-v1-1 .char-name, .reveal-card-v1-1 .char-role { text-align: center; }
.task-banner {
  position: relative;
  margin-top: 12px;
  padding: 12px 12px 12px;
  border-radius: 20px;
  background: rgba(239,209,70,0.08);
  border: 1px solid rgba(239,209,70,0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.task-banner-label {
  display: block;
  text-align: center;
  font-size: 1rem;
  padding: 4px;
  margin: 0 auto 3px auto;
  width: fit-content;
  background: var(--gold);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.06em;
  min-height: auto;
  line-height: 1.4;
  box-shadow: 0 0 20px rgba(239,209,70,0.3);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.task-banner-title {
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}
.task-banner-desc {
  color: var(--text);
  font-size: 1rem;
  text-align: center;
  line-height: 1.5;
}
.task-banner-card .task-banner-code {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 10px;
}

/* =========================
   Modal
   ========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12,14,16,0.72);
  z-index: 60;
}
.modal {
  position: relative;
  width: min(100%, 640px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #2f363b;
}
.player-modal { max-width: 520px; }
.player-modal-image {
  display: block;
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(98,124,140,0.45);
  margin-bottom: 16px;
}
.landing-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
}
.landing-rules-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.landing-rules-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(98,124,140,0.4);
  border-radius: 18px;
  padding: 18px;
}
.landing-rules-text { color: var(--text); }
.landing-modal { color: var(--text); }

/* =========================
   Game header
   ========================= */
.score-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.score-bar-compact {
  position: sticky;
  top: var(--sticky-score-top);
  z-index: 40;
  padding: 0 0 4px;
  background: linear-gradient(180deg, rgba(43,48,52,0.0), rgba(43,48,52,0.0));
  backdrop-filter: blur(10px);
}
.score-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(98,124,140,0.45);
  border-radius: 18px;
  padding: 14px;
  text-align: center;
}
.score-label {
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 6px;
}
.score-value {
  font-size: 1.8rem;
  font-weight: 800;
}
.score-conflict { color: var(--danger); }
.score-trust { color: var(--success); }

/* =========================
   Player ribbon
   ========================= */
#player-ribbon.player-ribbon {
  position: sticky;
  top: 4px;
  z-index: 45;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 0 12px 0;
  padding: 6px 3px 6px;
  background: rgba(43,48,52,0.95);
  border-radius: 16px;
  border: 1px solid rgba(98,124,140,0.3);
}
#player-ribbon .player-chip {
  flex: 0 0 130px;
  min-width: 130px;
  max-width: 130px;
}
@media (max-width: 640px) {
  #player-ribbon.player-ribbon { top: 2px; }
  #player-ribbon .player-chip {
    flex: 0 0 112px;
    min-width: auto;
    max-width: max-content;
  }
}
.player-chip {
  flex: 0 0 132px;
  min-width: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0,0,0,0.34);
  border: 1px solid rgba(239,209,70,0.22);
  color: var(--white);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.player-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(239,209,70,0.45);
  background: rgba(0,0,0,0.42);
}
.player-chip-score {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}
.player-chip-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(239,209,70,0.24);
  background: rgba(255,255,255,0.05);
}
.player-chip-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--gold);
  border: 2px solid rgba(239,209,70,0.24);
  background: rgba(255,255,255,0.05);
}
.player-chip-name {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

/* =========================
   Game card & animations
   ========================= */
.game-view {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.game-view.slide-in {
  animation: slideIn 0.4s ease both;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.fade-in {
  animation: fadeIn 0.4s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(98,124,140,0.3);
}
.card-meta-line {
  color: var(--muted);
  font-size: 0.95rem;
}
.card-code {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(239,209,70,0.25);
  color: var(--gold);
  background: rgba(239,209,70,0.08);
  font-size: 0.82rem;
  font-weight: 700;
}
.card-text, .card-text-long { font-size: 1rem; }
.card-text { color: var(--text); margin-bottom: 10px; }
.card-text-long {
  color: var(--muted);
  border-left: 2px solid rgba(98,124,140,0.45);
  padding-left: 14px;
  margin-bottom: 18px;
}
.task-image-wrap, .card-image-wrap {
  margin: 12px 0 14px;
}
.task-image, .card-image {
  display: block;
  width: 100%;
  border-radius: 16px;
  border: 0px solid rgba(98,124,140,0.45);
  background: rgba(255,255,255,0.02);
}

/* =========================
   Progress bar
   ========================= */
.progress-bar-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 18px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 20px;
  border: 1px solid rgba(98,124,140,0.3);
}
.progress-step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(98,124,140,0.3);
  color: var(--muted);
  transition: all 0.3s ease;
}
.progress-step:not(.active):not(.done) {
  border-color: rgba(98,124,140,0.3);
  color: var(--muted);
  background: rgba(255,255,255,0.06);
}
.progress-step.active {
  border-color: var(--success);
  background: rgba(123,216,143,0.2);
  color: var(--success);
  transform: scale(1.2);
  box-shadow: 0 0 25px rgba(123,216,143,0.3);
}
.progress-step.done {
  border-color: var(--success);
  background: rgba(123,216,143,0.15);
  color: var(--success);
}

/* =========================
   Chronotope indicator
   ========================= */
.chronotope-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 12px;
  padding: 6px 16px;
  background: rgba(239,209,70,0.08);
  border: 1px solid rgba(239,209,70,0.25);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
}
.chronotope-indicator .chronotope-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chronotope-indicator .chronotope-name {
  color: var(--text);
  font-weight: 400;
  font-size: 0.9rem;
}

/* =========================
   Choices / timer
   ========================= */
.choices {
  display: grid;
  gap: 14px;
  margin: 22px 0 16px;
}
.choice-btn {
  width: 100%;
  border: 1px solid rgba(98,124,140,0.45);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.choice-btn:hover, .choice-btn.selected {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: rgba(239,209,70,0.08);
}
.choice-label {
  display: inline-block;
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 6px;
}
.choice-short {
  display: block;
  color: var(--white);
  margin-bottom: 4px;
}
.choice-long {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}
.timer-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(98,124,140,0.45);
}
.timer-display {
  color: var(--gold);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.timer-btn {
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(239,209,70,0.28);
  background: rgba(239,209,70,0.08);
  color: var(--gold);
  font-weight: 700;
}
.timer-btn.timer-running { opacity: 0.65; }

/* =========================
   Voting
   ========================= */
.vote-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(98,124,140,0.3);
}
.vote-title {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.vote-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.vote-btn {
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(98,124,140,0.45);
  background: rgba(255,255,255,0.02);
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.vote-btn:hover { transform: translateY(-1px); }
.vote-btn.vote-a.active, .vote-btn.vote-a:hover {
  border-color: var(--danger);
  background: rgba(255,133,127,0.12);
}
.vote-btn.vote-b.active, .vote-btn.vote-b:hover {
  border-color: var(--success);
  background: rgba(123,216,143,0.12);
}
.vote-board {
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(239,209,70,0.18);
  border-radius: 26px;
  padding: 10px;
}
.vote-board-head { margin-bottom: 16px; }
.vote-board-options {
  display: grid;
  gap: 10px;
}
.vote-option {
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 0px solid rgba(255,255,255,0.14);
}
.vote-option-a { border-color: rgb(255, 204, 0, 0.5); }
.vote-option-b { border-color: rgba(255, 204, 0, 0.5); }
.vote-player-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.vote-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(239,209,70,0.08);
}
.vote-player-name {
  color: var(--gold);
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  flex: 1;
}
.vote-player-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  min-width: 200px;
}
.vote-btn {
  min-width: 100px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 2px solid rgba(239,209,70,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  transition: all 0.2s ease;
  flex: 1;
  max-width: 150px;
  text-align: center;
}
.vote-btn.vote-a.active, .vote-btn.vote-a:hover {
  border-color: var(--danger);
  background: rgba(255,133,127,0.12);
}
.vote-btn.vote-b.active, .vote-btn.vote-b:hover {
  border-color: var(--success);
  background: rgba(123,216,143,0.12);
}

/* =========================
   Results / tie
   ========================= */
.result-banner {
  margin-top: 20px;
  border-radius: 20px;
  padding: 18px;
  border: 1px solid rgba(98,124,140,0.45);
  background: rgba(255,255,255,0.03);
}
.result-banner.tie {
  border-color: rgba(233,60,53,0.35);
  background: rgba(233,60,53,0.08);
}
.tiebreaker-text, .debuff-box {
  color: var(--text);
  font-size: 0.97rem;
}
.debuff-box {
  z-index: 10;
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 2px dashed rgba(233,60,53,0.5);
  background: rgba(233,60,53,0.2);
}

/* =========================
   Final screen
   ========================= */
.final-card {
  margin-top: 0px;
  padding: 0px;
  border-radius: 28px;
  border: px solid rgba(239,209,70,0.24);
  background: rgba(239,209,70,0.06);
}
.final-card-expanded .final-description, .final-narrative {
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 14px;
}
.final-player-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.final-player-card {
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(239,209,70,0.2);
  border-radius: 14px;
  padding: 10px;
}

.final-player-code {
  font-family: "Courier New", monospace;
  color: var(--white);
  font-size: 14px;
  padding: 2px 10px;
  border-radius: 8px;
}
.final-influence-box {
  margin-top: 1px;
  padding-top: 2px;
}
.final-influence-box label {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}
.final-influence-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.influence-input {
  flex: 1 1 160px;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(239,209,70,0.24);
  background: rgba(0,0,0,0.28);
  color: var(--white);
  outline: none;
}
.influence-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(239,209,70,0.12);
}
.final-influence-row .landing-btn {
  flex: 0 0 auto;
  min-width: 100px;
}

/* =========================
   Final stats table
   ========================= */
.final-stats {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(98,124,140,0.3);
  border-radius: 16px;
  padding: 16px;
  margin-top: 20px;
}
.final-stats h3 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(98,124,140,0.15);
  font-size: 0.95rem;
}
.stat-row:last-child {
  border-bottom: none;
}
.stat-row span:first-child {
  color: var(--muted);
}
.stat-row span:last-child {
  color: var(--white);
}

/* =========================
   Particles
   ========================= */
.particles-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
}
.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--particle-color, rgba(239, 209, 70, 1));
  animation: floatParticle linear infinite;
  will-change: transform, opacity;
}
@keyframes floatParticle {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

/* =========================
   Misc helpers
   ========================= */
.pass-device-panel .landing-btn { display: block; }
.score-bar + .player-ribbon { margin-top: -4px; }

/* =========================
   Кнопка хронотопа (универсальная)
   ========================= */
/* =========================
   Кнопка хронотопа (исправленная)
   ========================= */
.chronotope-btn {
  margin: 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px; /* уменьшили отступы */
  border-radius: var(--radius-xl);
  border: 1px solid rgba(239, 209, 70, 0.35);
  background: linear-gradient(145deg, rgba(239, 209, 70, 0.15), rgba(239, 209, 70, 0.05));
  color: var(--gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(239, 209, 70, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
  min-height: 100px; /* уменьшили */
  overflow-wrap: break-word;   /* перенос длинных слов */
  word-break: break-word;      /* принудительный перенос */
  width: 100%;                 /* чтобы кнопка занимала всю ячейку сетки */
}

.chronotope-title {
  font-size: clamp(1.2rem, 1.8vw, 2.2rem); /* уменьшили максимальный размер */
  font-weight: 800;
  color: var(--gold);
  text-shadow:
    0 1px 0 rgba(239, 209, 70, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  max-width: 100%;             /* не выходит за пределы кнопки */
  display: block;
}

/* Подпись (sub) – оставляем как есть, но можно тоже уменьшить */
.chronotope-btn .sub {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
  opacity: 0.8;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  max-width: 100%;
  overflow-wrap: break-word;
}

/* =========================
   Улучшения для index.htm (картинка, иконки, тень)
   ========================= */
.landing-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
}
.landing-image {
  width: 100%;
  max-width: 500px;
  border-radius: 224px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.3s forwards;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.landing-image:hover {
  transform: scale(1.02);
  box-shadow: 0 30px 60px rgba(239, 209, 70, 0.15);
}
.btn-icon {
  margin-right: 10px;
  font-size: 1.2rem;
  display: inline-block;
  vertical-align: middle;
}
#rules-start-btn {
  margin-top: 10px;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 900px) {
  :root { --sticky-ribbon-top: 78px; }
  .container { padding: 20px 16px 32px; }
  .game-card, .character-card, .modal, .landing-actions,  {
    border-radius: 28px;
    padding: 2px 2px;
  }
  .pass-device-panel {
    border-radius: 28px;
    padding: 2px 20px;
  }
  .setup-card{
    border-radius: 28px;
    padding: 10px 10px;
  }
  .card-title { font-size: clamp(1.6rem, 4vw, 2.1rem); }
  .vote-player-actions { min-width: 140px; }
}
@media (max-width: 768px) {
  .container { padding: 15px 10px 20px; }
  .landing-text, .landing-rules-text, .char-section, .task-banner-desc { font-size: 1.1rem; }
  .player-item {
    grid-template-columns: 36px 1fr;
    gap: 10px;
  }
  .player-num { width: 36px; height: 36px; }
  .score-bar, .vote-btns { grid-template-columns: 1fr; }
  .card-meta { flex-direction: column; }
  .timer-box { flex-direction: column; }
  .score-bar-compact {
    gap: 8px;
    padding: 6px 0;
    position: static;
  }
  .score-item { padding: 6px; }
  .score-value { font-size: 1.2rem; }
  .player-ribbon { top: 68px; padding: 4px 0 8px; }
  .player-chip {
    flex: 0 0 90px;
    min-width: 90px;
    max-width: 110px;
    padding: 4px;
  }
  .player-chip-avatar { width: 36px; height: 36px; }
}
@media (max-width: 640px) {
  :root { --sticky-ribbon-top: 82px; }
  .player-chip { flex-basis: 112px; min-width: 112px; }
  .vote-player-row, { flex-direction: column; align-items: stretch; }
  .final-influence-row { align-items: stretch; }
  .vote-player-actions, .final-player-stats, .final-influence-row .landing-btn, .final-influence-row button { width: 100%; }
  .final-player-stats { grid-template-columns: 1fr; }
  .influence-input { max-width: none; }
  .chronotope-indicator { flex-wrap: wrap; text-align: center; }
}
@media (max-width: 600px) {
  .chronotope-btn {
    min-height: 100px;
    min-width: 100px;
    padding: 16px 12px;
  }
  .chronotope-title {
    font-size: 1.6rem;
  }
  .pass-device {
    padding: 16px 16px;
  }
  .character-card {
    padding: 5px 5px;
  }
  .task-banner {
    padding: 7px 7px;
  }
  #player-name {
    font-size: 2rem !important;
  }
}
@media (max-width: 480px) {
  .landing-actions { gap: 14px; }
  .landing-image {
    max-width: 100%;
    border-radius: 160px;
    animation-duration: 0.6s;
  }
  .btn-icon { font-size: 1rem; margin-right: 6px; }
  .game-title { font-size: clamp(1.8rem, 8vw, 2.8rem); }
  .range-display { width: 56px; height: 56px; }
  .range-number { font-size: 2rem; }
  .form-label { font-size: 1.1rem; }
  .range-slider { max-width: 280px; }
}

/* =========================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ GAME.HTM
   ========================= */

/* 1. Лента игроков – закреплена сверху, адаптивные чипы */
.player-ribbon {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  padding: 8px 6px;
  background: rgba(43,48,52,0.95);
  backdrop-filter: blur(8px);
  border-radius: 0 0 16px 16px;
  border-bottom: 1px solid rgba(239,209,70,0.2);
  margin-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.player-ribbon .player-chip {
  flex: 0 1 auto;
  min-width: 70px;
  max-width: 130px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(0,0,0,0.34);
  border: 1px solid rgba(239,209,70,0.22);
  color: var(--white);
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.8rem;
}
.player-ribbon .player-chip-avatar {
  width: 36px;
  height: 36px;
  border-radius: 30%;
  border: 1px solid rgba(239,209,70,0.2);
}
.player-ribbon .player-chip-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.player-ribbon .player-chip-score {
  font-size: 0.65rem;
}
/* Если игроков больше 4 – уменьшаем чипы */
.player-ribbon.player-ribbon-compact .player-chip {
  min-width: 56px;
  max-width: 90px;
  padding: 4px 4px;
}
.player-ribbon.player-ribbon-compact .player-chip-avatar {
  width: 26px;
  height: 26px;
}
.player-ribbon.player-ribbon-compact .player-chip-name {
  font-size: 0.6rem;
}
.player-ribbon.player-ribbon-compact .player-chip-score {
  font-size: 0.55rem;
}

/* 2. Score-bar – компактный, на мобильных два в строку */
.score-bar-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 6px;
  margin-bottom: 6px;
}
.score-item {
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(98,124,140,0.3);
  text-align: center;
}
.score-label {
  font-size: 0.7rem;
  color: var(--muted);
}
.score-value {
  font-size: 1.2rem;
  font-weight: 700;
}

/* 3. Индикатор хронотопа + номер карточки */
.chronotope-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 12px;
  background: rgba(239,209,70,0.08);
  border: 1px solid rgba(239,209,70,0.2);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.card-number-badge {
  background: rgba(255,255,255,0.06);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text);
  border: 1px solid rgba(98,124,140,0.3);
}

/* 4. Прогресс-бар – только текущий уровень активен */
.progress-bar-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.progress-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(98,124,140,0.3);
  color: var(--muted);
  transition: all 0.3s ease;
}
.progress-step.active {
  border-color: var(--gold);
  background: rgba(239,209,70,0.2);
  color: var(--gold);
  box-shadow: 0 0 20px rgba(239,209,70,0.3);
  transform: scale(1.1);
}
.progress-step:not(.active) {
  border-color: rgba(98,124,140,0.2);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}

/* 5. Карточка: картинка сверху, скругление только сверху */
.card-image-top {
  margin: -2px -2px 0 -2px; /* чтобы вписаться в границы карточки */
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  width: calc(100% + 4px);
  max-width: none;
}
.card-image-top img {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-content {
  padding: 15px 15px 20px;
}

/* 6. Текст карточки – улучшенные шрифты */
.card-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}
.card-text-long {
  font-family: 'Inter', system-ui, sans-serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
  border-left: 2px solid rgba(98,124,140,0.3);
  padding-left: 14px;
}

/* 7. Голосование – убираем красный/зелёный, делаем нейтральный */
.vote-option-a,
.vote-option-b {
  border-color: rgba(239,209,70,0.25) !important;
  background: rgba(255,255,255,0.03) !important;
}
.vote-btn.vote-a,
.vote-btn.vote-b {
  border-color: rgba(239,209,70,0.3) !important;
  background: rgba(239,209,70,0.05) !important;
  color: var(--white) !important;
}
.vote-btn.vote-a.active,
.vote-btn.vote-b.active {
  border-color: var(--gold) !important;
  background: rgba(239,209,70,0.35) !important;
  color: var(--gold) !important;
}
.vote-btn.vote-a:hover,
.vote-btn.vote-b:hover {
  border-color: var(--gold) !important;
  background: rgba(239,209,70,0.35) !important;
}

/* 8. Тай-брейк – светящийся, менее прозрачный */
.result-banner.tie {
  border-color: rgba(239,209,70,0.6) !important;
  background: rgba(239,209,70,0.15) !important;
  box-shadow: 0 0 40px rgba(239,209,70,0.2), inset 0 0 30px rgba(239,209,70,0.05);
}

/* 9. Статистика – бонусы в столбец */
.stat-row-bonus {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 4px;
}
.stat-row-bonus span:first-child {
  font-weight: 700;
  color: var(--gold);
}
.stat-row-bonus span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--white);
  font-size: 0.9rem;
}

/* 10. Влияние – уменьшаем высоту input */
.influence-input {
  flex: 1 1 16px; /* было 16px – исправлено */
  min-width: 45%;
  max-width: 48%;
  padding: 6px 10px;
  font-size: 0.9rem;
  height: 38px;
}
.final-influence-row .landing-btn {
  min-height: 38px;
  min-width: 45%;
  max-width: 48%;
  padding: 6px 14px;
  font-size: 0.9rem;
}

/* 11. Адаптив для мобильных */
@media (max-width: 640px) {
  .player-ribbon .player-chip {
    min-width: 56px;
    max-width: 80px;
    padding: 4px 4px;
  }
  .player-ribbon .player-chip-avatar {
    width: 24px;
    height: 24px;
  }
  .player-ribbon .player-chip-name {
    font-size: 0.7rem;
  }
  .player-ribbon .player-chip-score {
    font-size: 0.7rem;
  }
  .score-bar-compact {
    gap: 4px;
    padding: 2px 4px;
  }
  .score-item {
    padding: 4px 6px;
  }
  .score-value {
    font-size: 1rem;
  }
  .chronotope-indicator {
    font-size: 0.7rem;
    gap: 6px;
    padding: 4px 10px;
  }
  .card-number-badge {
    font-size: 0.6rem;
    padding: 1px 8px;
  }
  .progress-step {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
  .card-content {
    padding: 10px 10px 12px;
  }
  .vote-player-row {
    flex-wrap: wrap;
  }
  .vote-player-actions {
    min-width: unset;
    width: 100%;
    justify-content: center;
  }
  .vote-btn {
    min-width: 60px;
    font-size: 25px;
  }
  .final-player-top {
    flex-wrap: wrap;
  }
  .final-player-code {
    font-size: 12px;
  }
}

.player-chip-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap; /* если имён длинные, чтобы не ломали вёрстку */
  max-width: 100%;
}
.player-chip-name {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px; /* подберите по необходимости */
}
.player-chip-score {
  font-size: 1rem;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

.final-player-top {
  display: flex;
  flex-direction: row;           /* горизонтальное расположение */
  flex-wrap: nowrap;             /* запрещаем перенос на следующую строку */
  align-items: center;           /* выравнивание по вертикали по центру */
  justify-content: space-between; /* распределяем пространство между элементами */
  gap: 8px;                      /* небольшой отступ между элементами */
  overflow: hidden;              /* чтобы ничего не вылезало за границы */
}
.final-player-name,
.final-player-code,
.player-chip-score {
  white-space: nowrap;          /* текст не переносится */
  flex-shrink: 0;               /* по возможности не сжимать */
}
@media (max-width: 600px) {
  .final-player-top {
    gap: 4px;
    font-size: 0.8rem;
  }
  .final-player-code {
    padding: 1px 6px;
  }
  .player-chip-score {
    font-size: 0.7rem;
  }
}

/* ========== Кнопка опасного действия (перезапуск) ========== */
.landing-btn-danger {
  background: var(--danger);
  color: var(--white);
  box-shadow: 0 14px 30px rgba(233, 60, 53, 0.35);
  border: 1px solid var(--danger);
}
.landing-btn-danger:hover {
  box-shadow: 0 18px 36px rgba(233, 60, 53, 0.55);
  transform: translateY(-2px);
}
.landing-btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Предупреждение фатального исхода */
.fatal-warning {
    margin: 16px 0;
    padding: 8px 0;
    border-radius: 16px;
    background: rgba(233, 60, 53, 0.05);
}
.fatal-warning h2 {
    animation: pulseFatal 1.5s infinite;
    text-align: center;
}
@keyframes pulseFatal {
    0% { opacity: 0.7; text-shadow: 0 0 10px #FF4444; }
    50% { opacity: 1; text-shadow: 0 0 40px #FF4444, 0 0 80px #FF4444; }
    100% { opacity: 0.7; text-shadow: 0 0 10px #FF4444; }
}
.fatal-warning p {
    text-align: center;
}
.highlight h6 { 
  font-size: 2rem;
  }

  /* =========================
   Мобильная адаптация для choice.htm
   ========================= */
@media (max-width: 480px) {
    .chronotope-grid {
        grid-template-columns: 1fr !important; /* одна колонка на всю ширину */
        gap: 12px;
        padding: 0 4px; /* небольшой отступ по краям */
    }

    .chronotope-btn {
        min-height: 80px; /* уменьшаем высоту */
        padding: 12px 8px; /* уменьшаем отступы внутри */
        font-size: 1.2rem; /* уменьшаем шрифт */
        border-radius: 18px;
        width: 100% !important; /* гарантируем заполнение */
        box-sizing: border-box;
    }

    .chronotope-title {
        font-size: 1.4rem !important; /* уменьшаем заголовок */
        line-height: 1.2;
        margin-bottom: 2px;
    }

    .chronotope-btn .sub {
        font-size: 0.7rem;
        margin-top: 2px;
    }
}

/* =========================
   Таймер: красная кнопка при истечении времени
   ========================= */
/* Кнопка таймера становится красной при истечении времени */
.landing-btn-secondary.timer-ended,
#timer-btn.timer-ended {
    background: var(--red) !important;
    color: var(--white) !important;
    border-color: var(--red) !important;
    box-shadow: 0 0 30px rgba(233, 60, 53, 0.7) !important;
    animation: pulseRed 1s infinite;
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 10px rgba(233, 60, 53, 0.4); }
    50% { box-shadow: 0 0 40px rgba(233, 60, 53, 0.9); }
    100% { box-shadow: 0 0 10px rgba(233, 60, 53, 0.4); }
}


/* Ограничение ширины контейнера на десктопах */
@media (min-width: 1024px) {
    .container.landing-shell {
        max-width: 600px;
        padding-left: 40px;
        padding-right: 40px;
    }
}
.final-player-card .task-banner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.final-player-card .task-banner .task-banner-label {
  flex: 2 0 auto;
  font-size: 0.7rem;
  margin: 1 !important;
}
.final-player-card .task-banner .task-banner-title {
  flex: 1 2 auto;
  font-size: 0.7rem;
  text-align: left;
}