:root {
  color-scheme: dark;
  font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  font-size: 16px;
  --surface-rgb: 27, 39, 40;
  --surface-deep-rgb: 16, 26, 27;
  --accent-solid: #e7c464;
  --accent-rgb: 231, 196, 100;
  --accent-warn-rgb: 140, 96, 43;
  --bg-gradient: radial-gradient(circle at top left, #263638 0%, rgba(var(--surface-rgb), 0.9) 40%, #101a1b 75%);
  --card-bg: rgba(var(--surface-rgb), 0.82);
  --card-border: rgba(var(--accent-rgb), 0.2);
  --text-primary: #f3f6f5;
  --text-secondary: rgba(229, 235, 234, 0.7);
  --accent: linear-gradient(135deg, #f3df9a, #e7c464 60%, #cfa542 100%);
  --accent-strong: linear-gradient(135deg, #f7e6af, #e7c464);
  --accent-text: #1b2728;
  --btn-bg: rgba(var(--accent-rgb), 0.18);
  --btn-border: rgba(var(--accent-rgb), 0.34);
  --error: #d95f4b;
  --error-rgb: 217, 95, 75;
  --success: #61d2a4;
  --success-rgb: 97, 210, 164;
  --surface-highlight: rgba(var(--accent-rgb), 0.32);
  --accent-relax: 76, 141, 127;
}

* {
  box-sizing: border-box;
}

html {
  overflow: hidden;
  height: 100%;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height для iOS */
  height: calc(var(--vh, 1vh) * 100); /* Fallback с JS-управляемой высотой */
  max-height: 100vh;
  max-height: 100dvh;
  max-height: calc(var(--vh, 1vh) * 100);
  display: flex;
  justify-content: center;
  background: var(--bg-gradient);
  color: var(--text-primary);
  padding: 0;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: 1080px;
  position: relative;
  z-index: 2;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.5rem;
}

@media (min-width: 769px) {
  .container {
    padding: 1rem;
  }
}

header {
  text-align: center;
  margin-bottom: clamp(0.5rem, 2vh, 1rem);
  flex-shrink: 0;
}

header h1 {
  font-size: clamp(2.2rem, 6vw + 0.5rem, 3rem); /* Увеличен минимум для мобильных */
  letter-spacing: 0.03em;
  margin-bottom: clamp(0.25rem, 0.8vh, 0.5rem);
  margin-top: clamp(0.3rem, 1.2vh, 0.6rem);
}

.build-badge {
  margin-left: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--btn-border);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  vertical-align: middle;
}

header p {
  color: var(--text-secondary);
  position: relative;
  z-index: 2;
  margin: 0 auto;
  max-width: 440px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.5vw, 0.7rem);
  padding: clamp(1rem, 2.2vh, 1.3rem) clamp(1.3rem, 3.5vw, 1.7rem);
  font-size: clamp(1.15rem, 3vw, 1.35rem); /* Увеличен минимум */
  font-weight: 500;
  border-radius: clamp(15px, 3.5vw, 19px);
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: inherit;
  cursor: pointer;
  min-height: clamp(54px, 7.5vh, 62px); /* Увеличен минимум */
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, background 0.3s ease-out, border 0.3s ease-out;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.mode-switcher {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.mode-switcher button {
  padding: 0.9rem 1.9rem;
  font-size: 1.05rem;
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}


.mode-switcher button.primary,
button.primary {
  background: var(--accent);
  border: none;
  color: var(--accent-text);
  font-weight: 600;
}

button.secondary {
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid var(--btn-border);
  color: var(--text-primary);
}

.mode-switcher button:hover,
button.primary:hover,
button.secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.2);
}

button:disabled.primary,
button:disabled.secondary {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.12);
  color: rgba(246, 240, 220, 0.45);
}

main {
  display: flex;
  justify-content: center;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  width: 100%;
}

.view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0; /* Важно для правильной работы flexbox */
}

.card {
  flex: 1;
  min-height: 0;
  overflow: hidden; /* Никакого скролла на карточках по умолчанию */
  background: var(--card-bg);
  border: none;
  border-radius: clamp(20px, 4.5vw, 28px);
  padding: clamp(1.4rem, 3.5vh, 2.2rem) clamp(1.4rem, 4.5vw, 2.2rem); /* Увеличен минимум */
  backdrop-filter: blur(18px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: clamp(0.9rem, 2.5vh, 1.4rem);
  height: 100%;
}

/* Админ должен скроллиться для длинного контента */
#hostView {
  overflow-y: auto;
  overflow-x: hidden;
}

.card h2 {
  margin-top: 0;
  letter-spacing: 0.03em;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

label {
  display: block;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.1rem);
}

input,
textarea {
  width: 100%;
  margin-top: clamp(0.5rem, 1.2vh, 0.7rem);
  padding: clamp(1rem, 2.3vh, 1.2rem) clamp(1.15rem, 3vw, 1.4rem); /* Увеличен минимум */
  border-radius: clamp(14px, 3vw, 17px);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--surface-rgb), 0.7);
  color: inherit;
  font-size: clamp(1.1rem, 3vw, 1.3rem); /* Увеличен минимум */
  transition: border 0.3s ease-out, box-shadow 0.3s ease-out;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.28);
}

textarea {
  resize: vertical;
}

.answers {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.question-media {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.9rem;
}

#addQuestionBtn {
  margin-bottom: 1.4rem;
  margin-top: 1.4rem;
}

.image-upload input[type='file'] {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 15px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--surface-rgb), 0.7);
  color: inherit;
  cursor: pointer;
}

.image-preview {
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(var(--surface-rgb), 0.6);
  border: none;
  display: grid;
  gap: 0.75rem;
}

.image-preview img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(var(--surface-rgb), 0.6);
}

.answer-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
}

.answer-option input[type='radio'] {
  accent-color: var(--accent-solid);
  width: 1.1rem;
  height: 1.1rem;
}

#questionsContainer,
#playersContainer,
#hostResultsList,
#playerResultsList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.player-item {
  padding: 0.9rem 1.1rem;
  background: rgba(var(--surface-rgb), 0.32);
  border-radius: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
}

.player-info {
  display: grid;
  gap: 0.5rem;
}

.player-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-name {
  font-weight: 600;
  font-size: 1rem;
}

.player-score {
  margin-left: auto;
  font-weight: 700;
  font-size: 1rem;
}

.player-status {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--surface-rgb), 0.5);
}

.player-status.online {
  color: #4caf50;
  border-color: rgba(76, 175, 80, 0.45);
  background: rgba(76, 175, 80, 0.15);
}

