/* ============================================================
   军训训练场 · 队列大考核
   0. 主题变量 / 基础重置
   ============================================================ */
:root {
  --ink: #0f140b;
  --panel: rgba(20, 26, 14, .82);
  --line: rgba(255, 226, 160, .22);
  --gold: #ffd166;
  --sand: #e9d3a3;
  --good: #9be15d;
  --bad: #ff5c5c;
  --cyan: #7fd8ff;
  --pink: #ff9ec4;
  --purple: #c9a7ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
               system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #f4f6ea;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button { font-family: inherit; outline: none; border: none; cursor: pointer; }
input { font-family: inherit; outline: none; }

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(125% 85% at 50% 45%, rgba(0,0,0,0) 40%, rgba(28,18,4,.45) 100%),
    linear-gradient(180deg, rgba(14,20,9,.72) 0%, rgba(14,20,9,0) 26%,
                            rgba(14,20,9,0) 66%, rgba(10,14,6,.7) 100%);
}

#flash {
  position: absolute;
  inset: 0;
  z-index: 17;
  pointer-events: none;
  opacity: 0;
  background: #ff3b3b;
}

/* 烈日眩光 */
#glare {
  position: absolute;
  inset: 0;
  z-index: 16;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 78% 15%, rgba(255,255,255,1) 0%, rgba(255,253,240,.97) 26%,
                    rgba(255,246,214,.62) 52%, rgba(255,246,214,0) 76%),
    radial-gradient(circle at 50% 22%, rgba(255,255,255,.9), rgba(255,255,255,0) 62%);
}
#glare.active { animation: glareFlash 1.05s ease-out; }
@keyframes glareFlash {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  46%  { opacity: .96; }
  100% { opacity: 0; }
}

/* ============================================================
   1. 顶部 HUD
   ============================================================ */
.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

.hud-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.panel {
  background: linear-gradient(180deg, rgba(38,47,25,.86), rgba(17,22,11,.9));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.1);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.stamina { width: 230px; padding: 8px 12px 10px; }
.stamina-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
}
.stamina-head .t { font-size: 10.5px; letter-spacing: .28em; color: #d9c68f; }
.stamina-head .n {
  font-size: 15px;
  font-weight: 900;
  color: #d9f0a8;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(160,230,110,.5);
}
.stamina-track {
  position: relative;
  height: 13px;
  border-radius: 7px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65);
  overflow: hidden;
}
.stamina-fill {
  position: relative;
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 7px;
  background: linear-gradient(180deg, #c2f57a, #6fc93a);
  box-shadow: 0 0 14px rgba(155,225,93,.55);
  transition: width .16s linear, background .35s ease;
}
.stamina-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg,
    rgba(255,255,255,.16) 0 7px, rgba(255,255,255,0) 7px 15px);
}
.stamina.shake { animation: barShake .4s ease; }
@keyframes barShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  50%      { transform: translateX(4px); }
  75%      { transform: translateX(-2px); }
}

.chips { display: flex; gap: 8px; }
.chip {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(38,47,25,.86), rgba(17,22,11,.9));
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(7px);
}
.chip span { font-size: 10px; letter-spacing: .2em; color: #c4cfa9; }
.chip b {
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  color: #fff6d8;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255,210,120,.55);
}
.chip b.pop { animation: numPop .32s cubic-bezier(.2,1.5,.4,1); }
@keyframes numPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.28); }
  100% { transform: scale(1); }
}
#comboChip { transition: box-shadow .25s, border-color .25s; }
#comboChip.hot {
  border-color: rgba(255,209,102,.72);
  box-shadow: 0 0 22px rgba(255,190,80,.45), inset 0 1px 0 rgba(255,255,255,.1);
}
#comboChip.hot b { color: var(--gold); }

.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.stage-box {
  padding: 8px 14px;
  border-radius: 12px;
  text-align: right;
  background: linear-gradient(180deg, rgba(38,47,25,.86), rgba(17,22,11,.9));
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(7px);
}
.stage-box .s1 { display: block; font-size: 10px; letter-spacing: .26em; color: #b9c4a3; }
.stage-box .s2 {
  display: block;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255,200,90,.45);
}

.clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(38,47,25,.86), rgba(17,22,11,.9));
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(7px);
}
.clock span { font-size: 10px; letter-spacing: .18em; color: #b9c4a3; }
.clock b {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  color: #fff6d8;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.clock.danger b { color: #ff8080; animation: clockPulse .8s ease-in-out infinite; }
@keyframes clockPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}

.thirst-badge {
  align-self: flex-start;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #ffd9a0;
  background: rgba(180, 60, 30, .55);
  border: 1px solid rgba(255, 170, 120, .5);
  animation: thirstPulse .9s ease-in-out infinite;
}
.thirst-badge.on { display: inline-flex; }
@keyframes thirstPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,120,60,.5); }
  50%      { box-shadow: 0 0 0 9px rgba(255,120,60,0); }
}

/* ============================================================
   2. 教官台词框
   ============================================================ */
.dialog {
  position: absolute;
  top: 92px;
  left: 50%;
  z-index: 8;
  width: min(560px, 92%);
  transform: translateX(-50%);
  padding: 12px 20px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(40,50,27,.93), rgba(18,23,12,.95));
  border: 1px solid rgba(255,226,160,.32);
  box-shadow: 0 18px 44px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
  transition: opacity .25s ease, transform .25s ease;
}
.dialog.hidden { opacity: 0; transform: translateX(-50%) translateY(-12px); pointer-events: none; }
.dialog::after {
  content: "";
  position: absolute;
  left: 54px;
  bottom: -11px;
  width: 20px;
  height: 20px;
  background: #161c10;
  border-right: 1px solid rgba(255,226,160,.32);
  border-bottom: 1px solid rgba(255,226,160,.32);
  transform: rotate(45deg);
}

.dialog-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2px;
}
.who {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .3em;
  text-indent: .3em;
  color: #1d2410;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe38a, #ffbe4d);
  box-shadow: 0 2px 0 rgba(140,90,10,.5);
}
.who-tip { font-size: 10.5px; letter-spacing: .22em; color: #a9b795; }

.order {
  font-size: clamp(32px, 6.6vw, 54px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: .06em;
  color: #fffdf3;
  text-shadow:
    0 3px 0 rgba(66,42,10,.55),
    0 0 30px rgba(255,205,110,.6),
    0 12px 32px rgba(0,0,0,.6);
  will-change: transform, opacity;
}
.order.pop { animation: orderPop .34s cubic-bezier(.2,1.5,.35,1); }
@keyframes orderPop {
  0%   { transform: scale(.6) translateY(-12px); opacity: 0; filter: blur(6px); }
  60%  { transform: scale(1.06); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); }
}

.order-bar {
  position: relative;
  width: 88%;
  height: 8px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.6);
  overflow: hidden;
}
.order-bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9be15d, #d7f26b);
  transition: width .06s linear, background .2s linear;
}

/* ============================================================
   3. 底部按键提示
   ============================================================ */
.keys {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 12;
  width: min(880px, calc(100% - 20px));
  transform: translateX(-50%);
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px 7px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(74,88,51,.92), rgba(38,46,26,.95));
  border: 1px solid rgba(255,255,255,.16);
  box-shadow:
    0 5px 0 rgba(16,22,10,.9),
    0 10px 18px rgba(0,0,0,.42),
    inset 0 1px 0 rgba(255,255,255,.16);
  transition: transform .09s ease, box-shadow .09s ease, filter .2s ease, border-color .2s;
  color: #eef2e0;
}
.key .k {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .04em;
  color: #fff6d8;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(0,0,0,.28));
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: 0 2px 0 rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.2);
}
.key .n { font-size: 11px; letter-spacing: .06em; color: #d6dfc2; }
.key.down {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(16,22,10,.9), 0 4px 10px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1);
  filter: brightness(1.2);
}
.key.right { border-color: rgba(155,225,93,.9); animation: keyRight .45s ease; }
.key.wrong { border-color: rgba(255,92,92,.9); animation: keyWrong .45s ease; }
@keyframes keyRight {
  0%   { box-shadow: 0 0 0 0 rgba(155,225,93,.9), 0 5px 0 rgba(16,22,10,.9); }
  100% { box-shadow: 0 0 0 20px rgba(155,225,93,0), 0 5px 0 rgba(16,22,10,.9); }
}
@keyframes keyWrong {
  0%   { box-shadow: 0 0 0 0 rgba(255,92,92,.9), 0 5px 0 rgba(16,22,10,.9); }
  100% { box-shadow: 0 0 0 20px rgba(255,92,92,0), 0 5px 0 rgba(16,22,10,.9); }
}

