:root {
  color-scheme: light;
  --ink: #24302d;
  --muted: #77837f;
  --mist: #e8f0f1;
  --mist-deep: #d5e4e5;
  --paper: #f7f4ed;
  --paper-deep: #ece7dc;
  --gold: #c5a657;
  --gold-deep: #947936;
  --line: rgba(50, 68, 63, 0.12);
  --red: #c9615d;
  --red-soft: #f0d5cf;
  --green: #5b927a;
  --green-soft: #cfe1d7;
  --blue: #5f86a9;
  --blue-soft: #d3e0e9;
  --yellow: #d0a84e;
  --yellow-soft: #eee0b8;
  --panel: rgba(248, 249, 245, 0.66);
  --shadow: 0 26px 72px rgba(44, 64, 59, 0.13);
  font-family: "DengXian", "Microsoft YaHei UI", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 7% 1%, rgba(255, 255, 255, 0.95), transparent 29rem),
    radial-gradient(circle at 96% 95%, rgba(197, 166, 87, 0.09), transparent 28rem),
    var(--mist);
}

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

button {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(197, 166, 87, 0.68);
  outline-offset: 3px;
}

svg,
a {
  -webkit-user-drag: none;
  user-drag: none;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(1220px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  margin-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.43);
  box-shadow: 0 8px 18px rgba(43, 64, 58, 0.07);
  transform: rotate(-4deg);
}

.brand-mark svg {
  width: 31px;
  fill: var(--ink);
}

.brand-mark path {
  stroke: var(--gold);
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.brand strong {
  display: block;
  font-family: inherit;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.05;
}

.brand small,
.turn-card small,
.section-heading small,
.option-heading small,
.dialog-card > small {
  display: block;
  margin-top: 5px;
  color: var(--gold-deep);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.73);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 20px rgba(51, 61, 60, 0.05);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.79);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: scale(0.94);
}

.icon-button svg,
.tool-button svg,
.mode-button svg,
.note-icon svg,
.confirm-icon svg,
.rule-list svg,
.dice-arrow {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.sound-off,
.is-muted .sound-on {
  display: none;
}

.is-muted .sound-off {
  display: block;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 330px;
  gap: clamp(28px, 5vw, 66px);
  align-items: center;
}

.board-column {
  min-width: 0;
}

.board-frame {
  position: relative;
  width: min(100%, calc(100svh - 158px));
  margin: 0 auto;
  padding: clamp(9px, 1.2vw, 14px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow), 0 0 0 1px rgba(110, 130, 128, 0.04);
}

.board-frame::after {
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 27px;
  background: rgba(211, 230, 232, 0.75);
  content: "";
}

.board-surface {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 12px;
  background:
    repeating-linear-gradient(87deg, transparent 0 48px, rgba(84, 70, 48, 0.016) 49px, transparent 51px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 48%),
    var(--paper);
  box-shadow: inset 0 0 45px rgba(78, 69, 53, 0.07);
}

#boardSvg {
  display: block;
  width: 100%;
  height: 100%;
}

