/* Шрифты лежат у нас (Google Fonts из РФ бывает медленным, а архив площадки не должен ходить на чужие CDN). Лицензия — SIL OFL. */
@font-face {
  font-family: 'Dela Gothic One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/dela-gothic-one-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Dela Gothic One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/dela-gothic-one-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/golos-text-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/golos-text-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Шлакоблокунь. Бетон, окунь и стык.
   Палитра: бетон (фон), плита (поверхности), шлак (вторичный текст),
   окунь (основное действие, верно), плавник (стык, акцент, таймер), брюшко (найденные буквы). */

:root {
  --concrete: #b9b5ab;
  --concrete-deep: #a7a398;
  --slab: #dcd9d1;
  --slab-edge: #8f8b81;
  --paper: #eeece6;
  --slag: #615d55;
  --ink: #1d2717;
  --perch: #4b6a28;
  --perch-edge: #2e4417;
  --perch-ink: #f6f8ee;
  --fin: #e4552a;
  --fin-edge: #a33613;
  --belly: #e6dc74;
  --belly-edge: #b5aa45;
  --danger: #b4321c;
  --shadow: rgba(40, 34, 24, 0.18);
  --pore: rgba(0, 0, 0, 0.09);
  --radius: 10px;
  --display: 'Dela Gothic One', 'Arial Black', 'Helvetica Neue', sans-serif;
  --text: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --concrete: #2c2b28;
    --concrete-deep: #23221f;
    --slab: #3b3a36;
    --slab-edge: #1a1917;
    --paper: #4a4944;
    --slag: #a7a297;
    --ink: #efede6;
    --perch: #7fa443;
    --perch-edge: #4b6a28;
    --perch-ink: #10160a;
    --fin: #ff6a3d;
    --fin-edge: #b8461f;
    --belly: #d6cc66;
    --belly-edge: #8f8736;
    --danger: #ff7a5c;
    --shadow: rgba(0, 0, 0, 0.45);
    --pore: rgba(255, 255, 255, 0.05);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --concrete: #2c2b28;
  --concrete-deep: #23221f;
  --slab: #3b3a36;
  --slab-edge: #1a1917;
  --paper: #4a4944;
  --slag: #a7a297;
  --ink: #efede6;
  --perch: #7fa443;
  --perch-edge: #4b6a28;
  --perch-ink: #10160a;
  --fin: #ff6a3d;
  --fin-edge: #b8461f;
  --belly: #d6cc66;
  --belly-edge: #8f8736;
  --danger: #ff7a5c;
  --shadow: rgba(0, 0, 0, 0.45);
  --pore: rgba(255, 255, 255, 0.05);
  color-scheme: dark;
}

/* ---------- основа ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--concrete);
  /* Поры бетона: шум + редкие раковины. */
  background-image:
    radial-gradient(circle at 20% 30%, var(--pore) 0 1.5px, transparent 2px),
    radial-gradient(circle at 70% 80%, var(--pore) 0 1px, transparent 1.5px),
    radial-gradient(circle at 85% 15%, var(--pore) 0 2px, transparent 2.5px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 37px 41px, 53px 47px, 71px 67px, 180px 180px;
  overscroll-behavior-y: none;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

p {
  margin: 0;
}

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

.small {
  font-size: 14px;
}

.num {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- каркас ---------- */

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 16px calc(84px + env(safe-area-inset-bottom));
  gap: 18px;
}

.screen--game {
  height: 100dvh;
  min-height: 0;
  padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
  gap: 8px;
  overflow: hidden;
}

.screen--center {
  justify-content: center;
  text-align: center;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.topbar__title {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iconbtn {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.iconbtn:active {
  background: var(--concrete-deep);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--slab);
  box-shadow: 0 2px 0 var(--slab-edge);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--concrete) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--concrete-deep);
}

.tabbar__inner {
  display: flex;
  width: 100%;
  max-width: 520px;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--slag);
  border-radius: 8px;
}

.tab__icon {
  font-size: 20px;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.7;
}

.tab[aria-current='page'] {
  color: var(--ink);
}

.tab[aria-current='page'] .tab__icon {
  filter: none;
  opacity: 1;
}

/* ---------- кнопки-плиты ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  background: var(--slab);
  box-shadow: 0 4px 0 var(--slab-edge);
  transition: transform 0.06s, box-shadow 0.06s;
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--slab-edge);
}

.btn--primary {
  background: var(--perch);
  color: var(--perch-ink);
  box-shadow: 0 4px 0 var(--perch-edge);
}

.btn--primary:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--perch-edge);
}

.btn--fin {
  background: var(--fin);
  color: #fff;
  box-shadow: 0 4px 0 var(--fin-edge);
}

.btn--fin:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--fin-edge);
}

.btn--ghost {
  background: transparent;
  box-shadow: none;
  border: 2px solid var(--slab-edge);
}

.btn--small {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 14px;
  box-shadow: 0 3px 0 var(--slab-edge);
}

.btn--block {
  display: flex;
  width: 100%;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row > .btn {
  flex: 1;
}

/* Режимы игры на главной: плиты разного веса. */
.slab {
  position: relative;
  display: block;
  text-align: left;
  text-decoration: none;
  border-radius: 12px;
  padding: 16px 18px 18px;
  background: var(--slab);
  box-shadow: 0 5px 0 var(--slab-edge), 0 10px 18px var(--shadow);
  transition: transform 0.06s, box-shadow 0.06s;
}

.slab:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--slab-edge), 0 3px 6px var(--shadow);
}

