/* «Клуб историй»: собственная палитра, игровые карточки и рельефные кнопки. */
:root {
  --font-ui: "Nunito", "Segoe UI", system-ui, sans-serif;
  --ink: #2b1b4b;
  --muted: #665777;
  --purple: #6940ba;
  --purple-dark: #432272;
  --paper: #fffaf0;
  --lilac: #eee5ff;
  --yellow: #ffda70;
  --mint: #b8e6d0;
  --line: 2px solid var(--ink);
  --shadow: 0 6px 0 #3b2168;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: #6340b0;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
/* Выделяем содержательный текст, а не изображения, декорации и подписи кнопок. */
img, svg, video, canvas,
button, button *, select, option, summary, summary *,
[role="button"], [role="button"] *,
.avatar, .avatar *, .preset-icon, .graph-arrow, [aria-hidden="true"], [aria-hidden="true"] *,
input:is([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]) {
  -webkit-user-select: none;
  user-select: none;
}
img, svg, video, canvas {
  -webkit-user-drag: none;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle, #ffffff0e 1.5px, transparent 2px) 0 0 / 19px 19px,
    radial-gradient(ellipse at 0 0, #9c71e5a8, transparent 65%),
    linear-gradient(135deg, #7350c7, #57319c);
}
button, input, textarea, select {
  font: inherit;
}
button, a, input, select, textarea, summary {
  -webkit-tap-highlight-color: transparent;
}
button, input, select {
  min-height: 48px;
}
button, a, summary {
  touch-action: manipulation;
}
button {
  border: var(--line);
  border-radius: 13px;
  padding: 12px 19px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
button:hover:not(:disabled) {
  background: #f0e7ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink);
}
button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
button:disabled {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #432272;
  outline-offset: 4px;
  box-shadow: 0 0 0 6px #fffaf0;
}
.primary, .demo-button {
  background: var(--yellow);
}
.primary:hover:not(:disabled), .demo-button:hover:not(:disabled) {
  background: #ffe69a;
}
/* Запуск пока недоступен, но кнопка открывает объяснение в снекбаре. */
.start-party[data-start-blocked="true"] {
  background: #d8c8ec;
  color: #514267;
  border-color: #6b568b;
  box-shadow: 0 4px 0 #6b568b;
}
.start-party[data-start-blocked="true"]:hover {
  background: #e4d8f3;
  box-shadow: 0 6px 0 #6b568b;
}
.start-party[data-start-blocked="true"]:active {
  box-shadow: 0 1px 0 #6b568b;
}
.secondary {
  background: var(--lilac);
}
input, textarea, select {
  width: 100%;
  min-width: 0;
  padding: 13px 15px;
  border: var(--line);
  border-radius: 12px;
  background: #fffefd;
  color: var(--ink);
  box-shadow: inset 0 3px 0 #2b1b4b0a;
}
input::placeholder, textarea::placeholder {
  color: #82738e;
  opacity: 1;
}
textarea {
  resize: vertical;
  min-height: 110px;
}
.character-field {
  margin-bottom: 16px;
}
.character-counter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 6px;
  color: #685875;
  font-size: 13px;
  line-height: 1.5;
}
.character-counter-value {
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.character-counter[data-limit-reached="true"] {
  padding: 7px 10px;
  border: 1px solid #b85165;
  border-radius: 10px;
  background: #ffe4e8;
  color: #8b2940;
  font-weight: 700;
}
.character-field textarea[data-limit-reached="true"] {
  border-color: #b85165;
}
/* Исходный select сохраняет API, а видимое меню одинаково выглядит в браузерах. */
.game-select-source, .settings .game-select-source {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}
.game-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 13px 15px;
  text-align: left;
  font-weight: 700;
  background: #fffefd;
  box-shadow: inset 0 3px 0 #2b1b4b0a;
}
.game-select-trigger::after {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid var(--purple-dark);
  border-bottom: 2px solid var(--purple-dark);
  transform: rotate(45deg);
  transition: transform 120ms ease;
}
.game-select-trigger[aria-expanded="true"] {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
  background: var(--lilac);
}
.game-select-trigger[aria-expanded="true"]::after { transform: rotate(225deg); }
.game-select-trigger:hover:not(:disabled),
.game-select-trigger:active:not(:disabled) {
  transform: none;
  box-shadow: inset 0 3px 0 #2b1b4b0a;
}
.game-select-popup {
  position: fixed;
  z-index: 1500;
  padding: 6px;
  border: var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--purple-dark), 0 12px 28px #2b1b4b33;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--purple) var(--lilac);
  font-size: 15px;
  text-align: left;
}
.game-select-option {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  padding: 11px 34px 11px 12px;
  min-height: 44px;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.game-select-option:hover:not(:disabled), .game-select-option:active:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: var(--lilac);
}
.game-select-option[aria-selected="true"] { background: var(--mint); }
.game-select-option[aria-selected="true"]::after {
  content: "✓";
  position: absolute;
  top: 11px;
  right: 12px;
  color: var(--purple-dark);
}
.game-select-option.active { background: var(--lilac); outline: 2px solid var(--purple); outline-offset: -2px; }
.game-select-option[aria-disabled="true"] { opacity: .48; cursor: not-allowed; }
.game-select-hint {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
  color: #686868;
}
.game-select-option[aria-selected="true"] .game-select-hint { color: #606060; }
@media (forced-colors: active) {
  .game-select-popup, .game-select-option.active { border: 2px solid ButtonText; }
}
label {
  display: block;
  margin: 14px 0 7px;
  font-size: 14px;
  font-weight: 800;
}
h1, h2, h3, p {
  overflow-wrap: anywhere;
}
h1, h2, h3 {
  line-height: 1.16;
  font-weight: 900;
}
h1 {
  font-size: clamp(32px, 3.8vw, 51px);
  letter-spacing: -1.8px;
  margin: 18px 0 12px;
  font-weight: 900;
}
h2 {
  font-size: 27px;
  margin: 0 0 12px;
  letter-spacing: -.7px;
}
h3 {
  font-size: 18px;
  margin: 0 0 8px;
}
p {
  color: var(--muted);
  line-height: 1.55;
  margin: 12px 0;
}
small {
  line-height: 1.45;
}
.eyebrow {
  display: inline-block;
  color: #6b419c;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.7px;
}
.hint {
  font-size: 14px;
}
.panel {
  min-width: 0;
  padding: 26px;
  border: var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding-bottom: 4px;
}

/* Постоянная шапка и оболочка не перерисовываются при обновлениях комнаты. */
.site-header {
  max-width: 1280px;
  margin: auto;
  padding: 26px 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
  font-weight: 900;
  font-size: 34px;
  letter-spacing: -1px;
  text-decoration: none;
  line-height: 1;
}
.brand img {
  flex: 0 0 56px;
  filter: drop-shadow(0 3px 0 #432272);
}
.brand b {
  color: var(--yellow);
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 1.1px;
  font-weight: 700;
  margin-top: 9px;
  color: #f5eaff;
}
.header-badge {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #fff6e4;
  padding: 10px 16px;
  border: 1px solid #ffffff45;
  border-radius: 30px;
  font-size: 13px;
}
.header-badge span {
  color: var(--yellow);
  font-size: 21px;
}
main, .media, .feedback {
  max-width: 1224px;
  margin: 0 auto 24px;
}
input[aria-invalid="true"] {
  border-color: #9d3a53;
  background: #fff4f5;
}
.site-footer {
  max-width: 1224px;
  margin: 26px auto 0;
  padding: 0 0 26px;
  color: #f3e9ff;
  font-size: 12px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  line-height: 1.6;
}
.site-footer strong {
  flex-shrink: 0;
  color: #ffdf8b;
}

/* Вход: собственные SVG-персонажи и форма без обязательной камеры. */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: stretch;
}
.welcome-card {
  padding: 30px 32px 28px;
}
.welcome-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sticker {
  background: var(--mint);
  border: var(--line);
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
  transform: rotate(3deg);
  white-space: nowrap;
}
.welcome-card h1 span {
  color: var(--purple);
}
.welcome-lead {
  font-size: 16px;
  max-width: 500px;
}
.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-top: 22px;
}
.friends-art {
  min-width: 0;
  align-self: center;
}
.friends-art img {
  width: 100%;
  height: auto;
  display: block;
}
.story-sticker {
  position: relative;
  padding: 15px;
  background: #f3eaff;
  border: var(--line);
  border-radius: 14px;
  transform: rotate(-3deg);
  margin: 2px 4px 12px;
  box-shadow: 0 3px 0 #2b1b4b24;
}
.story-sticker small, .story-sticker strong, .story-sticker span {
  display: block;
}
.story-sticker small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #69418f;
}
.story-sticker strong {
  font-size: 18px;
  line-height: 1.25;
  margin: 6px 0;
}
.story-sticker span {
  font-size: 12px;
  color: var(--muted);
}
.entry-form h2 {
  font-size: 22px;
  margin-bottom: 18px;
}
.entry-form input {
  font-size: 17px;
}
.create-button, .join-button, .demo-button {
  width: 100%;
}
.create-button, .join-button {
  margin-top: 12px;
}
.create-button span {
  font-size: 20px;
}
.join-button {
  background: #e9dffa;
}
.entry-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 26px 0 10px;
}
.entry-divider::before, .entry-divider::after {
  content: "";
  height: 1px;
  background: #cdbfdc;
  flex: 1;
}
.entry-note {
  text-align: center;
  font-size: 11px;
  margin: 16px 0 0;
}
.how-to-play {
  background: #ede4ff;
  display: flex;
  flex-direction: column;
  padding: 30px 26px 24px;
}
.how-to-play h2 {
  font-size: 30px;
  margin-top: 11px;
  margin-bottom: 10px;
}
.guide-step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  padding: 21px 0;
  border-bottom: 1px dashed #bca4db;
  align-items: start;
}
.guide-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: var(--line);
  border-radius: 14px;
  background: #ffda70;
  font-size: 29px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--ink);
  transform: rotate(-5deg);
}
.guide-step:nth-of-type(2) .guide-icon {
  background: var(--mint);
  transform: rotate(5deg);
}
.guide-step:nth-of-type(3) .guide-icon {
  background: #f5b3a0;
}
.step-number {
  color: #77579a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
}
.guide-step h3 {
  font-size: 17px;
  margin: 5px 0;
}
.guide-step p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.demo-invite {
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
}
.demo-invite p {
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 10px;
  font-size: 14px;
}
.demo-invite small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 12px;
}

