/* 宸希的世界 · Minecraft 风格 — 原创像素美术，不复制任何 Mojang 素材 */
@font-face{
  font-family:'Zpix';
  src:url('assets/zpix.woff2') format('woff2');
  font-display:swap;
  font-weight:400;
}

:root{
  /* 像素字体只在 12 的整数倍下清晰 */
  --t-xs:12px; --t-sm:24px; --t-md:36px; --t-lg:48px; --t-xl:72px;
  --ink:#ffffff;
  --ink-shadow:#2b2b2b;
  --panel:#c6c6c6;
  --panel-dark:#8b8b8b;
  --panel-line:#373737;
  --hl:#ffffff;
  --sh:#5a5a5a;
  --grass:#7cb342;
  --dirt:#8d6e63;
  --stone:#9e9e9e;
  --gold:#ffd54f;
  --diamond:#4dd0e1;
  --red:#e53935;
  --shadow:0 4px 0 rgba(0,0,0,.35);
  --bevel: inset 3px 3px 0 rgba(255,255,255,.55), inset -3px -3px 0 rgba(0,0,0,.28);
}
:root[data-mode="tv"]{ --t-xs:24px; --t-sm:36px; --t-md:48px; --t-lg:72px; --t-xl:96px; }

*{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html,body{ height:100%; overflow:hidden; }
body{
  font-family:'Zpix','PingFang SC',monospace;
  font-size:var(--t-sm);
  color:var(--ink);
  background:#12171d;
  letter-spacing:0;
  -webkit-font-smoothing:none;
  text-rendering:geometricPrecision;
}
#app{ position:fixed; top:0; right:0; bottom:0; left:0; width:100%; height:100%; display:flex; flex-direction:column; }

/* ---------- 天空与云 ---------- */
#sky{
  position:absolute; top:0; right:0; bottom:0; left:0; z-index:0; overflow:hidden;
  background:linear-gradient(#241a44 0%, #3a2660 14%, #5f3570 30%, #8b4272 46%, #c0576a 60%, #e8795d 72%, #ffa565 84%, #ffd39c 100%);
}
#sky #bg{
  position:absolute; top:0; right:0; bottom:0; left:0; width:100%; height:100%;
  pointer-events:none;
  image-rendering:pixelated;
}
#sky .cl{ animation:drift 90s linear infinite; }
#sky .cl-b{ animation-duration:120s; animation-direction:reverse; }
#sky .cl-c{ animation-duration:150s; }
@keyframes drift{
  from{ transform:translateX(-40px); }
  to{ transform:translateX(60px); }
}
body.lowpower #sky .cl{ animation:none; }

/* ---------- 画风 skin：?skin=day|sunset|night|dusk ---------- */
#sky .moon, #sky .stars{ opacity:0; }
#sky .sun, #sky .moon{ transform-box:fill-box; transform-origin:center; }

:root[data-skin="day"] #sky{
  background:linear-gradient(#2f83cf 0%, #4ba2e4 26%, #74c2f1 52%, #a6ddf8 76%, #d8f2ff 100%);
}
:root[data-skin="day"] #sky .clouds{ filter:brightness(3.1) saturate(.06); }
:root[data-skin="day"] #sky .sun{ transform:translate(-120px,-90px); }
:root[data-skin="day"] #sky .sun-glow{ opacity:.35; }
:root[data-skin="day"] #stage{ filter:saturate(1.12) brightness(1.06); }
:root[data-skin="day"] #mg-far stop{ stop-color:#a8c6de; }
:root[data-skin="day"] #mg-mid stop{ stop-color:#82a3c2; }
:root[data-skin="day"] #mg-near stop{ stop-color:#5f7f9e; }