.board-base {
  fill: url(#boardWash);
}

.decor-ring {
  fill: none;
  stroke: rgba(62, 79, 74, 0.045);
  stroke-width: 2;
}

.track-guide {
  fill: none;
  stroke: rgba(65, 82, 77, 0.1);
  stroke-dasharray: 2 16;
  stroke-linecap: round;
  stroke-width: 5;
}

.track-guide--square {
  stroke-dasharray: 2 15;
}

.track-cell {
  fill: rgba(255, 255, 255, 0.76);
  stroke: rgba(53, 70, 65, 0.14);
  stroke-width: 2;
  filter: url(#cellShadow);
}

.track-cell.is-red,
.lane-cell.is-red { fill: var(--red-soft); stroke: rgba(164, 71, 67, 0.34); }
.track-cell.is-green,
.lane-cell.is-green { fill: var(--green-soft); stroke: rgba(58, 116, 90, 0.32); }
.track-cell.is-blue,
.lane-cell.is-blue { fill: var(--blue-soft); stroke: rgba(60, 105, 142, 0.3); }
.track-cell.is-yellow,
.lane-cell.is-yellow { fill: var(--yellow-soft); stroke: rgba(160, 124, 39, 0.32); }

.track-cell.is-start {
  stroke-width: 5;
}

.track-number {
  fill: rgba(49, 66, 61, 0.42);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  pointer-events: none;
  text-anchor: middle;
}

.lane-cell {
  stroke-width: 2;
  filter: url(#cellShadow);
}

.lane-index {
  fill: rgba(42, 60, 54, 0.36);
  font-family: ui-monospace, monospace;
  font-size: 14px;
  font-weight: 700;
  text-anchor: middle;
}

.flight-route {
  fill: none;
  stroke-width: 7;
  stroke-dasharray: 13 15;
  stroke-linecap: round;
  opacity: 0.28;
}

.flight-route.is-red { stroke: var(--red); }
.flight-route.is-green { stroke: var(--green); }
.flight-route.is-blue { stroke: var(--blue); }
.flight-route.is-yellow { stroke: var(--yellow); }

.flight-arrow {
  opacity: 0.55;
}

.hangar-halo {
  opacity: 0.45;
  filter: url(#softGlow);
}

.hangar-pad {
  fill: rgba(255, 255, 255, 0.6);
  stroke-width: 3;
}

.hangar-pad.is-red { stroke: rgba(201, 97, 93, 0.28); }
.hangar-pad.is-green { stroke: rgba(91, 146, 122, 0.28); }
.hangar-pad.is-blue { stroke: rgba(95, 134, 169, 0.28); }
.hangar-pad.is-yellow { stroke: rgba(208, 168, 78, 0.3); }

.hangar-dash {
  fill: none;
  stroke-width: 2;
  stroke-dasharray: 6 9;
  opacity: 0.34;
}

.hangar-title {
  font-family: inherit;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-anchor: middle;
}

.hangar-subtitle {
  fill: rgba(50, 67, 62, 0.36);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-anchor: middle;
}

.hangar-title.is-red { fill: var(--red); }
.hangar-title.is-green { fill: var(--green); }
.hangar-title.is-blue { fill: var(--blue); }
.hangar-title.is-yellow { fill: #b58d31; }

.center-disc {
  fill: rgba(255, 255, 255, 0.74);
  stroke: rgba(52, 70, 64, 0.11);
  stroke-width: 3;
  filter: url(#cellShadow);
}

.center-wing {
  opacity: 0.86;
}

.center-plane {
  fill: rgba(38, 51, 47, 0.68);
  stroke: var(--gold);
  stroke-linejoin: round;
  stroke-width: 2;
}

.plane-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plane-piece {
  --plane-color: var(--red);
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(31px, 5.1%, 44px);
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: var(--plane-color);
  color: white;
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.2), inset -3px -4px 7px rgba(44, 49, 46, 0.16), 0 5px 10px rgba(34, 51, 46, 0.22);
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: top 300ms cubic-bezier(0.2, 0.72, 0.2, 1), left 300ms cubic-bezier(0.2, 0.72, 0.2, 1), transform 180ms ease, opacity 240ms ease;
}

.plane-piece[data-color="0"] { --plane-color: var(--red); }
.plane-piece[data-color="1"] { --plane-color: var(--green); }
.plane-piece[data-color="2"] { --plane-color: var(--blue); }
.plane-piece[data-color="3"] { --plane-color: var(--yellow); color: #5c481c; }

.plane-piece svg {
  width: 71%;
  height: 71%;
  fill: currentColor;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
  transform: rotate(var(--plane-rotation, 0deg));
}

.plane-piece:not(.is-current) {
  cursor: default;
}

.plane-piece.is-movable {
  z-index: 6;
  cursor: pointer;
  animation: plane-ready 1.15s ease-in-out infinite;
}

.plane-piece.is-movable:hover {
  transform: translate(-50%, -50%) scale(1.12);
}

.plane-piece.is-moving {
  z-index: 8;
  animation: plane-hop 370ms ease both;
}

.plane-piece.is-flying {
  z-index: 9;
  transition-duration: 500ms;
  animation: plane-flight 550ms ease-in-out both;
}

.plane-piece.is-captured {
  animation: plane-captured 480ms ease both;
}

.board-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 12;
  display: flex;
  min-width: min(310px, 74%);
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(197, 166, 87, 0.3);
  border-radius: 19px;
  background: rgba(249, 248, 242, 0.93);
  box-shadow: 0 18px 48px rgba(29, 46, 41, 0.2);
  pointer-events: none;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  animation: toast-in 230ms ease both;
}

.board-toast.is-leaving {
  animation: toast-out 230ms ease forwards;
}

.board-toast__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(229, 207, 130, 0.24);
  color: var(--gold-deep);
}

.board-toast svg {
  width: 24px;
  fill: currentColor;
}

.board-toast strong,
.board-toast small {
  display: block;
}

.board-toast strong {
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
}

.board-toast small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.mobile-turn {
  display: none;
}

.board-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 16px;
}

.tool-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 7px 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #59645f;
  font-size: 12px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.tool-button:hover {
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
}

.tool-button:active {
  transform: scale(0.97);
}

.tool-button svg {
  width: 20px;
  height: 20px;
}

.tool-divider {
  width: 1px;
  height: 21px;
  background: var(--line);
}

.control-panel {
  padding: 28px 26px 23px;
  border: 1px solid rgba(255, 255, 255, 0.73);
  border-radius: 23px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(51, 65, 63, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.turn-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.turn-beacon {
  --beacon: var(--red);
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 17px;
  background: color-mix(in srgb, var(--beacon) 17%, white);
  color: var(--beacon);
  box-shadow: 0 8px 17px color-mix(in srgb, var(--beacon) 17%, transparent);
  transition: color 220ms ease, background 220ms ease;
}

.turn-beacon--red { --beacon: var(--red); }
.turn-beacon--green { --beacon: var(--green); }
.turn-beacon--blue { --beacon: var(--blue); }
.turn-beacon--yellow { --beacon: var(--yellow); }

.turn-beacon svg {
  width: 35px;
  fill: currentColor;
}

.turn-card h1 {
  margin: 4px 0 2px;
  font-family: inherit;
  font-size: clamp(25px, 2.8vw, 31px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.12;
}

.turn-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.dice-button {
  display: grid;
  grid-template-columns: 58px 1fr 21px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  gap: 14px;
  margin-top: 21px;
  padding: 10px 16px 10px 11px;
  border: 1px solid rgba(197, 166, 87, 0.23);
  border-radius: 19px;
  background: linear-gradient(135deg, rgba(233, 215, 151, 0.33), rgba(255, 255, 255, 0.53));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(82, 75, 49, 0.08);
  transition: transform 150ms ease, box-shadow 170ms ease, opacity 170ms ease;
}

.dice-button:hover:not(:disabled) {
  box-shadow: 0 13px 27px rgba(82, 75, 49, 0.12);
  transform: translateY(-1px);
}

.dice-button:active:not(:disabled) {
  transform: scale(0.985);
}

.dice-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.dice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 58px;
  height: 58px;
  padding: 9px;
  border: 1px solid rgba(72, 79, 74, 0.12);
  border-radius: 16px;
  background: #fffefa;
  box-shadow: inset -4px -5px 10px rgba(87, 83, 69, 0.08), 0 6px 13px rgba(52, 61, 57, 0.14);
}

.dice i {
  display: none;
  align-self: center;
  justify-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.dice i:nth-child(1) { grid-area: 1 / 1; }
.dice i:nth-child(2) { grid-area: 1 / 2; }
.dice i:nth-child(3) { grid-area: 1 / 3; }
.dice i:nth-child(4) { grid-area: 2 / 1; }
.dice i:nth-child(5) { grid-area: 2 / 2; }
.dice i:nth-child(6) { grid-area: 2 / 3; }
.dice i:nth-child(7) { grid-area: 3 / 1; }
.dice i:nth-child(8) { grid-area: 3 / 2; }
.dice i:nth-child(9) { grid-area: 3 / 3; }
.dice[data-face="1"] i:nth-child(5),
.dice[data-face="2"] i:nth-child(1), .dice[data-face="2"] i:nth-child(9),
.dice[data-face="3"] i:nth-child(1), .dice[data-face="3"] i:nth-child(5), .dice[data-face="3"] i:nth-child(9),
.dice[data-face="4"] i:nth-child(1), .dice[data-face="4"] i:nth-child(3), .dice[data-face="4"] i:nth-child(7), .dice[data-face="4"] i:nth-child(9),
.dice[data-face="5"] i:nth-child(1), .dice[data-face="5"] i:nth-child(3), .dice[data-face="5"] i:nth-child(5), .dice[data-face="5"] i:nth-child(7), .dice[data-face="5"] i:nth-child(9),
.dice[data-face="6"] i:nth-child(1), .dice[data-face="6"] i:nth-child(3), .dice[data-face="6"] i:nth-child(4), .dice[data-face="6"] i:nth-child(6), .dice[data-face="6"] i:nth-child(7), .dice[data-face="6"] i:nth-child(9) {
  display: block;
}

.dice.is-rolling {
  animation: dice-roll 960ms cubic-bezier(0.22, 0.78, 0.3, 1) both;
}

.dice-copy small,
.dice-copy strong {
  display: block;
}

.dice-copy small {
  margin-bottom: 4px;
  color: var(--gold-deep);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.dice-copy strong {
  font-family: inherit;
  font-size: 19px;
  font-weight: 600;
}

.dice-arrow {
  width: 19px;
  color: var(--gold-deep);
}

.rule {
  height: 1px;
  margin: 21px 0 20px;
  background: linear-gradient(90deg, var(--gold) 0 38px, var(--line) 38px 100%);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 13px;
}

.section-heading h2,
.option-heading h2 {
  margin: 3px 0 0;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
}

.section-heading small,
.option-heading small {
  margin: 0;
}

.classic-badge {
  padding: 5px 8px;
  border: 1px solid rgba(197, 166, 87, 0.18);
  border-radius: 999px;
  background: rgba(229, 207, 130, 0.12);
  color: var(--gold-deep);
  font-size: 9px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border-radius: 15px;
  background: rgba(91, 109, 103, 0.09);
}

.mode-button {
  display: flex;
  min-height: 65px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #74807b;
  font-size: 11px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.mode-button svg {
  width: 22px;
  height: 22px;
}

.mode-button.is-active,
.difficulty-button.is-active,
.count-button.is-active,
.fill-button.is-active,
.shape-button.is-active {
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(53, 64, 62, 0.08);
}

.mode-button:active,
.difficulty-button:active,
.count-button:active,
.fill-button:active,
.shape-button:active,
.color-button:active {
  transform: scale(0.98);
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.option-heading {
  flex: 0 0 auto;
}

.option-heading h2,
.option-heading h3 {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 600;
}

.small-segment {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(2, 1fr);
  max-width: 161px;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(91, 109, 103, 0.09);
}

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

.difficulty-button,
.count-button,
.fill-button,
.shape-button {
  min-height: 37px;
  padding: 5px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.color-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 161px;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(91, 109, 103, 0.09);
}

.color-button {
  display: grid;
  min-height: 37px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.color-button.is-active {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 14px rgba(53, 64, 62, 0.08);
}

.color-button i {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(35, 48, 44, 0.2);
}

.color-button i.is-red { background: var(--red); }
.color-button i.is-green { background: var(--green); }
.color-button i.is-blue { background: var(--blue); }
.color-button i.is-yellow { background: var(--yellow); }

.settings-card {
  width: min(520px, 100%);
  text-align: left;
}

.settings-card > small,
.settings-card > h2,
.settings-card > p {
  text-align: center;
}

.settings-card .primary-button {
  margin-top: 22px;
}

.settings-form {
  display: grid;
  gap: 3px;
  padding: 4px 0 2px;
}

.settings-form .option-row {
  min-height: 51px;
  margin-top: 5px;
  padding: 4px 0;
}

.settings-subheading {
  margin: 12px 0 8px;
}

.settings-subheading small {
  margin: 0;
  color: var(--gold-deep);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.settings-subheading h3 {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 600;
}

.player-color-settings {
  margin-top: 2px;
  padding: 2px 0 11px;
  border-bottom: 1px solid var(--line);
}

#playerColorRows {
  display: grid;
  gap: 7px;
}

.player-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 3px 0 3px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.35);
}

.player-color-row > strong {
  font-size: 12px;
  font-weight: 600;
}

.player-color-row .color-picker {
  flex: 0 0 181px;
  width: 181px;
  background: rgba(91, 109, 103, 0.07);
}

.gentle-note {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 15px;
  padding: 12px 13px;
  border: 1px solid rgba(197, 166, 87, 0.16);
  border-radius: 14px;
  background: rgba(229, 207, 130, 0.11);
}

.note-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: rgba(229, 207, 130, 0.25);
  color: var(--gold-deep);
}

.note-icon svg {
  width: 18px;
  height: 18px;
}

.gentle-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.gentle-note strong {
  color: #49524f;
  font-size: 11px;
  font-weight: 600;
}

.player-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.player-list li {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  min-width: 0;
  gap: 7px;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.28);
  opacity: 0.68;
  transition: border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.player-list li.is-current {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 5px 12px rgba(47, 61, 56, 0.06);
  opacity: 1;
}

.player-list li.is-inactive {
  display: none;
}

.player-swatch,
.color-dot {
  display: block;
  border-radius: 50%;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.35), 0 2px 4px rgba(29, 43, 38, 0.16);
}

.player-swatch {
  width: 14px;
  height: 14px;
}

.player-swatch--red,
.color-dot--red { background: var(--red); }
.player-swatch--green,
.color-dot--green { background: var(--green); }
.player-swatch--blue,
.color-dot--blue { background: var(--blue); }
.player-swatch--yellow,
.color-dot--yellow { background: var(--yellow); }

.player-list strong,
.player-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-list strong {
  font-size: 9px;
  font-weight: 600;
}

.player-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.player-list b {
  color: var(--muted);
  font-size: 9px;
}

.version-button {
  position: fixed;
  right: max(13px, env(safe-area-inset-right));
  bottom: max(11px, env(safe-area-inset-bottom));
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
  box-shadow: 0 5px 15px rgba(45, 61, 56, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 150ms ease;
}

.version-button:hover {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
}

.version-button:active {
  transform: scale(0.97);
}

.version-button span {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.version-button strong {
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.changelog-card {
  width: min(460px, 100%);
  overflow: hidden;
  text-align: left;
}

.changelog-card > small,
.changelog-card h2,
.changelog-subtitle {
  text-align: center;
}

.changelog-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.changelog-list {
  max-height: min(480px, calc(100dvh - 210px));
  padding-right: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: color-mix(in srgb, var(--muted) 32%, transparent) transparent;
  scrollbar-width: thin;
}

.changelog-entry {
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.43);
}

.changelog-entry + .changelog-entry {
  margin-top: 9px;
}

.changelog-entry.is-current {
  border-color: rgba(197, 166, 87, 0.36);
  background: rgba(229, 207, 130, 0.11);
}

.changelog-entry header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.changelog-entry header strong {
  font-family: inherit;
  font-size: 17px;
}

.changelog-entry header span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(197, 166, 87, 0.17);
  color: var(--gold-deep);
  font-size: 9px;
  font-weight: 700;
}

.changelog-entry ul {
  margin: 9px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.changelog-entry li::marker {
  color: var(--gold);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(35, 47, 43, 0.29);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 190ms ease both;
}

.dialog-card {
  position: relative;
  width: min(410px, 100%);
  max-height: calc(100dvh - 44px);
  padding: 42px 35px 30px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: rgba(248, 247, 241, 0.97);
  box-shadow: 0 35px 90px rgba(29, 36, 33, 0.22);
  text-align: center;
  overscroll-behavior: contain;
  touch-action: pan-y;
  animation: card-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dialog-close {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  border: 0;
  border-radius: 50%;
  background: rgba(79, 87, 82, 0.07);
  color: #606a65;
  font-family: Arial, sans-serif;
  font-size: 25px;
  font-weight: 300;
  cursor: pointer;
}

.dialog-card h2 {
  margin: 8px 0 9px;
  font-family: inherit;
  font-size: 33px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.dialog-card > p {
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.rule-list {
  display: grid;
  gap: 8px;
  margin: 24px 0 23px;
  text-align: left;
}

.rule-list article {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.43);
}

.rule-list article > span,
.rule-list article > svg {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(229, 207, 130, 0.2);
  color: var(--gold-deep);
}

.rule-list article > span {
  font-family: ui-monospace, monospace;
  font-size: 20px;
  font-weight: 800;
}

.rule-list strong {
  display: block;
  margin-bottom: 3px;
  font-family: inherit;
  font-size: 15px;
}

.rule-list p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.primary-button {
  width: 100%;
  min-height: 51px;
  border: 0;
  border-radius: 16px;
  background: #dbc477;
  color: #373329;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 9px 22px rgba(168, 139, 51, 0.18);
  transition: transform 150ms ease, background 150ms ease;
}

.primary-button:hover {
  background: #e3cb7d;
  transform: translateY(-1px);
}

.primary-button:active {
  transform: scale(0.98);
}

.text-button {
  margin-top: 11px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 17px;
  border-radius: 50%;
  background: rgba(229, 207, 130, 0.22);
  color: var(--gold-deep);
}

.confirm-icon svg {
  width: 27px;
  height: 27px;
}

.result-planes {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 4px 0 22px;
}

.result-planes i {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: var(--winner-color, var(--red));
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.25), 0 5px 10px rgba(40, 54, 49, 0.16);
  animation: plane-pop 390ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result-planes i:nth-child(2) { animation-delay: 70ms; }
.result-planes i:nth-child(3) { animation-delay: 140ms; }
.result-planes i:nth-child(4) { animation-delay: 210ms; }

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

.confetti i {
  position: absolute;
  top: -24px;
  width: 9px;
  height: 14px;
  border-radius: 50%;
  opacity: 0;
  animation: confetti-fall var(--duration, 2.6s) ease-in var(--delay, 0s) forwards;
}

@keyframes dice-roll {
  0% { transform: rotate(0) scale(1); }
  35% { transform: rotate(19deg) scale(0.88); }
  70% { transform: rotate(-13deg) scale(1.08); }
  100% { transform: rotate(0) scale(1); }
}

@keyframes plane-ready {
  0%, 100% { box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.2), inset -3px -4px 7px rgba(44, 49, 46, 0.16), 0 5px 10px rgba(34, 51, 46, 0.22), 0 0 0 0 color-mix(in srgb, var(--plane-color) 35%, transparent); }
  50% { box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.2), inset -3px -4px 7px rgba(44, 49, 46, 0.16), 0 5px 10px rgba(34, 51, 46, 0.22), 0 0 0 9px color-mix(in srgb, var(--plane-color) 3%, transparent); }
}

@keyframes plane-hop {
  48% { transform: translate(-50%, -72%) scale(1.1); }
}

@keyframes plane-flight {
  45% { transform: translate(-50%, -76%) scale(1.2) rotate(4deg); filter: drop-shadow(0 12px 9px rgba(34, 51, 46, 0.23)); }
}

@keyframes plane-captured {
  35% { transform: translate(-50%, -50%) scale(0.72) rotate(14deg); opacity: 0.55; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 13px)) scale(0.95); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translate(-50%, calc(-50% - 8px)) scale(0.98); }
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes card-in { from { opacity: 0; transform: translateY(17px) scale(0.97); } }
@keyframes plane-pop { from { opacity: 0; transform: translateY(-15px) scale(0.65); } }

@keyframes confetti-fall {
  0% { opacity: 0; transform: translate3d(0, -20px, 0) rotate(0); }
  12% { opacity: 0.9; }
  100% { opacity: 0; transform: translate3d(var(--drift, 20px), 110svh, 0) rotate(540deg); }
}

@media (orientation: landscape) and (pointer: coarse) {
  html,
  body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }

  .app-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .board-frame {
    width: min(100%, calc(100dvh - 166px));
  }

  .control-panel {
    padding: 20px 22px 16px;
  }

  .turn-card {
    gap: 12px;
  }

  .turn-beacon {
    width: 48px;
    height: 48px;
  }

  .turn-card h1 {
    font-size: 27px;
  }

  .dice-button {
    min-height: 72px;
    margin-top: 15px;
  }

  .rule {
    margin: 15px 0 14px;
  }

  .section-heading {
    margin-bottom: 9px;
  }

  .mode-button {
    min-height: 55px;
  }

  .option-row {
    margin-top: 9px;
  }

  .gentle-note {
    margin-top: 10px;
    padding: 9px 11px;
  }

  .control-panel.is-local .gentle-note {
    display: none;
  }

  .note-icon {
    width: 29px;
    height: 29px;
  }

  .player-list {
    gap: 5px;
    margin-top: 9px;
  }

  .player-list li {
    padding: 7px 8px;
  }
}

@media (max-width: 920px) {
  .game-layout {
    grid-template-columns: 1fr;
    gap: 31px;
  }

  .board-frame {
    width: min(100%, 700px);
  }

  .control-panel {
    width: min(700px, 100%);
    margin: 0 auto 20px;
  }

  .turn-card {
    display: none;
  }

  .mobile-turn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 37px;
    margin-bottom: 8px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
  }

  .color-dot {
    width: 18px;
    height: 18px;
  }

  .dice-button {
    margin-top: 0;
  }
}

@media (max-width: 540px) {
  .app-shell {
    padding-top: max(11px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .topbar {
    min-height: 57px;
    margin-bottom: 7px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
    border-radius: 13px;
  }

  .brand-mark svg {
    width: 27px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand small {
    font-size: 6px;
  }

  .icon-button {
    width: 41px;
    height: 41px;
  }

  .board-frame {
    padding: 6px;
    border-radius: 13px;
  }

  .board-frame::after {
    inset: -6px;
    border-radius: 18px;
  }

  .board-surface {
    border-radius: 8px;
  }

  .track-number,
  .lane-index,
  .hangar-subtitle {
    display: none;
  }

  .hangar-title {
    font-size: 16px;
  }

  .board-toast {
    min-width: min(290px, 83%);
    padding: 12px 14px;
  }

  .board-tools {
    margin-top: 11px;
  }

  .control-panel {
    padding: 22px 17px 19px;
    border-radius: 19px;
  }

  .dialog-card {
    padding: 41px 23px 26px;
  }

  .dialog-card h2 {
    font-size: 29px;
  }

  .settings-card {
    padding-inline: 22px;
  }

  .player-color-row {
    padding-left: 10px;
  }

  .player-color-row .color-picker {
    flex-basis: 164px;
    width: 164px;
  }

  .version-button span {
    display: none;
  }
}

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