/* Лобби: компания слева, план и игровые действия справа. */
.room-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 0 0 23px;
  color: white;
}
.room-header .eyebrow {
  color: #e5d5fc;
}
.room-header h1 {
  font-size: 29px;
  margin: 8px 0 0;
  letter-spacing: -.8px;
}
.room-header .actions {
  margin-top: 0;
}
.room-header > div { min-width: 0; }
.room-header .room-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 4px 20px;
  align-items: center;
  max-width: 100%;
  padding: 13px 20px;
  border-radius: 18px;
  text-align: left;
  background: var(--yellow);
  box-shadow: var(--shadow);
  --motion-hover-background: #ffe69a;
}
.room-title-label {
  grid-column: 1;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--purple-dark);
}
.room-code {
  font-family: var(--font-ui);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 3px;
  color: var(--ink);
  grid-column: 1;
}
.room-copy-icon {
  grid-column: 2;
  grid-row: 1 / 3;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #fffaf0b3;
}
.room-copy-icon::before, .room-copy-icon::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
}
.room-copy-icon::before { left: 9px; top: 8px; }
.room-copy-icon::after { left: 15px; top: 14px; }
.room-copy-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #f5eaff;
}
.layout {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.room-main {
  min-width: 0;
  display: grid;
  gap: 22px;
}
.players-panel {
  padding: 20px 16px;
  position: sticky;
  top: 20px;
  background: #e9dffc;
}
.players-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.players-heading h2 {
  font-size: 19px;
  margin: 0;
  letter-spacing: -.5px;
}
.player-count {
  border: var(--line);
  background: var(--paper);
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 8px;
  font-weight: 900;
}
.players {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}
.players li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 10px;
  border: var(--line);
  border-radius: 15px;
  background: #fffaf0;
  box-shadow: 0 3px 0 #2b1b4b18;
  min-width: 0;
}
.players li.player-ready {
  background: #def2e7;
}
.players li.player-empty {
  border: 2px dashed #b1a0cb;
  color: #75618f;
  background: #e3d6f5;
  box-shadow: none;
}
.player-info {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
  flex: 1;
}
.players small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #6b5c7d;
  margin-top: 4px;
}
.avatar {
  width: 43px;
  height: 43px;
  border-radius: 14px;
  border: var(--line);
  background: #ffda70;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  flex: 0 0 43px;
  transform: rotate(-5deg);
}
.players li:nth-child(3n+2) .avatar {
  background: #c3afea;
  transform: rotate(4deg);
}
.avatar-emoji, .avatar-picker-symbol {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-weight: 400;
  line-height: 1;
}
.avatar-emoji {
  font-size: 27px;
}
.creation-avatar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px 0 26px;
}
.creation-avatar > div {
  flex: 1;
  min-width: 0;
}
.creation-avatar .hint {
  margin: 6px 0 0;
  font-size: 14px;
}
.avatar-picker {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  min-height: 76px;
  padding: 8px;
  border-radius: 22px;
  transform: none;
}
.avatar-picker-symbol {
  font-size: 42px;
}
.avatar-picker-shuffle {
  position: absolute;
  right: -7px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--purple-dark);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}