.player-status.offline {
  color: #f06292;
  border-color: rgba(240, 98, 146, 0.45);
  background: rgba(240, 98, 146, 0.18);
}

.question-item {
  padding: 0.95rem 1.2rem;
  background: rgba(var(--surface-rgb), 0.3);
  border-radius: 18px;
  display: grid;
  gap: 0.75rem;
  border: none;
}

.question-image-preview {
  padding: 0.75rem 0.85rem;
  background: rgba(var(--surface-rgb), 0.58);
  border-radius: 16px;
  border: none;
  display: grid;
  gap: 0.6rem;
}

.question-image-caption {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.75);
}

.question-image-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  background: rgba(var(--surface-deep-rgb), 0.55);
}

.remove-question {
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  color: var(--accent-solid);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.3s ease-out, background 0.3s ease-out;
}

.remove-question:hover {
  transform: translateY(-1px);
  background: rgba(var(--accent-rgb), 0.28);
}

.question-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.question-title {
  font-weight: 600;
}

.question-options {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.35rem;
}

.question-options li {
  position: relative;
  padding: 0.35rem 0.65rem;
  border-radius: 12px;
  background: rgba(var(--surface-rgb), 0.6);
  border: none;
}

.question-option-correct {
  background: rgba(var(--accent-rgb), 0.22) !important;
  border: 1px solid rgba(var(--accent-rgb), 0.45) !important;
  color: var(--text-primary);
}

.question-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.preset-selector {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.preset-selector select {
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.8);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.preset-selector select:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.question-option-label {
  font-size: 0.85rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
}

.host-status {
  margin-top: 1.5rem;
}

.settings-block {
  margin-top: 1.75rem;
  padding: 1.4rem 1.6rem;
  border-radius: 22px;
  background: rgba(var(--surface-rgb), 0.7);
  border: none;
}

.timer-setting {
  display: block;
  color: var(--text-secondary);
}

.timer-setting-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.6rem;
  align-items: center;
}


.timer-setting-row input[type='number'] {
  max-width: 200px;
}

.toggle-group {
  display: grid;
  gap: 1rem;
  margin-top: 1.35rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  background: rgba(var(--surface-rgb), 0.7);
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
  margin: 0;
}

.toggle:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(33, 26, 16, 0.78);
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-visual {
  width: 50px;
  height: 26px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  display: inline-flex;
  align-items: center;
  padding: 3px;
  transition: background 0.2s ease, border 0.2s ease;
}

.toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  transition: transform 0.35s ease-out, background 0.35s ease-out;
}

.toggle input:checked + .toggle-visual {
  background: rgba(var(--accent-rgb), 0.45);
  border-color: rgba(var(--accent-rgb), 0.7);
}

.toggle input:checked + .toggle-visual .toggle-thumb {
  transform: translateX(22px);
  background: var(--accent-text);
}

.toggle input:disabled + .toggle-visual {
  opacity: 0.5;
}

.toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toggle-title {
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-description {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.62);
}

.hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.host-actions {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: center;
}

.host-actions-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 640px;
}

.host-actions-buttons button {
  min-height: 52px;
  border-radius: 16px;
  font-weight: 600;
}

.host-actions-buttons button.primary {
  box-shadow: 0 16px 28px rgba(var(--accent-rgb), 0.3);
}

.host-actions-buttons button.secondary {
  box-shadow: 0 16px 28px rgba(var(--accent-rgb), 0.18);
}

.host-actions-buttons button.primary:hover,
.host-actions-buttons button.secondary:hover {
  transform: translateY(-1px);
}


@keyframes overlayFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}


.status-header {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.status-message {
  margin-top: 0.75rem;
  color: var(--text-secondary);
}

.status-message.warning {
  color: rgba(var(--accent-warn-rgb), 0.75);
  font-weight: 600;
}

.warning-text {
  color: rgba(var(--accent-warn-rgb), 0.75);
  font-weight: 600;
}

.timer-display {
  padding: 0.85rem 1.2rem;
  border-radius: 18px;
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  display: grid;
  gap: 0.2rem;
  text-align: center;
  min-width: 120px;
}

.timer-display.danger {
  background: rgba(var(--accent-warn-rgb), 0.24);
  border-color: rgba(var(--accent-warn-rgb), 0.45);
}

.timer-display.timeup {
  animation: timeup-flash 0.9s ease-in-out 4;
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.4);
}

.timer-label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.timer-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.question-header span {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#questionProgress {
  text-align: left;
  white-space: nowrap;
}

.timer-container {
  display: flex;
  justify-content: flex-start;
  margin-bottom: clamp(0.6rem, 1.5vh, 1rem);
  width: 100%;
}

.question-illustration {
  margin: 0;
  padding: clamp(0.25rem, 1vh, 0.6rem);
  border-radius: 18px;
  background: rgba(var(--surface-rgb), 0.78);
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 0;
}

.question-illustration img {
  width: 100%;
  height: auto;
  max-height: clamp(220px, 36vh, 340px);
  object-fit: cover;
  border-radius: clamp(12px, 2.5vw, 16px);
  background: rgba(var(--surface-deep-rgb), 0.6);
}


.timer-pill {
  position: relative;
  padding: 0.35rem 1.15rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 140px;
  width: 100%;
}

.timer-progress-bar {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.timer-progress-fill {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(1);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.65) 0%, rgba(var(--accent-rgb), 0.35) 100%);
  transition: background 0.2s ease;
  z-index: 1;
}

.timer-progress-fill.timer-progress-fill--intro {
  animation: timer-progress-fill-intro 2s ease-out forwards;
}

.timer-text {
  position: relative;
  z-index: 3;
}

.timer-pill.danger {
  border-color: rgba(var(--accent-warn-rgb), 0.52);
  background: rgba(var(--accent-warn-rgb), 0.14);
}

.timer-pill.danger .timer-progress-fill {
  background: linear-gradient(90deg, rgba(var(--accent-warn-rgb), 0.75) 0%, rgba(var(--accent-warn-rgb), 0.45) 100%);
}

.timer-pill.danger:not(.timeup) {
  animation: danger-pulse 0.7s ease-in-out infinite;
  box-shadow: 0 0 14px rgba(var(--accent-warn-rgb), 0.35);
}

.timer-pill.waiting-results .timer-progress-fill {
  background: linear-gradient(90deg, rgba(var(--accent-relax), 0.6) 0%, rgba(var(--accent-relax), 0.35) 100%);
}

.timer-progress-fill.timer-progress-fill--waiting {
  background: linear-gradient(90deg, rgba(var(--accent-relax), 0.6) 0%, rgba(var(--accent-relax), 0.35) 100%) !important;
}