/* ============================================================
   4. 阶段横幅 / 事件提示
   ============================================================ */
.stage-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  z-index: 20;
  transform: translate(-50%, -50%) scale(.9);
  padding: 14px 44px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(180deg, rgba(28,36,19,.95), rgba(12,16,8,.96));
  border: 1px solid rgba(255,226,160,.42);
  box-shadow: 0 22px 60px rgba(0,0,0,.66), inset 0 1px 0 rgba(255,255,255,.14);
  opacity: 0;
  pointer-events: none;
}
.stage-banner.show { animation: bannerIn 1.7s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes bannerIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.82); }
  16%  { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
  24%  { transform: translate(-50%, -50%) scale(1); }
  82%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.06); }
}
.stage-banner .b1 {
  display: block;
  font-size: 11px;
  letter-spacing: .42em;
  text-indent: .42em;
  color: #b9c4a3;
}
.stage-banner .b2 {
  display: block;
  margin-top: 4px;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 900;
  letter-spacing: .14em;
  text-indent: .14em;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(255,190,70,.6);
}

.toast {
  position: absolute;
  top: 218px;
  left: 50%;
  z-index: 15;
  transform: translateX(-50%);
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  color: #2a1e06;
  background: linear-gradient(180deg, #ffe38a, #ffb347);
  box-shadow: 0 8px 22px rgba(255,170,50,.38);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { animation: toastIn 1.8s ease both; }
@keyframes toastIn {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(.92); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(1); }
}

/* ============================================================
   5. 弹层通用
   ============================================================ */
.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(85% 70% at 50% 34%, rgba(26,34,17,.7), rgba(7,11,4,.96));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 1;
  transition: opacity .35s ease, visibility .35s ease;
}
.screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.card {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: 24px 22px 20px;
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 18% 0%, rgba(126,146,84,.3), transparent 62%),
    linear-gradient(165deg, rgba(56,68,38,.97), rgba(21,27,14,.99));
  border: 1px solid rgba(255,226,160,.22);
  box-shadow: 0 34px 80px rgba(0,0,0,.66), inset 0 1px 0 rgba(255,255,255,.14);
}
.screen:not(.hidden) .card,
.screen:not(.hidden) .cert { animation: cardIn .5s cubic-bezier(.2,.9,.3,1.14) both; }
@keyframes cardIn {
  0%   { opacity: 0; transform: translateY(26px) scale(.94); }
  100% { opacity: 1; transform: none; }
}

.badge {
  display: inline-block;
  padding: 4px 14px;
  margin-bottom: 12px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: #ffe9b0;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,226,160,.3);
}

.game-title {
  font-size: clamp(32px, 9vw, 46px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: .08em;
  background: linear-gradient(180deg, #fffaea 6%, #ffd166 56%, #e2922a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 rgba(74,46,8,.55)) drop-shadow(0 0 26px rgba(255,180,60,.42));
}
.game-sub {
  margin-top: 6px;
  font-size: 11.5px;
  letter-spacing: .24em;
  text-indent: .24em;
  color: #cbd5b4;
}

/* ---- 姓名 / 连队 ---- */
.signup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.field span { font-size: 10px; letter-spacing: .18em; color: #a9b795; padding-left: 4px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 13px;
  color: #fff6d8;
  background: rgba(0,0,0,.34);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.35);
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #7d8a6b; }
.field input:focus {
  border-color: rgba(255,209,102,.75);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.35), 0 0 0 3px rgba(255,209,102,.16);
}

.key-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.key-legend div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 4px;
  border-radius: 10px;
  font-size: 11.5px;
  color: #d6dfc2;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.07);
}
.key-legend kbd {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  color: #fff6d8;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: 0 2px 0 rgba(0,0,0,.4);
}

