/* ══════════════════════════════════════════════════════════════
   帽峰飞行 · 飞行棋
   与「云山对弈」同一套设计语言：深墨底、细线、衬线标题、云雾质感。
   主色从金换成山青 —— 帽峰山的林色，一眼能认出是同一系列，
   又不会和五子棋混淆。
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #050505;
  --ink: #f5f4f1;
  --ink-dim: #a09d97;
  --ink-faint: #6a6862;

  /* 主色：山青 */
  --jade: #6fae94;
  --jade-line: rgba(111, 174, 148, .40);
  --jade-soft: rgba(111, 174, 148, .10);

  --line: rgba(245, 244, 241, .11);
  --line-2: rgba(245, 244, 241, .20);

  /* 四色。全部压低饱和度，免得在一片墨色里显得刺眼。
     每色三档：l 亮（高光）/ 本色 / d 暗（边缘）——
     飞机的立体感靠这三档做，不用纯白高光，那会显塑料。 */
  --c0: #c9705f; --c0-l: #d98d7e; --c0-d: #8a4438;   /* 赭石 */
  --c1: #6fae94; --c1-l: #8ec7ae; --c1-d: #3f6e5b;   /* 山青 */
  --c2: #c9a558; --c2-l: #ddc07f; --c2-d: #87702f;   /* 陈金 */
  --c3: #6e8fc4; --c3-l: #93b0dd; --c3-d: #42597f;   /* 黛青 */

  /* 棋盘 */
  --board-bg: #0a0a0d;
  /* 路径格要比底色明显亮一档。太暗的话整盘只剩几颗彩色棋子在飘，
     看不出「这是一条路」——这是飞行棋最要紧的结构信息。 */
  --cell: #1b1b21;
  --cell-line: rgba(245, 244, 241, .10);

  --font-display: "NSSC FS", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-ui: "Manrope", system-ui, -apple-system, "PingFang SC", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100svh;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, #101012 0%, #08080a 55%, #050505 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  /* 纵向列 + 居中。注意用的是 flex-direction: column 而不是 row ——
     这样 .wrap 才能靠 margin:auto 在「有空间时居中、没空间时从顶部排」，
     不会像 justify-content:center 那样一溢出就把顶部裁掉。 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem .9rem calc(1rem + env(safe-area-inset-bottom));
}

.wrap {
  width: 100%;
  max-width: 40rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  /* flex 子项默认 min-width: auto —— 内容一宽就把容器顶出去，
     整个页面横向溢出、右边被裁掉。必须显式压成 0。 */
  min-width: 0;
  margin: auto 0;
}

/* ═══════════ 顶部 ═══════════ */

.hd {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .8rem;
}

.hd__back {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-dim);
  flex: none;
  text-decoration: none;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.hd__back:hover { color: var(--jade); border-color: var(--jade-line); }

.hd__title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: .18em;
  text-align: center;
  color: var(--ink);
  min-width: 0;
  /* 标题上藏着一个双击彩蛋，触发点不做任何视觉标记。
     这两条只防双击时冒文字选中、防手机双击缩放，外观不变。 */
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.hd__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .12rem;
  flex: none;
  min-width: 4.2rem;
}

