/*
 * Шашки — вид игры. Общий игровой язык (фон, кнопки, меню, окно) — в kit/kit.css,
 * сетевой экран (режимы, комната, таблички, реакции) — в kit/lobby.css.
 * Здесь своё: тёплый оттенок, деревянная доска, объёмные шашки, корона дамки, лотки побитых,
 * подсказки хода, значок в меню, лист правил, медаль в окне итога.
 */

/* ---------- Оттенок: янтарь и дерево ---------- */

:root {
  --bg-top: #f7a21b; /* повторён в <meta name="theme-color"> */
  --bg-mid: #ec671b;
  --bg-bottom: #9a2a1c;
  --glow-a: rgba(255, 238, 132, 0.6);
  --glow-b: rgba(255, 66, 112, 0.42);
  --frame: #dc8d3b;
  --frame-lip: #6a2a10;
  --pit: #3b1a0c;
  --shade-rgb: 74, 20, 4;
  --deep-rgb: 104, 34, 10;
  --title-hi: #fff0cf;

  /* Белая (слоновая кость) шашка. */
  --iv: #f8e6bf;
  --iv-hi: #fffdf3;
  --iv-lo: #e2c286;
  --iv-side: #c2924f;
  --iv-side2: #94672f;
  --iv-groove: rgba(146, 98, 38, 0.6);
  --iv-ridge: rgba(255, 255, 255, 0.85);
  /* Красная шашка. */
  --rd: #dc323c;
  --rd-hi: #ff8572;
  --rd-lo: #a5172a;
  --rd-side: #7e1021;
  --rd-side2: #560815;
  --rd-groove: rgba(84, 0, 14, 0.62);
  --rd-ridge: rgba(255, 150, 140, 0.6);
  /* Клетки. */
  --sq-l: #fbe6b8;
  --sq-l2: #efce94;
  --sq-d: #7d4525;
  --sq-d2: #5a2b13;
}

/* ---------- Шашка ---------- */
/*
 * Размер шашки — её font-size (1em = диаметр). Свет сверху слева: блик на верхней грани,
 * кольцевая канавка, тёмная боковая кромка снизу, мягкая тень под ней.
 */