.timer-pill.timeup {
  animation: none;
  background: rgba(var(--accent-warn-rgb), 0.88);
  border-color: rgba(var(--accent-warn-rgb), 0.95);
  box-shadow: 0 0 24px rgba(var(--accent-warn-rgb), 0.6);
  color: #fff;
}

.timer-pill.timeup .timer-text {
  color: #fff;
}

.timer-pill.timeup .timer-progress-fill {
  opacity: 0;
}

.image-modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(1.5rem, 6vw, 2.6rem);
  background: rgba(5, 10, 12, 0.88);
  z-index: 1200;
}

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

.image-modal__content {
  position: relative;
  width: min(92vw, 540px);
  max-height: 90vh;
}

.image-modal__content img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 90vh;
  border-radius: clamp(18px, 4vw, 24px);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
}

.image-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
}

.image-modal__close::before,
.image-modal__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.6rem;
  height: 2px;
  background: currentColor;
  transform-origin: center;
}

.image-modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.image-modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

body.image-modal-open {
  overflow: hidden;
}

.connection-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 13, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  z-index: 1200;
  backdrop-filter: blur(6px);
}

.connection-overlay.hidden {
  display: none;
}

.connection-dialog {
  width: min(520px, 100%);
  background: rgba(var(--surface-rgb), 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  display: grid;
  gap: 1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.connection-dialog h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
}

.connection-status {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.connection-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
  font-size: 0.95rem;
}

.connection-steps li strong {
  color: var(--accent-solid);
}

#connectionRetryBtn {
  justify-self: start;
  min-width: 200px;
}

@media (max-width: 600px) {
  .connection-dialog {
    padding: 1.4rem;
    border-radius: 18px;
    gap: 0.8rem;
  }

  .connection-steps {
    padding-left: 1rem;
    font-size: 0.9rem;
  }

  #connectionRetryBtn {
    width: 100%;
    justify-self: stretch;
  }
}

.collapsible {
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 14px;
  background: rgba(var(--surface-rgb), 0.35);
  margin-bottom: 1rem;
  overflow: hidden;
}

.collapsible[open] {
  background: rgba(var(--surface-rgb), 0.55);
}

.collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

.collapsible summary::-webkit-details-marker,
.collapsible summary::marker {
  display: none;
}

.collapsible > *:not(summary) {
  padding: 0 1rem 1rem 1rem;
}

.collapsible-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.collapsible-meta.hidden {
  display: none;
}

.host-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: rgba(var(--surface-rgb), 0.5);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  margin-bottom: 1rem;
}

.host-overview.hidden {
  display: none;
}

.host-overview-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.overview-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.overview-meta.hidden {
  display: none;
}

.reconnect-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.reconnect-hint strong {
  color: var(--accent-solid);
}

@media (max-width: 768px) {
  .host-overview {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .host-overview-left {
    width: 100%;
  }

  .host-overview .timer-display {
    align-self: flex-end;
  }
}

#optionsContainer {
  display: grid;
  gap: var(--options-gap);
}

.option-btn {
  width: 100%;
  padding: clamp(1rem, 2.2vh, 1.35rem) clamp(1.1rem, 2.5vw, 1.6rem);
  border-radius: clamp(18px, 2.2vw, 22px);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--surface-deep-rgb), 0.98);
  color: var(--text-primary);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.6rem, 1.4vw, 0.9rem);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.3s ease, border 0.3s ease;
  font-size: clamp(1rem, 2.2vh, 1.15rem);
  min-height: clamp(68px, 12vh, 86px);
  line-height: 1.35;
}

.option-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(var(--surface-deep-rgb), 0.99);
  border-color: rgba(var(--accent-rgb), 0.45);
}

.option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.9;
  transform: none;
}

.option-btn:disabled:not(.correct):not(.incorrect) {
  background: rgba(var(--surface-deep-rgb), 0.9);
}

#questionCard.timeup,
#observerQuestionCard.timeup {
  animation: none;
  outline: 2px solid rgba(var(--accent-warn-rgb), 0.35);
  outline-offset: 6px;
}

.option-btn.correct {
  background: rgba(var(--success-rgb), 0.22);
  border-color: rgba(var(--success-rgb), 0.65);
}

.option-btn.incorrect {
  background: rgba(var(--error-rgb), 0.22);
  border-color: rgba(var(--error-rgb), 0.7);
}

.error {
  margin-top: 0.75rem;
  color: var(--error);
  min-height: 1.25rem;
}

#playerResultsList li,
#hostResultsList li,
#observerResultsList li {
  background: rgba(var(--surface-rgb), 0.68);
  border-radius: 14px;
  padding: 0.65rem 1rem;
  border: none;
}

/* Скролл ТОЛЬКО для списков результатов когда много игроков */
#playerResultsList,
#hostResultsList,
#observerResultsList {
  max-height: 55vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
}

/* Стилизация скроллбара */
#playerResultsList::-webkit-scrollbar,
#hostResultsList::-webkit-scrollbar,
#observerResultsList::-webkit-scrollbar {
  width: 6px;
}

#playerResultsList::-webkit-scrollbar-track,
#hostResultsList::-webkit-scrollbar-track,
#observerResultsList::-webkit-scrollbar-track {
  background: rgba(var(--surface-rgb), 0.3);
  border-radius: 3px;
}

#playerResultsList::-webkit-scrollbar-thumb,
#hostResultsList::-webkit-scrollbar-thumb,
#observerResultsList::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.4);
  border-radius: 3px;
}

#playerResultsList::-webkit-scrollbar-thumb:hover,
#hostResultsList::-webkit-scrollbar-thumb:hover,
#observerResultsList::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.6);
}

#observerGame.showing-results #observerQuestionCard {
  display: none !important;
}

#observerGame.showing-results .observer-header {
  display: none !important;
}

#observerGame.showing-results .observer-header {
  display: none !important;
}

#observerGame.showing-results #observerResults {
  margin-top: 0;
}

/* Стили для финальных результатов */
.top-player-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  background: rgba(var(--surface-rgb), 0.68);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  transform: translateY(20px);
  opacity: 0;
  animation: slideInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.top-player-item:nth-child(1) {
  animation-delay: 0.1s;
}

.top-player-item:nth-child(2) {
  animation-delay: 0.2s;
}

.top-player-item:nth-child(3) {
  animation-delay: 0.3s;
}

.top-player-item:nth-child(4) {
  animation-delay: 0.4s;
}

.top-player-item:nth-child(5) {
  animation-delay: 0.5s;
}