.players li:nth-child(3n) .avatar {
  background: var(--mint);
}
.players li.player-empty .avatar {
  background: transparent;
  border: 2px dashed #b1a0cb;
  font-size: 24px;
  transform: none;
}
.players li button {
  padding: 4px;
  min-height: 30px;
  width: 30px;
  box-shadow: none;
}
.players li.player-empty .player-invite {
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex-basis: 44px;
  color: var(--purple-dark);
  --motion-hover-background: var(--yellow);
  --motion-hover-shadow: none;
  --motion-pressed-shadow: none;
}
.players li.player-empty .player-invite:where(:hover, :focus-visible):not(:disabled) {
  background: var(--yellow);
  border-color: var(--purple-dark);
}
.players-panel > .hint {
  font-size: 11px;
  margin-bottom: 0;
}
.drop-avatar {
  cursor: grab;
}
.lobby-controls h2 {
  font-size: 23px;
  margin-top: 8px;
}
.lobby-controls p {
  font-size: 14px;
}
.lobby-controls .actions {
  margin-top: 15px;
}
.progress {
  font-size: 14px;
  font-weight: 700;
  color: #655077;
  margin: 16px 0 0;
}

/* Сценарии и конструктор. Пресеты меняют только несохранённый план ведущего. */
.settings h2 {
  margin-top: 7px;
}
.draft-notice {
  background: #fff0ba;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #594321;
}
.presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 17px 14px;
  background: #f0e8fc;
  min-width: 0;
  min-height: 150px;
}
.preset-card:nth-child(3) {
  background: #e1f1e8;
}
.preset-card.selected {
  background: #fff0ba;
  outline: 3px solid #ac72dd;
  outline-offset: 2px;
}
.preset-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: var(--line);
  background: var(--paper);
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 12px;
  transform: rotate(-5deg);
}
.preset-card strong {
  font-size: 18px;
}
.preset-card small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 7px;
}
.preset-chosen {
  position: absolute;
  top: 9px;
  right: 8px;
  border-radius: 5px;
  padding: 3px 5px;
  color: #4a2d74;
  background: #f7fbdd;
  font-size: 9px;
}
.round-graph {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
}
.round-node {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: var(--line);
  border-radius: 14px;
  padding: 13px;
  background: #f3edfc;
  max-width: 100%;
  min-width: 0;
}
.round-node.selected {
  background: #fff0ba;
  outline: 2px solid #9f78d1;
  outline-offset: 2px;
}
.round-node[draggable=true] {
  cursor: grab;
}
.round-node button {
  margin: 0;
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
}
.round-node span {
  color: var(--muted);
  font-size: 12px;
}
.round-node strong {
  font-size: 13px;
}
.graph-end {
  font-size: 12px;
  font-weight: 900;
  color: var(--purple);
}
.graph-arrow {
  color: #8063a3;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.settings fieldset {
  border: 2px solid #cab8e0;
  border-radius: 16px;
  padding: 18px;
  margin: 24px 0;
  min-width: 0;
}
.settings legend {
  font-weight: 900;
  padding: 0 8px;
}
.settings label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.settings input, .settings select {
  width: 100%;
  min-width: 0;
}
.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  cursor: pointer;
  min-height: 44px;
}
.check-row input, .settings .check-row input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--purple);
}
.adult-warning, .error {
  padding: 12px;
  border-radius: 12px;
  background: #ffe1d4;
  color: #75351e;
  font-weight: 700;
}