:root[data-skin="night"] #sky{
  background:linear-gradient(#0b0f24 0%, #141a38 22%, #1f2549 44%, #2c2f55 64%, #40365e 82%, #5a4568 100%);
}
:root[data-skin="night"] #sky .clouds{ filter:brightness(.42) saturate(.5) hue-rotate(-16deg); }
:root[data-skin="night"] #sky .sun{ opacity:0; }
:root[data-skin="night"] #sky .moon{ opacity:1; transform:translate(-30px,-40px) scale(.92); }
:root[data-skin="night"] #sky .stars{ opacity:.85; animation:twinkle 4s ease-in-out infinite alternate; }
:root[data-skin="night"] #stage{ filter:brightness(.6) saturate(.92) hue-rotate(-6deg); }
:root[data-skin="night"] #mg-far stop{ stop-color:#3a3a63; }
:root[data-skin="night"] #mg-mid stop{ stop-color:#2a2a4c; }
:root[data-skin="night"] #mg-near stop{ stop-color:#1b1b33; }
:root[data-skin="night"] .node-g.active .node-box{ filter:drop-shadow(0 0 10px rgba(255,226,130,.85)); }

:root[data-skin="dusk"] #sky{
  background:linear-gradient(#2a1c3f 0%, #4a2a52 16%, #7a3d5c 34%, #a84d55 52%, #d9704a 70%, #f2a259 86%, #ffd9a0 100%);
}
:root[data-skin="dusk"] #sky .clouds{ filter:sepia(.25) saturate(1.15) brightness(1.05); }
:root[data-skin="dusk"] #stage{ filter:sepia(.16) saturate(1.14) brightness(1.03); }
:root[data-skin="dusk"] #mg-far stop{ stop-color:#a97a93; }
:root[data-skin="dusk"] #mg-mid stop{ stop-color:#7b4f68; }
:root[data-skin="dusk"] #mg-near stop{ stop-color:#4e3049; }
:root[data-skin="dusk"] #sky .sun{ transform:scale(.82); opacity:.9; }

@keyframes twinkle{ from{opacity:.55} to{opacity:.95} }

