/* MLBB Угадайка — визуальная система.
   Тёмно-синее поле, золотые рамки со скошенными углами, шестиугольные жетоны героев.
   Токены совпадают с docs/design/overview.md бекенда. */

:root {
  color-scheme: dark;
  --bg: #070d1f;
  --bg-2: #0b1430;
  --panel: #111b3a;
  --panel-2: #172453;
  --line: #24356b;
  --gold: #f3c55b;
  --gold-hi: #fff0b8;
  --gold-deep: #a8761f;
  --text: #e9edf8;
  --muted: #8f9bc0;
  --correct: #23b26b;
  --partial: #e2a51a;
  --wrong: #d43f3a;

  --role-tank: #3d7bd9;
  --role-fighter: #d9783d;
  --role-assassin: #c43b5c;
  --role-mage: #8a5ad9;
  --role-marksman: #d9b23d;
  --role-support: #2fa88a;

  --display: "Oswald", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --body: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;

  --cut: 12px;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Поле арены: свечение сверху и тонкая сетка, как пол лобби. */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(64, 102, 214, .45), transparent 60%),
    radial-gradient(80% 40% at 50% 110%, rgba(243, 197, 91, .10), transparent 70%),
    repeating-linear-gradient(90deg, rgba(120, 150, 255, .045) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(120, 150, 255, .045) 0 1px, transparent 1px 44px),
    var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.muted { color: var(--muted); }

/* ---------- Верхняя панель ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) var(--gutter) 8px;
  background: linear-gradient(180deg, rgba(7, 13, 31, .96), rgba(7, 13, 31, .82));
  border-bottom: 1px solid rgba(243, 197, 91, .18);
  backdrop-filter: blur(8px);
}

.topbar-title {
  grid-column: 2;
  margin: 0;
  text-align: center;
  font: 600 19px/1.2 var(--display);
  letter-spacing: .02em;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font: 600 18px/1 var(--display);
  color: var(--gold);
}

.topbar-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#back { grid-column: 1; }
#help { grid-column: 3; }

/* ---------- Экран ---------- */

.screen {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  outline: none;
}

.screen > * + *,
.view > * + * { margin-top: 16px; }

.boot {
  min-height: 60dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.boot-hex { animation: pulse 1.6s var(--ease) infinite; }

@keyframes pulse {
  50% { transform: scale(1.06); filter: brightness(1.25); }
}

/* ---------- Рамка со скошенными углами ---------- */

.frame {
  --frame-cut: var(--cut);
  position: relative;
  padding: 1px;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold) 30%, var(--gold-deep) 70%, var(--gold));
  clip-path: polygon(var(--frame-cut) 0, 100% 0, 100% calc(100% - var(--frame-cut)), calc(100% - var(--frame-cut)) 100%, 0 100%, 0 var(--frame-cut));
}

.frame > .frame-in {
  height: 100%;
  background: linear-gradient(165deg, var(--panel-2), var(--panel) 55%, #0d1531);
  clip-path: polygon(var(--frame-cut) 0, 100% 0, 100% calc(100% - var(--frame-cut)), calc(100% - var(--frame-cut)) 100%, 0 100%, 0 var(--frame-cut));
}

.panel {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(23, 36, 83, .9), rgba(17, 27, 58, .9));
}

/* ---------- Шестиугольник ---------- */

.hex {
  --size: 52px;
  --tint: var(--panel-2);
  position: relative;
  flex: none;
  width: var(--size);
  height: calc(var(--size) * 1.1);
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold) 40%, var(--gold-deep));
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.hex::before {
  content: "";
  position: absolute;
  inset: 2px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .22), transparent 60%),
    linear-gradient(165deg, var(--tint), #0a1128);
  clip-path: inherit;
}

