:root {
  --safe-top: max(env(safe-area-inset-top, 0px), var(--android-safe-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--android-safe-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--android-safe-left, 0px));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--android-safe-right, 0px));
  --olive: #8da200;
  --olive-deep: #6f8000;
  --olive-ink: #4f5c06;
  --lime: #dcf542;
  --score-outline: #ece9dd;
  --cream: rgba(252, 251, 228, 0.8);
  --pill-dark: rgba(38, 48, 16, 0.58);
  --font-en: "Fredoka", "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-cn: "Fredoka", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #eef2ec; }
body { font-family: var(--font-cn); color: #fff; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

#app { position: fixed; inset: 0; overflow: hidden; }
#app { background: radial-gradient(90% 75% at 50% 45%, #fbf8ee 0%, #f2eedf 70%, #e9e4d2 100%); }
#gl, #stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#stage { pointer-events: none; }

/* ---------- 屏幕通用 ---------- */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.screen.show { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .45s ease; }

.menu { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pill {
  position: relative; min-width: 148px; padding: 9px 30px 10px; border-radius: 999px;
  font-size: 18px; font-weight: 700; letter-spacing: .12em; line-height: 1.2;
  background: var(--pill-dark); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(30, 40, 10, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), background .2s, color .2s, box-shadow .2s;
  opacity: 0; transform: translateY(14px);
}
.screen.show .pill { animation: pillIn .55s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.screen.show .menu .pill:nth-child(2) { animation-delay: .07s; }
.screen.show .menu .pill:nth-child(3) { animation-delay: .14s; }
.screen.show .menu .pill:nth-child(4) { animation-delay: .21s; }
@keyframes pillIn { to { opacity: 1; transform: none; } }
.pill:hover, .pill:focus-visible { transform: translateY(-2px) scale(1.04); background: rgba(38, 48, 16, .78); color: var(--lime); outline: none; box-shadow: 0 10px 26px rgba(30, 40, 10, .26), 0 0 0 2px rgba(220, 245, 66, .45); }
.pill:active { transform: scale(.96); transition-duration: .06s; }
.pill.primary { color: var(--lime); }
.pill.primary::after {
  content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid rgba(220, 245, 66, .5);
  animation: pulse 2s ease-out infinite; pointer-events: none;
}
@keyframes pulse { 0% { opacity: .9; transform: scale(.96); } 70%, 100% { opacity: 0; transform: scale(1.14); } }

.pill.olive { background: var(--olive); color: #fff; backdrop-filter: none; box-shadow: none; }
.pill.olive:hover, .pill.olive:focus-visible { background: var(--olive-deep); color: #fff; box-shadow: 0 0 0 3px rgba(141, 162, 0, .25); }
.pill.olive.ghost { background: rgba(141, 162, 0, .14); color: var(--olive-deep); box-shadow: inset 0 0 0 2px rgba(141, 162, 0, .55); }
.pill.olive.ghost:hover { background: rgba(141, 162, 0, .24); color: var(--olive-ink); }
.pill.primary-olive { background: var(--olive); }

/* ---------- 开始界面 ---------- */
.start { justify-content: flex-start; }
/* CHG-331：主页玩家名只显示、不可点；贴屏幕顶部居中（与左上版本号、右上按钮同一行）。 */
.start .nick { position: absolute; top: calc(4px + var(--safe-top)); left: 50%; transform: translateX(-50%); cursor: default; pointer-events: none; }
.nick {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--olive-ink); background: rgba(255, 255, 240, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .2s;
}
.nick span { color: var(--olive); font-family: var(--font-en); }
.nick svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; opacity: .6; }
.nick:hover { background: rgba(255, 255, 240, .55); }

.logo {
  position: absolute; top: 25%; left: 50%; transform: translate(-50%, -50%); display: flex; gap: .06em;
  font-family: var(--font-en); font-weight: 600; font-size: clamp(32px, min(13vw, 18vh), 176px); line-height: 1; letter-spacing: .08em;
  color: #fff; text-shadow: 0 2px 0 rgba(255, 255, 255, .6), 0 10px 30px rgba(60, 80, 30, .35), 0 2px 6px rgba(60, 80, 30, .25);
}
.logo span { display: inline-block; opacity: 0; transform: translateY(-60px) scale(.6); }
.screen.show .logo span { animation: letterIn .9s cubic-bezier(.2, 1.5, .4, 1) forwards, bob 4s ease-in-out infinite; }
.screen.show .logo span:nth-child(1) { animation-delay: .05s, 1.0s; }
.screen.show .logo span:nth-child(2) { animation-delay: .12s, 1.15s; }
.screen.show .logo span:nth-child(3) { animation-delay: .19s, 1.3s; }
.screen.show .logo span:nth-child(4) { animation-delay: .26s, 1.45s; }
.screen.show .logo span:nth-child(5) { animation-delay: .33s, 1.6s; }
.screen.show .logo span:nth-child(6) { animation-delay: .40s, 1.75s; }
.screen.show .logo span:nth-child(7) { animation-delay: .47s, 1.9s; }
@keyframes letterIn { to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
/* 标题与按钮分别按页面高度定位，避免超宽屏标题把菜单位置挤偏。 */
.start .menu { position: absolute; top: min(49%, calc(100% - 224px)); gap: 12px; }
.start-tip { position: absolute; bottom: clamp(12px, 3.2vh, 32px); max-width: calc(100% - 24px); text-align: center; font-size: 13px; font-weight: 600; letter-spacing: .1em; color: rgba(70, 84, 20, .7); background: rgba(255, 255, 240, .5); padding: 6px 16px; border-radius: 999px; backdrop-filter: blur(4px); }

/* 模式选择与图鉴的课程咨询 */
.mode, .guide { --course-contact-top: calc(var(--safe-top) + 12px); }
.course-contact {
  position: absolute; top: var(--course-contact-top); inset-inline: 0;
  color: var(--olive-ink); font-size: clamp(13px, 1.3vw, 17px); font-weight: 600;
  line-height: 1.4; text-align: center; white-space: nowrap;
}

/* ---------- 模式选择 ---------- */
.mode .logo { top: 23%; font-size: clamp(32px, min(10vw, 14vh), 132px); }
.mode-cards { position: absolute; top: 37%; display: flex; gap: clamp(12px, 2.4vw, 36px); max-width: calc(100% - 24px); }
.mode-card {
  position: relative; width: clamp(150px, 17vw, 270px); padding: clamp(8px, 1vw, 16px); border-radius: 22px 22px 40px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(64, 82, 22, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 28px rgba(30, 40, 10, .2), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), background .2s, box-shadow .2s;
  opacity: 0; transform: translateY(14px);
}
.screen.show .mode-card { animation: pillIn .55s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.screen.show .mode-card:nth-child(2) { animation-delay: .07s; }
.screen.show .mode-card:nth-child(3) { animation-delay: .14s; }
.mode-card::after { content: ""; position: absolute; inset: -5px; border-radius: 26px 26px 44px 26px; border: 4px solid var(--lime); opacity: 0; transform: scale(.96); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.mode-card.selected::after { opacity: .9; transform: none; }
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-2px) scale(1.04); background: rgba(48, 62, 16, .78); outline: none; box-shadow: 0 14px 32px rgba(30, 40, 10, .28); }
.mode-card:active { transform: scale(.96); transition-duration: .06s; }
.mode-card.locked { cursor: default; }
.mode-card.locked:hover { transform: none; }
.mode-thumb { width: 100%; aspect-ratio: 8 / 5; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: rgba(40, 52, 12, .55); margin-bottom: clamp(4px, 1.2vh, 14px); }
.mode-thumb canvas { width: 100%; height: 100%; display: block; }
.mode-thumb i { font-style: normal; font-family: var(--font-en); font-weight: 700; font-size: clamp(48px, 7vw, 110px); line-height: 1; color: var(--lime); }
.mode-card b { font-size: clamp(16px, 1.8vw, 28px); font-weight: 800; letter-spacing: .08em; color: #fff; }
.mode-card small { font-size: clamp(12px, 1.2vw, 19px); font-weight: 700; letter-spacing: .06em; color: var(--lime); opacity: .9; }
.mode .mode-actions { position: absolute; top: min(76%, calc(100% - 110px)); flex-direction: row; }

/* ---------- HUD ---------- */
.hud {
  position: absolute; left: 0; right: 0; top: 0; height: 84px; padding: 18px 26px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start;
  opacity: 0; transform: translateY(-20px); transition: opacity .4s, transform .4s; pointer-events: none;
}
.hud.show { opacity: 1; transform: none; }
.hud.show .icon-btn { pointer-events: auto; }
.hud-left { display: flex; flex-direction: column; gap: 4px; }
/* 分数带 ece9dd 描边：四正 + 四对角共八层阴影拼出实心轮廓，随字体大小缩放。 */
.hud-score {
  font-family: var(--font-en); font-weight: 700; font-size: 40px; line-height: 1; color: var(--olive);
  text-shadow:
    -0.055em 0 0 var(--score-outline), 0.055em 0 0 var(--score-outline),
    0 -0.055em 0 var(--score-outline), 0 0.055em 0 var(--score-outline),
    -0.039em -0.039em 0 var(--score-outline), 0.039em -0.039em 0 var(--score-outline),
    -0.039em 0.039em 0 var(--score-outline), 0.039em 0.039em 0 var(--score-outline);
  transition: transform .15s; transform-origin: center center; text-align: center;
}
.hud-score.bump { transform: scale(1.22); }
.hud-score.hurt { color: #e5462b; }
.hud-title { font-family: var(--font-en); font-weight: 600; font-size: 17px; letter-spacing: .32em; color: var(--olive); padding-top: 6px; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.hud-right { display: flex; justify-content: flex-end; gap: 10px; }
/* 分数下方居中的道具状态栏：圆形图标 + 剩余时间圆环。 */
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.buff-bar { display: flex; gap: 8px; min-height: 0; }
.buff { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 240, .82); box-shadow: 0 3px 10px rgba(60, 80, 20, .2); animation: buff-in .25s ease-out; }
.buff[hidden] { display: none; }
.buff-icon { width: 30px; height: 30px; }
.buff-ring { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); transform: rotate(-90deg); display: none; }
.buff.timed .buff-ring { display: block; }
.buff-track { fill: none; stroke: rgba(60, 79, 20, .18); stroke-width: 3; }
.buff-left { fill: none; stroke: var(--buff-color); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100 100; }
.buff.blink { opacity: .35; }
@keyframes buff-in { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .buff { animation: none; } }
/* 鲸鱼娘 Boss 战顶部细条：分数下方居中，不遮分数与触控区；刻度有形状 + 数字，不只靠颜色；阶段 2/3 显示无敌与生存条。 */
.boss-bar { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 14px 6px; border-radius: 14px;
  background: rgba(255, 255, 240, .84); box-shadow: 0 3px 10px rgba(60, 80, 20, .2); color: var(--olive-deep); animation: buff-in .3s ease-out; }
.boss-bar[hidden] { display: none; }
.boss-head { display: flex; gap: 8px; align-items: baseline; font-size: 14px; letter-spacing: .08em; }
.boss-head span { font-size: 12px; opacity: .75; }
.boss-row { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.boss-pips { display: flex; gap: 4px; }
.boss-pip { width: 18px; height: 16px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; background: #fff8e6;
  border: 2px solid #c8a246; box-shadow: inset 0 -4px 0 #2e3a22; transition: transform .2s, opacity .2s; }
.boss-pip.broken { opacity: .28; transform: scale(.7) rotate(-18deg); box-shadow: none; }
.boss-count { font-variant-numeric: tabular-nums; opacity: .8; }
.boss-slow { font-size: 12px; color: #b0461e; font-weight: 700; font-variant-numeric: tabular-nums; }
.boss-slow[hidden] { display: none; }
.boss-bar.invincible .boss-slow { color: #2e6f9e; }
.boss-meter { width: 150px; height: 6px; border-radius: 3px; background: rgba(46, 58, 34, .18); overflow: hidden; }
.boss-meter::before { content: ''; display: block; height: 100%; width: calc(var(--left, 1) * 100%); background: linear-gradient(90deg, #6fb7e8, #2e6f9e); }
.boss-meter[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .boss-bar { animation: none; } }
/* 屏幕暗角：PC 与移动端共用，仅四周轻微压暗，中间完全透明，不拦截点击。 */
/* 不设 z-index：紧跟两张画布之后，叠在游戏画面上、位于其后的 HUD/按键/界面之下。 */
.vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, rgba(20, 30, 10, 0) 55%, rgba(20, 30, 10, .16) 82%, rgba(14, 22, 6, .3) 100%); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 240, .72); box-shadow: 0 4px 12px rgba(60, 80, 20, .16); transition: transform .15s, background .2s;
}
.icon-btn:hover { transform: scale(1.08); background: #fff; }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--olive); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .ic-play, .icon-btn.paused .ic-pause { display: none; }
.icon-btn.paused .ic-play { display: block; fill: var(--olive); }
.icon-btn .snd-off, .icon-btn.muted .snd-on { display: none; }
.icon-btn.muted .snd-off { display: block; }

/* ---------- Toast ---------- */
.toast {
  position: absolute; left: 50%; top: 96px; transform: translate(-50%, -10px); padding: 8px 20px; border-radius: 999px;
  font-size: 16px; font-weight: 700; letter-spacing: .06em; color: #fff; background: rgba(38, 48, 16, .7);
  backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.danger { background: rgba(200, 50, 30, .82); }
.toast.gold { background: linear-gradient(90deg, #c88a00, #f2c230); }

/* 吐弹教学提示：CHG-339 起与转向教程同一位置——页面中间靠上、分数下方（原来贴在屏幕底部）。 */
.bomb-guide {
  position: absolute; z-index: 4; left: 50%; top: calc(var(--safe-top) + 92px);
  transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 20px;
  border-radius: 18px; background: rgba(38, 48, 16, .9); color: #fffbe9;
  font-size: 17px; font-weight: 600; line-height: 1.5; text-align: center;
  pointer-events: none;
}
.bomb-guide[hidden] { display: none; }
/* CHG-338：PC 吐弹教学提示里的空格键帽闪烁。 */
.bomb-guide { display: inline-flex; align-items: center; gap: 10px; }
.bomb-guide-key { padding: 3px 14px; border-radius: 7px; background: #fff27a; color: #3a4608; font: 700 15px var(--font-en);
  letter-spacing: .12em; box-shadow: 0 3px 0 rgba(111, 128, 0, .6); animation: spaceBlink .6s ease-in-out infinite; }
@keyframes spaceBlink { 50% { background: #fffbe9; transform: translateY(2px); box-shadow: 0 1px 0 rgba(111, 128, 0, .6); } }
@media (prefers-reduced-motion: reduce) { .bomb-guide-key { animation: none; } }

/* CHG-337：转向教程——页面中间靠上、分数下方。
   CHG-337 追加：文字不闪；键帽按 W → A → S → D 逐个亮起（像被按下：变黄、下沉），每键约 0.6 秒，一轮 2.4 秒。 */
.turn-guide {
  position: absolute; z-index: 4; left: 50%; top: calc(var(--safe-top) + 92px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.turn-guide[hidden] { display: none; }
.turn-keys { display: grid; grid-template: repeat(2, 40px) / repeat(3, 40px); gap: 5px; }
.tk { display: grid; place-items: center; border-radius: 9px; background: rgba(252, 251, 236, .92); color: var(--olive-deep);
  box-shadow: 0 3px 0 rgba(111, 128, 0, .45), 0 6px 14px rgba(40, 60, 10, .18); font: 700 19px var(--font-en); }
.tk-up { grid-area: 1 / 2; } .tk-left { grid-area: 2 / 1; } .tk-down { grid-area: 2 / 2; } .tk-right { grid-area: 2 / 3; }
.tk-arrow { display: none; font-size: 15px; }
.turn-guide p { margin: 0; padding: 6px 16px; border-radius: 999px; background: rgba(38, 48, 16, .86); color: #fffbe9;
  font-size: 16px; font-weight: 700; letter-spacing: .1em; }
.tk { animation: turnKeyPress 2.4s ease-in-out infinite; }
.tk-up { animation-delay: 0s; } .tk-left { animation-delay: .6s; } .tk-down { animation-delay: 1.2s; } .tk-right { animation-delay: 1.8s; }
@keyframes turnKeyPress {
  0%, 30%, 100% { background: rgba(252, 251, 236, .92); color: var(--olive-deep); transform: none; box-shadow: 0 3px 0 rgba(111, 128, 0, .45), 0 6px 14px rgba(40, 60, 10, .18); }
  8%, 22% { background: #fff27a; color: #3a4608; transform: translateY(2px); box-shadow: 0 1px 0 rgba(111, 128, 0, .6), 0 0 16px rgba(255, 242, 122, .8); }
}
@media (prefers-reduced-motion: reduce) { .tk { animation: none; } }

/* ---------- QTE ---------- */
.qte {
  position: absolute; left: 50%; bottom: 9vh; width: min(440px, 86vw); transform: translate(-50%, 30px) scale(.9);
  padding: 16px 20px 14px; border-radius: 22px; background: rgba(255, 255, 238, .88); box-shadow: 0 18px 50px rgba(40, 60, 10, .3);
  backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s cubic-bezier(.2, 1.4, .4, 1);
  color: var(--olive-ink); text-align: center;
}
.is-paused .qte { opacity: 0 !important; pointer-events: none !important; }
.qte.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.qte-title { font-size: 22px; font-weight: 800; letter-spacing: .08em; color: var(--olive-deep); }
.qte.danger .qte-title { color: #d8361c; }
.qte.danger { animation: qteShake .12s linear infinite; }
@keyframes qteShake { 0%, 100% { margin-left: 0; } 50% { margin-left: 2px; } }
.qte-bar { position: relative; height: 18px; margin: 12px 0 10px; border-radius: 999px; background: rgba(80, 90, 30, .14); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .1); }
.qte-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, #a6c600, #dcf542); transition: width .06s linear; }
.qte.danger .qte-fill { background: linear-gradient(90deg, #ff7a3a, #e3361d); }
.qte-zone { position: absolute; top: 0; bottom: 0; display: none; border-radius: 6px; background: linear-gradient(90deg, rgba(120, 220, 255, .35), rgba(160, 120, 255, .6), rgba(120, 220, 255, .35)); box-shadow: 0 0 0 2px rgba(130, 110, 240, .6) inset; }
.qte-needle { position: absolute; top: -3px; bottom: -3px; width: 6px; margin-left: -3px; display: none; border-radius: 3px; background: #4f5c06; box-shadow: 0 0 0 2px #fff; }
.qte.timing .qte-zone, .qte.timing .qte-needle { display: block; }
.qte.timing .qte-fill { display: none; }
.qte-hint { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; font-weight: 700; }
.qte-hint kbd { font-family: var(--font-en); font-size: 12px; padding: 3px 14px; border-radius: 7px; background: #fff; box-shadow: 0 2px 0 rgba(80, 90, 30, .35); color: var(--olive-deep); animation: kbd .3s ease-in-out infinite alternate; }
@keyframes kbd { to { transform: translateY(2px); box-shadow: 0 0 0 rgba(80, 90, 30, .35); } }
.qte-time { font-family: var(--font-en); color: var(--olive); min-width: 3em; text-align: left; }

/* ---------- 暂停 ---------- */
.pause { background: radial-gradient(ellipse at center, rgba(30, 40, 10, .18), rgba(30, 40, 10, 0) 60%); }
.pause-title { display: flex; flex-direction: column; align-items: center; margin-bottom: 30px; transform: scale(.8); opacity: 0; }
.screen.show .pause-title { animation: popIn .5s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.pause-title b { font-size: clamp(44px, 6vw, 72px); font-weight: 800; letter-spacing: .06em; text-shadow: 0 6px 24px rgba(40, 60, 10, .4); }
.pause-title span { font-family: var(--font-en); font-weight: 600; font-size: 22px; letter-spacing: .2em; margin-top: 2px; text-shadow: 0 2px 10px rgba(40, 60, 10, .4); }
@keyframes popIn { to { opacity: 1; transform: none; } }

/* ---------- 奶油遮罩 ---------- */
.veil { background: var(--cream); backdrop-filter: blur(3px) saturate(.9); -webkit-backdrop-filter: blur(3px) saturate(.9); color: var(--olive-deep); }
.veil-card { display: flex; flex-direction: column; align-items: center; transform: translateY(16px); opacity: 0; }
.screen.show .veil-card { animation: popIn .5s cubic-bezier(.2, 1.3, .4, 1) .05s forwards; }
.veil-card.wide { width: min(760px, 92vw); }
.veil-text { text-align: center; font-size: 20px; font-weight: 700; line-height: 1.6; margin-bottom: 26px; }
.veil-text small { font-size: 15px; font-weight: 600; opacity: .8; }
.q-mark { font-family: var(--font-en); font-size: 120px; font-weight: 700; line-height: .9; color: rgba(141, 162, 0, .22); margin-bottom: -24px; }

.over-label { font-size: 18px; font-weight: 700; letter-spacing: .1em; }
.over-score { font-family: var(--font-en); font-weight: 700; font-size: clamp(110px, 16vw, 180px); line-height: 1.02; color: var(--olive); text-shadow: 0 6px 0 rgba(141, 162, 0, .15); }
.over-score.pop { animation: scorePop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes scorePop { 0% { transform: scale(.6); } 100% { transform: none; } }
.over-stats { display: flex; gap: 10px; margin: 4px 0 8px; font-size: 13px; font-weight: 700; }
.over-stats span { padding: 4px 12px; border-radius: 999px; background: rgba(141, 162, 0, .14); }
.over-stats b { font-family: var(--font-en); font-size: 14px; margin-left: 4px; }
.over-cause { font-size: 14px; font-weight: 600; opacity: .75; margin-bottom: 22px; min-height: 1.2em; }
.over-cause.record { opacity: 1; color: #c47d00; }

/* 排行榜 */
.rank-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(340px, 80vw); margin-bottom: 18px; padding: 4px;
  border-radius: 999px; background: rgba(141, 162, 0, .14); box-shadow: inset 0 0 0 2px rgba(141, 162, 0, .35);
}
.rank-tabs::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: var(--olive);
  transition: transform .38s cubic-bezier(.3, 1.4, .5, 1);
}
.rank-tabs[data-tab="mine"]::before { transform: translateX(100%); }
.rank-tabs button { position: relative; z-index: 1; padding: 8px 0; font-size: 16px; font-weight: 800; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; letter-spacing: .1em; color: var(--olive-deep); transition: color .25s, transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.rank-tabs button[aria-selected="true"] { color: #fff; }
.rank-tabs button:hover { transform: scale(1.05); }
.rank-tabs button:active { transform: scale(.95); }
.rank-tabs button:focus-visible { outline: none; text-decoration: underline; }
/* 从页签顶部到返回按钮底部整体居中；上下采用相同安全边距，小屏只收缩列表。 */
.rank { padding-block: max(20px, var(--safe-top), var(--safe-bottom)); }
.rank .veil-card { height: auto; max-height: 100%; min-height: 0; padding: 0; }
.rank-tabs, .rank-tools, .rank .menu { flex: none; }
.rank-body { width: 100%; flex: 0 1 auto; min-height: 0; height: min(502px, calc(100vh - 170px)); display: flex; flex-direction: column; align-items: center; padding-top: 14px; }
.rank-body .rank-list { flex: 1 1 auto; min-height: 0; max-height: none; }
.rank-body .rank-head, .rank-body #rank-status { flex: none; }
.rank-body #rank-status { display: block; min-height: 20px; margin: 0 0 6px; }
.rank-tools { margin-top: 0; padding-top: 0; }
.rank .menu { margin-top: 16px; }
.rank-body.from-right { animation: rankFromRight .42s cubic-bezier(.2, 1.1, .4, 1); }
.rank-body.from-left { animation: rankFromLeft .42s cubic-bezier(.2, 1.1, .4, 1); }
@keyframes rankFromRight { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes rankFromLeft { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
.rank-head, .rank-list li, .rank-me {
  display: grid; grid-template-columns: 1fr 1.6fr 1fr 1.2fr; align-items: center; text-align: center;
}
.rank-head { width: 100%; padding: 0 12px 10px; font-size: 14px; font-weight: 700; opacity: .8; }
.rank-list { list-style: none; width: 100%; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; padding: 0 2px; }
.rank-list li { height: 38px; flex-shrink: 0; border-radius: 10px; font-size: 15px; font-weight: 700; background: rgba(141, 162, 0, .13); opacity: 0; transform: translateX(-16px); }
.screen.show .rank-list li { animation: popIn .4s ease forwards; }
.rank-list li .n { font-family: var(--font-en); }
.rank-list li .s { font-family: var(--font-en); font-size: 16px; }
.rank-list li .d, .rank-me .d {
  display: grid; grid-template-columns: 1fr 24px; align-items: center; gap: 8px; padding: 0 8px 0 12px;
}
.rank-play {
  width: 24px; height: 24px; flex: none; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--olive); color: #fff; font-size: 10px; line-height: 1; cursor: pointer;
}
.rank-play:hover { filter: brightness(1.1); }
.rank-play:active { transform: scale(.94); }
.rank-play[hidden] { display: none; }
.rank-list li .d { font-family: var(--font-en); font-size: 13px; font-weight: 500; }
.rank-list li:nth-child(1) .n { color: #d79a00; }
.rank-list li:nth-child(2) .n { color: #8f9aa6; }
.rank-list li:nth-child(3) .n { color: #b8733a; }
.rank-list li.me, .rank-me { background: var(--olive); color: #fff; }
.rank-list li.me .n { color: #fff; }
.rank-me { width: 100%; height: 42px; margin: 10px 0 22px; border-radius: 10px; font-size: 15px; font-weight: 700; }
.rank-me:empty { display: none; }
.rank-me .n, .rank-me .s, .rank-me .d { font-family: var(--font-en); }
.rank-empty { padding: 30px 0; text-align: center; font-weight: 700; opacity: .6; }
.rank .menu { margin-top: 16px; }
.rank-me { margin-bottom: 0; }

/* 图鉴 */
.guide .veil-card { max-height: calc(100% - 2 * (var(--course-contact-top) + 32px)); }
/* 右侧让出列表的滚动条槽位与内边距，“已发现”右缘与卡片对齐且不贴边。 */
.guide-head { display: flex; align-items: baseline; justify-content: space-between; width: 100%; gap: 12px; margin-bottom: 12px; padding-right: 12px; }
.guide-title { font-size: 26px; font-weight: 800; letter-spacing: .1em; margin: 0; }
.codex-progress { font-size: 13px; font-weight: 700; color: var(--olive-deep); white-space: nowrap; }
.codex-status { width: 100%; margin: 0 0 10px; font-size: 12px; color: #a35e2a; text-align: center; }
.guide-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; width: 100%; margin-bottom: 22px; max-height: 62vh;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 6px;
}
/* 细圆角橄榄色滑块，无箭头；Chromium 用伪元素，其他浏览器退回标准属性。 */
.guide-grid::-webkit-scrollbar { width: 6px; }
.guide-grid::-webkit-scrollbar-button { display: none; height: 0; }
.guide-grid::-webkit-scrollbar-track { background: rgba(141, 162, 0, .1); border-radius: 999px; margin: 4px 0; }
.guide-grid::-webkit-scrollbar-thumb { background: rgba(111, 128, 0, .45); border-radius: 999px; }
.guide-grid::-webkit-scrollbar-thumb:hover { background: rgba(111, 128, 0, .7); }
@supports not selector(::-webkit-scrollbar) {
  .guide-grid { scrollbar-width: thin; scrollbar-color: rgba(111, 128, 0, .45) rgba(141, 162, 0, .1); }
}
.g-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-radius: 14px; background: rgba(141, 162, 0, .11); }
.g-item canvas { flex: none; width: 44px; height: 44px; }
.g-item h3 { font-size: 15px; font-weight: 800; margin-bottom: 2px; color: var(--olive-ink); }
.g-item p { font-size: 13px; font-weight: 600; line-height: 1.5; color: rgba(79, 92, 6, .85); }
.g-item.locked { background: rgba(141, 162, 0, .05); }
.g-item.locked canvas { filter: grayscale(1) brightness(0); opacity: .22; }
.g-item.locked h3 { color: rgba(79, 92, 6, .42); }
.g-item.locked p { color: rgba(79, 92, 6, .38); }

/* 设置（CHG-325） */
.settings { padding-block: max(20px, var(--safe-top), var(--safe-bottom)); }
/* 与排行榜一致（用户 2026-11-24）：同一个 veil 弹入、同样的行底色/圆角/字重，行依次滑入；
   卡片本身不滚动——原来的 overflow-y:auto 在弹入位移时会冒出一条滚动条。 */
.settings-card { width: min(480px, 92vw); max-height: 100%; min-height: 0; }
.settings-card .veil-text { margin-bottom: 14px; }
.settings-list { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.settings-row { display: grid; grid-template-columns: 5.5em 1fr auto; align-items: center; gap: 12px; min-height: 42px; padding: 4px 14px; border-radius: 10px; background: rgba(141, 162, 0, .13); opacity: 0; transform: translateX(-16px); }
.screen.show .settings-row { animation: popIn .4s ease forwards; }
.screen.show .settings-row:nth-child(2) { animation-delay: .04s; }
.screen.show .settings-row:nth-child(3) { animation-delay: .08s; }
.screen.show .settings-row:nth-child(4) { animation-delay: .12s; }
.screen.show .settings-row:nth-child(5) { animation-delay: .16s; }
.screen.show .settings-row:nth-child(6) { animation-delay: .2s; }
.settings .menu { margin-top: 12px; }
.settings-label { font-size: 15px; font-weight: 700; color: var(--olive-deep); white-space: nowrap; }
.settings-seg { grid-column: 2 / 4; display: flex; gap: 3px; padding: 3px; border-radius: 999px; background: rgba(141, 162, 0, .14); box-shadow: inset 0 0 0 2px rgba(141, 162, 0, .35); }
.settings-seg button { flex: 1; min-height: 30px; padding: 4px 10px; border-radius: 999px; font: 800 14px var(--font-cn); letter-spacing: .06em; color: var(--olive-deep); background: transparent; cursor: pointer; transition: background .25s, color .25s, transform .15s; }
.settings-seg button:active { transform: scale(.95); }
.settings-seg button:hover { background: rgba(141, 162, 0, .2); }
.settings-seg button.on { background: var(--olive); color: #fff; }
.settings-seg button:focus-visible, .settings-link:focus-visible, .settings-input:focus-visible { outline: 2px solid var(--olive-deep); outline-offset: 2px; }
.settings-input { grid-column: 2 / 4; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; outline: none; font: 700 15px var(--font-cn); color: var(--olive-ink); background: #fff; box-shadow: 0 0 0 2px rgba(141, 162, 0, .3); }
.settings-input:focus { box-shadow: 0 0 0 2px var(--olive); }
.settings-input:disabled { opacity: .7; }
.settings-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 0; border-radius: 999px; background: rgba(141, 162, 0, .22); cursor: pointer; }
.settings-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--olive); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(30, 40, 10, .3); }
.settings-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--olive); border: 2px solid #fff; }
.settings-value { min-width: 3em; text-align: right; font: 600 13px var(--font-en); color: var(--olive-ink); font-variant-numeric: tabular-nums; }
.settings-link { grid-column: 2 / 4; justify-self: start; font-size: 15px; font-weight: 700; color: var(--olive-deep); text-decoration: underline; text-underline-offset: 3px; }
.settings-link:hover { color: var(--olive-ink); }
.settings-note { min-height: 1.4em; margin: 8px 0 4px; font-size: 13px; color: var(--olive-deep); text-align: center; }

/* 昵称 */
#nick-input {
  width: 260px; height: 48px; margin: -10px 0 24px; padding: 0 18px; border-radius: 999px; border: 0; outline: none;
  font: 700 18px var(--font-cn); text-align: center; color: var(--olive-ink); background: #fff; box-shadow: 0 0 0 3px rgba(141, 162, 0, .35);
}
#nick-input:focus { box-shadow: 0 0 0 3px var(--olive); }

/* 过场 */
.fade { position: absolute; inset: 0; background: #fbfbe8; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.fade.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Toy 玩家身份与联网榜单：不依赖 SDK 加载完成即可显示本地游戏。 */
[hidden] { display: none !important; }
.nick b { max-width: min(60vw, 280px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-nick svg { display: none; }
.account-status { position: absolute; top: calc(42px + var(--safe-top)); max-width: 90%; margin: 0; font-size: 12px; text-align: center; color: var(--olive-ink); }
.platform-status { margin: 0 0 10px; font-size: 13px; text-align: center; color: var(--olive-ink); }
.platform-status:empty { display: none; }
.platform-action { padding: 7px 14px; margin-bottom: 10px; border: 1px solid var(--olive); border-radius: 18px; background: transparent; color: var(--olive-ink); font: inherit; font-size: 13px; cursor: pointer; }
.platform-action:hover { background: rgba(141, 162, 0, .15); }
button:disabled { cursor: wait; opacity: .6; }
.rank-tools { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.rank-list .nm, .rank-me .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 5px; }
.rank-list li.rank-empty { display: block; height: auto; padding: 20px 8px; }
@keyframes spit-urgent { 50% { background: rgba(255,70,40,.45); } }
@keyframes spit-lesson { 50% { background: rgba(255,230,90,.55); transform: scale(1.12); box-shadow: 0 0 22px 6px rgba(255,230,90,.7); } }

/* 资源齐备前阻止开局；失败页可刷新重试。 */
.boot-cover { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: #f4f0df; color: #627524; font-size: 20px; }
.boot-cover[hidden], .boot-cover [hidden] { display: none; }
.boot-cover .pill { opacity: 1; transform: none; }
.boot-progress-wrap { position: absolute; bottom: max(32px, var(--safe-bottom)); left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 48px)); display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 14px; }
#boot-progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden; background: #e2e3c6; accent-color: #94ab00; }
#boot-progress::-webkit-progress-bar { background: #e2e3c6; border-radius: 8px; }
#boot-progress::-webkit-progress-value { background: #94ab00; border-radius: 8px; transition: width .18s ease; }
#boot-progress::-moz-progress-bar { background: #94ab00; border-radius: 8px; }
#boot-progress:indeterminate { background: linear-gradient(90deg, #e2e3c6 30%, #94ab00 50%, #e2e3c6 70%) 0 0 / 200% 100%; animation: boot-loading 1.4s linear infinite; }
#boot-progress:indeterminate::-webkit-progress-bar { background: transparent; }
#boot-percent { min-height: 20px; }
@keyframes boot-loading { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { #boot-progress:indeterminate { animation: none; } #boot-progress::-webkit-progress-value { transition: none; } }
.menu-whale-notice { position: absolute; bottom: 68px; left: 16px; right: 16px; text-align: center; font-size: 12px; color: #627524; pointer-events: auto; }
.menu-whale-notice button { margin-left: 8px; padding: 5px 10px; border: 0; border-radius: 12px; background: #e5eac5; color: inherit; cursor: pointer; }
.menu-whale-notice [hidden] { display: none; }

/* 调试面板（~ 键） */
.debug-panel { position: fixed; left: max(12px, var(--safe-left)); top: max(12px, var(--safe-top)); z-index: 900; width: 236px; max-width: calc(100vw - 24px); padding: 10px 12px; border-radius: 12px;
  background: rgba(20, 26, 14, .82); color: #eef5d8; font: 600 13px/1.4 Fredoka, "Microsoft YaHei", sans-serif; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.debug-panel[hidden] { display: none; }
.debug-panel { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.debug-title { font-weight: 700; letter-spacing: .12em; margin-bottom: 6px; color: #dcf542; }
.debug-title small { float: right; letter-spacing: 0; font-weight: 500; color: rgba(238,245,216,.55); }
.debug-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; cursor: default; }
.debug-row b { font-variant-numeric: tabular-nums; color: #b8f08a; }
.debug-row b.low { color: #ff9a6a; }
#debug-speed { display: block; width: 100%; margin: 2px 0 4px; accent-color: #b8f08a; }
#debug-speed:focus-visible { outline: 2px solid #dcf542; outline-offset: 2px; }
.debug-hint { margin: 4px 0 0; font-size: 11px; font-weight: 500; color: rgba(238,245,216,.6); }
.debug-open { width: 100%; margin-top: 6px; padding: 5px; border: 1px solid #73834b; border-radius: 8px; background: #354323; color: #eef5d8; font: inherit; cursor: pointer; }
.debug-open:hover { background: #46582e; }
.debug-open:focus-visible { outline: 2px solid #dcf542; outline-offset: 2px; }

#debug-status:empty { display: none; }
#debug-panel [hidden] { display: none; }
#debug-close { min-width: 44px; min-height: 44px; color: #eef5d8; font-size: 13px; }
@keyframes rotateHint { 0%, 25% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* 手机全屏：全屏 API 可用时使用动态视口；不支持时保留浏览器可视区域。 */
html.mobile-fullscreen, body.mobile-fullscreen { height: 100%; overscroll-behavior: none; }
html.mobile-fullscreen #app, body.mobile-fullscreen #app { height: 100dvh; }
html.mobile-fullscreen:fullscreen, html.mobile-fullscreen:-webkit-full-screen { background: #eef2ec; }
#btn-fullscreen.active { color: var(--lime); }
#btn-fullscreen .fs-off { display: none; }
#btn-fullscreen.active .fs-on { display: none; }
#btn-fullscreen.active .fs-off { display: block; }

/* 左上角常驻版本号：菜单和游戏中都能确认当前构建。 */
.build-version { position: absolute; z-index: 4; top: calc(4px + var(--safe-top)); left: max(8px, var(--safe-left)); padding: 3px 7px; border-radius: 5px; pointer-events: none; font-family: var(--font-en); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: rgba(79, 92, 6, .74); background: rgba(255, 255, 240, .56); }
.build-version:empty { display: none; }

/* 开始页右上角语言切换：切换后整页重载，避免局部文本与新语言混排。 */
.lang-switch { position: absolute; z-index: 5; top: calc(4px + var(--safe-top)); right: max(8px, var(--safe-right)); min-width: 42px; padding: 5px 10px 6px; border-radius: 999px; font-family: var(--font-cn); font-size: 12px; font-weight: 700; letter-spacing: .04em; line-height: 1.2; color: var(--olive-ink); background: rgba(255, 255, 240, .72); box-shadow: inset 0 0 0 1px rgba(141, 162, 0, .3); cursor: pointer; }
.lang-switch:hover, .lang-switch:focus-visible { color: #fff; background: var(--olive); outline: none; box-shadow: 0 0 0 3px rgba(141, 162, 0, .25); }
.lang-switch:active { transform: scale(.96); }
/* CHG-321：手机主页右上角的全屏按钮，排在语言切换左侧；只在手机上显示（由 PlatformFullscreen 控制 hidden）。 */
/* CHG-325：主页右上角常驻“设置”齿轮（占原语言按钮的位置，语言切换并入设置页）。 */
.menu-settings { position: absolute; z-index: 5; top: calc(4px + var(--safe-top)); right: max(8px, var(--safe-right)); width: 36px; height: 36px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--olive-ink); background: rgba(255, 255, 240, .72); box-shadow: inset 0 0 0 1px rgba(141, 162, 0, .3); cursor: pointer; transition: transform .15s, background .2s, color .2s; }
/* 参考图（用户 2026-11-24）：实心齿轮，方齿 + 圆孔；描一圈同色细边让齿角略圆。 */
.menu-settings svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: .8; stroke-linejoin: round; }
.menu-settings:hover, .menu-settings:focus-visible { color: #fff; background: var(--olive); outline: none; }
.menu-settings:active { transform: scale(.94); }

/* ---------- 结算页回放浮层 ---------- */
.replay-layer {
  position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: clamp(8px, 2.5vw, 34px);
  background: rgba(28, 38, 12, .58);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.replay-layer[hidden] { display: none !important; }
.replay-panel {
  position: relative; width: min(1180px, 100%); height: min(88vh, 100%);
  overflow: hidden; border-radius: 22px; background: #fbf8ee;
  box-shadow: 0 26px 70px rgba(20, 30, 5, .42), inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.replay-panel iframe { display: block; width: 100%; height: 100%; border: 0; background: #eef2ec; }
.replay-close {
  position: absolute; z-index: 2; top: 12px; left: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 7px 16px; border-radius: 999px;
  color: var(--olive-deep); background: rgba(251, 248, 238, .92);
  box-shadow: 0 3px 12px rgba(30, 40, 10, .2), inset 0 0 0 1.5px rgba(141, 162, 0, .45);
  font: 700 14px var(--font-cn); letter-spacing: .04em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.replay-close:hover { color: var(--olive-ink); background: #fff; }
.replay-close:focus { outline: none; }
.replay-close:focus-visible { outline: 2px solid var(--olive-deep); outline-offset: 2px; }
/* CHG-322：返回/分享由回放页自己的顶栏提供，父页面的浮动按钮不再压在画面上。 */
.replay-close { display: none; }
/* CHG-323：浮层铺满整个窗口、用游戏本身的背景色，不再是暗色遮罩上的一张卡片；
   回放页与里面的游戏画面都透明，顶栏、画面、控制栏落在同一片连续背景上。 */
.replay-layer { padding: 0; background: radial-gradient(90% 75% at 50% 45%, #fbf8ee 0%, #f2eedf 70%, #e9e4d2 100%); -webkit-backdrop-filter: none; backdrop-filter: none; }
.replay-panel { width: 100%; height: 100%; border-radius: 0; box-shadow: none; background: transparent; }
.replay-panel iframe { background: transparent; }

/* HUD gear reuses the exact homepage .menu-settings look; only its layout is in-flow. */
.hud-settings { position: static; width: 36px; height: 36px; }
/* CHG-329：游戏内右上角的齿轮与暂停键统一为 HUD 图标键样式（用户截图：风格不一致）。
   .menu-settings 是主页的齿轮样式（36px、内描边、深色实心图标、悬停变绿底），在 HUD 里全部还原成 .icon-btn：
   同尺寸（桌面 40 / 手机 44）、同底色与投影、无描边、图标用橄榄绿线条色系，悬停只放大变白。 */
.hud .hud-settings {
  width: 40px; height: 40px; color: var(--olive);
  background: rgba(255, 255, 240, .72); box-shadow: 0 4px 12px rgba(60, 80, 20, .16);
}
.hud .hud-settings svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: .6; }
.hud .hud-settings:hover, .hud .hud-settings:focus-visible { color: var(--olive); background: #fff; transform: scale(1.08); }
.hud .hud-settings:active { transform: scale(.94); }