.slab__title {
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.15;
}

.slab__text {
  margin-top: 4px;
  font-size: 14px;
  color: var(--slag);
}

.slab__icon {
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 26px;
}

.slab--daily {
  background: var(--perch);
  color: var(--perch-ink);
  box-shadow: 0 6px 0 var(--perch-edge), 0 12px 22px var(--shadow);
  padding: 20px 20px 22px;
}

.slab--daily .slab__title {
  font-size: 26px;
}

.slab--daily .slab__text {
  color: color-mix(in srgb, var(--perch-ink) 80%, transparent);
}

.slab--daily:active {
  box-shadow: 0 2px 0 var(--perch-edge), 0 4px 8px var(--shadow);
}

.slab__status {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--perch-ink) 16%, transparent);
  font-size: 14px;
  font-weight: 600;
}

.slabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.slabs .slab {
  min-height: 112px;
}

.slabs .slab__icon {
  position: static;
  display: block;
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1;
}

/* ---------- логотип-схема ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.logo {
  --t: min(36px, calc((min(100vw, 520px) - 32px - 22px) / 12));
  display: grid;
  grid-template-columns: repeat(12, var(--t));
  grid-template-rows: var(--t) var(--t);
  gap: 2px;
  cursor: pointer;
}

.logo .tile {
  width: var(--t);
  height: var(--t);
  font-size: calc(var(--t) * 0.56);
  border-radius: 3px;
}

.logo__row2 {
  grid-row: 2;
  transition: transform 0.55s cubic-bezier(0.5, 0, 0.2, 1.3);
}

.logo {
  transition: margin-bottom 0.55s cubic-bezier(0.5, 0, 0.2, 1);
}

.logo.is-merged {
  margin-bottom: calc(-1 * var(--t) + 4px);
}

.logo.is-merged .logo__row2 {
  transform: translateY(calc(-1 * (var(--t) + 2px)));
}

.logo .logo__seam {
  transition: background-color 0.2s 0.45s, color 0.2s 0.45s;
}

.logo.is-merged .logo__seam {
  background: var(--fin);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--fin-edge);
}

.logo.is-merged .logo__seam::before,
.logo.is-merged .logo__seam::after {
  opacity: 0;
}

.hero__formula {
  font-size: 15px;
  color: var(--slag);
  text-align: center;
}

.hero__formula b {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- плитка-шлакоблок с буквой ---------- */

.board {
  --gap: 3px;
  --tile: min(40px, calc((min(100vw, 520px) - 24px - (var(--n) - 1) * var(--gap)) / var(--n)));
  display: flex;
  justify-content: center;
  gap: var(--gap);
  min-height: var(--tile);
  flex: none;
}

.tile {
  position: relative;
  flex: none;
  width: var(--tile, 40px);
  height: calc(var(--tile, 40px) * 1.12);
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--paper);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  font-family: var(--display);
  font-size: calc(var(--tile, 40px) * 0.56);
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  user-select: none;
}

/* Две пустоты шлакоблока: видны, пока в плитке нет буквы. */
.tile::before,
.tile::after {
  content: '';
  position: absolute;
  top: 24%;
  bottom: 28%;
  width: 26%;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.12);
  transition: opacity 0.12s;
}

.tile::before {
  left: 15%;
}

.tile::after {
  right: 15%;
}

.tile__ch {
  position: relative;
  z-index: 1;
}

.tile--typed::before,
.tile--typed::after,
.tile--ghost::before,
.tile--ghost::after,
.tile--reveal::before,
.tile--reveal::after {
  opacity: 0;
}

.tile--ghost {
  color: color-mix(in srgb, var(--ink) 38%, transparent);
  background: color-mix(in srgb, var(--belly) 45%, var(--paper));
}