.chip {
  position: relative;
  flex: none;
  display: block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background:
    radial-gradient(60% 46% at 32% 22%, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(158deg, var(--ch-hi) 0%, var(--ch) 46%, var(--ch-lo) 100%);
  box-shadow:
    inset 0 0.03em 0 rgba(255, 255, 255, 0.72),
    inset 0 -0.035em 0.02em var(--ch-groove),
    0 0.1em 0 var(--ch-side),
    0 0.135em 0 var(--ch-side2),
    0 0.22em 0.12em rgba(46, 10, 0, 0.5);
}

.chip.iv {
  --ch: var(--iv);
  --ch-hi: var(--iv-hi);
  --ch-lo: var(--iv-lo);
  --ch-side: var(--iv-side);
  --ch-side2: var(--iv-side2);
  --ch-groove: var(--iv-groove);
  --ch-ridge: var(--iv-ridge);
}

.chip.rd {
  --ch: var(--rd);
  --ch-hi: var(--rd-hi);
  --ch-lo: var(--rd-lo);
  --ch-side: var(--rd-side);
  --ch-side2: var(--rd-side2);
  --ch-groove: var(--rd-groove);
  --ch-ridge: var(--rd-ridge);
}

/* Кольцевая канавка и углубление в середине. */
.chip::before,
.chip::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.chip::before {
  top: 0.13em;
  right: 0.13em;
  bottom: 0.13em;
  left: 0.13em;
  box-shadow:
    inset 0 0.035em 0.03em var(--ch-groove),
    inset 0 -0.02em 0.01em var(--ch-ridge),
    0 0.02em 0 var(--ch-ridge);
}

.chip::after {
  top: 0.27em;
  right: 0.27em;
  bottom: 0.27em;
  left: 0.27em;
  background: linear-gradient(160deg, var(--ch-lo) 0%, var(--ch) 60%, var(--ch-hi) 100%);
  box-shadow:
    inset 0 0.035em 0.035em var(--ch-groove),
    0 0.02em 0 var(--ch-ridge);
}

/* Дамка — две шашки стопкой: кромка вдвое выше, наверху золотая корона. */
.chip.king {
  box-shadow:
    inset 0 0.03em 0 rgba(255, 255, 255, 0.72),
    inset 0 -0.035em 0.02em var(--ch-groove),
    0 0.085em 0 var(--ch-side),
    0 0.105em 0 var(--ch-side2),
    0 0.12em 0 var(--ch-lo),
    0 0.2em 0 var(--ch-side),
    0 0.235em 0 var(--ch-side2),
    0 0.32em 0.13em rgba(46, 10, 0, 0.5);
  transform: translateY(-0.085em);
}

.chip.king::after {
  top: 0.13em;
  right: 0.13em;
  bottom: 0.13em;
  left: 0.13em;
  background: radial-gradient(circle at 50% 40%, var(--ch) 0%, var(--ch-lo) 100%);
}

/* Золотое кольцо по краю верхней грани: дамку видно издалека и без короны. */
.chip.king::before {
  top: 0.035em;
  right: 0.035em;
  bottom: 0.035em;
  left: 0.035em;
  box-shadow:
    inset 0 0 0 0.05em #f2b632,
    inset 0 0.02em 0 0.05em rgba(255, 244, 190, 0.55),
    inset 0 0 0 0.075em rgba(122, 60, 2, 0.5);
}

/* Корона занимает почти всю верхнюю грань (около двух третей диаметра). */
.crown {
  position: absolute;
  z-index: 1;
  top: 0.085em;
  left: 0.09em;
  width: 0.82em;
  height: 0.82em;
  display: none;
  overflow: visible;
  filter: drop-shadow(0 0.02em 0.015em rgba(70, 20, 0, 0.55));
}

.chip.king .crown {
  display: block;
}

.cr-lip {
  fill: #a45a06;
  stroke: #5e2c00;
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.cr-body {
  fill: #ffcf33;
  stroke: #5e2c00;
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.cr-shine {
  fill: none;
  stroke: #fff6c4;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.cr-gem {
  fill: #e8343f;
  stroke: #8a1020;
  stroke-width: 1;
}

.chip.rd .cr-gem {
  fill: #fff3d2;
  stroke: #a06a1c;
}

/* Полоса света, пробегающая по шашке (появление дамки). */
.shine {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  border-radius: 50%;
  pointer-events: none;
}

.shine::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -70%;
  width: 46%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
}

@keyframes ck-sweep {
  to { transform: translateX(440%) skewX(-18deg); }
}

/* ---------- Фон: плывущие шашки ---------- */

.sky i {
  opacity: 0.3;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 5px 0 var(--k-side),
    0 9px 8px rgba(var(--shade-rgb), 0.35);
}

.sky i.iv {
  --k-side: #b98b4c;
  background:
    radial-gradient(60% 46% at 32% 22%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(158deg, var(--iv-hi), var(--iv) 46%, var(--iv-lo));
}

.sky i.rd {
  --k-side: #7e1021;
  background:
    radial-gradient(60% 46% at 32% 22%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(158deg, var(--rd-hi), var(--rd) 46%, var(--rd-lo));
}

.sky i::after {
  content: "";
  position: absolute;
  top: 20%;
  right: 20%;
  bottom: 20%;
  left: 20%;
  border-radius: 50%;
  box-shadow: inset 0 2px 2px rgba(60, 20, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.5);
}

body:not(.in-menu) .sky {
  opacity: 0.5;
}

/* ---------- Значок в меню ---------- */
/* Кусочек доски и две шашки на нём: белая простая и красная дамка. Каждая покачивается сама. */

.logo {
  position: relative;
  display: block;
  width: 150px;
  height: 118px;
  transform: none;
  animation: none;
}

.lg-plate {
  position: absolute;
  left: 23px;
  top: 14px;
  display: grid;
  grid-template-columns: repeat(2, 48px);
  grid-auto-rows: 48px;
  padding: 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f0a850 0%, #cf7d2c 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 240, 200, 0.6),
    0 7px 0 #6a2a10,
    0 16px 20px rgba(var(--shade-rgb), 0.45);
  transform: rotate(-8deg);
  animation: lg-plate 3.4s ease-in-out infinite alternate, k-pop-in 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.lg-plate i {
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 0 rgba(40, 10, 0, 0.2);
}

.lg-plate i.l { background: linear-gradient(150deg, var(--sq-l), var(--sq-l2)); }
.lg-plate i.d { background: linear-gradient(150deg, var(--sq-d), var(--sq-d2)); }
.lg-plate i:nth-child(1) { border-radius: 12px 0 0 0; }
.lg-plate i:nth-child(2) { border-radius: 0 12px 0 0; }
.lg-plate i:nth-child(3) { border-radius: 0 0 0 12px; }
.lg-plate i:nth-child(4) { border-radius: 0 0 12px 0; }

@keyframes lg-plate {
  from { transform: rotate(-9deg) translateY(-2px); }
  to { transform: rotate(-6deg) translateY(3px); }
}

.lg-pc {
  position: absolute;
  font-size: 62px;
}

.lg-a {
  left: 6px;
  top: 50px;
  animation: lg-bob-a 2.3s ease-in-out infinite alternate, k-pop-in 0.5s 0.12s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}

.lg-b {
  left: 80px;
  top: 4px;
  animation: lg-bob-b 2.7s ease-in-out infinite alternate, k-pop-in 0.5s 0.22s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}

@keyframes lg-bob-a {
  from { transform: translateY(-3px) rotate(-5deg); }
  to { transform: translateY(5px) rotate(-2deg); }
}

@keyframes lg-bob-b {
  from { transform: translateY(4px) rotate(6deg); }
  to { transform: translateY(-5px) rotate(3deg); }
}

.lg-b .shine::before {
  animation: ck-glint 4.2s 0.8s ease-in-out infinite;
}

/* Набор красит любые <i> внутри .logo как плитки — у шашек и искр своё оформление. */
.logo .shine {
  border-radius: 50%;
  background: none;
  box-shadow: none;
  animation: none;
}

/* Искры у короны. */
.logo .lg-spark {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: #fff6c0;
  box-shadow: none;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: lg-spark 2.2s ease-in-out infinite;
}

.logo .lg-spark.s1 { left: 138px; top: 0; width: 14px; height: 14px; }
.logo .lg-spark.s2 { left: 72px; top: -8px; width: 10px; height: 10px; animation-delay: 0.7s; }
.logo .lg-spark.s3 { left: 144px; top: 54px; width: 9px; height: 9px; animation-delay: 1.3s; }

@keyframes lg-spark {
  0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1) rotate(45deg); opacity: 1; }
}

/* ---------- Меню ---------- */

.menu-actions {
  gap: 14px;
  margin-top: 26px;
}

.menu-best {
  margin-top: 16px;
}

/* Кнопка правил — под кнопкой языка. */
.menu-help {
  position: absolute;
  top: calc(max(14px, env(safe-area-inset-top)) + 46px);
  right: 16px;
  width: 52px;
  height: 44px;
  padding: 11px 15px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.3), 0 3px 0 rgba(var(--deep-rgb), 0.45);
  color: #fff;
}

.menu-help:active {
  transform: translateY(3px);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.3);
}

.menu-help .ico {
  width: 22px;
  height: 22px;
}

/* «Продолжить партию»: кремовая кнопка-шашка под названием. */
.ck-resume {
  flex: none;
  min-height: 46px;
  margin-top: 14px;
  padding: 0 22px 3px 16px;
  gap: 9px;
  border-radius: 23px;
  background: linear-gradient(180deg, #fffaf0 0%, #f6dfae 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    0 4px 0 #b98a45,
    0 9px 12px rgba(var(--shade-rgb), 0.35);
  color: #6a2a10;
  font-size: 17px;
  font-weight: 900;
  animation: k-pop-in 0.45s 0.2s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.ck-resume[hidden] {
  display: none;
}

.ck-resume:active {
  transform: translateY(4px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), 0 0 0 #b98a45;
}

.ck-resume .ico {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--rd-hi), var(--rd) 50%, var(--rd-lo));
  box-shadow: 0 2px 0 var(--rd-side2);
  color: #fff;
  box-sizing: content-box;
}

.menu.has-resume .menu-actions {
  margin-top: 16px;
}

@media (max-height: 620px) {
  /* Низкий экран: строка побед уступает место кнопке «Продолжить». */
  .menu.has-resume .menu-best {
    display: none;
  }

  .ck-resume {
    min-height: 44px;
    margin-top: 8px;
    font-size: 16px;
  }

  .menu.has-resume .menu-actions {
    margin-top: 10px;
  }

  .logo {
    width: 122px;
    height: 92px;
  }

  .lg-plate {
    left: 20px;
    top: 10px;
    grid-template-columns: repeat(2, 37px);
    grid-auto-rows: 37px;
    border-radius: 13px;
  }

  .lg-pc { font-size: 49px; }
  .lg-a { left: 5px; top: 39px; }
  .lg-b { left: 66px; top: 3px; }
  .logo .lg-spark.s1 { left: 112px; }
  .logo .lg-spark.s2 { left: 60px; }
  .logo .lg-spark.s3 { left: 116px; top: 40px; }

  .title {
    margin-top: 12px;
    font-size: min(50px, 15vw);
  }

  .menu-best {
    height: 28px;
    margin-top: 8px;
    font-size: 15px;
  }

  .menu-actions {
    gap: 10px;
    margin-top: 14px;
  }
}

/* ---------- Значок места в табличке игрока ---------- */

.lob-mark.seat-chip {
  font-size: 28px;
  padding-bottom: 4px;
}

/* ---------- Лотки побитых шашек ---------- */
/* Под табличкой игрока — двенадцать утопленных гнёзд; побитые шашки соперника ложатся в них по одной. */

.trays {
  flex: none;
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: var(--col, 460px);
  height: 20px;
  margin-top: -4px;
}

.tray {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 100%;
  padding: 0 4px 0 7px;
}

.tray-row {
  --slot: min(13px, calc((100% - 22px) / 12));
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.slot {
  position: relative;
  flex: none;
  width: var(--slot);
  height: 0;
  padding-top: var(--slot);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, rgba(var(--shade-rgb), 0.62), rgba(var(--shade-rgb), 0.3));
  box-shadow: inset 0 1.5px 2px rgba(40, 8, 0, 0.55), 0 1px 0 rgba(255, 236, 190, 0.28);
}

.mini {
  position: absolute;
  top: -1.5px;
  right: -1px;
  bottom: 1px;
  left: -1px;
  border-radius: 50%;
}

.mini.iv {
  background: linear-gradient(158deg, var(--iv-hi), var(--iv) 50%, var(--iv-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 0 var(--iv-side2), 0 3px 2px rgba(46, 10, 0, 0.45);
}

.mini.rd {
  background: linear-gradient(158deg, var(--rd-hi), var(--rd) 50%, var(--rd-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 var(--rd-side2), 0 3px 2px rgba(46, 10, 0, 0.45);
}

.mini.in {
  animation: ck-mini 0.38s cubic-bezier(0.3, 1.8, 0.5, 1) both;
}

@keyframes ck-mini {
  from { transform: translateY(12px) scale(0); }
}

/* Число побитых — только с первой побитой шашки. */
.tray-n {
  flex: none;
  min-width: 15px;
  font-size: 15px;
  font-weight: 900;
  line-height: 20px;
  color: #fff;
  text-align: right;
  text-shadow: 0 2px 0 rgba(var(--shade-rgb), 0.7);
  font-variant-numeric: tabular-nums;
}

/*
 * Высокий экран: лоток в два ряда по шесть крупных гнёзд, число рядом — свободное место занято делом.
 */
@media (min-height: 800px) and (max-width: 560px) {
  .trays {
    height: 44px;
    margin-top: -2px;
  }

  .tray {
    gap: 8px;
    padding: 0 6px 0 9px;
  }

  .tray-row {
    --slot: 18px;
    flex: none;
    flex-wrap: wrap;
    gap: 4px 3px;
    width: 123px;
  }

  .mini {
    top: -2px;
    bottom: 1.5px;
  }

  .mini.iv {
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.8), 0 2.5px 0 var(--iv-side2), 0 4px 3px rgba(46, 10, 0, 0.45);
  }

  .mini.rd {
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.5), 0 2.5px 0 var(--rd-side2), 0 4px 3px rgba(46, 10, 0, 0.45);
  }

  .tray-n {
    flex: 1 1 0;
    font-size: 24px;
    line-height: 44px;
    text-align: center;
  }
}

/*
 * Низкий экран: отдельной строки под лотки нет — счётчик висит на нижнем крае таблички игрока
 * (как ярлык часов на верхнем): одна шашка и число; пока никто не побит, его нет вовсе.
 * Поле от этого на три клеточных пикселя крупнее.
 */
@media (max-height: 620px) {
  .trays {
    position: relative;
    z-index: 3;
    height: 0;
    margin-top: calc(var(--stack) * -1);
  }

  .tray {
    position: absolute;
    top: -10px;
    right: 9px;
    flex: none;
    gap: 3px;
    width: auto;
    height: 17px;
    padding: 0 6px 0 4px;
    border-radius: 9px;
    background: rgb(var(--shade-rgb));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 0 rgba(var(--shade-rgb), 0.5);
  }

  #tray0 {
    right: calc(50% + 13px);
  }

  .tray:not(.some) {
    display: none;
  }

  .tray-row {
    --slot: 11px;
    flex: none;
  }

  .slot {
    background: none;
    box-shadow: none;
  }

  .slot:not(:first-child) {
    display: none;
  }

  .mini {
    top: -1px;
    right: 0;
    bottom: 1px;
    left: 0;
  }

  .tray-n {
    min-width: 0;
    font-size: 12px;
    line-height: 17px;
    text-shadow: none;
  }
}

/* ---------- Доска ---------- */
/* Толстая деревянная рама с латунными гвоздиками; внутри — утопленное поле 8×8. */

.well {
  --well-pad: 12px;
  --shard: calc(var(--cell, 40px) * 0.3);
  border-radius: 22px;
  background:
    repeating-linear-gradient(94deg, rgba(120, 48, 0, 0.1) 0 1px, rgba(120, 48, 0, 0) 1px 4px, rgba(255, 236, 190, 0.08) 4px 5px, rgba(120, 48, 0, 0) 5px 9px),
    linear-gradient(180deg, #f3ad53 0%, #dc8a35 46%, #bf6b22 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 240, 200, 0.7),
    inset 0 -3px 0 rgba(100, 40, 6, 0.3),
    0 9px 0 0 var(--frame-lip),
    0 20px 30px rgba(var(--shade-rgb), 0.5);
}

.well::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 11px 11px, #fff3bd 0 1px, #e2ab3c 1.4px 2.4px, rgba(96, 40, 0, 0.55) 2.8px 3.4px, rgba(96, 40, 0, 0) 3.8px),
    radial-gradient(circle at calc(100% - 11px) 11px, #fff3bd 0 1px, #e2ab3c 1.4px 2.4px, rgba(96, 40, 0, 0.55) 2.8px 3.4px, rgba(96, 40, 0, 0) 3.8px),
    radial-gradient(circle at 11px calc(100% - 11px), #fff3bd 0 1px, #e2ab3c 1.4px 2.4px, rgba(96, 40, 0, 0.55) 2.8px 3.4px, rgba(96, 40, 0, 0) 3.8px),
    radial-gradient(circle at calc(100% - 11px) calc(100% - 11px), #fff3bd 0 1px, #e2ab3c 1.4px 2.4px, rgba(96, 40, 0, 0.55) 2.8px 3.4px, rgba(96, 40, 0, 0) 3.8px);
}

.board {
  width: calc(var(--cell, 40px) * 8);
  height: calc(var(--cell, 40px) * 8);
  border-radius: 7px;
  box-shadow:
    0 0 0 3px #47200c,
    0 1px 0 4px rgba(255, 226, 170, 0.5),
    0 -1px 0 4px rgba(90, 36, 6, 0.45);
  outline: none;
}

/* Фокус с клавиатуры: белое кольцо вокруг поля. */
.board:focus-visible {
  box-shadow:
    0 0 0 3px #47200c,
    0 0 0 6px #fff,
    0 0 12px 6px rgba(255, 255, 255, 0.45);
}

.board.kb:focus {
  box-shadow:
    0 0 0 3px #47200c,
    0 0 0 6px #fff,
    0 0 12px 6px rgba(255, 255, 255, 0.45);
}

.sqs {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  overflow: hidden;
  border-radius: 6px;
}

/* Древесные волокна поверх всех клеток — доска из одного куска. */
.sqs::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: repeating-linear-gradient(97deg, rgba(120, 60, 10, 0.07) 0 1px, rgba(120, 60, 10, 0) 1px 5px, rgba(255, 255, 255, 0.05) 5px 6px, rgba(120, 60, 10, 0) 6px 11px);
  pointer-events: none;
}

/* Тень от рамы на поле: поле утоплено. */
.sqs::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  box-shadow: inset 0 5px 8px rgba(40, 10, 0, 0.5), inset 0 0 0 1px rgba(40, 10, 0, 0.35);
  pointer-events: none;
}

.sq {
  position: relative;
  display: block;
}

.sq.l {
  background: linear-gradient(150deg, var(--sq-l) 0%, var(--sq-l2) 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.5), inset 0 -1.5px 0 rgba(170, 112, 40, 0.28);
}

.sq.d {
  background: linear-gradient(150deg, var(--sq-d) 0%, var(--sq-d2) 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 200, 140, 0.16), inset 0 -1.5px 0 rgba(20, 5, 0, 0.35);
}

/* Тёмная клетка — лунка под шашку. */
.sq.d::before {
  content: "";
  position: absolute;
  top: 11%;
  right: 11%;
  bottom: 11%;
  left: 11%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(30, 8, 0, 0.42), rgba(30, 8, 0, 0.18));
  box-shadow: inset 0 2px 3px rgba(20, 4, 0, 0.55), 0 1px 0 rgba(255, 206, 150, 0.2);
}

.sq::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

/* Последний ход: откуда ушла шашка и куда пришла — светящиеся кольца в лунках. */
.sq.from::after,
.sq.to::after {
  top: 13%;
  right: 13%;
  bottom: 13%;
  left: 13%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2.5px rgba(255, 216, 96, 0.8), 0 0 9px 1px rgba(255, 200, 60, 0.45);
}

.sq.to::after {
  top: 4%;
  right: 4%;
  bottom: 4%;
  left: 4%;
  box-shadow: inset 0 0 0 3px rgba(255, 226, 120, 0.95), 0 0 12px 2px rgba(255, 204, 70, 0.6);
}

/* Куда можно пойти: светящаяся точка. */
.sq.target::after {
  top: 31%;
  right: 31%;
  bottom: 31%;
  left: 31%;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fffbd0 0%, #ffd23a 55%, #f0a000 100%);
  box-shadow: 0 0 0 3px rgba(255, 214, 70, 0.3), 0 0 14px 4px rgba(255, 204, 50, 0.75), inset 0 -2px 0 rgba(170, 96, 0, 0.4);
  animation: ck-target 0.8s ease-in-out infinite alternate;
}

.sq.target.hover::after {
  animation: none;
  transform: scale(1.55);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6), 0 0 18px 6px rgba(255, 220, 90, 0.9);
}

@keyframes ck-target {
  from { transform: scale(0.82); }
  to { transform: scale(1.12); }
}

/* Клавиатурный курсор: золотая рамка в тёмной обводке — видна и на кремовой, и на тёмной клетке, и под шашкой. */
.sq.cursor {
  z-index: 2;
  box-shadow:
    inset 0 0 0 1.5px #3b1a08,
    inset 0 0 0 4.5px #ffd23f,
    inset 0 0 0 6px #3b1a08,
    inset 0 0 10px 6px rgba(255, 210, 63, 0.45);
}

.pcs {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

/* ---------- Шашка на доске ---------- */
/* Место задают --px и --py (столбец и ряд на экране); переезд — переход transform. */

.pc {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--cell, 40px);
  height: var(--cell, 40px);
  transform: translate(calc(var(--cell, 40px) * var(--px, 0)), calc(var(--cell, 40px) * var(--py, 0)));
  transition: transform var(--ms, 200ms) cubic-bezier(0.3, 0.75, 0.3, 1);
  will-change: transform;
}

.pc.moving {
  z-index: 5;
}

.pc.sel {
  z-index: 4;
}

.pc.drag {
  z-index: 6;
  transition: none;
}

.pc-lift {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: calc(var(--cell, 40px) * 0.09);
  font-size: calc(var(--cell, 40px) * 0.8);
  transition: transform 0.14s cubic-bezier(0.3, 1.6, 0.5, 1), filter 0.14s ease-out;
}

/* Кольцо-подсветка вокруг шашки, которой можно ходить. */
.pc-glow {
  position: absolute;
  top: 1%;
  right: 1%;
  bottom: -1%;
  left: 1%;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 220, 80, 0) 72%, rgba(255, 224, 90, 0.95) 80%, rgba(255, 214, 64, 0.55) 90%, rgba(255, 214, 64, 0) 100%);
}