/* Игровые карточки: одна визуальная система от ответа до результатов. */
.round-summary {
  margin-bottom: 18px;
}
.round-summary h2 {
  margin: 6px 0 0;
  font-size: clamp(20px, 2vw, 26px);
}
.round-summary-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
}
.round-summary-heading > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.round-summary-caption {
  margin: 0;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid #c9b5e7;
  border-radius: 12px;
  background: var(--lilac);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
/* Вопрос — главный акцент раунда, метаданные остаются компактными над ним. */
.question-card {
  min-width: 0;
  margin: 18px 0;
  padding: clamp(18px, 2.6vw, 30px);
  border: var(--line);
  border-radius: 20px;
  background: linear-gradient(120deg, #fff0b5, var(--yellow));
  color: var(--ink);
  box-shadow: 0 5px 0 var(--purple-dark);
}
.round-summary > .question-card:last-child {
  margin-bottom: 4px;
}
.question-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.question-card-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  height: 32px;
  border: 2px solid var(--purple-dark);
  border-radius: 11px;
  background: var(--purple-dark);
  color: var(--paper);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}
.question-card-label {
  min-width: 0;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
}
.question-card-text {
  max-width: 62ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.topic {
  border-left: 4px solid var(--purple);
  padding: 14px 18px;
  background: #f0e7fc;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  border-radius: 0 12px 12px 0;
}
.surprise {
  border: var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
}
.clock-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  margin-bottom: 22px;
  background: #f0e7ff;
}
.clock-panel p {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.clock-panel .actions {
  margin: 0;
}
.clock-panel button {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13px;
}
.board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.fact {
  padding: 22px;
  background: #fff0ba;
  border: var(--line);
  border-radius: 18px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 0 #2b1b4b20;
}
.fact:nth-child(3n+2) {
  background: #e0f0e7;
}
.fact:nth-child(3n) {
  background: #eee3ff;
}
.fact p {
  color: var(--ink);
  flex: 1;
  font-size: 18px;
  overflow-wrap: anywhere;
  margin: 4px 0;
}
.fact small {
  color: #685875;
}
.fact.own {
  border: 2px dashed #a68b72;
}
.fact.dragover {
  outline: 4px solid #6940ba;
  outline-offset: 3px;
}
.reveal {
  font-size: 28px;
  text-align: center;
  padding: 40px 20px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.reveal h3 {
  margin-top: 22px;
  font-size: 20px;
}
.reveal-story { font: inherit; color: inherit; margin: 0; }
.answers-confirmed {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  padding: 18px;
  border: 2px solid #4c8666;
  border-radius: 16px;
  background: var(--mint);
  color: #275c43;
}
.answers-confirmed-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--paper);
  font-size: 26px;
  font-weight: 900;
}
.answers-confirmed strong { font-size: 18px; }
.answers-confirmed > div { min-width: 0; overflow-wrap: anywhere; }
.answers-confirmed > div > p { margin: 6px 0 0; color: #275c43; font-size: 14px; line-height: 1.5; }
.votes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.pill {
  font-size: 13px;
  border: 1px solid #c8b5df;
  border-radius: 20px;
  padding: 8px 12px;
  background: #eee5ff;
}
.scores {
  width: 100%;
  border-collapse: collapse;
}
.scores td, .scores th {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid #d9cbe9;
  overflow-wrap: anywhere;
}
.scores th {
  font-size: 12px;
  text-transform: uppercase;
  color: #78608f;
}
.scores td:last-child {
  font-size: 22px;
  font-weight: 900;
  color: var(--purple);
}
.scores tbody tr:first-child {
  background: #fff1bf;
}
.demo {
  background: var(--yellow);
  border: var(--line);
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.guess-guide, .guess-controls {
  color: var(--ink);
}
.guess-guide p, .guess-controls p {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}
.guess-guide > p {
  margin: 0;
}
.guess-controls > p {
  margin: 14px 0 0;
}
.guess-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0;
}
.guess-toolbar .progress {
  margin: 0;
  font-weight: 800;
}
.card-pager {
  display: none;
}

/* Медиапанель постоянна: изменение этапа не прерывает живые потоки. */
.media {
  padding: 0;
  border: var(--line);
  border-radius: 18px;
  background: #f3ecff;
  box-shadow: 0 5px 0 #3b2168;
}
details > summary {
  cursor: pointer;
  font-weight: 800;
  padding: 16px 20px;
  min-height: 48px;
}
.media > details > summary .hint {
  color: #715b87;
  font-weight: 400;
  font-size: 12px;
  margin-left: 10px;
}
.media-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  padding: 0 20px 14px;
}
.media-tools button {
  min-height: 42px;
  font-size: 12px;
  padding: 10px 14px;
}
.media-tools label {
  margin: 0;
}
.media-tools input {
  width: auto;
  min-height: auto;
  accent-color: var(--purple);
}
.relay-setting {
  width: 100%;
  padding: 14px;
  border: 1px solid #cdb9e7;
  border-radius: 12px;
  background: var(--paper);
}
.media-tools .relay-setting label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
}
.relay-setting p {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink);
}
.media-tools span {
  width: 100%;
  color: var(--muted);
}
.device-summary {
  font-size: 13px;
  color: var(--muted);
}
#media-diagnostics {
  display: block;
  padding: 0 20px 16px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Планшет и узкие окна: без горизонтального прокручивания. */
