:root {
  color-scheme: light;
  --paper: #f8f0d8;
  --ink: #15191f;
  --muted: #6d7680;
  --line: #101418;
  --board: #5ec3e9;
  --board-deep: #38a9d2;
  --red: #f24a3d;
  --black: #050608;
  --gold: #e5b84b;
  --green: #2f8f6b;
  --panel: #ffffff;
  --panel-line: #ded9ce;
  --sky: #cfeffc;
  --leaf: #70bd72;
  --leaf-mid: #55ad62;
  --leaf-light: #9bd979;
  --leaf-dark: #2f8f6b;
  --grass: #cce98d;
  --flower: #ffcc5f;
  --trunk: #9a683b;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20px 20px, rgba(47, 143, 107, 0.12) 1px, transparent 1.5px),
    linear-gradient(180deg, #cfeffc 0 36%, #fff7d7 36% 56%, #dff0b2 56% 100%);
  background-size: 30px 30px, auto;
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: 0;
  height: 235px;
  background:
    radial-gradient(circle at 12% 40%, #fff 0 22px, transparent 23px),
    radial-gradient(circle at 16% 36%, #fff 0 30px, transparent 31px),
    radial-gradient(circle at 20% 43%, #fff 0 24px, transparent 25px),
    radial-gradient(circle at 78% 32%, #fff 0 24px, transparent 25px),
    radial-gradient(circle at 83% 29%, #fff 0 34px, transparent 35px),
    radial-gradient(circle at 88% 37%, #fff 0 24px, transparent 25px);
  opacity: 0.95;
}

body::after {
  bottom: 0;
  height: 230px;
  background:
    radial-gradient(circle at 8% 82%, #ffcf5c 0 6px, transparent 7px),
    radial-gradient(circle at 18% 74%, #ff7f8a 0 5px, transparent 6px),
    radial-gradient(circle at 34% 84%, #ffffff 0 5px, transparent 6px),
    radial-gradient(circle at 58% 78%, #ff7f8a 0 5px, transparent 6px),
    radial-gradient(circle at 82% 76%, #ffffff 0 5px, transparent 6px),
    radial-gradient(circle at 92% 84%, #ffcf5c 0 6px, transparent 7px),
    radial-gradient(circle at 4% 56%, var(--leaf-dark) 0 54px, transparent 55px),
    radial-gradient(circle at 12% 42%, var(--leaf-mid) 0 62px, transparent 63px),
    radial-gradient(circle at 24% 50%, var(--leaf-light) 0 58px, transparent 59px),
    radial-gradient(circle at 34% 40%, var(--leaf-dark) 0 68px, transparent 69px),
    radial-gradient(circle at 47% 54%, #7ecb68 0 66px, transparent 67px),
    radial-gradient(circle at 60% 42%, var(--leaf-mid) 0 58px, transparent 59px),
    radial-gradient(circle at 72% 48%, var(--leaf-dark) 0 74px, transparent 75px),
    radial-gradient(circle at 86% 38%, var(--leaf-light) 0 66px, transparent 67px),
    radial-gradient(circle at 96% 58%, var(--leaf-mid) 0 58px, transparent 59px),
    repeating-linear-gradient(90deg, transparent 0 62px, rgba(154, 104, 59, 0.34) 62px 70px, transparent 70px 124px),
    linear-gradient(180deg, transparent 0 20%, rgba(47, 143, 107, 0.48) 20% 62%, #8fcf68 62% 100%);
}

.forest-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.forest-scene::before,
.forest-scene::after {
  content: "";
  position: absolute;
  left: -8vw;
  right: -8vw;
  bottom: 0;
  pointer-events: none;
}

.forest-scene::before {
  height: 310px;
  background:
    radial-gradient(circle at 6% 72%, rgba(47, 143, 107, 0.9) 0 54px, transparent 55px),
    radial-gradient(circle at 14% 58%, rgba(112, 189, 114, 0.88) 0 72px, transparent 73px),
    radial-gradient(circle at 23% 74%, rgba(85, 173, 98, 0.84) 0 62px, transparent 63px),
    radial-gradient(circle at 38% 62%, rgba(155, 217, 121, 0.86) 0 78px, transparent 79px),
    radial-gradient(circle at 51% 76%, rgba(47, 143, 107, 0.82) 0 60px, transparent 61px),
    radial-gradient(circle at 64% 58%, rgba(112, 189, 114, 0.88) 0 76px, transparent 77px),
    radial-gradient(circle at 79% 70%, rgba(85, 173, 98, 0.86) 0 68px, transparent 69px),
    radial-gradient(circle at 92% 60%, rgba(47, 143, 107, 0.88) 0 72px, transparent 73px);
  opacity: 0.82;
}

.forest-scene::after {
  height: 120px;
  background:
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(126, 87, 48, 0.42) 54px 61px, transparent 61px 116px),
    linear-gradient(180deg, rgba(77, 151, 76, 0) 0%, rgba(77, 151, 76, 0.42) 44%, rgba(122, 190, 89, 0.7) 100%);
}

.bird {
  position: absolute;
  width: 34px;
  height: 18px;
  opacity: 0.82;
}

.bird::before,
.bird::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 17px;
  height: 10px;
  border-top: 3px solid rgba(21, 25, 31, 0.44);
  border-radius: 50%;
}

.bird::before {
  left: 1px;
  transform: rotate(18deg);
}

.bird::after {
  right: 1px;
  transform: rotate(-18deg);
}

.bird-one {
  top: 18%;
  left: 11%;
  transform: scale(0.72);
}

.bird-two {
  top: 11%;
  right: 18%;
  transform: scale(0.9);
}

.bird-three {
  top: 28%;
  right: 9%;
  transform: scale(0.58);
}

.bird-four {
  top: 23%;
  left: 34%;
  transform: scale(0.52);
}

.bird-five {
  top: 15%;
  right: 38%;
  transform: scale(0.66);
}

.leaf-clump,
.bush {
  position: absolute;
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 34%, var(--leaf-light) 0 24px, transparent 25px),
    radial-gradient(circle at 54% 20%, var(--leaf) 0 30px, transparent 31px),
    radial-gradient(circle at 70% 48%, var(--leaf-mid) 0 28px, transparent 29px),
    radial-gradient(circle at 38% 58%, var(--leaf-dark) 0 32px, transparent 33px);
  filter: drop-shadow(0 9px 0 rgba(47, 143, 107, 0.16));
}

.leaf-clump {
  width: 128px;
  height: 98px;
  opacity: 0.9;
}

.leaf-clump-one {
  left: 3%;
  bottom: 126px;
  transform: rotate(-7deg) scale(0.9);
}

.leaf-clump-two {
  left: 30%;
  bottom: 150px;
  transform: rotate(8deg) scale(1.04);
}

.leaf-clump-three {
  right: 25%;
  bottom: 138px;
  transform: rotate(-4deg) scale(1.1);
}

.leaf-clump-four {
  right: 1%;
  bottom: 118px;
  transform: rotate(9deg) scale(0.96);
}

.bush {
  width: 92px;
  height: 54px;
  bottom: 30px;
  opacity: 0.94;
}

.bush-one {
  left: 4%;
}

.bush-two {
  left: 38%;
  bottom: 18px;
  transform: scale(1.18);
}

.bush-three {
  right: 26%;
  bottom: 34px;
  transform: scale(0.9);
}

.bush-four {
  right: 6%;
  bottom: 20px;
  transform: scale(1.08);
}

.flower {
  position: absolute;
  bottom: 44px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffd85f 0 32%, transparent 34%),
    radial-gradient(circle at 50% 0, #ff7f8a 0 24%, transparent 26%),
    radial-gradient(circle at 100% 50%, #ff7f8a 0 24%, transparent 26%),
    radial-gradient(circle at 50% 100%, #ff7f8a 0 24%, transparent 26%),
    radial-gradient(circle at 0 50%, #ff7f8a 0 24%, transparent 26%);
  filter: drop-shadow(0 2px 0 rgba(47, 143, 107, 0.25));
}

.flower::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 11px;
  width: 2px;
  height: 22px;
  background: var(--leaf-dark);
}

.flower-one {
  left: 7%;
}

.flower-two {
  left: 22%;
  bottom: 24px;
  transform: scale(0.8);
}

.flower-three {
  right: 15%;
  bottom: 38px;
  transform: scale(0.95);
}

.flower-four {
  right: 5%;
  bottom: 22px;
  transform: scale(0.72);
}

.flower-five {
  left: 13%;
  bottom: 72px;
  transform: scale(0.68);
}

.flower-six {
  left: 46%;
  bottom: 28px;
  transform: scale(0.82);
}

.flower-seven {
  left: 62%;
  bottom: 64px;
  transform: scale(0.72);
}

.flower-eight {
  right: 29%;
  bottom: 18px;
  transform: scale(0.66);
}

.flower-nine {
  right: 42%;
  bottom: 86px;
  transform: scale(0.76);
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 760px) minmax(280px, 360px);
  gap: 28px;
  align-items: center;
  padding: 28px 0;
}

.board-zone,
.side-panel {
  min-width: 0;
}

.game-title {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 20px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 56px;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.78);
}

h2 {
  font-size: 28px;
  line-height: 1.1;
}

.score-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.score-strip span {
  min-width: 82px;
  padding: 9px 12px;
  border: 2px solid rgba(21, 25, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  box-shadow: 0 5px 0 rgba(21, 25, 31, 0.08);
}

.score-strip b {
  color: var(--ink);
  font-size: 20px;
}

.board {
  width: 100%;
  aspect-ratio: 720 / 792;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 22px 28px rgba(35, 77, 91, 0.2));
}

.side-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 2px solid rgba(21, 25, 31, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 252, 242, 0.94)),
    var(--panel);
  box-shadow: 0 12px 0 rgba(21, 25, 31, 0.07), 0 22px 50px rgba(24, 29, 36, 0.12);
}

.victory-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(14, 20, 26, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.victory-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.victory-card {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  padding: 28px;
  border: 3px solid rgba(21, 25, 31, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 231, 143, 0.7), transparent 34%),
    linear-gradient(180deg, #ffffff, #fff7df);
  box-shadow: 0 12px 0 rgba(21, 25, 31, 0.18), 0 28px 70px rgba(0, 0, 0, 0.28);
  text-align: center;
  transform: translateY(16px) scale(0.94);
  transition: transform 260ms cubic-bezier(0.2, 1.4, 0.35, 1);
}

.victory-overlay.is-visible .victory-card {
  transform: translateY(0) scale(1);
}

.victory-card h2 {
  margin: 4px 0 10px;
  font-size: 40px;
}

.victory-card p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.victory-card button {
  min-width: 132px;
  min-height: 44px;
  border: 2px solid rgba(21, 25, 31, 0.14);
  border-radius: 8px;
  background: var(--red);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 5px 0 #bb2f27;
}

.victory-card button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #bb2f27;
}

.fireworks {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.fireworks span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color);
  opacity: 0;
}

.victory-overlay.is-visible .fireworks span {
  animation: firework 1180ms ease-out infinite;
  animation-delay: var(--delay);
}

.status-block {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--panel-line);
}

#statusText {
  min-height: 48px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

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

.controls button {
  min-height: 42px;
  border: 2px solid rgba(21, 25, 31, 0.12);
  border-radius: 8px;
  background: #1f8fc0;
  color: white;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 5px 0 #176b8f;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.controls button:nth-child(2) {
  background: #3b5b70;
  box-shadow: 0 5px 0 #273f50;
}

.controls .music-toggle {
  background: #7aa75e;
  box-shadow: 0 5px 0 #567d3f;
}

.controls .music-toggle[aria-pressed="true"] {
  background: var(--green);
  box-shadow: 0 5px 0 #20674b;
}

.controls .sfx-toggle {
  background: #bd7d36;
  box-shadow: 0 5px 0 #87551f;
}

.controls .sfx-toggle[aria-pressed="true"] {
  background: var(--gold);
  color: #241a04;
  box-shadow: 0 5px 0 #a17725;
}

.controls button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(21, 25, 31, 0.2);
}

.controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.online-panel {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 2px solid rgba(47, 143, 107, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 18%, rgba(155, 217, 121, 0.42), transparent 36%),
    rgba(241, 249, 238, 0.88);
}

.online-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.online-actions button {
  min-height: 38px;
  border: 2px solid rgba(21, 25, 31, 0.12);
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
  font-weight: 850;
  box-shadow: 0 4px 0 #20674b;
}

.online-actions button:nth-child(2) {
  background: #1f8fc0;
  box-shadow: 0 4px 0 #176b8f;
}

.online-actions button:nth-child(3) {
  background: #5b6470;
  box-shadow: 0 4px 0 #3a424c;
}

.online-actions button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(21, 25, 31, 0.22);
}

.online-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.online-status,
.share-link {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.share-link {
  min-height: 19px;
  overflow-wrap: anywhere;
  color: #276a54;
  font-weight: 750;
}

.rules-strip {
  display: grid;
  gap: 10px;
}

.rules-strip div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
}

.rules-strip span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef7f2;
  color: var(--green);
  font-weight: 900;
  border: 2px solid rgba(47, 143, 107, 0.15);
}

.rules-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.guide-section {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--panel-line);
  border-bottom: 1px solid var(--panel-line);
}

.guide-item {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.guide-item + .guide-item,
.guide-note {
  padding-top: 12px;
  border-top: 1px dashed rgba(21, 25, 31, 0.16);
}

.guide-item h3,
.guide-note h3 {
  margin: 0 0 5px;
  font-size: 15px;
  line-height: 1.2;
}

.guide-item p,
.guide-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guide-figure {
  width: 116px;
  max-width: 100%;
  display: block;
  overflow: visible;
}

.guide-line {
  stroke: var(--line);
  stroke-width: 6;
  stroke-linecap: round;
}

.guide-node {
  fill: rgba(21, 25, 31, 0.28);
}

.guide-zone {
  fill: rgba(94, 195, 233, 0.62);
  stroke: var(--line);
  stroke-width: 5;
  stroke-linejoin: round;
}

.guide-red,
.guide-black {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4;
  filter: drop-shadow(0 5px 5px rgba(21, 25, 31, 0.16));
}

.guide-red {
  fill: var(--red);
}

.guide-black {
  fill: var(--black);
}

.guide-arrow,
.guide-bracket {
  fill: none;
  stroke: var(--gold);
  stroke-width: 5;
  stroke-linecap: round;
}

.guide-arrow-head {
  fill: var(--gold);
}

.guide-mark {
  fill: var(--green);
  font-size: 14px;
  font-weight: 900;
  text-anchor: middle;
}

.guide-a {
  fill: #ffffff;
  font-size: 15px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
}

.guide-note {
  padding-left: 4px;
}

.log-wrap {
  min-height: 150px;
}

.move-log {
  max-height: 220px;
  margin: 0;
  padding-left: 22px;
  overflow: auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.move-log li + li {
  margin-top: 6px;
}

.board-fill {
  fill: url(#streetFill);
  stroke: none;
}

.board-fill.main {
  filter: drop-shadow(0 18px 26px rgba(27, 78, 100, 0.17));
}

.board-line {
  stroke: var(--line);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node-hit {
  fill: transparent;
  cursor: pointer;
}

.node-point {
  fill: rgba(16, 20, 24, 0.28);
}

.piece {
  cursor: pointer;
  filter: url(#pieceShadow);
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 3;
  transition: transform 140ms ease, filter 140ms ease;
  transform-box: fill-box;
  transform-origin: center;
}

.piece.red {
  fill: var(--red);
}

.piece.black {
  fill: var(--black);
}

.piece.selectable:hover {
  transform: translateY(-3px) scale(1.04);
}

.piece.capture-bounce {
  animation: captureBounce 620ms ease-in-out;
  stroke: var(--gold);
  stroke-width: 6;
}

.selected-ring {
  fill: rgba(229, 184, 75, 0.22);
  stroke: var(--gold);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 10 7;
  animation: readyPulse 1.4s ease-in-out infinite;
}

.move-dot {
  fill: rgba(255, 245, 190, 0.95);
  stroke: rgba(21, 25, 31, 0.25);
  stroke-width: 3;
  cursor: pointer;
  filter: drop-shadow(0 7px 7px rgba(21, 25, 31, 0.16));
}

.last-move {
  stroke: var(--gold);
  stroke-width: 8;
  stroke-linecap: round;
  opacity: 0.45;
}

.a-node {
  fill: rgba(255, 255, 255, 0.88);
  stroke: var(--line);
  stroke-width: 5;
}

.a-label {
  fill: var(--ink);
  font-size: 34px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
}

@keyframes readyPulse {
  0%, 100% {
    opacity: 0.74;
    stroke-width: 8;
  }

  50% {
    opacity: 1;
    stroke-width: 11;
  }
}

@keyframes captureBounce {
  0% {
    transform: scale(1);
  }

  32% {
    transform: translateY(-14px) scale(1.18);
  }

  64% {
    transform: translateY(3px) scale(0.96);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes firework {
  0% {
    opacity: 0;
    box-shadow:
      0 0 var(--color),
      0 0 var(--color),
      0 0 var(--color),
      0 0 var(--color),
      0 0 var(--color),
      0 0 var(--color),
      0 0 var(--color),
      0 0 var(--color);
    transform: scale(0.45);
  }

  18% {
    opacity: 1;
  }

  72% {
    opacity: 1;
    box-shadow:
      0 -58px var(--color),
      42px -42px var(--color),
      58px 0 var(--color),
      42px 42px var(--color),
      0 58px var(--color),
      -42px 42px var(--color),
      -58px 0 var(--color),
      -42px -42px var(--color);
    transform: scale(1);
  }

  100% {
    opacity: 0;
    box-shadow:
      0 -72px transparent,
      52px -52px transparent,
      72px 0 transparent,
      52px 52px transparent,
      0 72px transparent,
      -52px 52px transparent,
      -72px 0 transparent,
      -52px -52px transparent;
  }
}

@media (max-width: 920px) {
  body::before {
    height: 170px;
    opacity: 0.72;
  }

  body::after {
    height: 178px;
  }

  .forest-scene::before {
    height: 240px;
    opacity: 0.72;
  }

  .forest-scene::after {
    height: 96px;
  }

  .app-shell {
    width: min(760px, calc(100vw - 24px));
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 18px;
    padding: 18px 0 28px;
  }

  h1 {
    font-size: 44px;
  }

  h2 {
    font-size: 24px;
  }

  .board {
    margin-inline: auto;
    max-height: 72vh;
  }

  .side-panel {
    gap: 14px;
    padding: 18px;
    margin-bottom: 24px;
  }

  .guide-section {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .guide-section > .eyebrow,
  .guide-note {
    grid-column: 1 / -1;
  }

  .guide-item {
    grid-template-columns: 102px 1fr;
  }

  .guide-figure {
    width: 102px;
  }
}

@media (max-width: 560px) {
  body {
    background-size: 24px 24px, auto;
  }

  body::before {
    height: 120px;
    opacity: 0.58;
  }

  body::after {
    height: 142px;
  }

  .forest-scene::before {
    left: -26vw;
    right: -26vw;
    height: 190px;
    opacity: 0.66;
  }

  .forest-scene::after {
    height: 76px;
  }

  .leaf-clump {
    transform: scale(0.74);
  }

  .leaf-clump-two,
  .leaf-clump-three {
    bottom: 96px;
  }

  .bush {
    transform: scale(0.78);
  }

  .app-shell {
    width: min(100vw - 12px, 560px);
    padding: 8px 0 18px;
    gap: 10px;
  }

  .game-title {
    align-items: start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 6px;
  }

  h1 {
    font-size: 31px;
  }

  h2 {
    font-size: 21px;
  }

  .eyebrow {
    font-size: 11px;
  }

  .score-strip {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: start;
  }

  .score-strip span {
    min-width: 0;
    padding: 7px 9px;
  }

  .score-strip b {
    font-size: 18px;
  }

  .board {
    width: 100%;
    max-height: none;
    filter: drop-shadow(0 12px 16px rgba(35, 77, 91, 0.18));
  }

  .side-panel {
    gap: 12px;
    padding: 13px;
    box-shadow: 0 7px 0 rgba(21, 25, 31, 0.06), 0 14px 30px rgba(24, 29, 36, 0.1);
  }

  .victory-overlay {
    padding: 14px;
  }

  .victory-card {
    padding: 22px 18px;
  }

  .victory-card h2 {
    font-size: 31px;
  }

  .victory-card p:not(.eyebrow) {
    font-size: 14px;
  }

  .status-block {
    padding-bottom: 12px;
  }

  #statusText {
    min-height: 0;
    margin-top: 8px;
    font-size: 14px;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .controls button {
    min-height: 40px;
    padding-inline: 6px;
  }

  .online-actions {
    grid-template-columns: 1fr;
  }

  .rules-strip {
    gap: 8px;
  }

  .rules-strip div {
    grid-template-columns: 32px 1fr;
    gap: 8px;
  }

  .rules-strip span {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 13px;
  }

  .rules-strip p {
    font-size: 13px;
  }

  .guide-section {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 0;
  }

  .guide-item {
    grid-template-columns: 82px 1fr;
    gap: 9px;
    align-items: start;
  }

  .guide-figure {
    width: 82px;
  }

  .guide-item h3,
  .guide-note h3 {
    font-size: 14px;
  }

  .guide-item p,
  .guide-note p {
    font-size: 12.5px;
  }

  .move-log {
    max-height: 150px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 28px;
  }

  .guide-item {
    grid-template-columns: 72px 1fr;
  }

  .guide-figure {
    width: 72px;
  }
}

/* Pixel 6556 theme */
:root {
  --px-bg: #071441;
  --px-deep: #0a0f36;
  --px-panel: rgba(8, 18, 58, 0.94);
  --px-panel-2: rgba(13, 31, 84, 0.94);
  --px-cyan: #18d8ff;
  --px-blue: #1787ff;
  --px-purple: #8b45ff;
  --px-pink: #ff3f9a;
  --px-yellow: #ffd94a;
  --px-green: #23d879;
  --px-text: #f6fbff;
  --px-muted: #a9c5ff;
  --px-line: #07111f;
  --red: #ff3e35;
  --black: #05070c;
  --gold: var(--px-yellow);
  --green: var(--px-green);
  --muted: var(--px-muted);
  --line: var(--px-line);
  --panel-line: rgba(81, 211, 255, 0.3);
  font-family: "Arial Black", "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
}

body {
  color: var(--px-text);
  background:
    linear-gradient(180deg, rgba(8, 16, 58, 0.18), rgba(5, 11, 38, 0.88)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #061249 0%, #0757a5 42%, #1090d2 58%, #152d63 72%, #082119 100%);
  background-size: auto, 4px 4px, 4px 4px, auto;
  image-rendering: pixelated;
}

body::before {
  top: 0;
  height: 56vh;
  opacity: 1;
  background:
    linear-gradient(90deg, transparent 0 7%, #7df1ff 7% 7.3%, transparent 7.3% 19%, #ffd94a 19% 19.35%, transparent 19.35% 31%, #f463ff 31% 31.28%, transparent 31.28% 46%, #ffffff 46% 46.24%, transparent 46.24% 68%, #31e4ff 68% 68.25%, transparent 68.25% 86%, #ffd94a 86% 86.3%, transparent 86.3%),
    linear-gradient(0deg, transparent 0 18%, rgba(255, 255, 255, 0.08) 18% 18.6%, transparent 18.6% 44%, rgba(255, 217, 74, 0.36) 44% 45%, transparent 45% 68%, rgba(49, 228, 255, 0.3) 68% 68.7%, transparent 68.7%);
  background-size: 180px 140px, 220px 120px;
  mix-blend-mode: screen;
}

body::after {
  height: 38vh;
  opacity: 1;
  background:
    linear-gradient(135deg, transparent 0 39%, #203f76 39% 41%, transparent 41%),
    linear-gradient(45deg, transparent 0 43%, #2f5d8c 43% 45%, transparent 45%),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(98, 72, 34, 0.95) 34px 42px, transparent 42px 96px),
    linear-gradient(180deg, transparent 0 22%, rgba(24, 84, 65, 0.7) 22% 48%, #0c461f 48% 100%);
}

.forest-scene::before {
  height: 42vh;
  background:
    linear-gradient(135deg, transparent 0 46%, #243f80 46% 48%, transparent 48%),
    linear-gradient(45deg, transparent 0 47%, #385e9b 47% 49%, transparent 49%),
    linear-gradient(180deg, transparent 0 54%, rgba(44, 77, 134, 0.92) 54% 100%);
  clip-path: polygon(0 100%, 0 76%, 8% 64%, 15% 80%, 23% 45%, 34% 84%, 45% 62%, 55% 88%, 67% 50%, 80% 82%, 90% 62%, 100% 76%, 100% 100%);
  opacity: 0.84;
}

.forest-scene::after {
  height: 24vh;
  background:
    repeating-linear-gradient(90deg, transparent 0 30px, #0b2b20 30px 38px, transparent 38px 70px),
    repeating-linear-gradient(90deg, transparent 0 52px, #124326 52px 74px, transparent 74px 118px),
    linear-gradient(180deg, transparent 0, rgba(13, 83, 45, 0.95) 46%, #092013 100%);
  clip-path: polygon(0 100%, 0 38%, 4% 38%, 4% 26%, 8% 26%, 8% 43%, 13% 43%, 13% 18%, 18% 18%, 18% 48%, 25% 48%, 25% 31%, 30% 31%, 30% 55%, 38% 55%, 38% 24%, 44% 24%, 44% 49%, 51% 49%, 51% 35%, 58% 35%, 58% 56%, 65% 56%, 65% 25%, 70% 25%, 70% 48%, 78% 48%, 78% 20%, 83% 20%, 83% 43%, 91% 43%, 91% 28%, 96% 28%, 96% 50%, 100% 50%, 100% 100%);
}

.bird,
.flower,
.leaf-clump,
.bush {
  display: none;
}

.pixel-topbar {
  position: relative;
  z-index: 2;
  width: min(1500px, calc(100vw - 24px));
  min-height: 88px;
  margin: 10px auto 0;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(360px, 0.9fr) minmax(260px, 0.8fr);
  gap: 16px;
  align-items: center;
  border: 4px solid #131d5a;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(11, 19, 70, 0.95), rgba(8, 21, 81, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 16px, rgba(24, 216, 255, 0.08) 16px 18px);
  box-shadow:
    0 0 0 2px #27cfff,
    0 0 0 6px #081235,
    0 10px 0 rgba(0, 0, 0, 0.42),
    0 0 28px rgba(133, 69, 255, 0.62);
}

.pixel-topbar::before,
.pixel-topbar::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: var(--px-yellow);
  pointer-events: none;
}

.pixel-topbar::before {
  left: -7px;
  top: -7px;
  border-left: 5px solid;
  border-top: 5px solid;
}

.pixel-topbar::after {
  right: -7px;
  top: -7px;
  border-right: 5px solid;
  border-top: 5px solid;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.bot-badge {
  position: relative;
  width: 104px;
  height: 72px;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 0 #03091f) drop-shadow(0 0 14px rgba(24, 216, 255, 0.76));
}

.bot-face,
.mini-bot {
  position: absolute;
  border: 6px solid #071036;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 45%, #101735 0 6px, transparent 7px),
    radial-gradient(circle at 66% 45%, #101735 0 6px, transparent 7px),
    radial-gradient(ellipse at 50% 48%, #f8fbff 0 43%, #cad8ff 44% 52%, #101735 53% 100%);
}

.bot-face {
  left: 18px;
  top: 5px;
  width: 68px;
  height: 56px;
}

.bot-face::before {
  content: "";
  position: absolute;
  right: 7px;
  top: -18px;
  width: 10px;
  height: 20px;
  background: #101735;
  box-shadow: 14px -8px 0 -2px #1aa7ff;
  transform: rotate(18deg);
}

.bot-ring {
  position: absolute;
  left: 0;
  top: 28px;
  width: 104px;
  height: 26px;
  border: 8px solid transparent;
  border-bottom-color: var(--px-pink);
  border-left-color: var(--px-blue);
  border-radius: 50%;
  transform: rotate(-11deg);
}

.brand-number {
  display: flex;
  align-items: end;
  gap: 4px;
  color: #f7fbff;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(58px, 6vw, 96px);
  line-height: 0.9;
  text-shadow:
    4px 0 0 #081138,
    -4px 0 0 #081138,
    0 4px 0 #081138,
    0 -4px 0 #081138,
    7px 7px 0 #020817,
    0 0 22px rgba(24, 216, 255, 0.7);
}

.brand-blue {
  color: var(--px-cyan);
}

.brand-pink {
  color: var(--px-pink);
}

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

.pixel-menu span,
.player-hud,
.score-strip span,
.status-block,
.online-panel,
.rules-strip,
.guide-section,
.log-wrap {
  border: 3px solid #1c2b76;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 40, 112, 0.96), rgba(8, 18, 58, 0.96));
  box-shadow:
    inset 0 0 0 2px rgba(24, 216, 255, 0.28),
    0 4px 0 #050a23,
    0 0 14px rgba(139, 69, 255, 0.34);
}

.pixel-menu span {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #030817;
}

.player-hud {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
}

.mini-bot {
  position: relative;
  width: 54px;
  height: 44px;
  display: block;
}

.player-hud strong {
  color: #ffffff;
  font-size: 17px;
  text-shadow: 2px 2px 0 #030817;
}

.level-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

.level-row span {
  min-height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #7e1c58;
  border-radius: 4px;
  background: var(--px-pink);
  color: #ffffff;
  font-size: 12px;
}

.level-row i {
  height: 15px;
  padding: 2px;
  border: 2px solid #061037;
  background: #0a123d;
}

.level-row b {
  display: block;
  width: 76%;
  height: 100%;
  background: linear-gradient(90deg, #ffd94a, #ff8f34);
}

.app-shell {
  width: min(1500px, calc(100vw - 24px));
  min-height: calc(100vh - 126px);
  grid-template-columns: minmax(520px, 820px) minmax(380px, 520px);
  gap: 22px;
  align-items: start;
  padding: 22px 0 84px;
}

.board-zone {
  position: relative;
  padding: 18px;
  border: 4px solid #101c5a;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(7, 21, 77, 0.74), rgba(6, 14, 50, 0.46)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 6px);
  box-shadow:
    inset 0 0 0 2px var(--px-cyan),
    inset 0 0 0 6px rgba(139, 69, 255, 0.34),
    0 8px 0 #050a23,
    0 0 32px rgba(24, 216, 255, 0.24);
}

.game-title {
  margin: 0 0 12px;
  justify-content: center;
}

.score-strip {
  width: min(360px, 100%);
  justify-content: center;
}

.score-strip span {
  min-width: 132px;
  padding: 8px 12px;
  color: #f6fbff;
  text-shadow: 2px 2px 0 #020817;
}

.score-strip b {
  color: #ffffff;
  font-size: 22px;
}

.board {
  width: min(100%, 760px);
  margin: 0 auto;
  filter:
    drop-shadow(0 10px 0 #06102d)
    drop-shadow(0 0 18px rgba(24, 216, 255, 0.7));
}

.board-fill {
  stroke: #07111f;
  stroke-width: 4;
}

.board-line {
  stroke: #07111f;
  stroke-width: 7;
  filter: drop-shadow(2px 2px 0 rgba(24, 216, 255, 0.28));
}

.node-point {
  fill: #062a60;
  stroke: #47e6ff;
  stroke-width: 1.5;
}

.a-node {
  fill: #f7fbff;
  stroke: #061037;
  stroke-width: 6;
  filter: drop-shadow(0 4px 0 #4b5570);
}

.a-label {
  fill: #071036;
  font-size: 36px;
  font-family: "Arial Black", sans-serif;
}

.piece {
  stroke-width: 5;
  stroke: #f8fbff;
  filter:
    drop-shadow(4px 0 0 rgba(4, 8, 20, 0.8))
    drop-shadow(0 5px 0 rgba(4, 8, 20, 0.86))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.24));
}

.piece.red {
  fill: #ff3e35;
}

.piece.black {
  fill: #0b0d14;
}

.selected-ring {
  fill: rgba(255, 217, 74, 0.16);
  stroke: var(--px-yellow);
  stroke-width: 10;
  stroke-dasharray: 8 6;
  filter: drop-shadow(0 0 10px rgba(255, 217, 74, 0.7));
}

.move-dot {
  fill: #fff2a6;
  stroke: #061037;
  stroke-width: 4;
  filter: drop-shadow(0 0 8px rgba(255, 217, 74, 0.9));
}

.last-move {
  stroke: var(--px-yellow);
  stroke-width: 9;
  opacity: 0.7;
}

.side-panel {
  gap: 12px;
  max-height: calc(100vh - 132px);
  overflow: auto;
  padding: 14px;
  border: 4px solid #172277;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 18, 58, 0.96), rgba(8, 13, 42, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 8px);
  box-shadow:
    inset 0 0 0 2px var(--px-cyan),
    inset 0 0 0 7px rgba(139, 69, 255, 0.26),
    0 8px 0 #050a23,
    0 0 30px rgba(139, 69, 255, 0.45);
  scrollbar-color: var(--px-purple) #071036;
}

.status-block,
.online-panel,
.rules-strip,
.guide-section,
.log-wrap {
  padding: 12px;
}

.eyebrow {
  color: var(--px-yellow);
  font-size: 13px;
  text-shadow: 2px 2px 0 #030817;
}

h2,
.guide-item h3,
.guide-note h3 {
  color: #ffffff;
  text-shadow: 2px 2px 0 #030817;
}

h2 {
  color: var(--px-yellow);
  font-size: 30px;
}

#statusText,
.rules-strip p,
.guide-item p,
.guide-note p,
.move-log,
.online-status,
.share-link,
.victory-card p:not(.eyebrow) {
  color: #b9cfff;
}

button,
.online-actions button,
.controls button,
.victory-card button {
  border: 3px solid #071036;
  border-radius: 6px;
  color: #ffffff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.16),
    0 5px 0 #050a23,
    0 0 12px rgba(24, 216, 255, 0.22);
}

.controls button,
.online-actions button:nth-child(2) {
  background: linear-gradient(180deg, #1bc7ff, #1266ff);
}

.controls button:nth-child(2),
.online-actions button:nth-child(3) {
  background: linear-gradient(180deg, #a45bff, #6429d3);
}

.controls .music-toggle,
.online-actions button {
  background: linear-gradient(180deg, #32e681, #10994f);
}

.controls .sfx-toggle,
.controls .sfx-toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffd94a, #f0941f);
  color: #ffffff;
}

.online-panel {
  background:
    linear-gradient(180deg, rgba(9, 44, 76, 0.96), rgba(8, 18, 58, 0.96));
}

.online-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.share-link {
  color: #30ff93;
  text-shadow: 1px 1px 0 #03150c;
}

.rules-strip div {
  grid-template-columns: 44px 1fr;
}

.rules-strip span {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: #081a4f;
  color: #31ff98;
  border-color: #22d3ff;
  box-shadow: inset 0 0 0 2px rgba(49, 255, 152, 0.18);
}

.guide-section {
  max-height: 380px;
  overflow: auto;
  scrollbar-color: var(--px-purple) #071036;
}

.guide-item {
  grid-template-columns: 96px 1fr;
}

.guide-figure {
  width: 96px;
  filter: drop-shadow(3px 3px 0 #030817);
}

.guide-line,
.guide-zone {
  stroke: #07111f;
}

.guide-zone {
  fill: rgba(20, 201, 255, 0.78);
}

.guide-red {
  fill: #ff3e35;
}

.guide-black {
  fill: #05070c;
}

.move-log {
  max-height: 150px;
}

.pixel-footer {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 8px;
  z-index: 3;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.pixel-footer span,
.pixel-footer strong {
  min-width: 76px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 3px solid #101c5a;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 40, 112, 0.96), rgba(8, 18, 58, 0.96));
  color: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(24, 216, 255, 0.34), 0 5px 0 #050a23;
  text-shadow: 2px 2px 0 #030817;
}

.pixel-footer strong {
  margin-left: auto;
  min-width: 260px;
  color: var(--px-cyan);
}

.victory-overlay {
  background: rgba(1, 5, 20, 0.72);
}

.victory-card {
  border: 4px solid #162374;
  background:
    linear-gradient(180deg, rgba(13, 31, 84, 0.98), rgba(8, 18, 58, 0.98));
  color: #ffffff;
  box-shadow:
    inset 0 0 0 2px var(--px-cyan),
    inset 0 0 0 8px rgba(139, 69, 255, 0.34),
    0 10px 0 #020817,
    0 0 42px rgba(255, 63, 154, 0.42);
}

.victory-card h2 {
  color: var(--px-yellow);
}

@media (max-width: 960px) {
  .pixel-topbar {
    grid-template-columns: 1fr;
  }

  .pixel-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-hud {
    max-width: 420px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: min(860px, calc(100vw - 20px));
  }

  .side-panel {
    max-height: none;
  }

  .board {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .pixel-topbar {
    width: calc(100vw - 12px);
    padding: 8px;
    gap: 8px;
    border-width: 3px;
  }

  .brand-mark {
    gap: 8px;
  }

  .bot-badge {
    width: 72px;
    height: 54px;
  }

  .bot-face {
    left: 12px;
    width: 50px;
    height: 42px;
    border-width: 5px;
  }

  .bot-ring {
    width: 72px;
    top: 22px;
    border-width: 6px;
  }

  .brand-number {
    font-size: 48px;
  }

  .pixel-menu {
    display: none;
  }

  .player-hud {
    grid-template-columns: 50px 1fr;
    padding: 8px;
  }

  .mini-bot {
    width: 42px;
    height: 34px;
  }

  .app-shell {
    width: calc(100vw - 10px);
    padding: 12px 0 78px;
    gap: 12px;
  }

  .board-zone {
    padding: 8px;
  }

  .score-strip {
    grid-template-columns: 1fr 1fr;
  }

  .score-strip span {
    min-width: 0;
  }

  .side-panel {
    padding: 10px;
  }

  .online-actions {
    grid-template-columns: 1fr;
  }

  .guide-item {
    grid-template-columns: 72px 1fr;
  }

  .guide-figure {
    width: 72px;
  }

  .pixel-footer {
    display: none;
  }
}