.hd__ver {
  font-family: var(--font-ui);
  font-size: .625rem;
  letter-spacing: .1em;
  color: var(--ink-faint);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.hd__stat {
  font-size: .625rem;
  letter-spacing: .06em;
  color: var(--ink-faint);
  white-space: nowrap;
}

.hd__reset {
  flex: none;
  font-family: var(--font-ui);
  font-size: .75rem;
  letter-spacing: .12em;
  color: var(--ink-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: .42rem .8rem;
  cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.hd__reset:hover { color: var(--jade); border-color: var(--jade-line); }
.hd__reset:disabled { opacity: .4; cursor: default; }

/* ═══════════ 座位条 ═══════════ */

.seats {
  flex: 0 0 auto;
  display: grid;
  /* 必须写 minmax(0, 1fr)，不能只写 1fr。
     1fr 的最小值是「内容宽度」，而座位名是 white-space: nowrap 的 ——
     四列一合计就把容器顶宽，整页横向溢出。这是 grid 里最常见的坑之一。 */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .4rem;
  min-width: 0;
}

.seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .38rem .28rem .34rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .012);
  transition: border-color .3s var(--ease), background .3s var(--ease);
  overflow: hidden;
  min-width: 0;
}

/* 当前该谁的回合：边框点亮 + 一点点内发光。
   不用整块填色 —— 四个人同屏时满屏亮色很难看。 */
.seat.is-turn {
  border-color: var(--sc, var(--line-2));
  background: color-mix(in srgb, var(--sc, #fff) 8%, transparent);
}
.seat.is-turn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 18px -6px var(--sc, transparent);
  pointer-events: none;
}

/* 座位没人：虚线框，明确「这里还能进」 */
.seat.is-empty {
  border-style: dashed;
  opacity: .55;
}

.seat__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--sc, #666);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc, #000) 18%, transparent);
  flex: none;
}

.seat__name {
  font-size: .6875rem;
  letter-spacing: .04em;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-width: 0;
}
.seat.is-turn .seat__name { color: var(--ink); }

/* 两架飞机的进度：两条细线，走满就亮 */
.seat__track {
  display: flex;
  gap: 2px;
  width: 100%;
  justify-content: center;
}
.seat__bar {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(245, 244, 241, .1);
  overflow: hidden;
}
.seat__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sc, #999);
  border-radius: 2px;
  transition: width .35s var(--ease);
}
.seat__bar.is-done i { background: var(--sc, #999); box-shadow: 0 0 6px var(--sc, transparent); }

/* 战果：每个座位四个小格，颜色是「打下来的是谁」。
   全 0 时压到几乎看不见，不然开局四个人就是十六个灰块。 */
.seat__kills {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-top: .05rem;
}
.seat__kills i {
  font-style: normal;
  font-size: .5625rem;
  line-height: 1;
  min-width: .86rem;
  padding: 1px 0;
  text-align: center;
  border-radius: 2px;
  color: var(--kc, #888);
  background: color-mix(in srgb, var(--kc, #888) 20%, transparent);
  font-variant-numeric: tabular-nums;
}
.seat__kills i.is-zero {
  color: var(--ink-faint);
  background: transparent;
  opacity: .42;
}
.seat__kills i.is-self {
  color: var(--ink-faint);
  background: transparent;
  opacity: .22;
}

/* ═══════════ 棋盘 ═══════════ */

.board-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* 关键：flex 子项默认 flex-shrink:1。
     座位条一加战果行，整列高度变高，棋盘就被压缩 ——
     aspect-ratio 拦不住压缩，格子会变成扁的、飞机全错位。
     棋盘必须刚性：宁可整页滚动，也不能变形。 */
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--board-bg);
  border: 1px solid var(--line);
  overflow: hidden;
  /* 一点点内阴影，让棋盘像嵌进去而不是贴上去 */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 20px 50px -30px #000;
}

.grid {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── 棋盘元素（SVG 类）── */
/* 外圈格子：一格一个独立方块，四色轮流实心填充。
   之前试过「无缝连成带」和「只描边不填色」，两种都数不清格子 ——
   飞行棋是要数格子的，这一条比好看重要。 */
.cell-rect {
  fill: var(--cell);
  stroke: rgba(0, 0, 0, .5);
  stroke-width: .04;
}
/* 亮度是这块棋盘的关键。低饱和是对的，但「低饱和 + 太暗」会糊成一片，
   远看像一张暗色马赛克地板，不像棋盘。.68 既能看清四色，
   又不会像参考图那样鲜亮到刺眼。 */
.cell-rect--0 { fill: rgba(201, 112, 95, .84); }
.cell-rect--1 { fill: rgba(111, 174, 148, .84); }
.cell-rect--2 { fill: rgba(201, 165, 88, .84); }
.cell-rect--3 { fill: rgba(110, 143, 196, .84); }

/* 行进方向：一个细箭头，压得很淡，只做提示不抢画面 */
.dir-arrow {
  fill: none;
  stroke: rgba(245, 244, 241, .50);
  stroke-width: .085;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* 基地：角落的淡色底，标识「这是谁的家」 */
.base {
  fill: rgba(255, 255, 255, .030);
  stroke: rgba(245, 244, 241, .16);
  stroke-width: .045;
}
/* 机库用「弱填充 + 强轮廓」：看起来像图纸上的机库边界，
   而不是一块压住四角的色块。填充降到 .022 之后，
   四角在视觉上就"退"下去了，路径自然浮上来。 */
/* 机库要"有颜色但不抢戏"。
   填太淡 → 一块空黑框，像没画完；填太浓 → 四个大色块压住四角。
   .11 配 .56 的轮廓，是这两个极端之间的位置。 */
/* 标准 Ludo：四角是铺满的机库。
   填充只给 .10 —— 再浓一点，停在里面的同色飞机会和底色糊在一起，
   看起来像「棋子丢了」。地盘归属靠轮廓线表达就够了。 */
.base--0 { fill: rgba(201, 112, 95, .10); stroke: rgba(201, 112, 95, .55); stroke-width: .06; }
.base--1 { fill: rgba(111, 174, 148, .10); stroke: rgba(111, 174, 148, .55); stroke-width: .06; }
.base--2 { fill: rgba(201, 165, 88, .10); stroke: rgba(201, 165, 88, .55); stroke-width: .06; }
.base--3 { fill: rgba(110, 143, 196, .10); stroke: rgba(110, 143, 196, .55); stroke-width: .06; }

/* 停机位：基地里两个小圆 */
.slot {
  fill: rgba(6, 6, 8, .30);
  stroke-width: .055;
  stroke-dasharray: .14 .12;
}
.slot--0 { stroke: rgba(201, 112, 95, .62); }
.slot--1 { stroke: rgba(111, 174, 148, .62); }
.slot--2 { stroke: rgba(201, 165, 88, .62); }
.slot--3 { stroke: rgba(110, 143, 196, .62); }

/* 机位编号：极小的数字，只在没有飞机时清楚，有飞机时被压住也无所谓 */
.slot-num {
  font-size: .52px;
  font-family: var(--font-ui);
  font-weight: 600;
  user-select: none;
  pointer-events: none;
}
.slot-num--0 { fill: rgba(201, 112, 95, .9); }
.slot-num--1 { fill: rgba(111, 174, 148, .9); }
.slot-num--2 { fill: rgba(201, 165, 88, .9); }
.slot-num--3 { fill: rgba(110, 143, 196, .9); }

/* 两个停机位之间的牵引虚线 */
.base-lead {
  stroke: rgba(245, 244, 241, .16);
  stroke-width: .035;
  stroke-dasharray: .10 .12;
  stroke-linecap: round;
}

/* 终点通道：用该方颜色浅浅染一条 */
.lane {
  fill: rgba(255, 255, 255, .035);
  stroke-width: .04;
}
.lane--0 { fill: rgba(201, 112, 95, .10); stroke: rgba(201, 112, 95, .20); }
.lane--1 { fill: rgba(111, 174, 148, .10); stroke: rgba(111, 174, 148, .20); }
.lane--2 { fill: rgba(201, 165, 88, .10); stroke: rgba(201, 165, 88, .20); }
.lane--3 { fill: rgba(110, 143, 196, .10); stroke: rgba(110, 143, 196, .20); }

/* 外圈格子按颜色轮转，但只给一点点暗示 —— 4 色全亮会花 */

/* 起点：加一圈实线 */
.start-ring {
  fill: none;
  stroke-width: .07;
}
.start-ring--0 { stroke: rgba(201, 112, 95, .75); }
.start-ring--1 { stroke: rgba(111, 174, 148, .75); }
.start-ring--2 { stroke: rgba(201, 165, 88, .75); }
.start-ring--3 { stroke: rgba(110, 143, 196, .75); }

/* 安全格：四角星。落上去不吃子、也不会被吃 —— Ludo 里叫 "safe square"。
   没有它，先起步的人可以守在起点反复吃人，落后方永远出不来。 */
.safe-star {
  fill: rgba(245, 244, 241, .22);
  stroke: rgba(245, 244, 241, .55);
  stroke-width: .045;
  stroke-linejoin: round;
  pointer-events: none;
}

/* 飞行点：一个向上的小三角，表示「从这里能飞」 */
.fly-mark { opacity: .8; }

/* 中心终点区 */
/* 中心终点：四色三角收束成一点，标准 Ludo 的图案 */
.home-tri--0 { fill: rgba(201, 112, 95, .48); }
.home-tri--1 { fill: rgba(111, 174, 148, .48); }
.home-tri--2 { fill: rgba(201, 165, 88, .48); }
.home-tri--3 { fill: rgba(110, 143, 196, .48); }

.home-core {
  fill: none;
  stroke: rgba(245, 244, 241, .30);
  stroke-width: .06;
}

/* ═══════════ 飞机 ═══════════ */

.planes { position: absolute; inset: 0; }

.pawn {
  position: absolute;
  width: 7.4%;
  aspect-ratio: 1 / 1;
  margin: -3.7% 0 0 -3.7%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  /* 位置用 left/top 百分比，配合 transform 做居中与抬起 */
  transform: translateZ(0);
  transition: left .26s var(--ease), top .26s var(--ease),
              transform .26s var(--ease), translate .26s var(--ease),
              box-shadow .3s var(--ease);
  will-change: left, top, transform;
  cursor: default;
  z-index: 2;
}

/* 机体：一个稍微带方向的形状，比纯圆点更像「飞机」 */
.pawn__body {
  width: 100%; height: 100%;
  border-radius: 50%;
  /* 国际飞行棋（Ludo）的标准棋子是**同心圆盘**：
     一圈浅色外沿 + 中间一道内环 + 中心微微隆起。
     这里用「同一颜色的三档明暗」做立体感，不用纯白高光。 */
  background: radial-gradient(circle at 50% 40%,
    var(--pc-l, #ccc) 0%, var(--pc, #aaa) 50%, var(--pc-d, #666) 100%);
  border: 1.5px solid rgba(255, 255, 255, .30);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, .72),
    inset 0 -2px 5px rgba(0, 0, 0, .34),
    inset 0 2px 3px rgba(255, 255, 255, .20);
  position: relative;
}

/* 内环：Ludo 棋子那道同心圆 */
.pawn__body::after {
  content: "";
  position: absolute;
  inset: 21%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .34);
  background: radial-gradient(circle at 50% 36%,
    rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, 0) 62%);
}

.pawn--0 { --pc: var(--c0); --pc-l: var(--c0-l); --pc-d: var(--c0-d); }
.pawn--1 { --pc: var(--c1); --pc-l: var(--c1-l); --pc-d: var(--c1-d); }
.pawn--2 { --pc: var(--c2); --pc-l: var(--c2-l); --pc-d: var(--c2-d); }
.pawn--3 { --pc: var(--c3); --pc-l: var(--c3-l); --pc-d: var(--c3-d); }

/* 可点的飞机：轻微呼吸 + 抬起，明确「这个能动」 */
.pawn.is-movable {
  cursor: pointer;
  transform: scale(1.16) translateZ(0);
  z-index: 5;
  animation: pawn-breathe 1.6s ease-in-out infinite;
}
.pawn.is-movable .pawn__body {
  box-shadow:
    0 0 0 2px rgba(245, 244, 241, .55),
    0 3px 10px rgba(0, 0, 0, .6),
    0 0 18px -2px var(--pc, #fff);
}
@keyframes pawn-breathe {
  0%, 100% { transform: scale(1.16) translateZ(0); }
  50%      { transform: scale(1.24) translateZ(0); }
}

/* 同格多子：用独立的 translate 属性错开，
   不用 transform —— 否则会和「可动棋子放大」的 transform 互相覆盖。
   （CSS 的 translate / rotate / scale 是三个独立属性，可以叠加。） */
.pawn.stack-1 { translate: 22% 22%; z-index: 1; }
.pawn.stack-2 { translate: -22% 22%; z-index: 1; }
.pawn.stack-3 { translate: 22% -22%; z-index: 1; }

/* 刚要起飞 / 刚落地的那一架，闪一下 */
.pawn.is-flash { animation: pawn-flash .6s var(--ease); }
@keyframes pawn-flash {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .0); }
  30%  { box-shadow: 0 0 0 6px rgba(255, 255, 255, .18); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ═══════════ 落点提示 ═══════════ */

.marks { position: absolute; inset: 0; pointer-events: none; }

/* 落点提示：实线圈 + 微光。
   刻意不用虚线 —— 基地里的停机位是虚线圈，两者混在一起就分不清
   「这是我要走到的位置」还是「这是飞机停着的地方」。 */
.mark {
  position: absolute;
  width: 6%;
  aspect-ratio: 1 / 1;
  margin: -3% 0 0 -3%;
  border-radius: 50%;
  border: 2px solid rgba(245, 244, 241, .9);
  background: rgba(245, 244, 241, .16);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .45),
    0 0 14px rgba(245, 244, 241, .35),
    inset 0 0 8px rgba(245, 244, 241, .25);
  animation: mark-pulse 1.5s ease-in-out infinite;
}
@keyframes mark-pulse {
  0%, 100% { opacity: .62; transform: scale(.94); }
  50%      { opacity: 1;   transform: scale(1.08); }
}

/* ═══════════ 特效 ═══════════ */

.fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; }

/* 飞行轨迹：一条从起点划到终点的光弧 */
.trail {
  position: absolute;
  height: 2px;
  transform-origin: 0 50%;
  background: linear-gradient(90deg,
    rgba(111, 174, 148, 0) 0%,
    rgba(111, 174, 148, .85) 45%,
    rgba(245, 244, 241, .95) 100%);
  border-radius: 2px;
  animation: trail-fly .52s cubic-bezier(.3, .7, .2, 1) forwards;
}
@keyframes trail-fly {
  from { opacity: 0; transform: scaleX(.2) rotate(var(--a)); }
  45%  { opacity: 1; }
  to   { opacity: 0; transform: scaleX(1) rotate(var(--a)); }
}

/* 落点涟漪 */
.ripple {
  position: absolute;
  width: 6%;
  aspect-ratio: 1 / 1;
  margin: -3% 0 0 -3%;
  border-radius: 50%;
  border: 1.5px solid rgba(111, 174, 148, .8);
  animation: ripple-out .7s var(--ease) forwards;
}
@keyframes ripple-out {
  from { opacity: .9; transform: scale(.4); }
  to   { opacity: 0;  transform: scale(3.4); }
}

/* 撞子：一圈红雾 */
.burst {
  position: absolute;
  width: 7%;
  aspect-ratio: 1 / 1;
  margin: -3.5% 0 0 -3.5%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 112, 95, .75) 0%, rgba(201, 112, 95, 0) 68%);
  animation: burst-out .65s var(--ease) forwards;
}
@keyframes burst-out {
  from { opacity: 1; transform: scale(.5); }
  to   { opacity: 0; transform: scale(2.6); }
}

/* 起飞：一道上冲的竖光 */
.liftoff {
  position: absolute;
  width: 1.4%;
  height: 12%;
  margin-left: -.7%;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(111, 174, 148, 0) 0%, rgba(111, 174, 148, .9) 100%);
  animation: liftoff-up .55s var(--ease) forwards;
}
@keyframes liftoff-up {
  from { opacity: .9; transform: translateY(0) scaleY(.3); }
  to   { opacity: 0;  transform: translateY(-140%) scaleY(1); }
}