.top-player-item:nth-child(6) {
  animation-delay: 0.6s;
}

.top-player-item:nth-child(7) {
  animation-delay: 0.7s;
}

.top-player-item:nth-child(8) {
  animation-delay: 0.8s;
}

.top-player-item:nth-child(9) {
  animation-delay: 0.9s;
}

.top-player-item:nth-child(10) {
  animation-delay: 1.0s;
}

/* Призовые места */
.top-player-item:nth-child(1) {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 223, 0, 0.1));
  border: 2px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(20px) scale(1.05);
}

.top-player-item:nth-child(1)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.1) 50%, transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

.top-player-item:nth-child(2) {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1));
  border: 2px solid rgba(192, 192, 192, 0.4);
  box-shadow: 0 6px 24px rgba(192, 192, 192, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(20px) scale(1.03);
}

.top-player-item:nth-child(3) {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1));
  border: 2px solid rgba(205, 127, 50, 0.4);
  box-shadow: 0 4px 20px rgba(205, 127, 50, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(20px) scale(1.02);
}

/* Позиция */
.top-player-item .position {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.top-player-item:nth-child(1) .position {
  font-size: 2rem;
  text-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
  animation: goldGlow 2s ease-in-out infinite;
}

.top-player-item:nth-child(2) .position {
  font-size: 1.8rem;
  text-shadow: 0 2px 6px rgba(192, 192, 192, 0.4);
}

.top-player-item:nth-child(3) .position {
  font-size: 1.7rem;
  text-shadow: 0 2px 6px rgba(205, 127, 50, 0.4);
}

/* Имя игрока */
.top-player-item .name {
  font-weight: 600;
  font-size: 1.1rem;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.top-player-item:nth-child(1) .name {
  font-weight: 700;
  font-size: 1.2rem;
  color: rgba(255, 215, 0, 0.9);
}

.top-player-item:nth-child(2) .name {
  font-weight: 650;
  color: rgba(192, 192, 192, 0.9);
}

.top-player-item:nth-child(3) .name {
  font-weight: 650;
  color: rgba(205, 127, 50, 0.9);
}

/* Очки */
.top-player-item .score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.9);
  text-align: right;
  font-size: 1.1rem;
}

.top-player-item:nth-child(1) .score {
  color: rgba(255, 215, 0, 0.95);
  font-size: 1.2rem;
  text-shadow: 0 1px 4px rgba(255, 215, 0, 0.3);
}

.top-player-item:nth-child(2) .score {
  color: rgba(192, 192, 192, 0.95);
}

.top-player-item:nth-child(3) .score {
  color: rgba(205, 127, 50, 0.95);
}

.top-player-item--self {
  border-color: rgba(var(--accent-relax), 0.45);
  box-shadow: 0 12px 28px rgba(var(--accent-relax), 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.top-player-item--self .score {
  color: rgba(var(--accent-relax), 0.85);
}

.score-sparkline-wrapper {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.top-player-item:not(.top-player-item--self) .score-sparkline-wrapper {
  display: none;
}

.score-sparkline-label {
  font-weight: 600;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(var(--accent-relax), 0.85);
}

.score-sparkline-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: rgba(var(--accent-rgb), 0.82);
}

.score-sparkline {
  flex: 1;
  max-width: 160px;
  height: 36px;
  filter: drop-shadow(0 6px 16px rgba(var(--accent-relax), 0.2));
}

.score-sparkline__area {
  fill: rgba(var(--accent-relax), 0.16);
}

.score-sparkline__line {
  stroke: rgba(var(--accent-relax), 0.8);
  stroke-width: 2;
}

.score-sparkline__dot {
  fill: rgba(var(--accent-rgb), 0.85);
  stroke: rgba(var(--accent-text), 0.35);
  stroke-width: 1;
}

/* Анимации */
@keyframes slideInUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes goldGlow {
  0%, 100% {
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
  }
  50% {
    text-shadow: 0 2px 12px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
  }
}

/* Анимация появления результатов с прогресс-барами */
.results-enter {
  animation: resultsSlideIn 1s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes resultsSlideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Стили для кнопок результатов */
.view-all-results {
  margin: 1.5rem 0;
  text-align: center;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.view-all-results button {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease-out;
  min-width: 140px;
}

.view-all-results button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Прогресс-бар для очков */
.score-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.6), rgba(var(--accent-rgb), 0.3));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.top-player-item:nth-child(1) .score-progress {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.8), rgba(255, 215, 0, 0.4));
  height: 6px;
}

.top-player-item:nth-child(2) .score-progress {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.8), rgba(192, 192, 192, 0.4));
  height: 5px;
}

.top-player-item:nth-child(3) .score-progress {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.8), rgba(205, 127, 50, 0.4));
  height: 5px;
}

.score-progress.animate {
  transform: scaleX(1);
}

/* Анимации для промежуточных результатов с WOW-эффектами */
.interim-result {
  opacity: 1;
  animation: slideInResult 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-fill-mode: forwards;
}