.brief-line {
  margin: 0 4px 16px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #bfc9a9;
  text-align: left;
}
.brief-line b { color: #fff3d0; }

.btn-primary {
  position: relative;
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .22em;
  text-indent: .22em;
  color: #2a2109;
  background: linear-gradient(180deg, #ffe08a, #ffb43d);
  box-shadow: 0 6px 0 #b97b1c, 0 16px 28px rgba(255,170,50,.32);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(255,255,255,.6) 50%, transparent 68%);
  transform: translateX(-130%);
  animation: sheen 2.8s ease-in-out infinite;
}
@keyframes sheen {
  0%, 55% { transform: translateX(-130%); }
  100%    { transform: translateX(130%); }
}
.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b97b1c, 0 6px 14px rgba(255,170,50,.3);
}

.btn-ghost {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  border-radius: 12px;
  font-size: 12.5px;
  letter-spacing: .16em;
  color: #cfd8bd;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  transition: background .2s, color .2s;
}
.btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

.tip {
  margin-top: 12px;
  font-size: 10.5px;
  line-height: 1.6;
  color: #93a17e;
  min-height: 14px;
}

/* ============================================================
   6. 排行榜
   ============================================================ */
.board-card { width: min(460px, 100%); }
.board-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .22em;
  text-indent: .22em;
  color: var(--gold);
  text-shadow: 0 0 26px rgba(255,190,70,.5), 0 3px 0 rgba(70,45,8,.45);
}
.board-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 14px 0 12px;
}
.board-stats div {
  padding: 8px 2px;
  border-radius: 11px;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.07);
}
.board-stats b {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: #ffe9b0;
  font-variant-numeric: tabular-nums;
}
.board-stats em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: .08em;
  color: #a9b795;
}

.board-list {
  list-style: none;
  max-height: 42vh;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
  text-align: left;
}
.board-list::-webkit-scrollbar { width: 6px; }
.board-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 3px;
}

.board-list .row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.06);
}
.board-list .row.top1 {
  background: linear-gradient(90deg, rgba(255,209,102,.16), rgba(0,0,0,.22));
  border-color: rgba(255,209,102,.4);
}
.board-list .row.top2 { border-color: rgba(200,214,229,.32); }
.board-list .row.top3 { border-color: rgba(214,160,110,.32); }

.board-list .rk {
  font-size: 15px;
  font-weight: 900;
  color: #c4cfa9;
  text-align: center;
}
.board-list .row.top1 .rk { font-size: 19px; }