/* ═══════════ 骰子与操作 ═══════════ */

.tray {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .1rem 0;
}

.dice {
  flex: none;
  width: 4.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .28rem;
  padding: .55rem .3rem .5rem;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.dice:hover:not(:disabled) {
  border-color: var(--jade-line);
  background: var(--jade-soft);
}
.dice:disabled { opacity: .45; cursor: default; }

.dice__face {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0;
  color: var(--jade);
  /* 数字切换时不要有跳动的宽度变化 */
  font-variant-numeric: tabular-nums;
}

/* 掷骰动画：快速抖动 */
.dice.is-rolling .dice__face {
  animation: dice-shake .12s linear infinite;
  color: var(--ink);
}
@keyframes dice-shake {
  0%   { transform: translate(0, 0) rotate(0); }
  25%  { transform: translate(-1px, 1px) rotate(-6deg); }
  50%  { transform: translate(1px, -1px) rotate(4deg); }
  75%  { transform: translate(-1px, -1px) rotate(-3deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

.dice__label {
  font-size: .625rem;
  letter-spacing: .14em;
  color: var(--ink-faint);
}

.tray__right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .42rem;
}

.hint {
  font-size: .75rem;
  line-height: 1.45;
  color: var(--ink-dim);
  letter-spacing: .01em;
  min-height: 1.1rem;
}
.hint b { color: var(--jade); font-weight: 500; }

.acts {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.act {
  font-family: var(--font-ui);
  font-size: .6875rem;
  letter-spacing: .06em;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: .34rem .68rem;
  cursor: pointer;
  transition: color .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
  white-space: nowrap;
}
.act:hover { color: var(--ink); border-color: var(--line-2); }
.act--ghost { background: transparent; }
.act--on {
  color: var(--jade);
  border-color: var(--jade-line);
  background: var(--jade-soft);
}
.act:disabled { opacity: .38; cursor: default; }

/* ═══════════ 规则摘要 ═══════════ */

/* 一行小字，把最容易卡住的几条讲清楚。
   飞行棋的规则不算复杂，但「掷 6 才能起飞」不写出来，
   第一次玩的人会盯着骰子发懵。 */
.rules {
  font-size: .625rem;
  line-height: 1.75;
  color: var(--ink-faint);
  letter-spacing: .02em;
  text-align: center;
  padding: 0 .2rem;
}
.rules b {
  color: var(--ink-dim);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ═══════════ 面板 ═══════════ */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(3, 3, 3, .62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.scrim[hidden] { display: none; }

.panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 21;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(12, 12, 14, .98);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .8);
  animation: panel-in .3s var(--ease);
}
.panel[hidden] { display: none; }
@keyframes panel-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.97); }
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.panel__head b {
  font-family: var(--font-display);
  font-size: .9375rem;
  font-weight: 400;
  letter-spacing: .12em;
}

.panel__x {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  font-size: .8rem;
  cursor: pointer;
  border-radius: 50%;
}
.panel__x:hover { color: var(--ink); }

.panel__note {
  font-size: .6875rem;
  line-height: 1.55;
  color: var(--ink-faint);
  margin-bottom: .75rem;
}

.panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
  margin-bottom: .85rem;
}

.pick {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .015);
  color: var(--ink-dim);
  font-size: .75rem;
  cursor: pointer;
  text-align: left;
  transition: all .22s var(--ease);
}
.pick:hover { border-color: var(--line-2); color: var(--ink); }
.pick.is-on {
  border-color: var(--sc, var(--jade-line));
  background: color-mix(in srgb, var(--sc, #fff) 10%, transparent);
  color: var(--ink);
}
.pick__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--sc, #666);
  flex: none;
}
.pick__txt { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.pick__txt i {
  font-style: normal;
  font-size: .625rem;
  color: var(--ink-faint);
}
.pick.is-on .pick__txt i { color: var(--ink-dim); }

.panel__foot { display: flex; justify-content: flex-end; }

/* 规则面板：条目化，每条一个编号 + 标题 + 两句说明 */
.panel--rules {
  width: min(24rem, calc(100vw - 2rem));
  max-height: min(80svh, 34rem);
  display: flex;
  flex-direction: column;
}
.rules-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: .2rem;
}
.rules-body h4 {
  display: flex;
  align-items: center;
  gap: .42rem;
  font-family: var(--font-display);
  font-size: .8125rem;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--jade);
  margin: .8rem 0 .28rem;
}
.rules-body h4:first-child { margin-top: 0; }
.rules-body__n {
  font-family: var(--font-ui);
  font-size: .5625rem;
  letter-spacing: .04em;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .1rem .26rem;
  flex: none;
}
.rules-body p {
  font-size: .6875rem;
  line-height: 1.7;
  color: var(--ink-dim);
  padding-left: 1.5rem;
}
.rules-body b { color: var(--ink); font-weight: 500; }

/* ═══════════ 局终浮层 ═══════════ */

.result {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(3, 3, 3, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in .4s var(--ease);
}
.result[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }

.result__inner {
  text-align: center;
  padding: 1.6rem 2rem;
  animation: result-in .55s var(--ease);
}
@keyframes result-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
}

.result__kicker {
  font-size: .625rem;
  letter-spacing: .3em;
  color: var(--ink-faint);
  margin-bottom: .7rem;
}

.result__name {
  font-family: var(--font-display);
  font-size: 1.9rem;
  letter-spacing: .18em;
  margin-bottom: .5rem;
}

.result__sub {
  font-size: .75rem;
  color: var(--ink-dim);
  letter-spacing: .05em;
  margin-bottom: 1.3rem;
}

/* ═══════════ 小屏微调 ═══════════ */

@media (max-width: 380px) {
  .hd__title { font-size: 1.05rem; letter-spacing: .12em; }
  .hd__stat { display: none; }
  .seat__name { font-size: .625rem; }
  .dice { width: 3.8rem; }
  .act { font-size: .625rem; padding: .3rem .55rem; }
}

/* 尊重「减少动态效果」的系统设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