/* Позиция не изменилась */
.interim-result.position-same {
  animation: slideInResult 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Позиции поднимаются вверх */
.interim-result.position-up {
  animation: moveUp 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.interim-result.position-up.jump-1 {
  animation: jumpUp1 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.interim-result.position-up.jump-2 {
  animation: jumpUp2 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.interim-result.position-up.jump-3,
.interim-result.position-up.jump-4,
.interim-result.position-up.jump-5 {
  animation: jumpUpBig 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Позиции опускаются вниз */
.interim-result.position-down {
  animation: moveDown 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

/* Индикаторы изменения позиций */
.change-indicator {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.1rem 0.4rem;
  border-radius: 12px;
  margin: 0 0.5rem;
  animation: indicatorPulse 0.8s ease-out;
}

.change-indicator.up {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.change-indicator.down {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  text-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

/* Огненный эффект для больших прыжков */
.fire-effect {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 1.2rem;
  animation: fireWave 1s ease-in-out infinite alternate;
}

/* Анимированный счетчик */
.score.counting {
  animation: counterTick 0.1s ease-in-out infinite;
  color: #fbbf24;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.score.count-complete {
  animation: countPulse 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Анимированный прогресс-бар */
.animated-progress {
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.5s cubic-bezier(0.23, 1, 0.32, 1);
  background: linear-gradient(90deg,
    rgba(var(--accent-rgb), 0.8),
    rgba(var(--accent-rgb), 0.6),
    rgba(var(--accent-rgb), 0.4)
  );
  animation: progressShine 2s linear infinite;
}

.animated-progress.filling {
  animation: progressFill 2s cubic-bezier(0.23, 1, 0.32, 1) forwards,
            progressShine 2.5s linear infinite;
}

/* Анимации движения */
@keyframes slideInResult {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes moveUp {
  0% {
    transform: translateY(0) scale(1);
    background: rgba(var(--surface-rgb), 0.68);
  }
  50% {
    transform: translateY(-10px) scale(1.03);
    background: rgba(74, 222, 128, 0.1);
    box-shadow: 0 8px 25px rgba(74, 222, 128, 0.3);
  }
  100% {
    transform: translateY(0) scale(1);
    background: rgba(var(--surface-rgb), 0.68);
  }
}

@keyframes jumpUp1 {
  0% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-15px) scale(1.05);
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(74, 222, 128, 0.1));
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes jumpUp2 {
  0% {
    transform: translateY(0) scale(1) rotateZ(0);
  }
  40% {
    transform: translateY(-20px) scale(1.08) rotateZ(1deg);
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.25), rgba(74, 222, 128, 0.15));
    box-shadow: 0 12px 35px rgba(74, 222, 128, 0.4);
  }
  100% {
    transform: translateY(0) scale(1) rotateZ(0);
  }
}

@keyframes jumpUpBig {
  0% {
    transform: translateY(0) scale(1) rotateZ(0);
  }
  25% {
    transform: translateY(-30px) scale(1.1) rotateZ(2deg);
  }
  50% {
    transform: translateY(-25px) scale(1.12) rotateZ(-1deg);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(74, 222, 128, 0.2));
    box-shadow: 0 15px 40px rgba(251, 191, 36, 0.5);
  }
  100% {
    transform: translateY(0) scale(1) rotateZ(0);
  }
}

@keyframes moveDown {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(8px);
    opacity: 0.7;
    background: rgba(248, 113, 113, 0.1);
  }
  100% {
    transform: translateY(0);
    opacity: 0.9;
  }
}

@keyframes indicatorPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

@keyframes fireWave {
  0% {
    transform: translateY(0) rotate(-5deg) scale(1);
  }
  100% {
    transform: translateY(-3px) rotate(5deg) scale(1.1);
  }
}

@keyframes counterTick {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes countPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

@keyframes progressFill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes progressShine {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Подсветка позиций для топ-3 в промежуточных результатах */
.interim-result:nth-child(1).position-up {
  animation: goldFlash 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.interim-result:nth-child(2).position-up {
  animation: silverFlash 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.interim-result:nth-child(3).position-up {
  animation: bronzeFlash 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes goldFlash {
  0% {
    background: rgba(var(--surface-rgb), 0.68);
  }
  50% {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 223, 0, 0.2));
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    transform: translateY(-10px) scale(1.1);
  }
  100% {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 223, 0, 0.1));
    transform: translateY(0) scale(1.05);
  }
}

@keyframes silverFlash {
  0% {
    background: rgba(var(--surface-rgb), 0.68);
  }
  50% {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.4), rgba(192, 192, 192, 0.2));
    box-shadow: 0 0 30px rgba(192, 192, 192, 0.5);
    transform: translateY(-8px) scale(1.08);
  }
  100% {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1));
    transform: translateY(0) scale(1.03);
  }
}

@keyframes bronzeFlash {
  0% {
    background: rgba(var(--surface-rgb), 0.68);
  }
  50% {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.4), rgba(205, 127, 50, 0.2));
    box-shadow: 0 0 25px rgba(205, 127, 50, 0.4);
    transform: translateY(-6px) scale(1.06);
  }
  100% {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1));
    transform: translateY(0) scale(1.02);
  }
}

/* Стили для страницы полных результатов */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.results-header > div:first-child {
  flex: 1 1 220px;
}

.results-header__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.results-header__actions button {
  white-space: nowrap;
}

.results-info {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  margin-top: 0.5rem;
}

.results-graph-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 420px;
}

.results-graph-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.results-graph-summary {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-size: 1rem;
}

.results-graph-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.score-graph-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.score-graph {
  width: 100%;
  overflow-x: auto;
}

.score-graph__svg {
  width: 100%;
  height: auto;
}

.score-graph__grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.score-graph__grid-line--vertical {
  stroke-dasharray: 6 6;
}

.score-graph__axis {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.5;
}

.score-graph__axis-label {
  fill: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
  font-weight: 500;
}

.score-graph__axis-title {
  fill: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.score-graph-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.score-graph-legend__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: rgba(var(--surface-rgb), 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.score-graph-legend__item:hover,
.score-graph-legend__item--active {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.score-graph-legend__item--primary {
  border-color: rgba(var(--accent-rgb), 0.4);
}

.score-graph-legend__color {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--series-color);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.score-graph-legend__name {
  flex: 1 1 auto;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.score-graph-legend__value {
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
}

.score-series__path {
  fill: none;
  stroke-width: 2;
  opacity: 0.65;
  transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.score-series__marker {
  stroke: rgba(0, 0, 0, 0.3);
  stroke-width: 1;
  opacity: 0.85;
  transition: opacity 0.2s ease, r 0.2s ease;
}

.score-series__label {
  fill: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  font-weight: 500;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.score-series--highlight .score-series__path {
  opacity: 1;
  stroke-width: 3.2;
}

.score-series--highlight .score-series__marker {
  opacity: 1;
  r: 5.5;
}

.score-series--dimmed .score-series__path {
  opacity: 0.18;
}

.score-series--dimmed .score-series__marker {
  opacity: 0.25;
}

.score-series--dimmed .score-series__label {
  opacity: 0.25;
}

@media (max-width: 720px) {
  .results-header__actions,
  .results-graph-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .score-graph-legend {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.full-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.full-result-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  background: rgba(var(--surface-rgb), 0.68);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease-out;
}

.full-result-item:hover {
  background: rgba(var(--surface-rgb), 0.8);
  transform: translateY(-1px);
}

/* Специальные стили для топ-3 */
.full-result-item.position-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 223, 0, 0.08));
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.15);
}

.full-result-item.position-2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.08));
  border: 1px solid rgba(192, 192, 192, 0.3);
  box-shadow: 0 4px 16px rgba(192, 192, 192, 0.1);
}

.full-result-item.position-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.08));
  border: 1px solid rgba(205, 127, 50, 0.3);
  box-shadow: 0 4px 16px rgba(205, 127, 50, 0.1);
}

.full-result-item .position {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 35px;
  text-align: center;
}

.full-result-item.position-1 .position {
  font-size: 1.4rem;
  text-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
}