.hex > span, .hex > img {
  position: relative;
  font: 600 calc(var(--size) * .36)/1 var(--display);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

.hex > img {
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  object-fit: cover;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.hex > svg {
  position: relative;
  width: 50%;
  height: 50%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hex > svg .fill { fill: var(--gold); }

.hex-sm { --size: 36px; }
.hex-lg { --size: 84px; }

.tint-none { --tint: #2a3d7a; }
.tint-tank { --tint: var(--role-tank); }
.tint-fighter { --tint: var(--role-fighter); }
.tint-assassin { --tint: var(--role-assassin); }
.tint-mage { --tint: var(--role-mage); }
.tint-marksman { --tint: var(--role-marksman); }
.tint-support { --tint: var(--role-support); }

/* ---------- Кнопки ---------- */

.btn {
  --frame-cut: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  font: 600 17px/1 var(--display);
  letter-spacing: .03em;
  clip-path: polygon(var(--frame-cut) 0, 100% 0, 100% calc(100% - var(--frame-cut)), calc(100% - var(--frame-cut)) 100%, 0 100%, 0 var(--frame-cut));
  transition: filter .15s, transform .15s var(--ease);
}

.btn:active { transform: scale(.97); }

.btn-gold {
  color: #2a1a02;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 45%, #d99a2e 55%, var(--gold-deep));
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

.btn-gold:hover { filter: brightness(1.08); }

.btn-ghost {
  color: var(--gold);
  background: rgba(243, 197, 91, .08);
  box-shadow: inset 0 0 0 1px rgba(243, 197, 91, .45);
}

.btn-wide { width: 100%; }

.btn[disabled] { filter: grayscale(.8) brightness(.7); cursor: default; }

.row { display: flex; gap: 10px; }
.row > .btn { flex: 1; }

/* ---------- Меню: шапка игрока ---------- */

.player {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-name {
  margin: 0;
  font: 600 24px/1.1 var(--display);
}

.player-sub { margin: 2px 0 0; font-size: 13px; }

.player-total {
  margin-left: auto;
  text-align: right;
  font: 600 26px/1 var(--display);
  color: var(--gold);
}

.player-total small {
  display: block;
  margin-top: 4px;
  font: 400 12px/1.2 var(--body);
  color: var(--muted);
}

/* ---------- Меню: карточки режимов ---------- */

.modes {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mode {
  --frame-cut: 16px;
  display: block;
  width: 100%;
  padding: 1px;
  border: 0;
  text-align: left;
  animation: rise .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

.mode:active { transform: scale(.985); }

.mode .frame-in {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 14px 14px;
}

.mode-title {
  margin: 0;
  font: 600 20px/1.15 var(--display);
  color: var(--text);
}

.mode-desc { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.mode-stage {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--gold);
}

.mode-score {
  display: grid;
  gap: 4px;
  justify-items: end;
  font: 600 15px/1 var(--display);
  white-space: nowrap;
}

.score {
  display: flex;
  gap: 16px;
  margin: 0;
  font: 600 17px/1 var(--display);
}

.ok { color: var(--correct); }
.no { color: var(--wrong); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 17, 40, .8);
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 500 16px/1 var(--display);
  color: var(--muted);
}

.tab[aria-selected="true"] {
  color: #2a1a02;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, #d99a2e);
}

/* ---------- Прогресс ---------- */

.progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-label { font: 500 16px/1 var(--display); }

.dots { display: flex; gap: 6px; }

.dot {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.dot.is-done { background: var(--gold-deep); border-color: var(--gold-deep); }
.dot.is-ok { background: var(--correct); border-color: var(--correct); }
.dot.is-no { background: var(--wrong); border-color: var(--wrong); }
.dot.is-now { border-color: var(--gold); animation: glow 1.4s infinite; }

@keyframes glow {
  50% { box-shadow: 0 0 10px var(--gold); background: rgba(243, 197, 91, .35); }
}

/* ---------- Сетка героев ---------- */

.grid {
  display: grid;
  gap: 10px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.tile {
  --frame-cut: 10px;
  min-height: 44px;
  padding: 1px;
  border: 0;
  background: linear-gradient(160deg, #3a4f91, var(--line));
  transition: transform .15s var(--ease), opacity .25s, filter .25s;
}

.tile .frame-in {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 6px 10px;
}

.tile-name {
  max-width: 100%;
  font: 500 15px/1.15 var(--display);
  text-align: center;
  overflow-wrap: anywhere;
}

.tile-sub { margin-top: -6px; font-size: 11px; color: var(--muted); text-align: center; }

.tile:not([disabled]):active { transform: scale(.96); }

.tile.is-correct { background: linear-gradient(160deg, #5be39d, var(--correct)); }
.tile.is-correct .frame-in { background: linear-gradient(165deg, #145a3c, #0e2a2a); }
.tile.is-wrong { background: linear-gradient(160deg, #ff7b74, var(--wrong)); animation: shake .4s; }
.tile.is-wrong .frame-in { background: linear-gradient(165deg, #5a1e2a, #2a1022); }
.tile.is-dim { opacity: .38; filter: saturate(.4); }
.tile[disabled] { cursor: default; }

.grid-2 .tile .frame-in { padding: 18px 8px 14px; }

@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ---------- Сравнение характеристик ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  vertical-align: -1px;
  transform: rotate(45deg);
}

.compare {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cell {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 62px;
  padding: 6px 2px;
  border-radius: 6px;
  font: 500 12px/1.15 var(--display);
  text-align: center;
  overflow-wrap: anywhere;
  animation: flip .45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

.cell small { display: block; margin-bottom: 3px; font: 400 10px/1 var(--body); opacity: .75; }
.cell b { font-weight: 600; font-size: 13px; white-space: pre-line; overflow-wrap: normal; word-break: keep-all; }

.cell-hero { background: var(--panel-2); }
.cell-ok { background: linear-gradient(170deg, #2fd083, #168a51); }
.cell-mid { background: linear-gradient(170deg, #f2bb3a, #b77c0d); color: #1d1200; }
.cell-no { background: linear-gradient(170deg, #e2574f, #9c2620); }

@keyframes flip {
  from { opacity: 0; transform: rotateX(90deg); }
}

/* ---------- Доска «Угадай героя» ---------- */

.board { display: grid; gap: 6px; }

.compare-head span {
  font-size: 10px;
  line-height: 1.1;
  color: var(--muted);
  text-align: center;
  align-self: end;
}

.cell-name {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  font: 500 10px/1.1 var(--display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare.is-win .cell-hero { background: linear-gradient(170deg, #2fd083, #168a51); }

/* ---------- Загадки: иконка, портрет, реплика ---------- */

.riddle-icon {
  --frame-cut: 18px;
  width: min(62vw, 220px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.riddle-zoom {
  --frame-cut: 14px;
  width: min(100%, 440px);
  aspect-ratio: 16 / 10;
  margin: 0 auto;
}

.riddle-icon .frame-in,
.riddle-zoom .frame-in {
  overflow: hidden;
  display: grid;
}

.riddle-icon img,
.riddle-zoom img,
.riddle-icon .placeholder-art,
.riddle-zoom .placeholder-art {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.riddle-icon img { transition: filter .7s var(--ease); }
.riddle-zoom img { transition: transform .7s var(--ease); }

.voice {
  display: grid;
  gap: 14px;
  padding: 20px 18px;
}

.voice-prompt { margin: 0; font-size: 13px; color: var(--muted); }

.quote {
  position: relative;
  margin: 0;
  padding: 0 0 0 30px;
  font: 500 22px/1.3 var(--display);
  color: var(--text);
}

.quote::before {
  content: "«";
  position: absolute;
  left: -2px;
  top: -10px;
  font: 700 46px/1 var(--display);
  color: var(--gold);
}

.voice-audio { display: grid; justify-items: center; }
.voice-audio .player-audio { padding: 4px 0 0; }

.lock {
  margin: 0;
  padding: 8px 14px;
  border: 1px dashed rgba(243, 197, 91, .45);
  border-radius: 999px;
  font-size: 13px;
  color: var(--gold);
  text-align: center;
}

.search-hint { margin: 6px 0 0; min-height: 0; font-size: 13px; color: var(--partial); }
.search-hint:empty { display: none; }

/* ---------- Баннер результата ---------- */

.banner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 26px 16px 22px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.banner::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(243, 197, 91, .16) 0 8deg, transparent 8deg 20deg);
  animation: spin 18s linear infinite;
}

.banner-word {
  margin: 0;
  font: 700 clamp(34px, 11vw, 52px)/1 var(--display);
  letter-spacing: .04em;
  max-width: 100%;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fffbe6, var(--gold) 50%, #c98c22);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(243, 197, 91, .45));
  animation: stamp .5s var(--ease) both;
}

.banner.is-defeat::before { background: repeating-conic-gradient(rgba(212, 63, 58, .14) 0 8deg, transparent 8deg 20deg); }

.banner.is-defeat .banner-word {
  background: linear-gradient(180deg, #e7e9f0, #8f97ad 60%, #5c6378);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 10px rgba(212, 63, 58, .5));
}

.banner-line { margin: 0; font: 500 18px/1.3 var(--display); }

.banner .hex { margin-bottom: 4px; }

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes stamp {
  from { opacity: 0; transform: scale(1.6); }
}

/* Короткий итог одного вопроса. */
.verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid var(--correct);
  background: rgba(35, 178, 107, .14);
  animation: rise .3s var(--ease) both;
}

.verdict.is-no { border-left-color: var(--wrong); background: rgba(212, 63, 58, .14); }

.verdict-word { margin: 0; font: 600 20px/1.1 var(--display); }
.verdict-text { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Загадка: силуэт, картинка, аудио ---------- */

.mystery {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 16px;
  text-align: center;
}

.mystery .hex-lg > span { font-size: 40px; color: var(--gold); }

.mystery-text { margin: 0; font: 500 17px/1.3 var(--display); }

.reveal {
  --frame-cut: 14px;
  position: relative;
  width: min(100%, 300px);
  margin: 0 auto;
  aspect-ratio: 3 / 4;
}

.reveal .frame-in {
  position: relative;
  overflow: hidden;
  display: grid;
}

.reveal img,
.reveal .placeholder-art {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-art {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(243, 197, 91, .25), transparent 45%),
    linear-gradient(180deg, #24346c, #0b1330);
  font: 700 120px/1 var(--display);
  color: rgba(243, 197, 91, .55);
}

.strips {
  grid-area: 1 / 1;
  display: grid;
  grid-template-rows: repeat(7, 1fr);
}

.strip {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 6px, transparent 6px 12px),
    #0c1530;
  border-bottom: 1px solid rgba(243, 197, 91, .14);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}

.strip.is-open { opacity: 0; transform: scaleX(.6); }

.reveal-caption { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

.player-audio {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 22px 16px;
}

.play {
  --size: 92px;
  border: 0;
  padding: 0;
}

.play[disabled] { filter: grayscale(.8) brightness(.6); cursor: default; }

.play.hex::before { background: linear-gradient(165deg, var(--panel-2), #0a1128); }

.play svg { position: relative; width: 34px; height: 34px; fill: var(--gold); }

.wave { display: flex; gap: 4px; height: 28px; align-items: center; }

.wave i {
  width: 4px;
  height: 30%;
  border-radius: 2px;
  background: var(--gold);
  opacity: .5;
}

.wave.is-on i { animation: bar .9s ease-in-out infinite; animation-delay: calc(var(--i) * 90ms); opacity: 1; }

@keyframes bar { 50% { height: 100%; } }

/* ---------- Поиск героя ---------- */

.search { position: relative; }

.search-input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 17, 40, .92);
  font-size: 16px;
  outline: none;
}

.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(243, 197, 91, .18); }

.search-icon {
  position: absolute;
  left: 14px;
  top: 15px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.2;
}

.suggest {
  margin: 6px 0 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1330;
  max-height: 260px;
  overflow-y: auto;
}

.suggest button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.suggest button:hover,
.suggest button:focus-visible { background: var(--panel-2); outline: none; }

.suggest .alt { margin-left: auto; font-size: 12px; color: var(--muted); }

/* ---------- Список попыток ---------- */

.attempts {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attempt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  border-radius: 8px;
  border-left: 3px solid var(--wrong);
  background: rgba(17, 27, 58, .9);
  animation: rise .25s var(--ease) both;
}

.attempt.is-ok { border-left-color: var(--correct); }
.attempt-name { font: 500 15px/1.2 var(--display); }
.attempt-mark { margin-left: auto; font: 600 15px/1 var(--display); }

.section-title {
  margin: 0;
  font: 500 15px/1.2 var(--display);
  color: var(--muted);
}

.note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(243, 197, 91, .08);
  font-size: 13px;
  color: var(--muted);
}

.prompt {
  margin: 0;
  text-align: center;
  font: 600 26px/1.15 var(--display);
}

.prompt-sub { margin: 4px 0 0; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- Профиль ---------- */

.form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; }

.field-label { font-size: 13px; color: var(--muted); }

.input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 17, 40, .92);
  font-size: 16px;
}

textarea.input { min-height: 88px; padding: 10px 14px; resize: vertical; }

.input:focus { outline: none; border-color: var(--gold); }

.segmented { display: flex; gap: 6px; }

.segmented button {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 17, 40, .92);
}

.segmented button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: rgba(243, 197, 91, .1); }

.form-status { margin: 0; min-height: 20px; font-size: 14px; }

/* ---------- Нижний лист ---------- */

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  background: rgba(3, 6, 16, .72);
  animation: fade .2s both;
}

.sheet {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 22px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--gold);
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, var(--panel-2), var(--bg-2));
  animation: up .3s var(--ease) both;
}

.sheet h2 { margin: 0 0 10px; font: 600 24px/1.15 var(--display); color: var(--gold); }
.sheet p { margin: 0 0 10px; }
.sheet .row, .sheet .btn-wide { margin-top: 16px; }
.sheet .row .btn { padding: 0 10px; white-space: nowrap; }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.demo-flag {
  margin: 0;
  padding: 6px 12px;
  border: 1px dashed rgba(243, 197, 91, .5);
  border-radius: 10px;
  font-size: 13px;
  color: var(--gold);
  text-align: center;
}

.error-box { display: grid; gap: 14px; justify-items: center; padding: 40px 8px; text-align: center; }
.error-box h2 { margin: 0; font: 600 24px/1.2 var(--display); }
.error-box p { margin: 0; color: var(--muted); max-width: 32ch; }

@media (max-width: 360px) {
  :root { --gutter: 12px; }
  .grid { gap: 8px; }
  .tile-name { font-size: 13px; }
  .banner-word { font-size: 42px; }
  .cell { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