.tile--hit {
  background: var(--belly);
  box-shadow: inset 0 -3px 0 var(--belly-edge);
}

.tile--cursor {
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16), 0 0 0 2px var(--slag);
}

.tile--over {
  background: color-mix(in srgb, var(--danger) 22%, var(--paper));
}

.tile--pop {
  animation: pop 0.12s ease-out;
}

.tile--reveal {
  animation: flip 0.42s ease both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.tile--win {
  background: var(--perch);
  color: var(--perch-ink);
  box-shadow: inset 0 -3px 0 var(--perch-edge);
}

.tile--lose {
  background: var(--slag);
  color: var(--paper);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}

.tile--seam {
  background: var(--fin);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--fin-edge);
}

.shake {
  animation: shake 0.36s;
}

@keyframes pop {
  50% {
    transform: scale(1.12);
  }
}

@keyframes flip {
  0% {
    transform: rotateX(0);
  }
  50% {
    transform: rotateX(90deg);
  }
  100% {
    transform: rotateX(0);
  }
}

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

/* Разбор ответа: шлакобл[ок] + [ок]унь */
.parts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 17px;
  font-weight: 600;
}

.parts mark {
  background: none;
  color: var(--fin);
  font-weight: 800;
}

.parts__plus {
  color: var(--slag);
  font-weight: 400;
}

/* ---------- игровой экран ---------- */

.hud {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  flex: none;
}

.hud__title {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud__stat {
  font-family: var(--display);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--slab);
}

.hud__combo {
  color: var(--fin);
}

.timerbar {
  height: 6px;
  border-radius: 3px;
  background: var(--concrete-deep);
  overflow: hidden;
  flex: none;
}

.timerbar__fill {
  height: 100%;
  width: 100%;
  background: var(--perch);
  transform-origin: left;
  transition: background-color 0.3s;
}

.timerbar--low .timerbar__fill {
  background: var(--fin);
}

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage__frame {
  position: relative;
  height: 100%;
  max-height: 440px;
  aspect-ratio: 1;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 6px 0 var(--slab-edge), 0 14px 26px var(--shadow);
}

.stage__frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage__badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.stage__share {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 18px;
}

.gain {
  position: absolute;
  left: 50%;
  top: 46%;
  translate: -50% -50%;
  font-family: var(--display);
  font-size: 44px;
  color: #fff;
  text-shadow: 0 3px 0 var(--perch-edge), 0 0 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: gain 1.1s ease-out forwards;
}

@keyframes gain {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  20% {
    opacity: 1;
    transform: scale(1.08);
  }
  70% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px);
  }
}

.feedback {
  min-height: 24px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  flex: none;
}

.feedback--good {
  color: var(--perch);
}

.feedback--warm {
  color: var(--fin);
}

.feedback--bad {
  color: var(--slag);
}

.actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex: none;
}

.actions .btn {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 14px;
  box-shadow: 0 3px 0 var(--slab-edge);
}

.actions .btn--primary {
  box-shadow: 0 3px 0 var(--perch-edge);
}

.done-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* ---------- экранная клавиатура ---------- */

.kb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
  user-select: none;
}

.kb__row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.key {
  flex: 1 1 0;
  max-width: 42px;
  height: 48px;
  border-radius: 6px;
  background: var(--slab);
  box-shadow: 0 2px 0 var(--slab-edge);
  font-weight: 600;
  font-size: 18px;
  text-transform: uppercase;
  display: grid;
  place-items: center;
}

.key--wide {
  flex: 1.6 1 0;
  max-width: 64px;
  font-size: 13px;
  text-transform: none;
}

.key--enter {
  background: var(--perch);
  color: var(--perch-ink);
  box-shadow: 0 2px 0 var(--perch-edge);
}

.key--down,
.key:active {
  transform: translateY(2px);
  box-shadow: none;
}

@media (max-height: 640px) {
  .key {
    height: 40px;
  }
  .kb {
    gap: 4px;
  }
}

/* ---------- итоги ---------- */

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.bigscore {
  font-family: var(--display);
  font-size: 56px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.grid-emoji {
  font-size: 30px;
  letter-spacing: 4px;
}

.statline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--slab);
  font-weight: 600;
  font-size: 14px;
}

.badge--fin {
  background: var(--fin);
  color: #fff;
}

.answers {
  width: 100%;
  display: grid;
  gap: 8px;
  text-align: left;
}

.answer-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--slab) 70%, transparent);
}

.answer-row img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.answer-row__word {
  font-weight: 700;
}

.answer-row__parts {
  font-size: 13px;
  color: var(--slag);
}

.countdown {
  font-family: var(--display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

/* ---------- списки ---------- */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--concrete-deep);
}