.full-result-item .name {
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.full-result-item.position-1 .name {
  color: rgba(255, 215, 0, 0.9);
  font-weight: 700;
}

.full-result-item.position-2 .name {
  color: rgba(192, 192, 192, 0.9);
}

.full-result-item.position-3 .name {
  color: rgba(205, 127, 50, 0.9);
}

.full-result-item .score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.9);
  text-align: right;
}

.full-result-item.position-1 .score {
  color: rgba(255, 215, 0, 0.95);
  text-shadow: 0 1px 4px rgba(255, 215, 0, 0.3);
}

.full-result-item.position-2 .score {
  color: rgba(192, 192, 192, 0.95);
}

.full-result-item.position-3 .score {
  color: rgba(205, 127, 50, 0.95);
}

/* Пагинация */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.pagination-btn {
  background: rgba(var(--surface-rgb), 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease-out;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(var(--surface-rgb), 1);
  border-color: rgba(var(--accent-rgb), 0.4);
  transform: translateY(-1px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  font-variant-numeric: tabular-nums;
}

/* Кнопка возврата */
.back-to-game {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Адаптивность */
@media (max-height: 700px) {
  /* Компактный режим для маленьких по высоте экранов */
  header {
    margin-bottom: 0.5rem;
  }

  header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }

  .page-intro {
    display: none;
  }

  .card {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  label {
    margin-bottom: 0.5rem;
  }

  input, textarea {
    padding: 0.5rem 0.75rem;
  }

  button {
    padding: 0.6rem 1rem;
    min-height: 40px;
  }

  .option-btn {
    padding: 0.75rem 1rem;
    min-height: 44px;
  }

  #optionsContainer {
    gap: 0.5rem;
  }

  .game-instructions {
    padding: 0.75rem;
    margin: 0.5rem 0;
  }

  .game-instructions h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .game-instructions li {
    margin: 0.35rem 0;
    font-size: 0.85rem;
  }

  /* Оптимизация для вопросов БЕЗ картинки - max-height: 700px (компактный режим) */
  

  

  
}

@media (max-width: 768px) {
  .full-result-item {
    padding: 0.8rem 1rem;
    gap: 1rem;
  }

  .full-result-item .position {
    font-size: 1.2rem;
    min-width: 35px;
  }

  .full-result-item.position-1 .position {
    font-size: 1.4rem;
  }

  .pagination-container {
    gap: 1.2rem;
  }

  .pagination-btn {
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
  }
}

/* Увеличенные размеры для десктопа */
@media (min-width: 769px) {
  :root {
    font-size: 18px;
  }

  header h1 {
    font-size: 3rem;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
  }

  header {
    margin-bottom: 0.75rem;
  }

  .card {
    padding: 2rem;
  }

  .card h2 {
    font-size: 2.2rem;
  }

  button {
    padding: 1.3rem 2rem;
    font-size: 1.3rem;
  }

  .option-btn {
    padding: 1.5rem 1.8rem;
    font-size: 1.4rem;
  }

  input, textarea {
    padding: 1.2rem 1.4rem;
    font-size: 1.25rem;
  }

  label {
    font-size: 1.2rem;
  }

  .question-illustration img {
    max-height: 450px;
  }

  .timer-pill {
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
  }

  /* Оптимизация для вопросов БЕЗ картинки - desktop */
  

  

  
}

@keyframes timer-progress-fill-intro {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes danger-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes timeup-flash {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes card-timeup {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.9;
  }
}

/* Анимация для ожидания результатов (мягкая пульсация) */
@keyframes waiting-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.015);
    opacity: 0.95;
  }
}

@keyframes card-waiting {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.005);
  }
}

/* Стили для игроков которые уже ответили */
.timer-display.waiting-results {
  animation: waiting-pulse 2s ease-in-out infinite;
  background: rgba(var(--accent-relax), 0.24);
  border-color: rgba(var(--accent-relax), 0.45);
  box-shadow:
    0 0 18px rgba(var(--accent-relax), 0.26),
    0 0 8px rgba(var(--accent-rgb), 0.18);
}

.timer-pill.waiting-results {
  animation: waiting-pulse 2s ease-in-out infinite;
  background: rgba(var(--accent-relax), 0.28);
  border-color: rgba(var(--accent-relax), 0.52);
  box-shadow:
    0 0 16px rgba(var(--accent-relax), 0.28),
    0 0 6px rgba(var(--accent-rgb), 0.16);
}

#questionCard.waiting-results,
#observerQuestionCard.waiting-results {
  animation: card-waiting 3s ease-in-out infinite;
  outline: 2px solid rgba(var(--accent-relax), 0.32);
  outline-offset: 6px;
  box-shadow:
    0 0 22px rgba(var(--accent-relax), 0.2),
    0 0 10px rgba(var(--accent-rgb), 0.15);
}

.hidden {
  display: none !important;
}

.observer-header.hidden {
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

.host-main-action {
  min-width: 220px;
  font-size: 1.05rem;
  padding: 1rem 2.2rem;
}

.host-hint {
  margin-top: 1rem;
  color: var(--text-secondary);
  text-align: center;
}

#hostIntro {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
  padding: 3rem 1.75rem;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), rgba(var(--surface-deep-rgb), 0.78));
  border-radius: 24px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

#hostIntro .host-main-action {
  width: min(320px, 100%);
  justify-content: center;
}

#hostIntro .host-hint {
  max-width: 420px;
  margin: 0;
}

.observer-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 20px;
  background: rgba(var(--surface-rgb), 0.72);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.observer-label {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
}

.observer-code {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.observer-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem 1rem;
  border-radius: 18px;
  background: rgba(var(--surface-rgb), 0.75);
}

.observer-qr img {
  width: 190px;
  height: 190px;
  object-fit: contain;
  border-radius: 12px;
}

.observer-qr-caption {
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
}

#observerStatus {
  margin: 1rem 0;
  font-size: 1.05rem;
  font-weight: 500;
}

.observer-options {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}


input.readonly {
  background: rgba(var(--surface-rgb), 0.55);
  color: rgba(246, 240, 220, 0.75);
  pointer-events: none;
}

/* Стили для playerGame - занимает всю высоту */
#playerGame {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Question screens layout */
:root {
  --option-slot-count: 4;
  --option-min-height: clamp(64px, 12vh, 92px);
  --options-gap: clamp(0.6rem, 1.6vh, 1rem);
  --feedback-min-height: clamp(18px, 2vh, 28px);
  --question-footer-gap: clamp(0.85rem, 1.8vh, 1.25rem);
  --question-footer-padding-block: clamp(1.2rem, 2.4vh, 1.6rem);
  --question-footer-padding-inline: clamp(1.2rem, 3vw, 1.8rem);
}

