:root {
  --food-ink: #fff9e7;
  --food-muted: #bad2d8;
  --food-night: #10091f;
  --food-navy: #102c42;
  --food-plum: #3e174d;
  --food-gold: #ffd66c;
  --food-gold-deep: #9f5a22;
  --food-green: #7ce46f;
  --food-green-deep: #19683f;
  --food-berry: #ff5b9c;
  --food-berry-deep: #8e235d;
  --food-aqua: #69e6dd;
  --food-cream: #fff1c6;
  --food-glass: rgba(15, 24, 43, .88);
  --food-edge: rgba(255, 255, 255, .2);
  --food-shadow: 0 24px 70px rgba(2, 2, 15, .55);
  --food-ease: cubic-bezier(.2, .85, .2, 1);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--food-ink);
  background: var(--food-night);
  font-family: ui-rounded, "Avenir Next Rounded", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  font-size: 16px;
}

body { min-height: 100dvh; }
button,
input,
select { font: inherit; }
button { color: inherit; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 4px solid #fff6a6;
  outline-offset: 3px;
}

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

.food-world,
.food-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.food-world {
  z-index: -3;
  background:
    linear-gradient(180deg, rgba(8, 7, 23, .06), rgba(8, 7, 23, .45)),
    url("assets/checkers/kitchen-coliseum.webp") center / cover no-repeat,
    #151025;
  transform: scale(1.015);
  animation: world-breathe 14s ease-in-out infinite alternate;
}

.food-vignette {
  z-index: -2;
  background:
    radial-gradient(circle at 50% 45%, transparent 0 30%, rgba(5, 5, 18, .18) 60%, rgba(4, 3, 14, .72) 100%),
    linear-gradient(180deg, rgba(3, 7, 19, .48), transparent 24%, rgba(5, 3, 14, .38));
}

.food-vignette::before,
.food-vignette::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  filter: blur(12px);
  opacity: .34;
  animation: kitchen-glow 4.6s ease-in-out infinite alternate;
}
.food-vignette::before { left: 4%; top: 45%; background: #ff9f3d; }
.food-vignette::after { right: 4%; top: 43%; background: #ff7151; animation-delay: -2.3s; }

@keyframes world-breathe { to { transform: scale(1.035) translateY(-3px); } }
@keyframes kitchen-glow { to { opacity: .65; transform: scale(1.22); } }

.food-header {
  position: relative;
  z-index: 30;
  min-height: 76px;
  padding: 9px clamp(14px, 2vw, 34px);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 226, 128, .34);
  background: linear-gradient(180deg, rgba(8, 19, 36, .97), rgba(19, 13, 40, .92));
  box-shadow: 0 7px 30px rgba(0, 0, 0, .38), inset 0 -1px rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
}

.food-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  color: var(--food-ink);
  text-decoration: none;
}
.food-brand__gem {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border: 2px solid #fff1a5;
  border-radius: 16px;
  color: #47315d;
  background: linear-gradient(145deg, #fff994, #ffc446 60%, #ef8e30);
  box-shadow: inset 0 2px white, 0 5px 0 #984a24, 0 9px 20px rgba(0,0,0,.32);
  font-size: 27px;
  font-weight: 1000;
  transform: rotate(-4deg);
}
.food-brand b,
.food-brand small { display: block; }
.food-brand b { font-size: 20px; line-height: 1; letter-spacing: -.03em; }
.food-brand small { margin-top: 4px; color: var(--food-gold); font-size: 9px; font-weight: 1000; letter-spacing: .17em; }

.food-title {
  min-width: min(390px, 42vw);
  min-height: 54px;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(26, 94, 77, .42), rgba(85, 28, 77, .5));
  box-shadow: inset 0 1px rgba(255,255,255,.17), 0 9px 24px rgba(0,0,0,.2);
  text-align: center;
}
.food-title > span { font-size: 28px; filter: drop-shadow(0 4px 2px rgba(0,0,0,.3)); }
.food-title small,
.food-title strong { display: block; }
.food-title small { color: #8ff4c3; font-size: 8px; font-weight: 1000; letter-spacing: .18em; }
.food-title strong { margin-top: 2px; color: #fff7d6; font-size: clamp(17px, 1.5vw, 23px); line-height: 1; letter-spacing: -.035em; }

.food-header__actions { display: flex; justify-content: flex-end; gap: 9px; }
.food-header__actions button,
.glass-button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.045));
  box-shadow: inset 0 1px rgba(255,255,255,.15), 0 4px 0 rgba(4,6,20,.55);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s var(--food-ease), filter .18s var(--food-ease);
}
.food-header__actions button:hover,
.glass-button:hover { transform: translateY(-2px); filter: brightness(1.1); }

