/* ==========================================================================
   坦克狂飙 · 网页原型样式（黑 / 红 / 黄 工业风）
   ========================================================================== */
:root {
  --bg: #0c0c0e;
  --panel: #16161a;
  --panel2: #1d1d22;
  --line: #2e2e36;
  --ink: #f2f0ea;
  --dim: #8b8b94;
  --dim2: #5f6068;
  --red: #e62e24;
  --red-d: #8e1b14;
  --yellow: #ffc400;
  --blue: #4a9eff;
  --mint: #3cc8a5;
  --navy: #10233f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(900px 520px at 78% -8%, #1b0d0b 0%, transparent 62%),
    radial-gradient(700px 420px at -6% 108%, #111117 0%, transparent 60%);
}

kbd {
  font-family: Bahnschrift, "DIN Alternate", monospace;
  font-size: 10px;
  border: 1px solid #3a3a44;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  color: var(--dim);
  vertical-align: 1px;
}

/* ---------------- top bar ---------------- */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 26px 14px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: repeating-linear-gradient(45deg,
    var(--yellow) 0 12px, transparent 12px 24px);
  opacity: .75;
}
.brand .kicker {
  font-family: Bahnschrift, "DIN Alternate", monospace;
  letter-spacing: .28em;
  font-size: 10px;
  color: var(--yellow);
}
.brand h1 {
  margin: 6px 0 0;
  font-size: 26px;
  letter-spacing: .04em;
}
.brand h1 em { font-style: normal; color: var(--red); }

.status { display: flex; gap: 26px; align-items: center; }
.stat { text-align: right; }
.stat span {
  display: block;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--dim2);
  font-family: Bahnschrift, monospace;
}
.stat b {
  font-family: Bahnschrift, "DIN Alternate", monospace;
  font-size: 22px;
  font-weight: 700;
}
.stat b.cur { font-family: inherit; font-size: 18px; }

/* ---------------- layout ---------------- */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 22px;
  padding: 18px 26px 22px;
  align-items: start;
  align-content: center;
  min-height: calc(100vh - 96px);
}

/* ---------------- board ---------------- */
.board-area { min-width: 0; }

.board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 7px;
  aspect-ratio: 9 / 5;
  background: #0a0a0d;
  border: 1px solid #3a3a44;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .02);
  position: relative;
}
.board::before,
.board::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px;
  height: 3px;
  background: repeating-linear-gradient(90deg,
    #e62e24 0 10px, #eee 10px 20px);
  opacity: .5;
  pointer-events: none;
}
.board::before { top: 3px; }
.board::after { bottom: 3px; }