#questionCard,
#observerQuestionCard,
.question-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: clamp(1rem, 2.2vh, 1.6rem);
}

.question-card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.3vh, 1.6rem);
  min-height: 0;
}

.question-card__meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.6rem, 1.6vw, 1rem);
  color: var(--text-secondary);
}

.question-card__meta .question-header {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
}

.question-card__timer {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.6rem, 1.6vh, 1rem);
  background: linear-gradient(145deg, rgba(var(--surface-deep-rgb), 0.92) 0%, rgba(var(--surface-rgb), 0.8) 100%);
  border-radius: clamp(22px, 3vw, 28px);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  padding: clamp(1rem, 2.3vh, 1.45rem) clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.question-card__timer .timer-container {
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.question-card__timer .timer-pill {
  width: 100%;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.question-card__timer .question-feedback {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: clamp(0.95rem, 1.8vh, 1.05rem);
}

.question-feedback--hint {
  color: var(--text-secondary);
}

.question-feedback--feedback {
  color: var(--text-primary);
}

.question-feedback--warning {
  color: var(--error);
}

.question-card__visual {
  display: none;
  border-radius: clamp(22px, 3vw, 28px);
  overflow: hidden;
  background: rgba(var(--surface-deep-rgb), 0.35);
  min-height: clamp(220px, 36vh, 360px);
}

.question-card--has-image .question-card__visual {
  display: block;
}

.question-card__visual .question-illustration {
  width: 100%;
  height: 100%;
}

.question-card__visual .question-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 16 / 9;
}

.question-card--no-image .question-card__visual {
  display: none;
  min-height: 0;
}

.question-image {
  display: flex;
  flex-direction: column;
  gap: clamp(0.6rem, 1.4vh, 1rem);
  align-items: center;
}

.question-image picture {
  width: 100%;
  display: block;
}

.question-image__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.question-image__toggle.hidden {
  display: none;
}

.question-image--modal picture {
  display: none;
}

.question-image--inline picture {
  display: block;
}

.question-card--image-modal .question-card__visual {
  min-height: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.question-card--image-inline .question-card__visual {
  display: block;
}

@media (max-width: 720px) {
  .question-card--image-modal .question-image__toggle {
    align-self: stretch;
    justify-content: center;
  }
}

#observerView .question-card__prompt h1,
#observerView .question-card__prompt h2,
#observerView .question-card__prompt h3,
#observerView .question-card__prompt h4 {
  text-align: center;
}

#playerView .question-card__prompt h2 {
  text-align: left;
}

.question-card__footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--question-footer-gap);
  position: relative;
  border-radius: clamp(18px, 2.6vw, 24px);
  padding-block: var(--question-footer-padding-block);
  padding-inline: var(--question-footer-padding-inline);
  overflow: hidden;
  margin-top: clamp(1.4rem, 2.8vh, 2rem);
  min-height: calc(
    var(--option-slot-count, 4) * var(--option-min-height)
    + (var(--option-slot-count, 4) - 1) * var(--options-gap)
    + var(--question-footer-padding-block) * 2
      );
}

.question-card__footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(var(--surface-deep-rgb), 0.98);
  border-radius: inherit;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  z-index: -1;
}

#optionsContainer,
#observerOptionsList {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(var(--option-min-height), auto);
  gap: var(--options-gap);
  justify-items: stretch;
}
.question-card__options {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(var(--option-min-height), auto);
  gap: var(--options-gap);
  min-height: calc(
    var(--option-slot-count, 4) * var(--option-min-height)
    + (var(--option-slot-count, 4) - 1) * var(--options-gap)
  );
}


#observerOptionsList {
  list-style: none;
  padding: 0;
}

.observer-options li {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(1.1rem, 2.5vh, 1.5rem) clamp(1.4rem, 3vw, 2rem);
  background: rgba(var(--surface-deep-rgb), 0.96);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: clamp(18px, 2.2vw, 22px);
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  line-height: 1.45;
  color: var(--text-primary);
  transition: transform 0.25s ease, background 0.3s ease, border 0.3s ease;
}

.observer-options li.option-placeholder {
  background: rgba(var(--surface-deep-rgb), 0.88);
  border-style: dashed;
  border-color: rgba(var(--accent-rgb), 0.4);
  color: rgba(255, 255, 255, 0.7);
}

.observer-options li:hover {
  transform: translateY(-2px);
  background: rgba(var(--surface-deep-rgb), 0.98);
  border-color: rgba(var(--accent-rgb), 0.45);
}

.question-feedback {
  min-height: var(--feedback-min-height);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.2s ease;
  font-size: 0.95rem;
  opacity: 1;
}

.question-feedback-empty {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 720px) {
  .question-card__meta {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .question-card__timer {
    width: 100%;
    padding: clamp(0.8rem, 2vh, 1.15rem) clamp(0.9rem, 4.5vw, 1.3rem);
  }

  .question-card__timer .timer-pill {
    width: 100%;
  }

  .question-card__timer .question-feedback {
    font-size: clamp(0.95rem, 2vh, 1.05rem);
  }

  .question-card__visual {
    min-height: clamp(200px, 34vh, 280px);
  }

  .question-card--no-image .question-card__visual {
    min-height: clamp(140px, 26vh, 200px);
  }

  .question-card__prompt h1,
  .question-card__prompt h2,
  .question-card__prompt h3,
  .question-card__prompt h4 {
    text-align: center;
    -webkit-line-clamp: 5;
  }

  #playerView .question-card__prompt {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  #playerView .question-card__prompt h2 {
    text-align: center;
    margin: 0;
  }

  #playerView .question-card__meta {
    display: none;
  }

  :root {
    --question-footer-padding-block: clamp(0.9rem, 2vh, 1.2rem);
    --question-footer-padding-inline: clamp(0.9rem, 4vw, 1.3rem);
    --question-footer-gap: clamp(0.6rem, 1.6vh, 0.85rem);
  }
}