.checkers-app {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: calc(100dvh - 76px);
  padding: clamp(12px, 1.35vw, 24px);
}

/* Setup */
.setup-stage {
  width: min(1180px, 100%);
  min-height: calc(100dvh - 116px);
  margin: 0 auto;
  display: grid;
  align-items: center;
}

.setup-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 3vw, 38px);
  border: 2px solid rgba(255, 240, 166, .56);
  border-radius: 34px;
  background:
    radial-gradient(circle at 8% 10%, rgba(96, 226, 110, .16), transparent 29%),
    radial-gradient(circle at 92% 10%, rgba(255, 91, 156, .18), transparent 31%),
    linear-gradient(150deg, rgba(11, 37, 47, .95), rgba(33, 15, 52, .96));
  box-shadow: inset 0 2px rgba(255,255,255,.17), inset 0 -18px 50px rgba(0,0,0,.24), 0 12px 0 rgba(7,5,23,.7), var(--food-shadow);
  backdrop-filter: blur(17px);
}

.setup-kicker {
  width: fit-content;
  margin: 0 auto 8px;
  padding: 6px 12px;
  border: 1px solid rgba(255,214,108,.5);
  border-radius: 999px;
  color: var(--food-gold);
  background: rgba(0,0,0,.2);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .16em;
}
.setup-panel h1 { margin: 0; color: #fff7ce; font-size: clamp(30px, 4vw, 53px); line-height: .95; text-align: center; letter-spacing: -.055em; }
.setup-panel > p { max-width: 640px; margin: 11px auto 24px; color: #c2dae0; font-size: 14px; line-height: 1.45; text-align: center; font-weight: 700; }

.setup-versus {
  display: grid;
  grid-template-columns: 1fr 70px 1fr;
  gap: 14px;
  align-items: stretch;
}
.versus-badge { align-self: center; color: var(--food-gold); font-size: 18px; font-weight: 1000; text-align: center; text-shadow: 0 3px 0 rgba(0,0,0,.38); }

.team-card {
  position: relative;
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-columns: 150px minmax(0,1fr);
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 25px;
  background: linear-gradient(150deg, rgba(255,255,255,.13), rgba(255,255,255,.045));
  box-shadow: inset 0 1px rgba(255,255,255,.16), 0 9px 26px rgba(0,0,0,.22);
}
.team-card--garden { border-color: rgba(124,228,111,.55); }
.team-card--treat { border-color: rgba(255,91,156,.55); }
.team-portrait {
  position: relative;
  width: 150px;
  height: 176px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.team-portrait::before {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 118px;
  height: 35px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,240,145,.95), rgba(51,228,162,.38) 44%, transparent 70%);
  filter: blur(2px);
}
.team-card--treat .team-portrait::before { background: radial-gradient(ellipse, rgba(255,240,145,.95), rgba(255,70,160,.42) 44%, transparent 70%); }
.team-portrait img { position: relative; z-index: 1; width: 175px; max-width: none; height: 190px; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(0,0,0,.42)); animation: mascot-bob 3.2s ease-in-out infinite; }
.team-card--treat .team-portrait img { animation-delay: -1.55s; }
@keyframes mascot-bob { 50% { transform: translateY(-7px) rotate(1deg); } }