.pc.can .pc-glow {
  animation: ck-glow 1s ease-in-out infinite alternate;
}

@keyframes ck-glow {
  from { opacity: 0.25; transform: scale(0.96); }
  to { opacity: 0.9; transform: scale(1.03); }
}

/* Обязана бить: кольцо ярче и краснее, шашка покачивается. */
.pc.must .pc-glow {
  background: radial-gradient(closest-side, rgba(255, 120, 40, 0) 68%, #fff1a0 78%, rgba(255, 96, 40, 0.9) 90%, rgba(255, 96, 40, 0) 100%);
  animation: ck-glow-must 0.55s ease-in-out infinite alternate;
}

@keyframes ck-glow-must {
  from { opacity: 0.45; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1.09); }
}

/* Бить обязательно: остальные свои шашки уходят в тень (тёплую, а не серую). */
.pc-lift::after {
  content: "";
  position: absolute;
  top: calc(var(--cell, 40px) * 0.045);
  left: calc(50% - 0.5em);
  width: 1em;
  height: 1.15em;
  border-radius: 0.5em;
  background: rgba(86, 34, 6, 0.5);
  opacity: 0;
  transition: opacity 0.16s ease-out;
  pointer-events: none;
}

.board.forced .pc.own:not(.can) .pc-lift::after {
  opacity: 1;
}