/* ---------- HUD ---------- */
#hud{
  position:relative; z-index:5;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:10px 14px;
  background:linear-gradient(rgba(38,28,58,.92), rgba(22,16,34,.94));
  border-bottom:4px solid rgba(10,6,20,.9);
  box-shadow:inset 0 -4px 0 rgba(255,255,255,.06);
}
.hud-left{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.hud-tag{
  font-size:var(--t-xs); padding:6px 10px; background:#1b2416; color:#d7f0c2;
  border:2px solid #0b100a; box-shadow:inset 2px 2px 0 rgba(255,255,255,.08);
}
.hud-chip{
  display:inline-flex; align-items:center; gap:6px;
  font-size:var(--t-xs); padding:6px 10px 6px 8px;
  background:#3a4a30; border:2px solid #0b100a;
  box-shadow:inset 2px 2px 0 rgba(255,255,255,.12), inset -2px -2px 0 rgba(0,0,0,.3);
}
.hud-chip b{ color:var(--gold); font-weight:400; }
.hud-right{ display:flex; gap:8px; }

/* ---------- 按钮（MC 立体按钮） ---------- */
.btn{
  position:relative;
  font-family:inherit; font-size:var(--t-sm); color:#fff;
  text-shadow:2px 2px 0 var(--ink-shadow);
  background:var(--panel-dark);
  border:3px solid #2b2b2b;
  padding:12px 20px;
  cursor:pointer;
  box-shadow:inset 3px 3px 0 rgba(255,255,255,.45), inset -3px -3px 0 rgba(0,0,0,.35);
  transition:none;
  image-rendering:pixelated;
}
.btn:hover{ background:#a4a4a4; }
.btn:active, .btn.pressed{ transform:translateY(3px); box-shadow:inset 3px 3px 0 rgba(0,0,0,.3); }
.btn-sm{ font-size:var(--t-xs); padding:8px 12px; border-width:2px; }
.btn-primary{ background:#5d9c3a; border-color:#22400f; }
.btn-primary:hover{ background:#6cb043; }
.btn-gold{ background:#c9a227; border-color:#4a3708; color:#fff8e1; }
.btn-gold:hover{ background:#dcb52f; }
.btn:disabled{ opacity:.5; cursor:default; }

/* ---------- 选中焦点（遥控器/键盘） ---------- */
[data-f].focused{
  outline:4px solid #fff;
  outline-offset:2px;
  box-shadow:0 0 0 4px #000, 0 0 0 8px rgba(255,255,255,.55),
             inset 3px 3px 0 rgba(255,255,255,.45), inset -3px -3px 0 rgba(0,0,0,.35);
  z-index:3;
}
body.no-focus [data-f].focused{ outline-color:transparent; box-shadow:none; }

/* ---------- 主舞台 ---------- */
#stage{ position:relative; z-index:2; flex:1; min-height:0; display:flex; }

/* 横屏 / 电视：左地图右面板 */
.stage-split{ flex-direction:row; gap:0; }
.stage-split .map-wrap{ flex:1 1 62%; min-width:0; }
.stage-split .side{
  flex:0 0 38%; max-width:640px;
  display:flex; flex-direction:column; gap:12px;
  padding:14px 18px 18px 0; min-width:0; overflow:auto;
}
/* 竖屏 / iPad：上地图下面板 */
.stage-stack{ flex-direction:column; }
.stage-stack .map-wrap{ flex:1 1 auto; min-height:0; }
.stage-stack .side{
  flex:0 0 auto; display:flex; flex-direction:column; gap:10px;
  padding:10px 12px 16px; max-height:46vh; overflow:auto;
}

/* ---------- 地图 ---------- */
.map-wrap{ position:relative; display:flex; align-items:center; justify-content:center; padding:8px; overflow:hidden; }
.map-wrap svg{ width:100%; height:100%; display:block; image-rendering:pixelated; overflow:visible; }
.map-shadow{ filter:drop-shadow(0 8px 0 rgba(0,0,0,.16)); }

.node-g{ cursor:pointer; }
.node-g .node-box{ transition:transform .18s steps(3); transform-box:fill-box; transform-origin:center bottom; }
.node-g:hover .node-box{ transform:translateY(-6px); }
.node-g.focused .node-ring{ opacity:1; }
.node-ring{ opacity:0; transition:opacity .12s steps(2); }
.node-g.done .node-icon{ opacity:.95; }
.node-g.locked .node-icon{ opacity:.92; }
.node-g.current .node-box{ animation:bob 1.2s steps(2) infinite; }
@keyframes bob{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-5px); } }
body.lowpower .node-g.current .node-box{ animation:none; }
body.lowpower .node-g:hover .node-box{ transform:none; }

/* ---------- 面板 ---------- */
.panel{
  background:var(--panel);
  border:4px solid var(--panel-line);
  box-shadow:var(--bevel);
  color:#1d1d1d;
  padding:12px 14px;
  position:relative;
}
.panel-dark{
  background:#3b3b3b; border-color:#111;
  box-shadow:inset 3px 3px 0 rgba(255,255,255,.14), inset -3px -3px 0 rgba(0,0,0,.4);
  color:#f2f2f2;
}
.panel-title{
  font-size:var(--t-sm); color:#fff; text-shadow:2px 2px 0 #1a1a1a;
  margin:-2px 0 10px;
}
.panel-dark .panel-title{ color:#ffe082; }
.row{ display:flex; align-items:center; gap:10px; }
.col{ display:flex; flex-direction:column; gap:10px; }
.grow{ flex:1; min-width:0; }
.muted{ opacity:.72; }
.small{ font-size:var(--t-xs); }
.center{ text-align:center; }

/* 任务清单行 */
.task-row{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; background:#e9e9e9; border:3px solid #373737;
  box-shadow:inset 2px 2px 0 rgba(255,255,255,.7), inset -2px -2px 0 rgba(0,0,0,.18);
  cursor:pointer;
}
.task-row .t-name{ font-size:var(--t-xs); color:#1d1d1d; }
.task-row .t-sub{ font-size:var(--t-xs); color:#5a5a5a; }
.task-row.is-done{ background:#cfe8bf; }
.task-row.is-locked{ opacity:.55; cursor:default; }
.task-row.is-current{ background:#fff3c4; }
.tick{ width:26px; height:26px; flex:0 0 auto; }

/* ---------- 答题卡 ---------- */
.quiz-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pips{ display:flex; gap:6px; }
.pip{ width:18px; height:18px; background:#6d6d6d; border:2px solid #1c1c1c; }
.pip.on{ background:var(--diamond); box-shadow:inset 0 0 0 2px #b2ebf2; }
.speech{
  position:relative; background:#f4ecd8; border:4px solid #3b2f1e; color:#241a0f;
  padding:14px 16px; font-size:var(--t-sm); line-height:1.55;
  box-shadow:inset 3px 3px 0 rgba(255,255,255,.7), inset -3px -3px 0 rgba(0,0,0,.12);
}
.speech .who{ font-size:var(--t-xs); color:#7a6242; margin-bottom:6px; display:flex; align-items:center; gap:8px; }
.options{ display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.opt{
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; text-align:left;
  background:#8f8f8f; border:3px solid #2b2b2b; color:#fff;
  font-family:inherit; font-size:var(--t-sm); text-shadow:2px 2px 0 #333;
  box-shadow:inset 3px 3px 0 rgba(255,255,255,.4), inset -3px -3px 0 rgba(0,0,0,.35);
  cursor:pointer;
}
.opt:hover{ background:#a0a0a0; }
.opt .key{
  width:34px; height:34px; flex:0 0 auto; display:grid; place-items:center;
  background:#5c5c5c; border:2px solid #1c1c1c; font-size:var(--t-xs); color:#fff;
}
.opt.correct{ background:#5d9c3a; }
.opt.correct .key{ background:#2f5c14; }
.opt.wrong{ background:#a03a34; }
.opt.wrong .key{ background:#5c1512; }
.opt:disabled{ cursor:default; }

.explain{
  margin-top:10px; background:#1f2a1a; border:3px solid #0a0f07; color:#dff3cf;
  padding:12px 14px; font-size:var(--t-xs); line-height:1.6;
}
.explain b{ color:var(--gold); font-weight:400; }

/* ---------- 通行证 ---------- */
.pass-card{
  background:linear-gradient(#f7f1dd, #e8dcbf);
  border:5px solid #2f2415; color:#241a0f;
  padding:18px; text-align:center;
  box-shadow:inset 3px 3px 0 rgba(255,255,255,.8), inset -3px -3px 0 rgba(0,0,0,.2), var(--shadow);
}
.pass-card h2{ font-size:var(--t-md); line-height:1.2; letter-spacing:2px; }
.pass-items{ display:flex; flex-direction:column; gap:8px; margin-top:14px; }
.pass-item{
  display:flex; align-items:center; gap:10px; justify-content:center;
  background:#fffdf3; border:3px dashed #8a7748; padding:10px 12px; font-size:var(--t-sm);
}
.pass-item .grow{ text-align:center; }
.pass-item b{ color:#b23b2f; font-weight:400; }

/* ---------- 家长页 / PIN ---------- */
.pin-display{ display:flex; gap:10px; justify-content:center; margin:8px 0 4px; }
.pin-dot{ width:28px; height:34px; background:#1b1b1b; border:3px solid #000; box-shadow:inset 2px 2px 0 rgba(255,255,255,.12); }
.pin-dot.on{ background:var(--gold); }
.keypad{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.keypad .btn{ padding:12px 0; font-size:var(--t-sm); }
.stat-line{ display:flex; justify-content:space-between; gap:10px; font-size:var(--t-xs); padding:6px 0; border-bottom:2px dotted #555; }
table.hist{ width:100%; border-collapse:collapse; font-size:var(--t-xs); }
table.hist th, table.hist td{ text-align:left; padding:5px 4px; border-bottom:2px solid rgba(255,255,255,.12); }

/* ---------- 娱乐计时 ---------- */
.hud-play{ background:#3a2f0c; color:#ffe082; border-color:#0b100a; }
.hud-tag[hidden]{ display:none; }
.timer-card{ display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; }
.timer-label{ font-size:var(--t-sm); color:#ffe082; text-shadow:2px 2px 0 #1a1a1a; }
.timer{
  font-size:96px; font-size:clamp(64px, 13vw, 150px); line-height:1.02; letter-spacing:4px;
  color:#eaf7d8; text-shadow:5px 5px 0 #16220f;
}
.timer-card .bar{ width:100%; }
:root[data-mode="tv"] .timer{ font-size:72px; font-size:clamp(64px, 8vw, 150px); }

/* ---------- 提示条 ---------- */
#toast{
  position:fixed; left:50%; top:66px; transform:translateX(-50%) translateY(-16px);
  background:#1b2416; color:#dff3cf; border:3px solid #0b100a;
  padding:10px 16px; font-size:var(--t-xs); opacity:0; pointer-events:none;
  transition:opacity .18s, transform .18s; z-index:20; max-width:80vw; text-align:center;
}
#toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
#toast{ z-index:60; }

/* ---------- 模态 ---------- */
#modal{ position:absolute; top:0; right:0; bottom:0; left:0; z-index:30; display:grid; place-items:center; background:rgba(6,10,4,.72); padding:16px; }
#modal[hidden]{ display:none; }
#modal .panel{ max-width:92vw; max-width:min(92vw,720px); width:100%; max-height:88vh; overflow:auto; }

/* ---------- 横竖屏切换 ---------- */
@media (max-aspect-ratio:1/1){
  :root{ --t-xs:12px; --t-sm:24px; --t-md:36px; --t-lg:48px; --t-xl:60px; }
}
@media (max-width:520px){
  :root{ --t-xs:12px; --t-sm:20px; --t-md:28px; --t-lg:36px; --t-xl:48px; }
}

/* 减少动画偏好 / 低性能设备 */
@media (prefers-reduced-motion:reduce){ *{ animation:none !important; transition:none !important; } }

/* ================= 世界地图版新增 ================= */
/* iOS 刘海安全区 */
#hud{ padding-top:calc(10px + env(safe-area-inset-top, 0px)); }

/* 页面容器 */
.page{ flex:1; min-height:0; overflow:auto; -webkit-overflow-scrolling:touch; padding:14px; display:flex; justify-content:center; }
.page-inner{ width:100%; max-width:760px; display:flex; flex-direction:column; gap:12px; min-height:0; }
.page-inner.is-card{ max-width:900px; }
:root[data-mode="tv"] .page-inner.is-card{ max-width:900px; gap:14px; }
:root[data-mode="tv"] .page-inner{ max-width:1120px; }
.page-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }

/* 图标 */
.ico{ display:inline-block; width:20px; height:20px; vertical-align:-3px; }
.ico svg{ width:100%; height:100%; display:block; image-rendering:pixelated; }

/* 节点：当前可走的那一站发光 */
.node-g.active .node-ring{ opacity:1; }
.node-g.active{ filter:drop-shadow(0 0 8px rgba(255,255,255,.8)); }
.node-g.locked{ opacity:.85; }

/* 进度条 */
.bar{ height:16px; background:#2b2b2b; border:3px solid #101010; box-shadow:inset 2px 2px 0 rgba(0,0,0,.6); }
.bar > i{ display:block; height:100%; width:0; background:linear-gradient(#8ce155,#4b8f22); transition:width .2s steps(4); }
body.lowpower .bar > i{ transition:none; }

/* 按钮行 */
.btn-row{ display:flex; gap:10px; flex-wrap:wrap; }
.btn-row > .btn{ flex:1 1 40%; }

/* 答题反馈 */
.feedback{ font-size:var(--t-sm); padding:10px 12px; border:3px solid #0a0f07; }
.feedback.ok{ background:#2f5c14; color:#e8ffd6; }
.feedback.bad{ background:#5c1512; color:#ffd9d6; }

/* 精灵场景 */
.scene{ display:flex; align-items:flex-end; gap:14px; justify-content:center; }
.spr{ width:96px; height:96px; flex:0 0 auto; }
.spr.small{ width:48px; height:48px; }
:root[data-mode="tv"] .spr{ width:132px; height:132px; }
:root[data-mode="tv"] .spr.small{ width:64px; height:64px; }
.bubble{ flex:1; min-width:0; }

/* 庆祝 */
.bigwin{ text-align:center; display:flex; flex-direction:column; align-items:center; gap:10px; }
.bigwin .spr{ width:180px; height:180px; }

/* 任务清单紧凑版 */
.task-row .t-main{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.task-row .t-name{ font-size:var(--t-sm); color:#1d1d1d; }
.task-row .t-sub{ font-size:var(--t-xs); color:#5a5a5a; }
.task-row .t-flag{ font-size:var(--t-xs); color:#2f5c14; }
.task-row.is-done .t-flag{ color:#1b4d0b; }


/* 地图节点：焦点不用外框，用脚下虚线环 */
.node-g[data-f].focused{ outline:none !important; box-shadow:none !important; }
.node-g .node-ring{ opacity:0; }
.node-g.focused .node-ring, .node-g.active .node-ring{ opacity:1; }
.node-g.active .node-ring{ animation:ring 1.1s steps(2) infinite; }
@keyframes ring{ 0%,100%{ stroke-dashoffset:0; } 50%{ stroke-dashoffset:10; } }
body.lowpower .node-g.active .node-ring{ animation:none; }
/* 竖屏：侧栏更紧凑，别把页面撑破 */
.stage-stack .side{ max-height:44vh; gap:8px; padding:8px 10px 12px; }
.stage-stack .task-row{ padding:8px 10px; }

/* 竖屏/横屏都把内容垂直居中，避免大屏下半截空白 */
.page{ align-items:center; }
:root[data-mode="tv"] .page-inner{ max-width:1400px; gap:18px; }
:root[data-mode="tv"] .opt{ padding:18px 22px; }
:root[data-mode="tv"] .opt .key{ width:44px; height:44px; }
:root[data-mode="tv"] .page{ padding:22px; }
:root[data-mode="tv"] .pip{ width:26px; height:26px; }
:root[data-mode="tv"] .speech{ padding:20px 22px; }
.pip{ width:22px; height:22px; }

/* ---------- 电视实际视口只有 960x540（DPR 2）时的缩小版，避免右侧面板挤成竖条 ---------- */
@media (max-width:1100px){
  :root[data-mode="tv"]{ --t-xs:14px; --t-sm:20px; --t-md:28px; --t-lg:38px; --t-xl:52px; }
  :root[data-mode="tv"] .page{ padding:12px; }
  :root[data-mode="tv"] .opt{ padding:12px 14px; }
  :root[data-mode="tv"] .opt .key{ width:30px; height:30px; }
  :root[data-mode="tv"] .speech{ padding:12px 14px; }
  :root[data-mode="tv"] .pip{ width:18px; height:18px; }
  :root[data-mode="tv"] .spr{ width:88px; height:88px; }
  :root[data-mode="tv"] .spr.small{ width:48px; height:48px; }
  :root[data-mode="tv"] .timer{ font-size:56px; font-size:clamp(48px, 8vw, 96px); }
}

/* ---------- 电视遥控器：TV Bro 只有鼠标光标，没有方向键事件 ---------- */
/* lowpower 关掉了 hover 抬升，这里补回来：光标扫到哪一项，哪一项就抬起来 + 亮出白色虚线环 */
body.lowpower .node-g:hover .node-box,
body.lowpower .node-g.focused .node-box{ transform:translateY(-8px); }
body.lowpower .node-g:hover .node-ring,
body.lowpower .node-g.focused .node-ring{ opacity:1; }
:root[data-mode="tv"] [data-f].focused{ outline-width:6px; outline-offset:3px; }
:root[data-mode="tv"] #toast{ font-size:var(--t-md); padding:14px 24px; top:88px; max-width:70vw; }

/* 电视上距离远，选中项再明显一点：抬起来放大、环改成亮黄加粗 */
body.lowpower .node-g:hover .node-box,
body.lowpower .node-g.focused .node-box{ transform:translateY(-10px) scale(1.14); }
body.lowpower .node-g.focused .node-ring{ stroke:#ffe082; stroke-width:9; }

/* ---------- 开屏选角色：两个超大按钮，电视上遥控器好点 ---------- */
.btn-big{ min-height:96px; font-size:var(--t-md); padding:18px 26px; }
:root[data-mode="tv"] .btn-big{ min-height:120px; font-size:var(--t-lg); }

/* 家长活码：6 个格子直接显示数字，避免数不清 */
.code-slots{ display:flex; gap:10px; justify-content:center; margin:10px 0 6px; }
.code-slot{ width:54px; height:66px; line-height:60px; text-align:center; font-size:38px; color:var(--gold);
  background:#1b1b1b; border:3px solid #000; box-shadow:inset 2px 2px 0 rgba(255,255,255,.12); }
.code-slot.on{ background:#2c2c2c; }
:root[data-mode="tv"] .code-slot{ width:66px; height:80px; line-height:74px; font-size:46px; }

/* ---------- 电视（Chrome 66 软渲染）减卡顿：整图投影最贵，直接去掉 ---------- */
body.lowpower .map-shadow{ filter:none; }
body.lowpower .node-g .node-box{ transition:none; }
body.lowpower .node-ring{ transition:none; }
body.lowpower #stage *{ animation:none !important; }


/* 防双击放大：touch-action 交给浏览器做“只平移不缩放”，聚焦输入框也不会再自动放大（2026-11-19） */
html{ -webkit-text-size-adjust:100%; }
body{ touch-action:manipulation; }
button,.btn,.opt,.node-g{ touch-action:manipulation; }

/* ================= 做题页：iPad 横屏一屏放完（2026-11-19） ================= */
.page.quiz-page{ align-items:stretch; overflow:hidden; padding:10px 14px; }
.page.quiz-page .page-inner{ height:100%; min-height:0; max-width:900px; gap:8px; }
.page.quiz-page .page-head{ flex:0 0 auto; }
.page.quiz-page .options{
  flex:1 1 auto; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch;
  gap:8px; margin-top:6px; padding-right:2px;
}
.page.quiz-page .opt{ padding:11px 16px; }
.page.quiz-page .scene .spr{ width:72px; height:72px; }
.page.quiz-page .feedback,
.page.quiz-page .explain,
.page.quiz-page .btn-row{ flex:0 0 auto; }
.page.quiz-page .explain{ font-size:14px; padding:8px 10px; }

/* 横屏（iPad 1024×768 / 1180×820）整体收一点，给做题页留出「继续挖下一格」 */
@media (max-height:840px) and (min-width:900px){
  :root{ --t-sm:20px; --t-md:30px; --t-lg:40px; }
  .page.quiz-page{ padding:8px 12px; }
  .page.quiz-page .page-inner{ gap:6px; }
  .page.quiz-page .opt{ padding:9px 14px; }
  .page.quiz-page .scene .spr{ width:64px; height:64px; }
  .page.quiz-page .explain{ font-size:13px; }
  .page.quiz-page .bar{ height:12px; }
}

/* 面板/按钮再加一层像素内描边，接近原版 GUI 的立体感 */
.panel::after{
  content:''; position:absolute; inset:3px; pointer-events:none;
  border:2px solid rgba(255,255,255,.5); border-right-color:rgba(0,0,0,.18); border-bottom-color:rgba(0,0,0,.18);
}
.panel-dark::after{ border-color:rgba(255,255,255,.12); border-right-color:rgba(0,0,0,.4); border-bottom-color:rgba(0,0,0,.4); }

.page.quiz-page .options{ justify-content:center; }

/* ================= 日出皮肤（跟着钟点自动切） ================= */
:root[data-skin="dawn"] #sky{
  background:linear-gradient(#2b2a58 0%, #4b3a72 12%, #7c4a78 28%, #b25f78 44%, #e0816f 60%, #ffb08a 78%, #ffe6c6 100%);
}
:root[data-skin="dawn"] #sky .clouds{ filter:sepia(.18) saturate(1.2) brightness(1.12) hue-rotate(-8deg); }
:root[data-skin="dawn"] #sky .sun{ transform:translate(-330px,96px) scale(.96); }
:root[data-skin="dawn"] #sky .sun-glow{ opacity:.65; }
:root[data-skin="dawn"] #sky .stars{ opacity:.16; }
:root[data-skin="dawn"] #stage{ filter:sepia(.08) saturate(1.06) brightness(1.02); }
:root[data-skin="dawn"] #mg-far stop{ stop-color:#b98aa8; }
:root[data-skin="dawn"] #mg-mid stop{ stop-color:#8a5a7c; }
:root[data-skin="dawn"] #mg-near stop{ stop-color:#5a3854; }

/* ================= TNT 引信 ================= */
.fuse-row{ display:flex; align-items:center; gap:10px; flex:0 0 auto; padding:2px; }
.fuse-tnt{ display:block; width:46px; height:46px; flex:0 0 auto; }
.fuse-tnt svg{ display:block; width:46px; height:46px; }
.fuse-bar{
  position:relative; flex:1 1 auto; height:16px; background:#241a12;
  border:3px solid #0b100a; box-shadow:inset 0 0 0 2px rgba(255,255,255,.08);
}
.fuse-bar i{ display:block; height:100%; background:linear-gradient(#ffe89b,#e6ad2e); transition:width .18s linear; }
.fuse-num{
  flex:0 0 auto; min-width:2.2em; text-align:right;
  font-size:var(--t-sm); color:#ffe082; text-shadow:2px 2px 0 #0b100a;
}
.fuse-row.warn .fuse-bar i{ background:linear-gradient(#ffc35c,#ef8030); }
.fuse-row.critical .fuse-bar i{ background:linear-gradient(#ff8a6b,#c9452f); }
.fuse-row.critical .fuse-num{ color:#ff8a6b; }
.fuse-row.critical .fuse-tnt{ animation:tntShake .3s steps(2) infinite; }
@keyframes tntShake{
  0%{ transform:translate(0,0) rotate(0deg); }
  50%{ transform:translate(1px,-2px) rotate(-4deg); }
  100%{ transform:translate(-1px,1px) rotate(4deg); }
}
body.lowpower .fuse-row.critical .fuse-tnt{ animation:none; }

/* ================= 爆炸 / 掉落方块粒子 ================= */
.fx-layer{ position:fixed; top:0; right:0; bottom:0; left:0; z-index:9000; pointer-events:none; overflow:visible; }
.fx-px{
  position:absolute; display:block;
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.3), inset 0 3px 0 rgba(255,255,255,.35);
  animation-name:fxFly; animation-timing-function:cubic-bezier(.2,.7,.4,1); animation-fill-mode:forwards;
}
@keyframes fxFly{
  0%{ transform:translate(-50%,-50%) rotate(0deg) scale(1); opacity:1; }
  100%{ transform:translate(calc(-50% + var(--dx,0px)), calc(-50% + var(--dy,0px))) rotate(var(--rot,180deg)) scale(.45); opacity:0; }
}
.fx-flash{
  position:fixed; top:0; right:0; bottom:0; left:0; z-index:8999; pointer-events:none;
  background:radial-gradient(circle at 50% 45%, rgba(255,220,130,.9), rgba(255,120,60,.45) 42%, rgba(255,90,40,0) 72%);
  animation:fxFlash .4s ease-out forwards;
}
@keyframes fxFlash{ 0%{opacity:.95} 100%{opacity:0} }
#stage.shake{ animation:stageShake .5s steps(2) both; }
@keyframes stageShake{
  0%{ transform:translate(0,0); }
  20%{ transform:translate(-7px,4px); }
  40%{ transform:translate(6px,-5px); }
  60%{ transform:translate(-5px,-3px); }
  80%{ transform:translate(4px,3px); }
  100%{ transform:translate(0,0); }
}

/* ================= 地图上的动物自己小步溜达 ================= */
.mob{ animation-name:mobWalk; animation-timing-function:steps(1,end); animation-iteration-count:infinite; }
@keyframes mobWalk{
  0%{ transform:translate(0,0); }
  18%{ transform:translate(7px,-5px); }
  36%{ transform:translate(14px,0); }
  54%{ transform:translate(7px,-5px); }
  72%{ transform:translate(0,0); }
  100%{ transform:translate(0,0); }
}
body.lowpower .mob{ animation:none; }


/* 家长面板：给老人看的大字（2026-11-19） */
.parent-panel .stat-line{ font-size:22px; gap:16px; padding:10px 0; align-items:center; }
.parent-panel .panel-title{ font-size:27px; }
.parent-panel .btn{ font-size:22px; padding:16px 18px; }
.parent-panel .btn-sm{ font-size:21px; padding:14px 16px; }
.parent-panel .small{ font-size:16px; line-height:1.6; }
.parent-panel table.hist{ font-size:20px; }
.parent-panel table.hist td, .parent-panel table.hist th{ padding:8px 4px; }
@media (max-height:620px){
  .parent-panel .stat-line{ font-size:19px; padding:8px 0; }
  .parent-panel .panel-title{ font-size:23px; }
  .parent-panel .btn{ font-size:19px; padding:12px 14px; }
  .parent-panel .small{ font-size:15px; }
  .parent-panel table.hist{ font-size:17px; }
}

/* 家长活码输入：给老人放大（2026-11-19） */
.parent-entry .panel-title{ font-size:30px; }
.parent-entry .small{ font-size:19px; line-height:1.6; }
.parent-entry .code-slot{ width:66px; height:80px; line-height:74px; font-size:46px; }
.parent-entry .keypad{ gap:10px; }
.parent-entry .keypad .btn{ font-size:30px; padding:18px 0; }