.team-card h2 { margin: 0; font-size: 21px; line-height: 1; letter-spacing: -.03em; }
.team-card h2 small { display: block; margin-top: 5px; color: var(--food-muted); font-size: 9px; letter-spacing: .11em; }
.setup-field { display: block; margin-top: 13px; }
.setup-field > span { display: block; margin: 0 0 6px 3px; color: #d6e6e8; font-size: 10px; font-weight: 1000; letter-spacing: .08em; }
.input-row { display: grid; grid-template-columns: minmax(0,1fr) 46px; gap: 7px; }
.setup-field input,
.setup-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
  color: #fff;
  background: rgba(4,10,25,.48);
  font-weight: 900;
}
.setup-field select option { color: #111; }
.random-button { min-width: 46px; min-height: 46px; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; color: var(--food-gold); background: rgba(255,255,255,.08); font-size: 20px; cursor: pointer; }

.setup-footer { margin-top: 21px; display: flex; align-items: center; justify-content: center; gap: 15px; }
.setup-note { max-width: 360px; color: #9fbcc4; font-size: 11px; font-weight: 750; line-height: 1.35; }
.primary-button {
  min-height: 56px;
  padding: 0 29px;
  border: 2px solid #fff1a0;
  border-radius: 18px;
  color: #382342;
  background: linear-gradient(#fff693, #ffc746 63%, #ff9d32);
  box-shadow: inset 0 2px white, 0 6px 0 #9d5224, 0 14px 24px rgba(0,0,0,.3);
  font-size: 15px;
  font-weight: 1000;
  cursor: pointer;
  transition: transform .18s var(--food-ease), filter .18s var(--food-ease);
}
.primary-button:hover { transform: translateY(-3px) scale(1.015); filter: brightness(1.07); }

.resume-banner {
  margin: 0 auto 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid rgba(105,230,221,.52);
  border-radius: 18px;
  background: rgba(30, 122, 122, .22);
  color: #d9ffff;
  font-size: 12px;
  font-weight: 900;
}
.resume-banner button { min-height: 44px; padding: 0 15px; border: 1px solid #a5fff1; border-radius: 13px; color: #143d42; background: #83ead9; font-weight: 1000; cursor: pointer; }

/* Game */
.game-shell {
  width: min(1560px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(520px, 760px) minmax(270px, 340px);
  justify-content: center;
  gap: clamp(11px, 1.3vw, 21px);
  align-items: center;
}

.food-panel {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(13,36,51,.91), rgba(34,13,49,.93));
  box-shadow: inset 0 1px rgba(255,255,255,.15), 0 8px 0 rgba(5,4,19,.64), 0 20px 48px rgba(0,0,0,.34);
  backdrop-filter: blur(18px);
}

.players-rail { padding: 13px; display: grid; gap: 11px; }
.rail-kicker { margin: 1px 5px 0; color: var(--food-gold); font-size: 9px; font-weight: 1000; letter-spacing: .16em; }
.player-card {
  position: relative;
  min-height: 116px;
  padding: 11px;
  display: grid;
  grid-template-columns: 82px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 19px;
  background: rgba(255,255,255,.055);
  transition: border-color .24s, background .24s, transform .24s var(--food-ease);
}
.player-card.is-active { transform: translateX(6px); border-color: #fff0a1; background: linear-gradient(135deg, rgba(255,211,90,.18), rgba(255,255,255,.07)); box-shadow: inset 0 1px rgba(255,255,255,.14), 0 0 24px rgba(255,213,108,.2); }
.player-card.is-active::after { content: "YOUR TURN"; position: absolute; left: 8px; top: 8px; padding: 4px 6px; border-radius: 8px; color: #33233f; background: var(--food-gold); box-shadow: 0 3px 0 rgba(91,46,23,.74); font-size: 7px; font-weight: 1000; letter-spacing: .08em; }
.player-card__portrait { position: relative; width: 82px; height: 88px; display: grid; place-items: end center; }
.player-card__portrait::before { content: ""; position: absolute; bottom: 2px; width: 66px; height: 21px; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,246,166,.88), rgba(92,224,164,.24) 45%, transparent 72%); }
.player-card--treat .player-card__portrait::before { background: radial-gradient(ellipse, rgba(255,246,166,.88), rgba(255,79,157,.28) 45%, transparent 72%); }
.player-card__portrait img { position: relative; z-index: 1; width: 98px; height: 102px; object-fit: contain; filter: drop-shadow(0 7px 5px rgba(0,0,0,.42)); }
.player-card h2 { margin: 0; overflow: hidden; font-size: 15px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.player-card h2 small { display: block; margin-top: 5px; color: var(--food-muted); font-size: 8px; letter-spacing: .08em; }
.player-stats { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.player-stats span { padding: 5px 7px; border-radius: 8px; color: #dbe9eb; background: rgba(0,0,0,.22); font-size: 8px; font-weight: 900; }
.player-stats b { color: var(--food-gold); }

.rail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.rail-actions button { min-height: 44px; padding: 0 8px; border: 1px solid rgba(255,255,255,.17); border-radius: 13px; color: #dceded; background: rgba(255,255,255,.065); font-size: 10px; font-weight: 900; cursor: pointer; }
.rail-actions button:disabled { opacity: .38; cursor: not-allowed; }

.arena-column { min-width: 0; display: grid; gap: 11px; }
.turn-banner {
  min-height: 68px;
  padding: 9px 15px;
  display: grid;
  grid-template-columns: 54px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255,239,155,.42);
  border-radius: 21px;
  background: linear-gradient(130deg, rgba(12,65,60,.92), rgba(48,16,59,.93));
  box-shadow: inset 0 1px rgba(255,255,255,.16), 0 7px 0 rgba(6,4,22,.62), 0 17px 36px rgba(0,0,0,.28);
}
.turn-avatar { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 6px 4px rgba(0,0,0,.38)); }
.turn-banner small,
.turn-banner strong { display: block; }
.turn-banner small { color: var(--food-gold); font-size: 8px; font-weight: 1000; letter-spacing: .13em; }
.turn-banner strong { margin-top: 3px; overflow: hidden; font-size: clamp(15px, 1.5vw, 21px); line-height: 1.02; text-overflow: ellipsis; white-space: nowrap; }
.turn-rule { max-width: 170px; color: #c9dee1; font-size: 9px; font-weight: 800; line-height: 1.25; text-align: right; }

.board-stage {
  position: relative;
  min-width: 0;
  padding: clamp(11px, 1.4vw, 18px);
  border: 2px solid rgba(255,239,158,.7);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.16), transparent 28%),
    linear-gradient(155deg, #3a241b, #160d25 58%, #4a242a);
  box-shadow: inset 0 2px rgba(255,255,255,.2), inset 0 -12px 25px rgba(0,0,0,.38), 0 10px 0 #090516, 0 28px 60px rgba(0,0,0,.55);
  perspective: 1200px;
}
.board-stage::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255,215,104,.3);
  border-radius: 23px;
  pointer-events: none;
}
.board-scroll { overflow: auto; border-radius: 18px; scrollbar-width: thin; }
.checker-board {
  position: relative;
  width: min(100%, 720px);
  min-width: 352px;
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  overflow: hidden;
  border: 3px solid #f1c86f;
  border-radius: 15px;
  background: #412738;
  box-shadow: inset 0 0 28px rgba(0,0,0,.5), 0 5px 0 #7e461f, 0 11px 23px rgba(0,0,0,.46);
  transform: rotateX(2.2deg);
  transform-origin: center bottom;
}

.board-square {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  isolation: isolate;
  cursor: default;
}
.board-square--light {
  background:
    radial-gradient(circle at 25% 18%, rgba(255,255,255,.55), transparent 12%),
    linear-gradient(145deg, #ffe5a6, #d9955f);
  box-shadow: inset 0 3px rgba(255,255,255,.4), inset 0 -5px rgba(111,48,39,.17);
}
.board-square--dark {
  background:
    radial-gradient(circle at 75% 22%, rgba(255,255,255,.11), transparent 9%),
    linear-gradient(145deg, #355e4e 0%, #183f3c 48%, #542641 100%);
  box-shadow: inset 0 3px rgba(255,255,255,.12), inset 0 -5px rgba(0,0,0,.32), inset 4px 0 rgba(255,255,255,.035);
  cursor: pointer;
}
.board-square--dark::before {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(255,241,186,.075);
  border-radius: 18%;
}
.board-square:hover.board-square--dark { filter: brightness(1.12); z-index: 3; }
.board-square.is-selectable::after,
.board-square.is-destination::after,
.board-square.is-selected::after {
  content: "";
  position: absolute;
  inset: 8%;
  z-index: 0;
  border-radius: 20%;
  pointer-events: none;
}
.board-square.is-selectable::after { border: 3px solid rgba(255,231,119,.82); box-shadow: inset 0 0 15px rgba(255,225,102,.24), 0 0 18px rgba(255,214,76,.32); animation: legal-pulse 1.4s ease-in-out infinite; }
.board-square.is-selected::after { border: 4px solid #fff4a8; background: rgba(255,215,78,.2); box-shadow: inset 0 0 18px rgba(255,234,126,.42), 0 0 24px rgba(255,221,90,.6); }
.board-square.is-destination::after { inset: 34%; border: 3px solid #baffdd; border-radius: 50%; background: rgba(94,244,187,.42); box-shadow: 0 0 0 5px rgba(80,235,196,.14), 0 0 20px #5ff1c1; animation: destination-pop .9s ease-in-out infinite alternate; }
.board-square.is-capture-destination::after { border-color: #ffdf72; background: rgba(255,114,80,.65); box-shadow: 0 0 0 5px rgba(255,99,92,.19), 0 0 24px #ff755a; }
@keyframes legal-pulse { 50% { opacity: .45; transform: scale(.94); } }
@keyframes destination-pop { to { transform: scale(1.22); filter: brightness(1.25); } }

.square-coordinate {
  position: absolute;
  z-index: 6;
  right: 5px;
  bottom: 3px;
  color: rgba(255,255,255,.52);
  font-size: clamp(7px, .65vw, 10px);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.65);
  pointer-events: none;
}
.board-square--light .square-coordinate { color: rgba(73,39,45,.5); text-shadow: none; }

.food-piece {
  position: relative;
  z-index: 4;
  width: 82%;
  height: 82%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-4%);
  filter: drop-shadow(0 7px 4px rgba(0,0,0,.44));
  transition: transform .22s var(--food-ease), filter .22s var(--food-ease), opacity .22s;
}
.food-piece::before {
  content: "";
  position: absolute;
  inset: 15% 6% 1%;
  z-index: -2;
  border: 3px solid rgba(255,255,255,.54);
  border-radius: 50%;
  box-shadow: inset 0 5px rgba(255,255,255,.27), inset 0 -8px rgba(0,0,0,.29), 0 5px 0 rgba(0,0,0,.36);
}
.food-piece--garden::before { background: radial-gradient(circle at 36% 25%, #d7ff99, #4fbc5d 43%, #126345 76%); }
.food-piece--treat::before { background: radial-gradient(circle at 36% 25%, #ffb7df, #e6418d 43%, #711d63 76%); }
.food-piece::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 18%;
  right: 18%;
  bottom: -2%;
  height: 19%;
  border-radius: 50%;
  background: rgba(3, 5, 13, .58);
  filter: blur(4px);
}
.food-piece img { width: 91%; height: 104%; object-fit: contain; transform: translateY(-10%); filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); }
.food-piece__crown {
  position: absolute;
  z-index: 8;
  top: -16%;
  left: 50%;
  width: 54%;
  height: 31%;
  display: grid;
  place-items: center;
  border: 2px solid #fff1a1;
  border-radius: 50% 50% 38% 38%;
  color: #6c321b;
  background: linear-gradient(#fff79d, #ffc43c 62%, #e78329);
  box-shadow: inset 0 2px white, 0 3px 0 #8e401e, 0 0 12px rgba(255,219,78,.8);
  font-size: clamp(10px, 1.25vw, 20px);
  font-weight: 1000;
  transform: translateX(-50%) rotate(-4deg);
}
.board-square:hover .food-piece,
.board-square.is-selected .food-piece { transform: translateY(-12%) scale(1.09); filter: drop-shadow(0 11px 6px rgba(0,0,0,.5)) brightness(1.08); }

.board-square.is-jumping { z-index: 18; overflow: visible; }
.board-square.is-jumping .food-piece { animation: piece-jump .48s var(--food-ease) both; }
.board-square.is-target-slam { animation: target-slam .48s var(--food-ease) both; }
.board-square.is-being-captured .food-piece { animation: food-gobbled .5s ease-in both; }
@keyframes piece-jump {
  0% { transform: translate(0, -4%); }
  48% { transform: translate(var(--jump-mid-x, 50%), var(--jump-peak-y, -65%)) scale(1.22) rotate(var(--jump-tilt, -7deg)); filter: drop-shadow(0 22px 11px rgba(0,0,0,.4)); }
  100% { transform: translate(var(--jump-x, 100%), var(--jump-y, -5%)) scale(1.03) rotate(3deg); }
}
@keyframes target-slam { 65% { filter: brightness(1.35); } }
@keyframes food-gobbled { 20% { transform: scaleX(1.18) scaleY(.76); } 62% { transform: scale(.72) rotate(20deg); opacity: .9; } to { transform: scale(.05) rotate(170deg); opacity: 0; } }

.capture-burst {
  position: absolute;
  z-index: 20;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #4c2146;
  background: radial-gradient(circle, #fffac2 0 25%, #ffca4f 26% 48%, #ff6f91 49% 62%, transparent 64%);
  filter: drop-shadow(0 8px 8px rgba(0,0,0,.4));
  font-size: 17px;
  font-weight: 1000;
  transform: translate(-50%, -50%);
  animation: burst-in .62s var(--food-ease) both;
  pointer-events: none;
}
.capture-burst i { position: absolute; font-style: normal; animation: crumb-fly .6s ease-out both; }
.capture-burst i:nth-child(1) { --x:-48px; --y:-35px; }
.capture-burst i:nth-child(2) { --x:51px; --y:-28px; }
.capture-burst i:nth-child(3) { --x:-39px; --y:43px; }
.capture-burst i:nth-child(4) { --x:45px; --y:41px; }
@keyframes burst-in { 0% { transform: translate(-50%,-50%) scale(.1) rotate(-25deg); opacity: 0; } 45% { transform: translate(-50%,-50%) scale(1.25) rotate(4deg); opacity: 1; } 100% { transform: translate(-50%,-50%) scale(.82) rotate(-2deg); opacity: 0; } }
@keyframes crumb-fly { to { transform: translate(var(--x), var(--y)) rotate(190deg); opacity: 0; } }

.board-lock {
  position: absolute;
  z-index: 15;
  inset: 18px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(8, 9, 26, .38);
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.board-lock span { padding: 10px 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 13px; color: #fff5c1; background: rgba(17,15,46,.88); box-shadow: 0 6px 20px rgba(0,0,0,.32); font-size: 11px; font-weight: 1000; }

.coach-panel { padding: 15px; display: grid; gap: 12px; align-content: start; }
.coach-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.coach-heading small { display: block; color: var(--food-gold); font-size: 8px; font-weight: 1000; letter-spacing: .15em; }
.coach-heading h2 { margin: 3px 0 0; color: #fff5d0; font-size: 20px; line-height: 1; letter-spacing: -.035em; }
.coach-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; background: rgba(255,255,255,.08); font-size: 22px; }

.coach-message { min-height: 87px; padding: 12px; border: 1px solid rgba(105,230,221,.3); border-radius: 16px; background: linear-gradient(135deg, rgba(50,160,146,.17), rgba(255,255,255,.035)); }
.coach-message strong { display: block; color: #dcfff6; font-size: 13px; line-height: 1.22; }
.coach-message p { margin: 6px 0 0; color: #abc8cf; font-size: 10px; font-weight: 750; line-height: 1.38; }

.math-card { padding: 13px; border: 1px solid rgba(255,213,108,.42); border-radius: 18px; background: linear-gradient(140deg, rgba(93,51,108,.5), rgba(26,70,66,.45)); box-shadow: inset 0 1px rgba(255,255,255,.12); }
.math-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.math-card__top span { color: var(--food-gold); font-size: 8px; font-weight: 1000; letter-spacing: .12em; }
.math-card__top b { padding: 4px 7px; border-radius: 8px; color: #c9e5e8; background: rgba(0,0,0,.2); font-size: 8px; }
.math-card h3 { margin: 11px 0; color: #fff7d6; font-size: 27px; text-align: center; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.answer-grid button { min-height: 46px; border: 1px solid rgba(255,255,255,.24); border-radius: 13px; color: #fff; background: rgba(255,255,255,.09); font-size: 15px; font-weight: 1000; cursor: pointer; }
.answer-grid button:hover { color: #253443; background: #fff2a1; transform: translateY(-1px); }
.math-card.is-wrong { animation: answer-wiggle .32s ease; border-color: #ff749d; }
@keyframes answer-wiggle { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

.turn-ready { padding: 13px; border: 1px solid rgba(124,228,111,.36); border-radius: 17px; background: rgba(68,152,96,.14); text-align: center; }
.turn-ready span { display: block; font-size: 27px; }
.turn-ready strong { display: block; margin-top: 4px; color: #dfffd9; font-size: 13px; }
.turn-ready small { display: block; margin-top: 4px; color: #9cc5bb; font-size: 9px; line-height: 1.3; }

.move-log { min-height: 120px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.1); }
.move-log h3 { margin: 0 0 8px; color: #d3e6e7; font-size: 9px; letter-spacing: .13em; }
.move-log ol { max-height: 168px; margin: 0; padding: 0; display: grid; gap: 6px; overflow: auto; list-style: none; }
.move-log li { padding: 7px 9px; border-radius: 10px; color: #a9c6cc; background: rgba(0,0,0,.17); font-size: 9px; font-weight: 800; line-height: 1.3; }
.move-log li:first-child { color: #fff7d3; background: rgba(255,212,86,.1); }

.save-status { display: flex; align-items: center; gap: 7px; color: #8db7be; font-size: 8px; font-weight: 900; }
.save-status i { width: 8px; height: 8px; border-radius: 50%; background: #6fe8ad; box-shadow: 0 0 10px #6fe8ad; }

.end-card {
  position: absolute;
  z-index: 24;
  inset: 50% auto auto 50%;
  width: min(390px, calc(100% - 40px));
  padding: 25px;
  border: 2px solid #fff1a3;
  border-radius: 25px;
  background: radial-gradient(circle at 50% 0, rgba(255,215,88,.18), transparent 38%), linear-gradient(150deg,#173849,#331543);
  box-shadow: inset 0 2px rgba(255,255,255,.18), 0 9px 0 #09051a, 0 25px 80px rgba(0,0,0,.68);
  text-align: center;
  transform: translate(-50%,-50%);
}
.end-card img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 10px 7px rgba(0,0,0,.4)); animation: victory-bounce 1.2s ease-in-out infinite; }
.end-card h2 { margin: 2px 0 7px; color: #fff4bc; font-size: 27px; line-height: 1; }
.end-card p { margin: 0 0 17px; color: #c3dadd; font-size: 12px; line-height: 1.4; }
@keyframes victory-bounce { 50% { transform: translateY(-8px) rotate(2deg); } }

.food-dialog { width: min(680px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 0; border-radius: 28px; color: var(--food-ink); background: transparent; }
.food-dialog::backdrop { background: rgba(3,4,18,.8); backdrop-filter: blur(9px); }
.food-dialog__panel { position: relative; max-height: calc(100dvh - 24px); padding: 26px; overflow: auto; border: 2px solid rgba(255,235,156,.55); border-radius: 27px; background: linear-gradient(150deg,#173a47,#30123f); box-shadow: inset 0 2px rgba(255,255,255,.16), 0 11px 0 #080416, 0 30px 80px rgba(0,0,0,.68); }
.food-dialog__close { position: absolute; right: 15px; top: 14px; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; background: rgba(255,255,255,.08); font-size: 25px; cursor: pointer; }
.food-dialog h2 { margin: 0 45px 8px 0; color: #fff5c3; font-size: 28px; }
.food-dialog p { color: #bdd5d9; font-size: 13px; line-height: 1.5; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rule-card { padding: 13px; border: 1px solid rgba(255,255,255,.15); border-radius: 15px; background: rgba(255,255,255,.055); }
.rule-card b { display: block; color: #fff1a6; font-size: 12px; }
.rule-card span { display: block; margin-top: 5px; color: #a9c5ca; font-size: 10px; line-height: 1.38; }
.dialog-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 9px; }
.dialog-actions button { min-height: 46px; padding: 0 18px; border: 1px solid rgba(255,255,255,.24); border-radius: 14px; background: rgba(255,255,255,.08); font-weight: 900; cursor: pointer; }
.dialog-actions .danger { color: #3b233b; border-color: #fff1a7; background: linear-gradient(#fff492,#ffbd42); }

@media (max-width: 1180px) {
  .food-header { grid-template-columns: auto 1fr auto; }
  .food-title { min-width: 0; }
  .food-title small { display: none; }
  .game-shell { grid-template-columns: minmax(180px, 220px) minmax(490px, 680px); align-items: start; }
  .coach-panel { grid-column: 1 / -1; grid-template-columns: minmax(220px, .8fr) minmax(260px, 1fr) minmax(220px, .9fr); align-items: stretch; }
  .coach-heading { grid-column: 1; }
  .coach-message { grid-column: 1; }
  .math-card,
  .turn-ready { grid-column: 2; grid-row: 1 / span 2; }
  .move-log { grid-column: 3; grid-row: 1 / span 2; padding: 0 0 0 11px; border-top: 0; border-left: 1px solid rgba(255,255,255,.1); }
  .save-status { grid-column: 1; }
}

@media (max-width: 900px) {
  .food-header { min-height: 68px; padding: 8px 12px; }
  .food-brand__gem { width: 44px; height: 44px; }
  .food-brand b { font-size: 17px; }
  .food-brand small { display: none; }
  .food-title { justify-self: center; min-height: 48px; padding: 5px 12px; }
  .food-title > span { font-size: 22px; }
  .food-title strong { font-size: 15px; }
  .food-header__actions button { width: 46px; padding: 0; font-size: 0; }
  .food-header__actions button span { font-size: 17px; }
  .checkers-app { min-height: calc(100dvh - 68px); padding: 10px; }
  .setup-versus { grid-template-columns: 1fr 44px 1fr; }
  .team-card { grid-template-columns: 1fr; text-align: center; }
  .team-portrait { width: 100%; height: 145px; }
  .team-portrait img { width: 165px; height: 165px; }
  .setup-field > span { text-align: left; }
  .game-shell { grid-template-columns: 1fr; width: min(730px,100%); }
  .players-rail { grid-template-columns: 1fr 1fr; }
  .rail-kicker,
  .rail-actions { grid-column: 1 / -1; }
  .player-card { min-height: 102px; grid-template-columns: 74px minmax(0,1fr); }
  .player-card__portrait { width: 74px; height: 78px; }
  .player-card__portrait img { width: 88px; height: 92px; }
  .player-card.is-active { transform: translateY(-3px); }
  .arena-column { grid-row: 1; }
  .players-rail { grid-row: 2; }
  .coach-panel { grid-row: 3; }
}

@media (max-width: 650px) {
  .food-world { background-position: center top; }
  .food-header { grid-template-columns: auto 1fr auto; gap: 7px; }
  .food-title { background: transparent; border: 0; box-shadow: none; }
  .food-title > span { display: none; }
  .food-title strong { font-size: 14px; }
  .food-header__actions button[data-action="new-game"] { display: none; }
  .setup-stage { align-items: start; }
  .setup-panel { padding: 17px 13px 22px; border-radius: 24px; }
  .setup-panel h1 { font-size: 34px; }
  .setup-panel > p { margin-bottom: 17px; font-size: 12px; }
  .setup-versus { grid-template-columns: 1fr; gap: 9px; }
  .versus-badge { display: none; }
  .team-card { grid-template-columns: 100px minmax(0,1fr); padding: 11px; text-align: left; }
  .team-portrait { width: 100px; height: 126px; }
  .team-portrait img { width: 128px; height: 137px; }
  .team-card h2 { font-size: 17px; }
  .setup-footer { flex-direction: column; }
  .setup-note { text-align: center; }
  .primary-button { width: 100%; }
  .turn-banner { min-height: 61px; grid-template-columns: 48px minmax(0,1fr); }
  .turn-avatar { width: 48px; height: 48px; }
  .turn-rule { display: none; }
  .board-stage { padding: 8px; border-radius: 22px; }
  .board-stage::before { inset: 4px; border-radius: 17px; }
  .checker-board { border-width: 2px; border-radius: 11px; transform: none; }
  .board-lock { inset: 9px; }
  .players-rail { padding: 9px; gap: 7px; }
  .player-card { min-height: 89px; padding: 7px; grid-template-columns: 61px minmax(0,1fr); }
  .player-card__portrait { width: 61px; height: 68px; }
  .player-card__portrait img { width: 76px; height: 80px; }
  .player-card h2 { font-size: 12px; }
  .player-card.is-active::after { display: none; }
  .player-stats { margin-top: 6px; }
  .coach-panel { padding: 11px; grid-template-columns: 1fr; }
  .coach-heading,
  .coach-message,
  .math-card,
  .turn-ready,
  .move-log,
  .save-status { grid-column: 1; grid-row: auto; }
  .move-log { min-height: 0; padding: 10px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.1); }
  .move-log ol { max-height: 102px; }
  .rule-grid { grid-template-columns: 1fr; }
  .food-dialog__panel { padding: 21px 15px; }
}

@media (max-width: 390px) {
  .food-brand span:last-child { display: none; }
  .food-title { justify-content: flex-start; }
  .team-card { grid-template-columns: 82px minmax(0,1fr); }
  .team-portrait { width: 82px; height: 110px; }
  .team-portrait img { width: 110px; height: 120px; }
}

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