/* Выбранная шашка приподнята, кольцо сплошное. */
.pc.sel .pc-lift {
  transform: translateY(-9%) scale(1.12);
}

.pc.sel .pc-glow {
  opacity: 1;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0) 70%, #ffffff 78%, rgba(255, 226, 96, 0.95) 88%, rgba(255, 214, 64, 0) 100%);
  animation: none;
  transform: scale(1.06);
}

.pc.drag .pc-lift {
  transform: translateY(-6%) scale(1.26);
}

.pc.drag .pc-glow {
  opacity: 0;
}

.pc.drag .chip,
.pc.sel .chip {
  box-shadow:
    inset 0 0.03em 0 rgba(255, 255, 255, 0.72),
    inset 0 -0.035em 0.02em var(--ch-groove),
    0 0.1em 0 var(--ch-side),
    0 0.135em 0 var(--ch-side2),
    0 0.36em 0.2em rgba(46, 10, 0, 0.42);
}

.pc.drag .chip.king,
.pc.sel .chip.king {
  box-shadow:
    inset 0 0.03em 0 rgba(255, 255, 255, 0.72),
    inset 0 -0.035em 0.02em var(--ch-groove),
    0 0.085em 0 var(--ch-side),
    0 0.105em 0 var(--ch-side2),
    0 0.12em 0 var(--ch-lo),
    0 0.2em 0 var(--ch-side),
    0 0.235em 0 var(--ch-side2),
    0 0.44em 0.2em rgba(46, 10, 0, 0.42);
}