@media (max-width: 1280px) {
  main, .media, .feedback, .site-footer {
    margin-left: 24px;
    margin-right: 24px;
  }
}
@media (max-width: 1000px) {
  .home-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  }
  .entry-layout {
    grid-template-columns: 1fr;
  }
  .friends-art {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .friends-art img {
    width: 40%;
  }
  .story-sticker {
    flex: 1;
  }
  .layout {
    grid-template-columns: 235px minmax(0, 1fr);
  }
  .presets {
    gap: 8px;
  }
  .preset-card {
    padding: 12px 10px;
  }
  .preset-card strong {
    font-size: 15px;
  }
  .preset-chosen {
    font-size: 8px;
  }
}
@media (max-width: 760px) {
  .site-header {
    padding: 20px 18px;
  }
  .brand {
    font-size: 28px;
    gap: 10px;
  }
  .brand img {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
  .brand small {
    font-size: 9px;
    letter-spacing: .5px;
  }
  .header-badge {
    display: none;
  }
  main, .media, .feedback, .site-footer {
    margin-left: 14px;
    margin-right: 14px;
  }
  .home-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .panel {
    padding: 22px;
    border-radius: 20px;
  }
  .welcome-card {
    padding: 24px;
  }
  .welcome-card h1 {
    font-size: clamp(30px, 6.4vw, 43px);
    letter-spacing: -1.2px;
  }
  .welcome-heading .eyebrow {
    font-size: 10px;
    letter-spacing: 1px;
  }
  .welcome-lead {
    font-size: 14px;
  }
  .entry-layout {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1fr);
    gap: 18px;
  }
  .friends-art {
    display: block;
  }
  .friends-art img {
    width: 100%;
  }
  .entry-form h2 {
    font-size: 20px;
  }
  .how-to-play {
    padding: 24px;
  }
  .guide-step {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 16px 0;
  }
  .guide-icon {
    width: 44px;
    height: 44px;
  }
  .how-to-play h2 {
    font-size: 26px;
  }
  .demo-invite {
    text-align: left;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .players-panel {
    position: static;
    padding: 16px;
  }
  .players {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0 6px;
  }
  .players li {
    min-height: 63px;
    padding: 8px;
    gap: 8px;
  }
  .players li.player-empty {
    display: none;
  }
  .players-panel > .hint {
    display: none;
  }
  .avatar {
    width: 34px;
    height: 36px;
    flex-basis: 34px;
    font-size: 12px;
    border-radius: 11px;
  }
  .player-info {
    font-size: 12px;
  }
  .players small {
    font-size: 10px;
  }
  .room-header {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 15px;
  }
  .room-header h1 {
    font-size: 25px;
  }
  .room-code {
    font-size: 28px;
  }
  .room-header button {
    font-size: 12px;
    min-height: 44px;
    padding: 10px 14px;
  }
  .presets {
    gap: 10px;
  }
  .preset-card {
    min-height: 145px;
  }
  .preset-icon {
    width: 35px;
    height: 35px;
    font-size: 22px;
  }
  .preset-chosen {
    position: static;
    margin-top: 8px;
    font-size: 9px;
  }
  .board {
    grid-template-columns: 1fr;
  }
  .board .fact:not(.current) {
    display: none;
  }
  .board .fact.current {
    min-height: 230px;
  }
  .card-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 14px 0;
  }
  .card-pager span {
    font-size: 12px;
    white-space: nowrap;
  }
  .card-pager button {
    padding: 10px;
    font-size: 13px;
  }
  .guess-controls {
    position: sticky;
    bottom: 12px;
    z-index: 2;
  }
  .guess-toolbar .progress {
    margin: 0;
  }
  .guess-toolbar button {
    width: 100%;
  }
  .reveal {
    font-size: 23px;
    padding: 24px 0;
  }
  .media > details > summary .hint {
    display: block;
    margin: 5px 0 0;
  }
  .media-tools {
    padding: 0 16px 14px;
  }
  .media-tools button {
    flex: 1 1 130px;
  }
  .site-footer {
    flex-direction: column;
    gap: 7px;
    font-size: 11px;
  }
}
@media (max-width: 520px) {
  .welcome-card {
    padding: 22px 20px;
  }
  .welcome-heading {
    align-items: flex-start;
  }
  .welcome-heading .eyebrow {
    max-width: 120px;
    line-height: 1.5;
  }
  .sticker {
    font-size: 10px;
    padding: 6px 8px;
  }
  .entry-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 12px;
  }
  .friends-art {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .friends-art img {
    width: 45%;
  }
  .story-sticker {
    padding: 10px;
    margin: 0;
  }
  .story-sticker strong {
    font-size: 14px;
  }
  .story-sticker small {
    font-size: 9px;
  }
  .story-sticker span {
    font-size: 10px;
  }
  .entry-form h2 {
    margin-bottom: 12px;
  }
  .presets {
    grid-template-columns: 1fr;
  }
  .preset-card {
    min-height: 0;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 4px 12px;
    padding: 14px;
    align-items: center;
  }
  .preset-icon {
    grid-row: 1 / 3;
    margin: 0;
  }
  .preset-card strong {
    font-size: 18px;
  }
  .preset-card small {
    margin: 0;
  }
  .preset-chosen {
    grid-column: 2;
    width: fit-content;
    margin: 2px 0 0;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings fieldset {
    padding: 14px;
  }
  .graph-arrow {
    display: none;
  }
  .round-node {
    width: 100%;
  }
  .round-graph {
    align-items: stretch;
  }
  .players-heading h2 {
    font-size: 18px;
  }
  .room-main > .panel {
    padding: 20px 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
.choice-gallery { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:20px; }
.choice-picture { margin:0; padding:10px; border:2px solid var(--line, #d7cde8); border-radius:18px; background:#fff9ed; min-width:0; }
.choice-picture img { display:block; width:100%; height:auto; border-radius:10px; }
.choice-picture figcaption { margin-top:8px; font-weight:700; }
.choice-picture details { margin-top:6px; }
.choice-picture summary { cursor:pointer; }
.choice-picture details[open] img { position:fixed; z-index:10; inset:10vh 5vw; width:90vw; height:80vh; object-fit:contain; background:#241b3be8; }
.choice-task { padding:14px 0; border-bottom:1px solid #ddd1e8; }
@media(max-width:560px) { .choice-gallery { grid-template-columns:1fr; } }
.choice-picture details[open] summary { position:fixed; z-index:11; top:4vh; right:5vw; background:#fff9ed; padding:10px 16px; border-radius:12px; }
.choice-music { display:grid; gap:14px; margin-bottom:20px; }
.choice-music audio { display:block; width:100%; margin-top:8px; }
.creation-layout { display:grid; gap:22px; max-width:1100px; margin:0 auto; }
.creation-layout h1 { margin:10px 0 18px; }
.creation-actions { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.creation-actions p { flex-basis:100%; margin:0; }
.branch-routes { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.branch-route { border:2px solid #cab8e0; border-radius:16px; padding:14px; background:#fff9ed; }
.branch-graph { display:grid; gap:5px; padding:10px; border:2px dashed #b399ce; border-radius:12px; margin-top:8px; }

.feedback-panel { padding: 0; border: var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 5px 0 #3b2168; }
.feedback-panel summary { font-weight: 800; cursor: pointer; }
.feedback-panel > :not(summary) { margin-left: 20px; margin-right: 20px; }
.feedback-panel > :last-child:not(summary) { margin-bottom: 20px; }
.feedback-panel p { font-size: .92rem; line-height: 1.5; }
.feedback-panel form { display: grid; gap: 12px; margin-top: 14px; }
.feedback-panel textarea { width: 100%; min-height: 130px; }
.feedback-panel .feedback-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Нативные SVG-курсоры: без JS-слежения за мышью, задержек и дополнительного DOM. */
.connection-widget {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  max-width: calc(100vw - 160px);
}
.connection-widget > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  min-height: 48px;
  padding: 12px 14px;
  border: var(--line);
  border-radius: 18px;
  background: var(--lilac);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
  --motion-hover-background: #f5edff;
}
#connection-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-widget > summary::-webkit-details-marker { display: none; }
.connection-widget[data-state="connected"] > summary {
  background: var(--mint);
  color: #24523c;
  --motion-hover-background: #d3f2df;
}
.connection-widget:is([data-state="connecting"], [data-state="reconnecting"]) > summary {
  background: var(--yellow);
  --motion-hover-background: #ffe69a;
}
.connection-widget[data-state="offline"] > summary {
  background: #ffe1e4;
  color: #7c2135;
  --motion-hover-background: #fff4f5;
}
.connection-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: 0 0 9px; }
.connection-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  padding: 20px;
  border: var(--line);
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.connection-panel h2 { margin: 0 0 10px; font-size: 22px; }
.connection-panel p { font-size: 13px; line-height: 1.5; }
.connection-panel .connection-copy-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--yellow);
}
.connection-code-label { display: block; font-size: 11px; margin-bottom: 4px; }
.connection-panel .room-code { font-size: 24px; }
.connection-panel .room-copy-icon { flex: 0 0 38px; }
.connection-copy-hint { color: var(--muted); }
.connection-panel dl { margin: 18px 0 0; font-size: 13px; }
.connection-panel dl > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.connection-panel dt { color: var(--muted); }
.connection-panel dd { margin: 0; overflow-wrap: anywhere; font-weight: 800; }
.sound-widget {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
}
.sound-widget > summary {
  list-style: none;
  border: var(--line);
  border-radius: 18px;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 12px 18px;
  min-height: 48px;
}
.sound-widget > summary::-webkit-details-marker { display: none; }
#sound-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sound-settings {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  padding: 20px;
  background: var(--paper);
  color: var(--ink);
  border: var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.sound-settings h2 { font-size: 22px; }
.sound-settings label { display: flex; justify-content: space-between; gap: 12px; }
.sound-settings output { font-variant-numeric: tabular-nums; }
.sound-settings input[type="range"] { padding: 0; accent-color: var(--purple); }
.sound-settings p { color: var(--ink); font-size: 14px; }
/* Место под постоянно видимой кнопкой, чтобы она не закрывала последние действия страницы. */
body { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
@media (max-width: 760px) {
  .guess-controls { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (forced-colors: none) {
  ::selection {
    background: var(--yellow);
    color: var(--ink);
    text-shadow: none;
  }
  input, textarea, [contenteditable]:not([contenteditable="false"]) {
    caret-color: var(--purple-dark);
  }
}
@media (hover: hover) and (pointer: fine) and (forced-colors: none) {
  body {
    cursor: url("/assets/cursor-default.svg") 5 4, default;
  }
  :is(p, h1, h2, h3, h4, h5, h6, span, small, strong, em, label, li, td, th, blockquote, pre, code),
  input:not([type]),
  input:is([type="text"], [type="search"], [type="email"], [type="url"], [type="password"], [type="tel"], [type="number"]),
  textarea, [contenteditable]:not([contenteditable="false"]) {
    cursor: url("/assets/cursor-text.svg") 16 16, text;
  }
  .preset-icon, .graph-arrow, [aria-hidden="true"] {
    cursor: inherit;
  }
  a[href], button:not(:disabled), summary:not([aria-disabled="true"]), .check-row, select:not(:disabled),
  input:is([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]):not(:disabled),
  [role="button"]:not([aria-disabled="true"]),
  [role="option"]:not([aria-disabled="true"]),
  [role="option"]:not([aria-disabled="true"]) *,
  :is(a[href], button:not(:disabled), summary:not([aria-disabled="true"]), .check-row, select:not(:disabled), [role="button"]:not([aria-disabled="true"])) * {
    cursor: url("/assets/cursor-pointer.svg") 12 4, pointer;
  }
  [draggable="true"], [draggable="true"] * { cursor: grab; }
  [draggable="true"]:active, [draggable="true"]:active * { cursor: grabbing; }
  :is(button, input, textarea, select):disabled,
  :is(button, input, textarea, select):disabled *,
  [aria-disabled="true"]:is(button, input, textarea, select, a, summary, [role="button"]),
  [aria-disabled="true"]:is(button, input, textarea, select, a, summary, [role="button"]) *,
  [aria-disabled="true"], [aria-disabled="true"] * { cursor: not-allowed; }
}

/* Декорации не участвуют в раскладке и не перекрывают мышь, поля или видеосвязь. */
#game-effects {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.screen-arrive { animation: screen-arrive 380ms cubic-bezier(.2,.8,.2,1); }
.screen-arrive h2 { animation: title-arrive 380ms cubic-bezier(.2,.8,.2,1); }
.screen-arrive .choice-picture > img { animation: picture-develop 420ms ease-out; }
@keyframes screen-arrive {
  from { opacity: .65; }
  to { opacity: 1; }
}
@keyframes title-arrive {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}
.button-spark {
  position: absolute;
  color: #ffe192;
  font-size: 32px;
  line-height: 1;
  text-shadow: 1px 2px var(--ink);
  animation: button-spark 550ms ease-out both;
}
@keyframes button-spark {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.45) rotate(-30deg); }
  to { opacity: 0; transform: translate(-50%, -160%) scale(1.3) rotate(30deg); }
}
#game-clock { border-radius: 12px; padding: 8px 12px; font-variant-numeric: tabular-nums; }
#game-clock[data-urgency="soon"] { background: #fff0c2; color: #6b4508; }
#game-clock[data-urgency="critical"] { background: #ffe0e9; color: #89264d; font-weight: 800; }
.clock-beat { animation: clock-beat 420ms ease-out; }
@keyframes clock-beat {
  40% { transform: scale(1.025); }
}
.choice-picture { transition: box-shadow 180ms ease, border-color 180ms ease; }
.picture-develop { animation: picture-develop 420ms ease-out both; }
@keyframes picture-develop {
  from { opacity: .6; transform: scale(.96) rotate(-1deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@media (hover: hover) and (pointer: fine) {
  .choice-picture:hover, .choice-picture:focus-within {
    border-color: #9773cf;
    box-shadow: 0 0 0 4px #b9a2ff45, 0 8px 22px #30234a18;
  }
  .preset-card:hover, .round-node:hover, .players li:hover {
    box-shadow: 0 0 0 3px #b5f4d280;
  }
  button:hover:not(:disabled) { filter: brightness(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  #game-effects { display: none; }
  .screen-arrive, .picture-develop, .clock-beat { animation: none !important; }
  button:hover:not(:disabled), button:active:not(:disabled) { transform: none; }
}