.cell {
  position: relative;
  border: 1px solid #3a3a46;
  border-radius: 8px;
  background: linear-gradient(180deg, #1d1d24, #141418);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--dim);
  overflow: hidden;
  transition: background .18s, border-color .18s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .45);
}
.cell::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 3px;
  background: var(--accent, #3a3a46);
  opacity: .9;
  z-index: 1;
}
.cell .tag {
  position: absolute;
  top: 7px; left: 7px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--dim2);
  font-family: Bahnschrift, monospace;
  letter-spacing: .04em;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid currentColor;
  z-index: 1;
}
.cell.normal .tag { display: none; }
.cell.normal {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .014) 0 3px, transparent 3px 9px),
    linear-gradient(180deg, #1d1d24, #141418);
}
.cell .glyph {
  font-family: Bahnschrift, monospace;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  opacity: .55;
  transform: translateY(5px);
  z-index: 0;
}
.cell .glyph.ev { color: #b48ce8; }
.cell .glyph.sup { color: var(--yellow); }
.cell .num {
  position: absolute;
  right: 6px; bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #6a6a7c;
  font-family: Bahnschrift, monospace;
  z-index: 1;
}

.cell.go    { background: var(--yellow); border-color: #ffe07a; color: #141414; --accent: #ffdf7a; }
.cell.pit   { background: #aeb4bc; border-color: #d6dbe1; color: #15151a; --accent: #e6ebf0; }
.cell.obst  { background: var(--red-d); border-color: #c33b30; color: #ffe9e7; --accent: #e2453a; }
.cell.chal  { background: var(--red); border-color: #ff7469; color: #180807; --accent: #ff8b80; }

.cell.corner {
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  letter-spacing: .04em;
}
.cell.corner::before { display: none; }
.cell.corner .en {
  font-family: Bahnschrift, monospace;
  font-size: 15px;
  letter-spacing: .1em;
}
.cell.corner .cn { font-size: 12px; opacity: .9; }

.cell.start::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, transparent 46%, rgba(255,255,255,.75) 46% 54%, transparent 54%);
  opacity: .9;
  pointer-events: none;
}

.cell.supply .tag { color: var(--yellow); }
.cell.chaos .tag { color: #ff8b84; }

.tokens {
  position: absolute;
  inset: auto 0 12px 0;
  display: flex;
  gap: 0;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 3px;
  pointer-events: none;
  z-index: 2;
}
.tok {
  width: 34px; height: 30px;
  border-radius: 7px;
  background:
    linear-gradient(90deg,
      #0b0b0e 0 5px,
      transparent 5px calc(100% - 5px),
      #0b0b0e calc(100% - 5px)),
    var(--c, #888);
  border: 2px solid #0b0b0e;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .28), 0 3px 8px rgba(0, 0, 0, .7);
  font: 800 15px/1 "Microsoft YaHei", Bahnschrift, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: none;
  pointer-events: auto;
  transition: transform .18s, box-shadow .18s;
}
.tok::before {
  content: "";
  position: absolute;
  left: 50%; bottom: 100%;
  width: 8px; height: 11px;
  background: #5c5c66;
  border: 1px solid #0b0b0e;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  transform: translateX(-50%);
}
.tok + .tok { margin-left: -10px; }
.cell.crowded .tok {
  width: 23px; height: 21px;
  font-size: 10px;
  border-radius: 5px;
}
.cell.crowded .tok::before {
  width: 5px; height: 7px;
}
.cell.crowded .tok + .tok { margin-left: -8px; }
.tok.cur {
  transform: translateY(-3px) scale(1.14);
  z-index: 3;
  animation: tokPulse 1.6s ease-in-out infinite;
}
@keyframes tokPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--c, #fff), 0 4px 12px rgba(0, 0, 0, .75);
  }
  50% {
    box-shadow: 0 0 0 2px #fff, 0 0 0 8px var(--c, #fff), 0 4px 16px rgba(0, 0, 0, .8);
  }
}

/* 图例 */
.board-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: .04em;
}
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot {
  width: 10px; height: 10px; border-radius: 3px;
  display: inline-block; background: #33333c;
}
.legend .dot.go { background: var(--yellow); }
.legend .dot.pit { background: #aeb4bc; }
.legend .dot.obst { background: var(--red-d); }
.legend .dot.chal { background: var(--red); }
.legend .dot.supply { background: var(--yellow); }
.legend .dot.tgt { background: #e2623f; border-radius: 50%; }
.legend .dot.evt { background: #9b6fd8; }

/* 靶位 / 事件 / 直道 */
.cell.target { color: #ff8a6b; border-color: #6b2a24; background: radial-gradient(circle at 50% 45%, #261512, #160f0e 72%); --accent: #e2623f; }
.cell.target .bull { width: 32px; height: 32px; opacity: .95; transition: .25s; }
.cell.target.down { color: #38383f; border-color: #2b2b33; background: #131317; --accent: #2e2e36; }
.cell.target.down .bull { opacity: .4; transform: scale(.82) rotate(-12deg); }
.cell.event { background: #1b1526; border-color: #4a3866; --accent: #9b6fd8; }
.cell.supply { background: #1d1a10; border-color: #5a4a18; --accent: var(--yellow); }
.cell .tag.ev { color: #b48ce8; }
.cell .tag.sup { color: var(--yellow); }
.cell .tag.dim { color: #3a3a44; }

/* 中央 M 轨 */
.center {
  grid-column: 2 / 9;
  grid-row: 2 / 5;
  position: relative;
  border: 1px solid var(--red-d);
  border-radius: 6px;
  background: radial-gradient(120% 120% at 50% 0%, #17171c 0%, #0f0f12 70%);
  overflow: hidden;
}
.center .c-head {
  position: absolute;
  top: 8px; left: 12px;
  font-family: Bahnschrift, monospace;
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--dim);
}
.center .c-head b { color: var(--red); }
.center .c-sub {
  position: absolute;
  top: 26px; left: 12px;
  font-size: 10px;
  color: var(--dim2);
}
.center svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.center .dz-label {
  font-family: Bahnschrift, monospace;
  font-size: 9px;
  fill: #141414;
}

/* ---------------- side ---------------- */
.side { display: flex; flex-direction: column; gap: 12px; }

.players { display: grid; gap: 8px; }
.pcard {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .18s, background .18s;
}
.pcard.active { border-color: var(--yellow); background: #1c1a12; }
.pcard.target { cursor: crosshair; border-color: var(--red); box-shadow: 0 0 0 2px rgba(230,46,36,.25); }
.pcard .bar { width: 8px; height: 34px; border-radius: 3px; }
.pcard .name { font-weight: 700; font-size: 14px; }
.pcard .name em.ai {
  font-style: normal;
  font-family: Bahnschrift, monospace;
  font-size: 9px;
  letter-spacing: .1em;
  color: #0b0b0d;
  background: var(--yellow);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 6px;
  vertical-align: 2px;
}
.pcard .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  row-gap: 3px;
  font-size: 10px;
  color: var(--dim2);
  margin-top: 4px;
  font-family: Bahnschrift, monospace;
  letter-spacing: .06em;
  min-width: 0;
}
.pcard .pts {
  font-family: Bahnschrift, monospace;
  font-size: 22px;
  font-weight: 700;
  text-align: right;
}
.pcard .pts small { display: block; font-size: 9px; color: var(--dim2); letter-spacing: .14em; }

.shells { display: inline-flex; gap: 3px; }
.shell { width: 7px; height: 13px; border-radius: 2px; background: #3a3a44; }
.shell.on { background: var(--red); }

.pips { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.pip { width: var(--pipw, 10px); height: 6px; border-radius: 2px; background: #33333c; }
.pip.on { background: var(--yellow); }

/* dice */
.dice-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.die {
  width: 54px; height: 54px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 7px;
  position: relative;
}
.diepips {
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
}
.diepips i { border-radius: 50%; background: transparent; display: block; }
.die.idle .diepips { visibility: hidden; }
.die.idle::after {
  content: "?";
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  font-family: Bahnschrift, monospace;
  font-size: 22px;
  font-weight: 700;
  color: #b9b9c2;
}

.die.white .diepips i.on { background: #141414; }
.die.red .diepips i.on { background: #fff; }
.die.white { background: #f2f0ea; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); }
.die.red { background: var(--red); box-shadow: inset 0 -4px 0 rgba(0,0,0,.28); }
.die.rolling { animation: shake .18s infinite; }
@keyframes shake {
  0% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-2px); }
  100% { transform: rotate(-4deg) translateY(0); }
}
.dice-label b { display: block; font-size: 12px; }
.dice-label small { color: var(--dim2); font-size: 10px; }

/* buttons */
.controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.btn { font-size: 12px; padding: 11px 4px; }
.btn kbd { display: none; }
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 10px;
  border-radius: 8px;
  border: 1px solid #3a3a44;
  background: var(--panel2);
  color: var(--ink);
  cursor: pointer;
  transition: transform .08s, background .18s, border-color .18s;
}
.btn:hover:not(:disabled) { border-color: #5a5a66; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.primary { background: var(--yellow); border-color: #ffe07a; color: #141414; }
.btn.danger { background: var(--red); border-color: #ff7469; color: #fff; }
.btn.warn { background: #241d0a; border-color: #4a3d14; color: #7a6a3a; }
.btn.warn.ready {
  background: #3a2d08;
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255, 196, 0, .15);
}
.btn.wide { width: 100%; margin-top: 14px; }

/* log */
.logbox {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 150px;
  max-height: 196px;
}
.log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: Bahnschrift, monospace;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--dim2);
  margin-bottom: 8px;
}
.mini {
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #3a3a44;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
#log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 168px;
  overflow-y: auto;
  font-size: 11.5px;
  line-height: 1.6;
  color: #cfcfd6;
}
#log li { padding: 3px 0; border-bottom: 1px dashed #232329; }
#log li:last-child { border-bottom: 0; }
#log li b { color: var(--ink); }
#log li.good { color: #9be8c8; }
#log li.bad { color: #ffa39c; }
#log .r {
  font-family: Bahnschrift, monospace;
  color: var(--dim2);
  font-size: 9px;
  margin-right: 6px;
}

/* rules */
.rules {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  color: #c9c9d2;
}
.rules summary {
  cursor: pointer;
  font-family: Bahnschrift, monospace;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--dim);
}
.rules ul { margin: 8px 0 0; padding-left: 16px; line-height: 1.7; }
.rules b { color: var(--yellow); }

/* 当前车组 */
.crewbox {
  background: var(--panel);
  border: 1px solid #3a3a44;
  border-radius: 10px;
  padding: 10px 12px 12px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.crewbox::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--crew, #E62E24);
}
.crewbox.flash {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255, 196, 0, .22), 0 0 24px rgba(255, 196, 0, .18);
}
.crewbox.flash .skill-name b { color: var(--yellow); }
.crew-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: Bahnschrift, monospace;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--dim2);
  margin-bottom: 8px;
}
.crew-top .tagline { color: #3d3d47; letter-spacing: .22em; }
.crew-body { display: flex; align-items: center; gap: 10px; }
.crew-badge {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  color: #111;
  background: var(--crew, #E62E24);
  box-shadow: 0 0 0 2px rgba(255,255,255,.06), 0 6px 16px rgba(0,0,0,.45);
  flex: none;
}
.crew-id { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.crew-id b { font-size: 15px; }
.crew-id span { font-size: 10px; color: var(--dim2); letter-spacing: .06em; }
.crew-pts { margin-left: auto; text-align: right; }
.crew-pts b {
  font-family: Bahnschrift, monospace;
  font-size: 20px;
  font-weight: 700;
}
.crew-pts small {
  display: block;
  font-family: Bahnschrift, monospace;
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--dim2);
}
.crew-skill {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed #2a2a33;
}
.sk-name { display: flex; align-items: center; gap: 8px; }
.sk-name b { font-size: 12.5px; }
.sk-name em {
  font-style: normal;
  font-family: Bahnschrift, monospace;
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--crew, #E62E24);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 1px 5px;
  opacity: .85;
}
.crew-skill p {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: #b9b9c2;
}

/* 部件 / 装备 */
.gear { display: inline-flex; gap: 2px; }
.gear .g {
  font-style: normal;
  font-size: 9px;
  line-height: 12px;
  width: 13px;
  text-align: center;
  border-radius: 3px;
  background: #26262e;
  color: #45454f;
}
.gear .g.on { background: var(--yellow); color: #141414; font-weight: 700; }

.crew-gear {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed #2a2a33;
}
.gear-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 0 4px;
  border-radius: 6px;
  border: 1px solid #2f2f38;
  background: #141418;
  font-size: 10px;
  color: #6d6d78;  transition: .2s;
}
.gear-chip em {
  font-style: normal;
  font-size: 8px;
  color: #3f3f48;
  letter-spacing: .02em;
}
.gear-chip.on {
  border-color: var(--crew);
  color: var(--ink);
  background: #1c1c22;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.gear-chip.on em { color: var(--crew); }

/* overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 8, .86);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 50;
}
.overlay.hidden { display: none; }
.modal {
  width: min(560px, 92vw);
  background: var(--panel);
  border: 1px solid #3a3a44;
  border-radius: 14px;
  padding: 28px 30px 26px;
  box-shadow: 0 40px 90px rgba(0,0,0,.6);
  position: relative;
}
.modal::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0; height: 4px;
  border-radius: 14px 14px 0 0;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 12px, transparent 12px 24px);
}
.modal .kicker {
  font-family: Bahnschrift, monospace;
  font-size: 10px;
  letter-spacing: .26em;
  color: var(--yellow);
}
.modal h2 { margin: 8px 0 6px; font-size: 26px; }
.modal p { color: var(--dim); font-size: 13px; line-height: 1.7; margin: 0; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.mode {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid #3a3a44;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: .18s;
}
.mode:hover { border-color: #5a5a66; color: var(--ink); }
.mode.on {
  color: var(--yellow);
  border-color: var(--yellow);
  background: #221d0c;
  box-shadow: inset 0 0 0 1px rgba(255,196,0,.25);
}
.seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.seat {
  padding: 14px 10px;
  border-radius: 10px;
  border: 1px solid #3a3a44;
  background: var(--panel2);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s;
}
.seat small { color: var(--dim2); font-weight: 400; font-size: 10px; }
.seat:hover { border-color: #5a5a66; }
.seat.on { border-color: var(--yellow); background: #221d0c; box-shadow: 0 0 0 2px rgba(255,196,0,.2); }

/* responsive */
@media (max-width: 1180px) {
  .app { grid-template-columns: 1fr; }
  .side { order: 2; }
}

/* ---------- 手机竖屏 ---------- */
@media (max-width: 640px) {
  body { -webkit-text-size-adjust: 100%; }
  .topbar { padding: 10px 12px 8px; }
  .brand h1 { font-size: 18px; letter-spacing: 0; }
  .kicker { font-size: 8px; letter-spacing: .16em; }
  .status { gap: 12px; }
  .status .stat span { font-size: 8px; }
  .status .stat b { font-size: 15px; }
  .status .cur { font-size: 14px !important; }

  .app { padding: 8px; gap: 10px; }
  .board { gap: 3px; padding: 4px; border-radius: 8px; }
  .cell { border-radius: 5px; }
  .cell::before { height: 2px; }
  .cell .num { font-size: 7px; right: 3px; bottom: 2px; }
  .cell .tag { display: none; }
  .cell .glyph { font-size: 17px; transform: translateY(2px); }
  .cell.target .bull { width: 17px; height: 17px; }
  .cell.corner .en { font-size: 10px; letter-spacing: .04em; }
  .cell.corner .cn { font-size: 8px; }

  .tokens { bottom: 4px; }
  .tok {
    width: 20px; height: 18px;
    font-size: 9px;
    border-width: 1px;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 1px 3px rgba(0, 0, 0, .7);
  }
  .tok::before { width: 5px; height: 6px; }
  .cell.crowded .tok {
    width: 15px; height: 14px;
    font-size: 7px;
    border-radius: 3px;
  }
  .cell.crowded .tok::before { width: 4px; height: 4px; }
  .cell.crowded .tok + .tok { margin-left: -5px; }

  .board-foot { font-size: 9px; gap: 9px; margin-top: 8px; }
  .legend .dot { width: 7px; height: 7px; }

  .side { gap: 8px; }
  .pcard { padding: 8px 10px; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 8px; }
  .pcard .bar { width: 6px; height: 28px; }
  .pcard .name { font-size: 12px; }
  .pcard .name em.ai { font-size: 8px; padding: 0 3px; }
  .pcard .pts { font-size: 18px; }
  .pcard .meta { font-size: 9px; gap: 6px; }
  .shell { width: 5px; height: 10px; }
  .pip { height: 5px; }

  .controls { gap: 6px; }
  .btn { font-size: 12px; padding: 11px 4px; border-radius: 8px; }
  .btn kbd { display: none; }

  .dice-row { padding: 8px; gap: 9px; }
  .die { width: 40px; height: 40px; }
  .dice-label b { font-size: 11px; }
  .dice-label small { font-size: 9px; }

  .logbox { max-height: 150px; }
  .crewbox { padding: 10px; }
  .modal { padding: 20px 18px; }
  .modal h2 { font-size: 21px; }
  .seats { gap: 8px; }
  .seat { padding: 10px 6px; font-size: 13px; }
}

/* ---------- 手机横屏：两栏更省纵向空间 ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .topbar { padding: 8px 14px 6px; }
  .brand h1 { font-size: 18px; }
  .app { grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; padding: 8px 12px; }
  .side { order: 0; gap: 8px; max-height: calc(100vh - 70px); overflow-y: auto; }
  .pcard { padding: 6px 9px; }
  .pcard .pts { font-size: 17px; }
  .dice-row { padding: 7px; }
  .die { width: 38px; height: 38px; }
  .controls { gap: 6px; }
  .btn { padding: 9px 4px; font-size: 12px; }
  .btn kbd { display: none; }
  .logbox { max-height: 96px; }
  .crewbox { display: none; }
  .board-foot { margin-top: 6px; font-size: 9px; }
}