.tabs button {
  flex: 1;
  padding: 8px 6px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 14px;
  color: var(--slag);
}

.tabs button[aria-selected='true'] {
  background: var(--slab);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--slab-edge);
}

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

.board-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--slab) 75%, transparent);
}

.board-list li.is-me {
  background: var(--belly);
  color: #1d2717;
}

.board-list__rank {
  font-family: var(--display);
  color: var(--slag);
  text-align: center;
}

.board-list li:nth-child(-n + 3) .board-list__rank {
  color: var(--fin);
}

.board-list__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.board-list__value {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--slag);
  border: 2px dashed var(--slab-edge);
  border-radius: 12px;
}

/* ---------- профиль и коллекция ---------- */

.card {
  padding: 16px;
  border-radius: 12px;
  background: var(--slab);
  box-shadow: 0 4px 0 var(--slab-edge);
}

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

.league__icon {
  font-size: 44px;
  line-height: 1;
}

.progress {
  height: 10px;
  border-radius: 5px;
  background: var(--concrete-deep);
  overflow: hidden;
  margin-top: 8px;
}

.progress__fill {
  height: 100%;
  background: var(--fin);
  border-radius: 5px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat {
  padding: 12px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--slab) 75%, transparent);
}

.stat__value {
  font-family: var(--display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-size: 13px;
  color: var(--slag);
}

.dex {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.dex__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--slab) 75%, transparent);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  word-break: break-word;
}

.dex__item img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.dex__locked {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--concrete-deep);
  font-family: var(--display);
  font-size: 28px;
  color: var(--slag);
}

.dots {
  color: var(--fin);
  letter-spacing: 2px;
}

/* ---------- формы ---------- */

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

.field label {
  font-weight: 600;
  font-size: 14px;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--slab-edge);
  background: var(--paper);
  font-size: 18px;
}

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

.wordrow {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.wordrow .field {
  flex: 1;
}

/* ---------- обучение ---------- */

.lesson {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--slab) 60%, transparent);
}

.lesson__title {
  margin: 0;
  font-size: 17px;
}

.lesson__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.lesson .parts {
  justify-content: flex-start;
  font-size: 16px;
}

.btn--pulse {
  animation: pulse 1.2s ease-in-out infinite;
  border-color: var(--fin);
}

@keyframes pulse {
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--fin) 30%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn--pulse {
    animation: none;
    outline: 3px solid var(--fin);
  }
}

/* ---------- комната ---------- */

.roomcode {
  display: flex;
  justify-content: center;
  gap: 6px;
  --tile: 52px;
}

.roomcode .tile {
  font-size: 28px;
}

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

.players li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--slab) 75%, transparent);
}

.players__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.players li.is-off {
  opacity: 0.5;
}

.strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: none;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.strip::-webkit-scrollbar {
  display: none;
}

.strip__p {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--slab);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.strip__p.is-solved {
  background: var(--perch);
  color: var(--perch-ink);
}

.strip__p.is-me {
  outline: 2px solid var(--fin);
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--concrete-deep);
}

.segmented button {
  flex: 1;
  padding: 6px 4px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 14px;
  color: var(--slag);
}

.segmented button[aria-pressed='true'] {
  background: var(--slab);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--slab-edge);
}

.bigcount {
  font-family: var(--display);
  font-size: 120px;
  line-height: 1;
  color: var(--fin);
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}

.podium__step {
  width: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

.podium__block {
  width: 100%;
  display: grid;
  place-items: center;
  border-radius: 8px 8px 0 0;
  background: var(--slab);
  box-shadow: inset 0 -4px 0 var(--slab-edge);
  font-family: var(--display);
  font-size: 28px;
}

.podium__step:nth-child(2) .podium__block {
  height: 110px;
  background: var(--fin);
  color: #fff;
  box-shadow: inset 0 -4px 0 var(--fin-edge);
}

.podium__step:nth-child(1) .podium__block {
  height: 80px;
}

.podium__step:nth-child(3) .podium__block {
  height: 60px;
}

.podium__name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delta-up {
  color: var(--perch);
  font-weight: 700;
}

.delta-down {
  color: var(--danger);
  font-weight: 700;
}

.feedline {
  min-height: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--slag);
  flex: none;
}

/* ---------- всплывашка ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 14px;
  translate: -50% 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, translate 0.2s;
}

.toast.is-on {
  opacity: 1;
  translate: -50% 0;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 40px auto;
  border-radius: 6px;
  background: var(--slab);
  animation: spin 0.9s cubic-bezier(0.6, 0, 0.4, 1) infinite;
  box-shadow: 0 3px 0 var(--slab-edge);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