/* Шашка под боем выбранной: красное кольцо. */
.pc.threat .pc-glow {
  opacity: 1;
  background: radial-gradient(closest-side, rgba(255, 60, 40, 0) 70%, rgba(255, 244, 200, 0.95) 79%, rgba(255, 48, 48, 0.95) 88%, rgba(255, 48, 48, 0) 100%);
  animation: ck-threat 0.5s ease-in-out infinite alternate;
}

@keyframes ck-threat {
  from { transform: scale(0.98); opacity: 0.6; }
  to { transform: scale(1.08); opacity: 1; }
}

/* Ход: прыжок через шашку, скольжение, посадка. */
.pc-lift.hop {
  animation: ck-hop var(--ms, 300ms) cubic-bezier(0.3, 0.6, 0.4, 1) both;
}

.pc-lift.glide {
  animation: ck-glide var(--ms, 200ms) ease-in-out both;
}

.pc-lift.land {
  animation: ck-land 0.24s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

@keyframes ck-hop {
  0% { transform: scale(1); }
  46% { transform: translateY(-16%) scale(1.34); }
  100% { transform: scale(1); }
}

@keyframes ck-glide {
  0% { transform: scale(1); }
  50% { transform: translateY(-5%) scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes ck-land {
  0% { transform: scale(1.12, 0.86); }
  55% { transform: scale(0.96, 1.05); }
  100% { transform: scale(1); }
}

/* Побита, но до конца хода остаётся на поле: придавлена и потускнела. */
.pc.struck .pc-lift {
  transform: scale(0.8);
  filter: grayscale(0.75) brightness(0.66);
  animation: ck-struck 0.3s ease-out;
}

@keyframes ck-struck {
  0% { transform: scale(1.14); filter: brightness(1.7); }
  40% { transform: scale(0.72) rotate(8deg); }
  100% { transform: scale(0.8); }
}

/* Снята с поля. */
.pc.pop .pc-lift {
  animation: ck-pop 0.28s cubic-bezier(0.4, 0, 0.8, 0.4) both;
}

@keyframes ck-pop {
  0% { transform: scale(0.8); filter: brightness(1.8); opacity: 1; }
  35% { transform: scale(1.22); opacity: 1; }
  100% { transform: scale(0.1); opacity: 0; }
}

/* Начало партии: шашки падают на доску волной. */
.pc.drop .pc-lift {
  animation: ck-drop 0.46s cubic-bezier(0.3, 1.45, 0.5, 1) both;
  animation-delay: calc(var(--i, 0) * 26ms);
}

@keyframes ck-drop {
  from { transform: translateY(-70%) scale(0.4); opacity: 0; }
  40% { opacity: 1; }
}

/* Дамка: подскок, вспышка, полоса света. */
.pc.crowned {
  z-index: 5;
}

.pc.crowned .pc-lift {
  animation: ck-crown 0.44s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.pc.crowned .chip.king .shine::before,
.pc.crowned .shine::before {
  animation: ck-sweep 0.5s 0.05s ease-out both;
}

.pc.crowned .crown {
  animation: ck-crown-in 0.4s cubic-bezier(0.3, 1.9, 0.5, 1) both;
}

@keyframes ck-crown {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: translateY(-14%) scale(1.42); filter: brightness(1.45); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes ck-crown-in {
  from { transform: scale(0) rotate(-40deg); }
}

/* Дамки на доске изредка поблёскивают. */
.pc .chip.king .shine::before {
  animation: ck-glint 5.2s ease-in-out infinite;
}

.pc.p1 .chip.king .shine::before {
  animation-delay: 2.1s;
}

@keyframes ck-glint {
  0%, 78% { transform: translateX(0) skewX(-18deg); }
  100% { transform: translateX(440%) skewX(-18deg); }
}

/* Нельзя: шашка качается. */
.pc-lift.nope {
  animation: ck-nope 0.3s ease-in-out;
}

@keyframes ck-nope {
  25% { transform: translateX(-9%); }
  55% { transform: translateX(8%); }
  80% { transform: translateX(-4%); }
}

/* «Бить нужно вот этими»: шашки подпрыгивают. */
.pc-lift.call {
  animation: ck-call 0.42s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes ck-call {
  40% { transform: translateY(-16%) scale(1.2); }
}

/* Конец партии: победители прыгают, проигравшие тускнеют. */
.pc.cheer .pc-lift {
  animation: ck-cheer 0.5s cubic-bezier(0.3, 0.6, 0.4, 1) infinite alternate;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes ck-cheer {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-16%) scale(1.08); }
}

.pc.lost .pc-lift {
  filter: grayscale(0.6) brightness(0.72);
}

/* Осколки цвета шашек и золотые искры короны. */
.shard.sh-iv { --tile: #f8e6bf; --tile-hi: #fffdf3; --tile-lo: #d9b473; border-radius: 50%; }
.shard.sh-rd { --tile: #dc323c; --tile-hi: #ff8572; --tile-lo: #a5172a; border-radius: 50%; }
.shard.sh-gold { --tile: #ffcf33; --tile-hi: #fff6c4; --tile-lo: #e08a00; }

/* ---------- Подсказки ---------- */

/* Короткая строка на верхней кромке рамы: первый ход, «нужно бить». */
.coach {
  position: absolute;
  top: -15px;
  left: 50%;
  z-index: 5;
  max-width: calc(100% - 16px);
  overflow: hidden;
  line-height: 26px;
  white-space: nowrap;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  animation: none;
  pointer-events: none;
}

.coach.in {
  animation: ck-coach 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes ck-coach {
  from { transform: translateX(-50%) scale(0.5); opacity: 0; }
}

/* Близкая ничья: тёмная плашка на нижней кромке рамы — две шашки и короткая строка. */
.drawchip {
  position: absolute;
  bottom: -14px;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 16px);
  height: 26px;
  padding: 0 12px 0 8px;
  border-radius: 13px;
  background: linear-gradient(180deg, #5a2a12, #3b1a0c);
  box-shadow: inset 0 1.5px 0 rgba(255, 220, 170, 0.28), 0 2px 0 #1f0b03, 0 5px 8px rgba(var(--shade-rgb), 0.4);
  color: #ffe9b8;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 26px;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.drawchip[hidden] {
  display: none;
}

.drawchip b {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
}

/* Значок ничьей: белая и красная шашки рядом. */
.drawchip i {
  position: relative;
  flex: none;
  width: 22px;
  height: 14px;
}

.drawchip i::before,
.drawchip i::after {
  content: "";
  position: absolute;
  top: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.drawchip i::before {
  left: 0;
  background: linear-gradient(158deg, var(--iv-hi), var(--iv) 50%, var(--iv-lo));
  box-shadow: 0 1.5px 0 var(--iv-side2);
}

.drawchip i::after {
  right: 0;
  background: linear-gradient(158deg, var(--rd-hi), var(--rd) 50%, var(--rd-lo));
  box-shadow: 0 1.5px 0 var(--rd-side2);
}

.drawchip.in {
  animation: ck-drawchip 0.36s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes ck-drawchip {
  from { transform: translateX(-50%) translateY(10px) scale(0.5); opacity: 0; }
}

/* Рука, показывающая первый ход: с шашки на клетку. */
.hand {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  width: var(--cell, 40px);
  height: var(--cell, 40px);
  pointer-events: none;
  animation: ck-hand 2.4s ease-in-out infinite;
}

.hand svg {
  position: absolute;
  top: 38%;
  left: 30%;
  width: 82%;
  height: 82%;
  overflow: visible;
  fill: #fff;
  stroke: #5a240a;
  stroke-width: 1.7;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 2px rgba(40, 10, 0, 0.45));
}

@keyframes ck-hand {
  0% { transform: translate(calc(var(--cell, 40px) * var(--hx0, 0)), calc(var(--cell, 40px) * (var(--hy0, 0) + 0.4))) scale(1); opacity: 0; }
  14% { transform: translate(calc(var(--cell, 40px) * var(--hx0, 0)), calc(var(--cell, 40px) * var(--hy0, 0))) scale(1); opacity: 1; }
  24% { transform: translate(calc(var(--cell, 40px) * var(--hx0, 0)), calc(var(--cell, 40px) * var(--hy0, 0))) scale(0.86); opacity: 1; }
  34% { transform: translate(calc(var(--cell, 40px) * var(--hx0, 0)), calc(var(--cell, 40px) * var(--hy0, 0))) scale(1); opacity: 1; }
  62% { transform: translate(calc(var(--cell, 40px) * var(--hx1, 0)), calc(var(--cell, 40px) * var(--hy1, 0))) scale(1); opacity: 1; }
  72% { transform: translate(calc(var(--cell, 40px) * var(--hx1, 0)), calc(var(--cell, 40px) * var(--hy1, 0))) scale(0.86); opacity: 1; }
  84% { transform: translate(calc(var(--cell, 40px) * var(--hx1, 0)), calc(var(--cell, 40px) * var(--hy1, 0))) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--cell, 40px) * var(--hx1, 0)), calc(var(--cell, 40px) * var(--hy1, 0))) scale(1); opacity: 0; }
}

/* ---------- Лист правил ---------- */
/* У каждого правила — картинка: кусочек доски с шашками и золотой стрелкой хода. */

.rules {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(352px, 100%);
  margin: 10px 0 14px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.rules li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 5px 12px 7px 8px;
  border-radius: 16px;
  background: rgba(var(--shade-rgb), 0.34);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.12), 0 2px 0 rgba(var(--shade-rgb), 0.3);
  font-size: 14px;
  font-weight: 700;
  line-height: 17px;
  animation: ck-rule 0.34s cubic-bezier(0.3, 1.4, 0.5, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms + 80ms);
}

@keyframes ck-rule {
  from { transform: translateY(14px) scale(0.92); opacity: 0; }
}

.r-art {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 58px;
}

.r-text {
  flex: 1 1 0;
  min-width: 0;
}

/* Мини-доска: рамка, клетки цвета настоящей доски, шашки, стрелка поверх. */
.r-board {
  position: relative;
  display: block;
  border-radius: 5px;
  box-shadow: 0 0 0 2px #c97a2c, 0 0 0 3px #6a2a10, 0 3px 0 3px rgba(40, 10, 0, 0.45);
}

.r-grid {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  overflow: hidden;
  border-radius: 4px;
}

.r-grid i.l { background: linear-gradient(150deg, var(--sq-l), var(--sq-l2)); }
.r-grid i.d { background: linear-gradient(150deg, var(--sq-d), var(--sq-d2)); }

.r-board .chip {
  position: absolute;
}

.r-board .chip.gone {
  opacity: 0.5;
  filter: grayscale(0.7);
}

.r-board .chip.ghost {
  opacity: 0.4;
}

.r-svg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}

.r-arrow .edge {
  fill: #4a1c04;
  stroke: #4a1c04;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.r-arrow path.edge {
  fill: none;
}

.r-arrow .line {
  fill: none;
  stroke: #ffd23f;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.r-arrow .tip {
  fill: #ffd23f;
  stroke: #ffd23f;
  stroke-width: 1;
  stroke-linejoin: round;
}

.r-arrow.trail {
  opacity: 0.5;
}

.r-cross {
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.r-cross.edge {
  stroke: #7e1021;
  stroke-width: 4.6;
}

.r-spark {
  fill: none;
  stroke: #ffe27a;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.r-equal circle {
  fill: #ffd23f;
  stroke: #4a1c04;
  stroke-width: 1.6;
}

.r-equal path {
  fill: none;
  stroke: #4a1c04;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.ck-rules .r-arrow:not(.trail) {
  animation: ck-arrow 1.6s ease-in-out infinite;
}

@keyframes ck-arrow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (max-height: 620px) {
  .rules {
    gap: 5px;
    margin: 8px 0 10px;
  }

  .rules li {
    min-height: 51px;
    gap: 9px;
    padding: 3px 9px 5px 6px;
    font-size: 12.5px;
    line-height: 15px;
  }

  .r-art {
    width: 64px;
    height: 44px;
  }
}

/* ---------- Окно итога: медаль и звёзды ---------- */

.ck-medal {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 78px;
  margin-bottom: 2px;
  font-size: 58px;
  animation: ck-medal 0.6s 0.1s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}

@keyframes ck-medal {
  from { transform: scale(0) rotate(-30deg); }
}

.ck-medal .chip {
  z-index: 1;
}

.ck-medal .rays {
  position: absolute;
  top: -26px;
  right: -17px;
  bottom: -26px;
  left: -17px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 226, 110, 0.6) 0deg 11deg, rgba(255, 226, 110, 0) 11deg 30deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 34%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(closest-side, #000 34%, rgba(0, 0, 0, 0) 100%);
  animation: ck-spin 12s linear infinite;
}

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

.ck-medal.win .shine::before {
  animation: ck-sweep 2.6s 0.6s ease-in-out infinite;
}

.ck-medal.lose .rays,
.ck-medal.draw .rays {
  display: none;
}

.ck-medal.lose .chip {
  filter: grayscale(0.3) brightness(0.9);
  transform: rotate(-14deg);
}

.ck-medal.draw .chip {
  font-size: 46px;
}

.ck-medal.draw .chip + .chip {
  margin-left: -0.3em;
}

.ck-medal.small {
  width: 64px;
  height: 50px;
  font-size: 38px;
}

.ck-medal.small.draw .chip {
  font-size: 32px;
}

.ck-medal.small .rays {
  top: -14px;
  right: -8px;
  bottom: -14px;
  left: -8px;
}

/* Окно итога поверх поля: медаль выступает над рамой, счёт пониже ростом — чтобы поместились звёзды. */
.over:not(.over-full) > .card > .ck-medal {
  margin-top: -40px;
}

/* Заголовок итога — главный на карточке: крупный, у победы — золотой, появляется с подпрыгиванием. */
.over.lob-result.ck-deco .card .over-title {
  font-size: 36px;
  font-weight: 900;
  line-height: 40px;
  color: #f3e3cf;
  text-shadow: 0 3px 0 rgba(var(--shade-rgb), 0.7);
  animation: ck-title 0.38s 0.16s cubic-bezier(0.3, 1.2, 0.5, 1) both;
}

.over.lob-result.ck-deco .card .over-title.wide {
  font-size: 27px;
  line-height: 32px;
}

.over.lob-result.lob-win.ck-deco .card .over-title {
  color: #ffd23f;
  text-shadow: 0 3px 0 #7a3a00, 0 7px 10px rgba(var(--shade-rgb), 0.5);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .over.lob-result.lob-win.ck-deco .card .over-title {
    padding: 0 4px 6px;
    margin-bottom: -6px;
    background: linear-gradient(180deg, #fff2a8 8%, #ffe27a 34%, #ffb81c 78%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 3px 0 #7a3a00) drop-shadow(0 6px 6px rgba(var(--shade-rgb), 0.45));
  }
}

@keyframes ck-title {
  0% { transform: scale(0.6); opacity: 0; }
  62% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Счёт побитых: значок шашки и число — сколько побил ты и сколько побили у тебя. */
.ck-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 3px;
  font-size: 30px;
  font-weight: 900;
  line-height: 34px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 0 rgba(var(--shade-rgb), 0.6);
}

.ck-score .part {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ck-score .chip {
  font-size: 24px;
  margin-top: -4px;
}

.ck-score .sep {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.ck-score.small {
  margin-top: 2px;
  font-size: 24px;
  line-height: 28px;
}

.ck-score.small .chip {
  font-size: 19px;
}

.ck-share {
  min-height: 44px;
}

.over.ck-deco:not(.over-full) .card .over-text {
  margin-top: 5px;
}

.over.ck-deco:not(.over-full) .over-actions {
  margin-top: 12px;
}

.lob-result.ck-deco .over-actions .btn-ghost {
  min-height: 44px;
}

@media (max-height: 620px) {
  .over.lob-result.ck-deco .card .over-title {
    font-size: 30px;
    line-height: 34px;
  }

  .over.lob-result.ck-deco .card .over-title.wide {
    font-size: 23px;
    line-height: 27px;
  }

  .ck-score {
    margin-top: 2px;
    font-size: 25px;
    line-height: 30px;
  }

  .ck-score .chip {
    font-size: 20px;
  }
}

.ck-stars {
  display: flex;
  gap: 5px;
  margin-bottom: 2px;
}

.ck-stars i {
  width: 26px;
  height: 26px;
  color: rgba(var(--shade-rgb), 0.5);
}

.ck-stars i .ico {
  width: 100%;
  height: 100%;
}

.ck-stars i.on {
  color: #ffd43a;
  filter: drop-shadow(0 2px 0 #b46a00);
  animation: ck-star 0.42s cubic-bezier(0.3, 1.9, 0.5, 1) both;
  animation-delay: calc(var(--i, 0) * 130ms + 380ms);
}

.ck-stars i:nth-child(2) {
  transform: translateY(-4px);
}

@keyframes ck-star {
  from { transform: scale(0) rotate(-60deg); }
}

/* ---------- Сетевой экран в цветах игры ---------- */

/* Ожидание соперника: вместо цветных плиток набора прыгают три шашки — белая, красная, белая. */
.lob-loader i,
.lob-loader i.tile {
  border-radius: 50%;
  background:
    radial-gradient(60% 46% at 32% 22%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(158deg, var(--iv-hi) 0%, var(--iv) 46%, var(--iv-lo) 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.8),
    inset 0 0 0 3.5px rgba(255, 255, 255, 0),
    0 3px 0 var(--iv-side),
    0 4px 0 var(--iv-side2),
    0 7px 5px rgba(46, 10, 0, 0.4);
}

.lob-loader i:nth-child(2),
.lob-loader i.tile:nth-child(2) {
  background:
    radial-gradient(60% 46% at 32% 22%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(158deg, var(--rd-hi) 0%, var(--rd) 46%, var(--rd-lo) 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.55),
    0 3px 0 var(--rd-side),
    0 4px 0 var(--rd-side2),
    0 7px 5px rgba(46, 10, 0, 0.4);
}

.lob-loader-small i,
.lob-loader-small i.tile {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 0 var(--iv-side2), 0 4px 3px rgba(46, 10, 0, 0.4);
}

.lob-loader-small i:nth-child(2),
.lob-loader-small i.tile:nth-child(2) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 0 var(--rd-side2), 0 4px 3px rgba(46, 10, 0, 0.4);
}

/* Вдвоём на одном экране ходит всегда человек: плашка хода золотая, слева — шашка того, чей ход. */
.app[data-lob-mode="hotseat"] .lob-turn:not(.warn) {
  background: linear-gradient(180deg, #ffe066, #ffbf1f);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.6), 0 2px 0 #c97b00;
  color: #5a3100;
}

.app[data-lob-mode="hotseat"] .lob-turn:not(.warn)::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin: -2px 7px 0 -5px;
  border-radius: 50%;
  background: linear-gradient(158deg, var(--iv-hi), var(--iv) 50%, var(--iv-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 2px 0 var(--iv-side2), 0 3px 2px rgba(90, 40, 0, 0.4);
}

.app[data-lob-mode="hotseat"][data-ck-turn="1"] .lob-turn:not(.warn)::before {
  background: linear-gradient(158deg, var(--rd-hi), var(--rd) 50%, var(--rd-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 var(--rd-side2), 0 3px 2px rgba(90, 40, 0, 0.4);
}

/*
 * Высокий экран (поле упирается в ширину, по высоте остаётся запас): таблички игроков выше, значок
 * места крупнее, лотки в два ряда; весь блок прижат к верху, воздух остаётся только снизу.
 */
@media (min-height: 800px) and (max-width: 560px) {
  .app {
    --stack: 15px;
    justify-content: flex-start;
    padding-top: max(24px, env(safe-area-inset-top));
  }

  .foot .lob-turn {
    min-height: 38px;
    padding: 4px 18px;
    border-radius: 19px;
    font-size: 17px;
    line-height: 21px;
  }

  .foot .lob-turn.long {
    font-size: 14px;
  }

  .lob-plates:not(.lob-many) {
    min-height: 64px;
    margin-top: 12px;
  }

  .lob-plates:not(.lob-many) .lob-plate {
    height: 64px;
    border-radius: 21px;
    gap: 10px;
    padding: 0 11px 0 10px;
  }

  .lob-plates:not(.lob-many) .lob-mark.seat-chip {
    width: 42px;
    height: 42px;
    font-size: 38px;
    padding-bottom: 5px;
  }

  .lob-plates:not(.lob-many) .lob-name {
    font-size: 17px;
    line-height: 21px;
  }

  .lob-plates:not(.lob-many) .lob-sub {
    font-size: 13px;
    line-height: 16px;
  }
}

/* ---------- Меньше движения ---------- */

@media (prefers-reduced-motion: reduce) {
  .lg-plate,
  .lg-a,
  .lg-b,
  .lg-spark,
  .hand,
  .pc.can .pc-glow,
  .pc.must .pc-glow,
  .pc.threat .pc-glow,
  .pc.cheer .pc-lift,
  .sq.target::after,
  .ck-medal .rays,
  .ck-rules .r-arrow:not(.trail),
  .shine::before,
  .pc .chip.king .shine::before {
    animation: none !important;
  }

  .logo .lg-spark,
  .hand {
    display: none;
  }

  .pc.can .pc-glow,
  .pc.must .pc-glow {
    opacity: 0.85;
  }

  .pc {
    transition-timing-function: linear;
  }
}