@media (max-width: 640px) {
  body.player-question-active header {
    display: none;
  }

  body.player-question-active .container {
    padding-top: 0.35rem;
  }

  body.player-question-active .card {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  :root {
    --option-min-height: clamp(56px, 13vh, 74px);
    --options-gap: clamp(0.55rem, 1.8vh, 0.75rem);
    --feedback-min-height: clamp(16px, 2vh, 24px);
    --question-footer-padding-block: clamp(0.75rem, 2vh, 1rem);
    --question-footer-padding-inline: clamp(0.75rem, 5vw, 1.1rem);
    --question-footer-gap: clamp(0.5rem, 1.5vh, 0.7rem);
  }

  .question-card {
    gap: clamp(0.5rem, 1.4vh, 0.8rem);
  }

  .question-card__timer {
    width: 100%;
    padding: clamp(0.65rem, 2vh, 0.9rem) clamp(0.7rem, 5.5vw, 0.95rem);
  }

  .question-card__timer .timer-pill {
    width: 100%;
  }

  .question-card__visual {
    min-height: clamp(180px, 46vh, 250px);
  }

  .question-card--no-image .question-card__visual {
    min-height: clamp(130px, 32vh, 180px);
  }

  .question-card .option-btn {
    min-height: clamp(60px, 13vh, 78px);
    font-size: clamp(0.95rem, 2.6vh, 1.1rem);
  }

  .question-card__prompt h1,
  .question-card__prompt h2,
  .question-card__prompt h3,
  .question-card__prompt h4 {
    font-size: clamp(1.2rem, 5.4vw, 1.6rem);
    -webkit-line-clamp: 6;
  }

  #playerView .question-card__meta {
    display: none;
  }
}

.option-btn {
  width: 100%;
  margin-bottom: 0;
  padding: 1rem 1.25rem;
  background: rgba(var(--surface-rgb), 0.98);
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 16px;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease-out;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: 100%;
  height: 100%;
}

.option-btn.option-placeholder {
  background: rgba(var(--surface-deep-rgb), 0.88);
  border-style: dashed;
  border-color: rgba(var(--accent-rgb), 0.4);
  color: rgba(255, 255, 255, 0.7);
  cursor: default;
}

.option-btn.option-placeholder .option-text {
  color: rgba(255, 255, 255, 0.68);
  letter-spacing: 0.02em;
}



.option-text {
  flex: 1;
  line-height: 1.4;
}

.option-btn:hover:not(:disabled) {
  background: rgba(var(--surface-rgb), 0.95);
  border-color: rgba(var(--accent-rgb), 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


.option-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.option-btn.selected {
  background: linear-gradient(180deg, rgba(var(--surface-rgb), 0.96), rgba(var(--surface-rgb), 0.85));
  border-color: rgba(var(--accent-rgb), 0.7);
  color: var(--text-primary);
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb), 0.35),
    0 0 18px rgba(var(--accent-rgb), 0.25);
  position: relative;
  transform: translateY(-1px);
}

.option-btn.selected::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.65);
  opacity: 0.9;
  pointer-events: none;
}

.option-btn.selected.incorrect {
  background: rgba(var(--error-rgb), 0.26);
  border-color: rgba(var(--error-rgb), 0.8);
  box-shadow: 0 0 0 2px rgba(var(--error-rgb), 0.45);
  color: var(--text-primary);
}

.option-btn.selected.incorrect::before,
.option-btn.selected.correct::before {
  display: none;
}

.option-btn.selected.correct {
  background: rgba(var(--success-rgb), 0.26);
  border-color: rgba(var(--success-rgb), 0.75);
  box-shadow: 0 0 0 2px rgba(var(--success-rgb), 0.4);
  color: var(--text-primary);
}

.option-btn.selected .option-text {
  color: inherit;
}


.option-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}


.player-answer {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.answer-dropdown {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--surface-rgb), 0.6);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: not-allowed;
}

.answer-dropdown.correct {
  border-color: rgba(var(--success-rgb), 0.65);
  background: rgba(var(--success-rgb), 0.12);
}

.answer-dropdown.incorrect {
  border-color: rgba(var(--error-rgb), 0.7);
  background: rgba(var(--error-rgb), 0.12);
}

.answer-result {
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.answer-result.correct {
  color: var(--success);
}

.answer-result.incorrect {
  color: var(--error);
}

/* Специальная адаптация для iPhone SE и подобных (375x667) */


@media (max-width: 720px) {
  .observer-header {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .observer-qr {
    padding: 0.5rem;
  }

  .observer-qr img {
    width: 120px;
    height: 120px;
  }

  .observer-qr-caption {
    font-size: 0.75rem;
  }

  .observer-code {
    font-size: 1.3rem;
  }

  .observer-label {
    font-size: 0.75rem;
  }

  #observerQuestionCard {
    padding: 0.75rem;
  }

  #observerQuestionText {
    font-size: clamp(1.05rem, 4vw, 1.35rem);
  }

  .observer-options {
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }

  .observer-options li {
    padding: 0.9rem 1.1rem;
    font-size: clamp(1rem, 3.2vw, 1.2rem);
  }
}

/* Дополнительные стили для планшетов */
@media (min-width: 481px) and (max-width: 768px) {
  header h1 {
    font-size: 2.5rem;
  }

  .card {
    padding: 1.75rem;
  }

  .card h2 {
    font-size: 1.75rem;
  }

  button {
    padding: 1.2rem 1.6rem;
    font-size: 1.2rem;
    min-height: 56px;
  }

  .option-btn {
    padding: 1.3rem 1.5rem;
    font-size: 1.25rem;
    min-height: 60px;
  }

  input, textarea {
    padding: 1rem 1.2rem;
    font-size: 1.15rem;
  }

  /* Оптимизация для вопросов БЕЗ картинки - tablet */
  

  

  
}

/* Large screen adaptations for observer mode (TV/projector display) */



/* Extra large screens (4K displays, large projectors) */



/* Game instructions */
.game-instructions {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 8px;
}

.game-instructions h3 {
  margin: 0 0 1rem 0;
  color: var(--accent-solid);
  font-size: 1.25rem;
}

.game-instructions ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: none;
}

.game-instructions li {
  margin: 0.75rem 0;
  padding-left: 0;
  position: relative;
}

.game-instructions li::before {
  content: "•";
  color: var(--accent-solid);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

.game-instructions strong {
  color: var(--accent-solid);
}

.instructions-footer {
  margin: 1rem 0 0 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Countdown overlay */
.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Убираем width и height чтобы не было конфликта с top/left/right/bottom */
  background: rgba(var(--surface-deep-rgb), 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Предотвращаем скролл внутри overlay */
}

.countdown-number {
  font-size: 20vw; /* Используем vw для адаптивности */
  font-weight: 900;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 60px rgba(var(--accent-rgb), 0.5);
  line-height: 1;
  padding: 0; /* Убираем padding чтобы цифры были по центру */
  margin: 0; /* Добавляем margin: 0 для страховки */
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-number.animate {
  animation: countdownPulse 1s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes countdownPulse {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}



.question-card__timer .question-feedback {
  width: 100%;
}