.board-list .who { min-width: 0; }
.board-list .nm {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: #fff6d8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-list .cls {
  display: block;
  font-size: 10.5px;
  color: #93a17e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-list .right { text-align: right; }
.board-list .sc {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.board-list .meta { display: block; font-style: normal; font-size: 10px; color: #93a17e; }

.board-empty {
  padding: 26px 0;
  text-align: center;
  font-size: 12.5px;
  color: #93a17e;
  list-style: none;
}

/* ============================================================
   7. 结算 / 成绩上传状态
   ============================================================ */
.rank-line {
  margin: 12px 0 14px;
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: #a9b795;
  min-height: 15px;
}
.rank-line.pending { color: #d9c68f; }
.rank-line.ok { color: #9be15d; }
.rank-line.err { color: #ff8a8a; }
.cert .rank-line { color: #8a6f43; margin: 8px 0 4px; }
.cert .rank-line.ok { color: #3f7a2a; }
.cert .rank-line.err { color: #a8271c; }

.fail-icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.5));
  animation: floatY 2.4s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
.fail-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .16em;
  text-indent: .16em;
  color: #ff8080;
  text-shadow: 0 0 28px rgba(255,80,80,.45), 0 3px 0 rgba(60,10,10,.5);
}
.fail-reason {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #c9d3b5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 6px;
}
.stat {
  padding: 10px 4px;
  border-radius: 13px;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.08);
}
.stat b {
  display: block;
  font-size: 19px;
  font-weight: 900;
  color: #ffe9b0;
  font-variant-numeric: tabular-nums;
}
.stat em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .1em;
  color: #a9b795;
}

/* ============================================================
   8. 荣誉证书
   ============================================================ */
.cert {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: 28px 24px 22px;
  border-radius: 18px;
  text-align: center;
  color: #3a2a12;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 2px, rgba(0,0,0,0) 2px 4px),
    linear-gradient(160deg, #fdf6e0, #f2e2bd 55%, #e9d5a8 100%);
  box-shadow:
    0 34px 90px rgba(0,0,0,.7),
    inset 0 0 0 3px #d8b976,
    inset 0 0 0 8px #fdf6e0,
    inset 0 0 0 10px #b9432f;
}
.cert-title {
  font-size: clamp(28px, 7.2vw, 36px);
  font-weight: 900;
  letter-spacing: .18em;
  text-indent: .18em;
  color: #a8271c;
  text-shadow: 0 2px 0 rgba(255,255,255,.7);
}
.cert-sub {
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: .5em;
  text-indent: .5em;
  color: #9a7c46;
}
.cert-body {
  margin: 16px 4px 14px;
  font-size: 13px;
  line-height: 1.95;
  text-align: left;
  text-indent: 2em;
  color: #4a3a1e;
}
.cert-body b {
  color: #a8271c;
  font-weight: 900;
  padding: 0 2px;
  border-bottom: 1px solid rgba(168,39,28,.4);
}
.cert-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 10px;
}
.cert-stats div {
  padding: 9px 4px;
  border-radius: 10px;
  background: rgba(168,39,28,.06);
  border: 1px solid rgba(168,39,28,.18);
}
.cert-stats b {
  display: block;
  font-size: 19px;
  font-weight: 900;
  color: #a8271c;
  font-variant-numeric: tabular-nums;
}
.cert-stats em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 10px;
  letter-spacing: .12em;
  color: #8a6f43;
}
.cert-rank { font-size: 13px; letter-spacing: .08em; color: #4a3a1e; }
.cert-rank b { font-size: 17px; color: #a8271c; letter-spacing: .14em; }

.cert-foot {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
}
.cert-date { font-size: 12px; letter-spacing: .1em; color: #7d6438; }
.seal {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: .08em;
  color: #c0261a;
  text-align: center;
  border: 3px solid rgba(192,38,26,.85);
  box-shadow: inset 0 0 0 2px rgba(192,38,26,.5);
  transform: rotate(-13deg);
  opacity: .92;
  animation: sealIn .7s .35s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes sealIn {
  0%   { opacity: 0; transform: rotate(-40deg) scale(1.7); }
  100% { opacity: .92; transform: rotate(-13deg) scale(1); }
}
.cert .btn-primary { margin-top: 18px; }

/* ============================================================
   9. 响应式
   ============================================================ */
@media (max-height: 640px) {
  .dialog { top: 76px; padding: 9px 16px 11px; }
  .order { font-size: clamp(26px, 5.4vw, 40px); }
  .order-bar { margin-top: 7px; height: 7px; }
  .stamina { width: 190px; padding: 6px 10px 8px; }
  .toast { top: 186px; }
  .key { padding: 6px 3px 5px; }
  .key .k { height: 22px; font-size: 11px; }
  .key .n { font-size: 10px; }
  .card { padding: 18px 18px 16px; }
  .signup { margin: 12px 0 10px; }
  .board-list { max-height: 34vh; }
}
@media (max-width: 560px) {
  .keys { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .key .n { font-size: 10px; }
  .stamina { width: 170px; }
  .stage-box .s2 { font-size: 12px; }
  .clock b { font-size: 17px; }
  .chip { padding: 6px 10px; }
  .chip b { font-size: 16px; }
  .key-legend { grid-template-columns: repeat(2, 1fr); }
  .hud { padding: 10px; }
  .dialog { top: 84px; }
  .signup { grid-template-columns: 1fr; }
  .board-stats { grid-template-columns: repeat(2, 1fr); }
}
