/* 2.19.27 — классический стол. Палитра и адаптация отдельно от сезонного CSS. */
html:not(.cc-halloween) {
  --bg: #111111;
  --paper: #1d1d1d;
  --paper-raised: #292929;
  --ink: #f5f5f5;
  --muted: #b9b9b9;
  --line: #424242;
  --accent: #69baf0;
  --accent-deep: #409bd7;
  --accent-soft: #69baf019;
  --dark: #151515;
}
html:not(.cc-halloween) .primary { background: #69baf0; border-color: #69baf0; color: #111; }
html:not(.cc-halloween) .primary:hover:not(:disabled) { background: #91cef5; border-color: #91cef5; color: #111; }
html:not(.cc-halloween) .primary:active:not(:disabled) { background: #409bd7; border-color: #409bd7; }
html:not(.cc-halloween) .secondary { border-color: #555; }
html:not(.cc-halloween) .secondary:hover:not(:disabled) { background: #383838; border-color: #777; }
html:not(.cc-halloween) .launch-panel { background: var(--paper); }
html:not(.cc-halloween) .demo-question { background: #080808; border-color: #555; color: #fff; }
html:not(.cc-halloween) .demo-cards .demo-answer { background: #fff; color: #171717; border-color: #bbb; box-shadow: 0 3px 0 #777; }
html:not(.cc-halloween) .demo-cards article { transform: none; }
html:not(.cc-halloween) body.game-focus { background: #e8e8e8; }
html:not(.cc-halloween) body.game-focus #header,
html:not(.cc-halloween) body.game-focus #nav,
html:not(.cc-halloween) body.game-focus #game-nav { background: #111; }
html:not(.cc-halloween) body.game-focus #nav { border-radius: 6px; }
html:not(.cc-halloween) body.game-focus #footer { background: #111; }
/* На столе светлый холст, чёрный вопрос и белые карты; системные диалоги/чат не перекрашиваем. */
html:not(.cc-halloween) .game {
  --paper: #fff;
  --paper-raised: #ededed;
  --ink: #191919;
  --muted: #545454;
  --line: #bcbcbc;
  --accent: #126ba6;
  --accent-soft: #e5f2fb;
  --danger: #a52c2c;
  --green: #237642;
  color: var(--ink);
  background: #fafafa;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 12px;
  color-scheme: light;
}
html:not(.cc-halloween) .game .primary { background: #126ba6; border-color: #126ba6; color: white; }
html:not(.cc-halloween) .game .primary:hover:not(:disabled) { background: #095784; border-color: #095784; color: white; }
html:not(.cc-halloween) .game .secondary { color: #191919; background: #f4f4f4; border-color: #aaa; }
html:not(.cc-halloween) .game .secondary:hover:not(:disabled) { background: #e5e5e5; border-color: #666; }
html:not(.cc-halloween) .game .question-card,
html:not(.cc-halloween) .game .game-status,
html:not(.cc-halloween) .game .room-roster {
  --paper: #151515; --paper-raised: #2b2b2b; --ink: #fff; --muted: #d1d1d1; --line: #555; --accent: #9ad7ff; --accent-soft: #ffffff12;
  background: #151515; color: #fff; border: 1px solid #333; border-radius: 6px; box-shadow: none;
}
html:not(.cc-halloween) .game .room-roster { padding: 8px; }
html:not(.cc-halloween) .game .question-meta .card-pack-name { color: #ccc; }
html:not(.cc-halloween) .game .question-tools .icon-button,
html:not(.cc-halloween) .game .question-header .icon-button { color: #ddd; }
html:not(.cc-halloween) .game .room-player.is-self { background: #ffffff15; border-color: #888; }
html:not(.cc-halloween) .game .room-player > span > .ui-icon { color: #ddd; }
html:not(.cc-halloween) .game .answer-card {
  color: #171717; background: #fff; border: 1px solid #a0a0a0; border-radius: 6px; box-shadow: none;
}
html:not(.cc-halloween) .game .answer-card:hover:not(:disabled):not([aria-disabled="true"]) { background: #f1f6fa; border-color: #126ba6; }
html:not(.cc-halloween) .game .answer-card.selected,
html:not(.cc-halloween) .game .answer-card.card-sent { background: #e5f2fb; border-color: #126ba6; box-shadow: inset 0 0 0 1px #126ba6; }
html:not(.cc-halloween) .game .selection-number { color: #555; }
html:not(.cc-halloween) .game .selected .selection-number { background: #126ba6; color: #fff; }
html:not(.cc-halloween) .game .answer-card .card-footer,
html:not(.cc-halloween) .game .answer-card .card-pack-name,
html:not(.cc-halloween) .game .card-audio-button,
html:not(.cc-halloween) .game .card-reaction-icon { color: #565656; }
html:not(.cc-halloween) .game .card-audio-button:hover { background: #e8e8e8; color: #111; }
html:not(.cc-halloween) .game .judge-hand .answer-card { background: #e7e7e7; color: #494949; border-color: #b5b5b5; }
html:not(.cc-halloween) .game .submission.winning { background: #e5f2fb; border-color: #126ba6; }
html:not(.cc-halloween) .game .hand-controls { background: #fafafa; border-color: #bbb; }
html:not(.cc-halloween) .game .hand-controls.urgent { border-color: #a52c2c; }
html:not(.cc-halloween) .game .classic-swap-button[aria-pressed="true"] { background: #e5f2fb; color: #095784; border-color: #126ba6; }
html:not(.cc-halloween) .game .is-swapping .answer-card:not(:disabled) { border-style: dashed; border-color: #126ba6; }
html:not(.cc-halloween) .game .classic-view-tabs button[aria-pressed="true"] { color: #fff; background: #222; border-color: #222; }
.game .selection-number:empty { display: none; }
.game .hand .answer-card:not(.selected):not(.card-sent):not(:disabled) strong { padding-right: 0; }
.game .answer-card strong { font-weight: 600; text-wrap: initial; }
.game .answer-card[data-action="judge"] { cursor: pointer; }
.game .answer-card[data-action="judge"]:disabled { cursor: not-allowed; }
.game .hand-controls { gap: 8px; }
.game .classic-action-hint { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
.game .classic-swap-button { white-space: nowrap; }
.game .classic-swap-button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.game .classic-view-tabs { display: none; }
@media (min-width:761px) {
  .game .game-sidebar .question-card { min-height: 172px; }
  .game .game-play .table-content { min-height: var(--table-min-height, 0px); }
  .game .game-play .game-status { margin-top: 8px; }
  .game .game-play .hand-area { margin-top: 8px; }
  .game .game-heading { margin-bottom: 8px; }
  .game .answer-card { padding: 9px; min-height: 76px; gap: 5px; }
}
@media (max-width:760px) {
  /* Рука и стол занимают одну область. Прокрутка — только внутри длинной руки/стола. */
  body.game-focus, body.game-focus.has-hand-controls { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.game-focus .layout { padding: 6px 8px; gap: 0; grid-template-areas: "main" "project"; }
  .game.classic-active {
    height: var(--classic-height, calc(100dvh - var(--header-h) - 76px - env(safe-area-inset-bottom)));
    min-height: 260px; display: flex; flex-direction: column; gap: 6px; padding: 6px;
    overflow: hidden;
  }
  .game.classic-active > * { flex-shrink: 0; min-width: 0; }
  .game.classic-active .game-heading { margin: 0; min-height: 36px; }
  .game.classic-active .game-heading h1 { font-size: 15px; line-height: 1.2; max-height: 2.4em; overflow: hidden; }
  .game.classic-active .game-status { position: static; margin: 0; }
  .game.classic-active .phase-line { padding: 5px 7px; gap: 2px 8px; }
  .game.classic-active .status-phase { font-size: 11px; }
  .game.classic-active .game-people { margin: 0; min-height: 20px; justify-content: flex-end; }
  .game.classic-active .game-people > button { display: none; } /* Игроки — постоянно доступная кнопка в нижнем меню. */
  .game.classic-active .question-card { position: static; padding: 8px; max-height: 33%; overflow: auto; overscroll-behavior: contain; }
  .game.classic-active .question-card h2 { font-size: 17px; margin-bottom: 4px; line-height: 1.25; }
  .game.classic-active .question-tools .icon-button { width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 9px; }
  .game.classic-active .question-jump { display: none; }
  .game.classic-active .question-card .round-summary { gap: 4px; margin: 0 0 4px; }
  .game.classic-active .classic-view-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
  .game.classic-active .classic-view-tabs button { min-height: 44px; padding: 6px; border-radius: 6px; font-size: 13px; }
  .game.classic-active .classic-view-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
  .game.classic-active .classic-stage { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  .game.classic-active .classic-stage > * { min-height: 0; min-width: 0; flex: 1 1 0; margin: 0; }
  .game.classic-active[data-classic-view="hand"] .classic-stage > .table-content,
  .game.classic-active[data-classic-view="table"] .classic-stage > .hand-area { display: none; }
  .game.classic-active .classic-stage .table-content { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .game.classic-active .classic-stage .hand-area { display: flex; flex-direction: column; gap: 4px; padding: 0; }
  .game.classic-active .hand-heading { margin: 0; align-items: center; flex: none; }
  .game.classic-active .hand-heading h2 { font-size: 13px; }
  .game.classic-active .hand-heading h2 small { margin-left: 2px; font-size: 10px; }
  .game.classic-active .hand-heading > span { max-width: 70%; font-size: 11px; line-height: 1.2; }
  .game.classic-active .hand { flex: 1 1 0; min-height: 0; align-content: start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; gap: 6px; padding: 2px 2px 4px; }
  .game.classic-active .answer-card { min-height: 62px; padding: 7px 8px; gap: 3px; }
  .game.classic-active .answer-card strong { font-size: 15px; line-height: 1.23; }
  .game.classic-active .answer-card .card-footer { font-size: 10px; }
  .game.classic-active .hand-card:not(.has-audio) .card-footer { min-height: 0; }
  .game.classic-active .hand-controls { position: static; flex: none; min-height: 0; margin: 0; padding: 4px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; gap: 5px; }
  .game.classic-active .hand-controls.single-controls .classic-action-hint { display: none; }
  .game.classic-active .hand-controls.single-controls #swap-button { width: 100%; }
  .game.classic-active #swap-button, .game.classic-active #submit-button { min-height: 44px; font-size: 12px; padding: 6px; }
  .game.classic-active .multi-controls #swap-button > span:not(.swap-glyph):not(.swap-count) { display: none; }
  .game.classic-active .multi-controls #swap-button[aria-pressed="true"] > span:not(.swap-glyph):not(.swap-count) { display: inline; }
  .game.classic-active #selection-count { min-width: 44px; padding: 2px; font-size: 12px; }
  .game.classic-active .submissions { gap: 6px; }
  .game.classic-active .table-heading h2 { font-size: 14px; }
  body.game-focus #selection-preview { bottom: calc(120px + env(safe-area-inset-bottom)); }
  /* На очень низких экранах предпочтительнее доступность всех элементов, а не обрезание текста. */
  @media (max-height: 470px) {
    .game.classic-active { height: auto; min-height: 0; overflow: visible; }
    .game.classic-active .question-card { max-height: none; }
    .game.classic-active .classic-stage, .game.classic-active .classic-stage > *, .game.classic-active .hand { flex: auto; overflow: visible; }
  }
}

/* Короткий экран: название комнаты и выход доступны через меню в нижней панели. */
.game .status-score { display: none; }
@media (max-width:760px) {
  html:not(.cc-halloween) .game.classic-active { padding: 6px; }
  .game.classic-active .game-heading, .game.classic-active .game-people { display: none; }
  .game.classic-active .status-phase { flex-basis: auto; flex: 1; }
  .game.classic-active .status-score { display: inline; order: 6; font-size: 10px; white-space: nowrap; }
  .game.classic-active #timer { order: 3; }
  .game.classic-active .phase-line { display: grid; grid-template-columns: auto minmax(0,1fr) auto; }
  .game.classic-active .status-phase { grid-column: 1 / 3; }
  .game.classic-active .status-score { grid-column: 3; text-align: right; }
  html:not(.cc-halloween) .game.classic-active .classic-view-tabs button[aria-pressed="true"],
  html:not(.cc-halloween) .game.classic-active .classic-view-tabs button[aria-pressed="true"]:hover:not(:disabled) { color: #fff; background: #222; border-color: #222; }
  .game.classic-active .hand-card.has-audio .card-audio-button { width:44px; height:44px; min-width:44px; min-height:44px; }
  .game.classic-active .hand-card.has-audio .card-footer { padding-right:40px; }
}
