/* 潘迪知识岛 —— 界面样式
   色彩：墨水蓝（法国学生用的钢笔墨水）、贝雷红、太阳黄、泻湖青、草绿；题目卡片是法国作业本的 Seyès 格线。 */
:root {
  --ink: #1f2a5c;
  --ink-soft: #55608f;
  --beret: #e8425a;
  --beret-dark: #c22c44;
  --sun: #ffc93c;
  --lagoon: #19b5c8;
  --grass: #58c067;
  --paper: #fffef8;
  --line: #cdd6f6;
  --margin: #f2a0ae;
  --font: ui-rounded, "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "Nunito", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --shadow: 0 6px 0 rgba(31, 42, 92, .16);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font-family: var(--font); color: var(--ink); background: #9fdcf7; font-size: 17px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 5.2vw, 3.2rem); line-height: 1.08; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; line-height: 1.2; }
h2 small { font-size: .95rem; font-weight: 600; color: var(--ink-soft); margin-left: .4em; }
h3 { font-size: 1.12rem; margin-top: 1.4rem; margin-bottom: .5rem; }
h4 { font-size: .98rem; margin-top: 1.1rem; margin-bottom: .4rem; color: var(--ink-soft); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.small { font-size: .86rem; color: var(--ink-soft); }
.zh-title { font-size: clamp(1.05rem, 2.6vw, 1.45rem); font-weight: 700; color: var(--ink-soft); margin-top: .25rem; }
.warn { color: var(--beret-dark); font-weight: 700; }
.note { color: var(--ink-soft); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; border: 0; border-radius: 16px; padding: .7em 1.3em; font-weight: 800;
  background: var(--beret); color: #fff; box-shadow: 0 5px 0 var(--beret-dark); text-decoration: none; transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--beret-dark); }
.btn.big { font-size: 1.2rem; padding: .75em 1.8em; }
.btn.sm { padding: .42em .9em; font-size: .9rem; border-radius: 12px; box-shadow: 0 3px 0 var(--beret-dark); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #c9d0e6; border: 0; }
.btn.sm.ghost { box-shadow: 0 3px 0 #c9d0e6; }
.btn.ghost.danger { color: var(--beret-dark); }
.btn.google { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #c9d0e6; font-size: 1.1rem; }
.btn.google .g { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: #4285f4; color: #fff; font-weight: 900; }
.link { background: none; border: 0; color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; padding: .6em; }
.chip { display: inline-flex; align-items: center; gap: .35em; background: #fff; border: 0; border-radius: 999px; padding: .38em .85em; font-weight: 800; box-shadow: 0 4px 0 rgba(31, 42, 92, .14); }
.chip.icon { width: 2.6em; height: 2.6em; justify-content: center; padding: 0; font-size: 1rem; }
.pill { background: #eef1fb; border: 0; border-radius: 999px; padding: .4em 1em; font-weight: 700; font-size: .92rem; }
.tag { display: inline-block; border-radius: 8px; padding: .12em .6em; font-size: .82rem; font-weight: 800; background: #eef1fb; }
.tag.on { background: #d8f3dd; color: #1f7a36; }
.tag.trial { background: #fff1c2; color: #8a5a00; }
.tag.off { background: #eceef4; color: var(--ink-soft); }

/* 封面与选择孩子 */
.hero { position: absolute; right: 5vw; top: 50%; transform: translateY(-50%); width: min(520px, 92vw); background: rgba(255, 254, 248, .96);
  border-radius: 28px; padding: clamp(1.4rem, 4vw, 2.4rem); box-shadow: var(--shadow); display: grid; gap: .9rem; }
.hero .lead { font-size: 1.02rem; max-width: 34em; }
.hero { max-height: calc(100vh - 24px); overflow: auto; }
.gbtn { min-height: 44px; display: grid; justify-items: start; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--ink-soft); font-size: .88rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 2px dashed var(--line); }
.seg { display: flex; background: #eef1fb; border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 10px; padding: .5em .4em; font-weight: 800; color: var(--ink-soft); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 rgba(31, 42, 92, .12); }
.auth { gap: .65rem; }
.auth .row { align-items: stretch; }
.auth .send { white-space: nowrap; padding: .4em .9em; font-size: .9rem; border-radius: 12px; box-shadow: 0 3px 0 #c9d0e6; }
.auth .send:disabled { opacity: .6; cursor: default; }
.auth .link { justify-self: start; padding: .2em 0; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: default; }
.row { display: flex; gap: .6rem; }
.row input { flex: 1; min-width: 0; }
input, select { border: 2px solid var(--line); border-radius: 12px; padding: .6em .8em; background: #fff; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
.profiles { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .4rem; padding: 1rem; text-align: center; overflow: auto;
  background: linear-gradient(rgba(159, 220, 247, .55), rgba(159, 220, 247, .9)); }
.kids { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin: 1.4rem 0 .6rem; max-width: 900px; }
.kid { display: grid; justify-items: center; gap: .15rem; width: 164px; padding: 1.1rem .8rem; border: 0; border-radius: 24px; background: #fff; box-shadow: var(--shadow); transition: transform .12s; }
.kid:hover { transform: translateY(-4px); }
.kid strong { font-size: 1.15rem; }
.kid span { font-size: .88rem; color: var(--ink-soft); }
.kid.add { background: rgba(255, 255, 255, .7); border: 3px dashed #fff; }
.face { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; color: #fff !important; font-size: 2rem !important; font-weight: 900; margin-bottom: .3rem; }
.face.plus { background: var(--ink); }
.face.sm { width: 40px; height: 40px; font-size: 1.15rem !important; margin: 0; background: var(--beret); }

/* 世界地图 HUD */
.hud { position: absolute; top: calc(10px + var(--safe-top)); left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; pointer-events: none !important; }
.hud > * { pointer-events: auto; }
.who { text-align: left; padding: .3em .9em .3em .3em; gap: .6em; }
.who small { display: flex; align-items: center; gap: .5em; font-size: .78rem; color: var(--ink-soft); font-weight: 700; }
.who span { display: grid; line-height: 1.2; }
.bar, .meter { display: inline-block; width: 64px; height: 8px; border-radius: 4px; background: #e3e7f5; overflow: hidden; vertical-align: middle; }
.bar b, .meter b { display: block; height: 100%; background: var(--grass); }
.counters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.isles { position: absolute; left: 50%; transform: translateX(-50%); top: calc(74px + var(--safe-top)); display: flex; gap: .35rem; background: rgba(255, 255, 255, .75); padding: .3rem; border-radius: 18px; }
.isle { border: 0; background: transparent; border-radius: 14px; padding: .25em .8em; display: grid; line-height: 1.15; font-weight: 800; }
.isle small { font-size: .7rem; color: var(--ink-soft); }
.isle.on { background: var(--ink); color: #fff; }
.isle.on small { color: #cfd6f5; }
.isle-name { position: absolute; left: 50%; transform: translateX(-50%); top: calc(128px + var(--safe-top)); white-space: nowrap; font-size: .95rem; color: var(--ink); background: rgba(255, 255, 255, .75); border-radius: 12px; padding: .15em .8em; pointer-events: none !important; }
.isle-name b { font-size: 1.1rem; margin-right: .4em; }
#pick { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(104px + var(--safe-bottom)); width: min(420px, 94vw); pointer-events: none !important; }
.pick { pointer-events: auto; background: var(--paper); border-radius: 22px; padding: 1rem 1.2rem 1.2rem; box-shadow: var(--shadow); display: grid; gap: .3rem; justify-items: center; text-align: center; animation: pop .22s ease-out; }
.pick > div { display: flex; justify-content: space-between; width: 100%; align-items: center; }
.pick .btn { margin-top: .5rem; }
.stars i, .bigstars i { font-style: normal; color: #d5daea; }
.stars i.on { color: var(--sun); }
.lockmsg { font-size: .95rem; color: var(--ink-soft); }
.dock { position: absolute; left: 0; right: 0; bottom: calc(10px + var(--safe-bottom)); display: flex; justify-content: center; gap: .5rem; padding: 0 .5rem; pointer-events: none !important; }
.dockbtn { pointer-events: auto; flex: 0 1 132px; border: 0; background: #fff; border-radius: 18px; padding: .45rem .3rem .5rem; display: grid; justify-items: center; font-weight: 800; font-size: .95rem; line-height: 1.2; box-shadow: var(--shadow); }
.dockbtn span { font-size: 1.5rem; line-height: 1.2; }
.dockbtn small { font-size: .68rem; color: var(--ink-soft); font-weight: 700; }
.dockbtn:disabled { opacity: .55; cursor: default; }

/* 闯关 */
.play { position: absolute; top: calc(10px + var(--safe-top)); left: 0; right: 0; display: grid; justify-items: center; gap: .6rem; padding: 0 10px; pointer-events: none !important; }
.play > * { pointer-events: auto; }
.playbar { display: flex; align-items: center; gap: .7rem; width: min(760px, 100%); }
.pips { flex: 1; display: flex; gap: 5px; }
.pips i { flex: 1; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .75); }
.pips i.now { background: #fff; box-shadow: 0 0 0 3px var(--ink); }
.pips i.ok { background: var(--grass); }
.pips i.ko { background: var(--sun); }
/* 法国作业本的 Seyès 格线：细横线 + 每四行一条粗线 + 左侧红色页边线 */
.seyes { width: min(760px, 100%); border-radius: 18px; box-shadow: var(--shadow); padding: .8rem 1.2rem 1rem 3.4rem; position: relative;
  background-color: var(--paper);
  background-image: linear-gradient(90deg, transparent 2.4rem, var(--margin) 2.4rem, var(--margin) calc(2.4rem + 2px), transparent calc(2.4rem + 2px)),
    repeating-linear-gradient(transparent 0 31px, #b9c5f2 31px 32px),
    repeating-linear-gradient(transparent 0 7px, #e6ebfb 7px 8px); }
.qtitle { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
#q-text { font-size: clamp(1.15rem, 3.2vw, 1.7rem); line-height: 1.3; margin: .1rem 0 .3rem; }
.seyes .zh { font-size: 1rem; color: #8a3b00; background: #fff1c2; border-radius: 10px; padding: .25em .7em; display: inline-block; margin-bottom: .4rem; }
.qtools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }

/* 小镇 */
.town { position: absolute; inset: 0; pointer-events: none !important; }
.town > * { pointer-events: auto; }
.town-top { position: absolute; top: calc(10px + var(--safe-top)); left: 10px; right: 10px; display: flex; align-items: flex-start; gap: .6rem; pointer-events: none !important; }
.town-top > * { pointer-events: auto; }
.objective { flex: 1; max-width: 560px; background: rgba(255, 254, 248, .95); border-radius: 16px; padding: .4rem .9rem; box-shadow: 0 4px 0 rgba(31, 42, 92, .14); display: grid; line-height: 1.25; }
.objective b { font-size: 1.05rem; }
.objective small { font-size: .8rem; color: var(--ink-soft); }
.town-top .counters { margin-left: auto; }
#t-gps.on { background: var(--sun); }
.gpsline { position: absolute; top: calc(74px + var(--safe-top)); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: .3em 1em; white-space: nowrap; font-size: .95rem; }
.gpsline small { opacity: .75; margin: 0 .5em; }
.gpsline span { background: var(--sun); color: var(--ink); border-radius: 999px; padding: 0 .6em; font-weight: 800; }
#t-map { position: absolute; right: 10px; top: calc(64px + var(--safe-top)); width: 240px; height: 176px; border-radius: 14px; box-shadow: 0 4px 0 rgba(31, 42, 92, .2); pointer-events: none; }
.camkeys { position: absolute; right: 10px; top: calc(246px + var(--safe-top)); display: flex; gap: .4rem; }
.camkeys .chip { padding: .25em .7em; font-size: .85rem; }
.town.cinema .camkeys { display: none; }
.prompt { position: absolute; left: 50%; bottom: calc(26px + var(--safe-bottom)); transform: translateX(-50%); background: rgba(255, 254, 248, .96); border-radius: 16px; padding: .5em 1em; box-shadow: var(--shadow); white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
.prompt small { color: var(--ink-soft); margin-left: .5em; }
kbd { display: inline-grid; place-items: center; min-width: 1.7em; white-space: nowrap; height: 1.7em; padding: 0 .35em; border-radius: 8px; background: var(--ink); color: #fff; font: inherit; font-weight: 900; font-size: .9em; box-shadow: 0 3px 0 #0e1535; margin-right: .3em; }
.tdialog { position: absolute; left: 50%; bottom: calc(14px + var(--safe-bottom)); transform: translateX(-50%); width: min(720px, calc(100vw - 20px)); max-height: 78vh; overflow: auto; background: var(--paper); border-radius: 22px; padding: 1rem 1.2rem 1.1rem; box-shadow: 0 8px 0 rgba(31, 42, 92, .2); display: grid; gap: .5rem; animation: pop .2s ease-out; }
.speaker { display: flex; align-items: center; gap: .6rem; }
.speaker .avatar { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #eef1fb; font-size: 1.4rem; }
.dtools { margin-left: auto; display: flex; gap: .4rem; }
.dfr { font-size: clamp(1.1rem, 2.6vw, 1.4rem); font-weight: 700; line-height: 1.35; }
.tdialog .zh { font-size: .98rem; color: #8a3b00; background: #fff1c2; border-radius: 10px; padding: .3em .7em; justify-self: start; }
.dask small { color: var(--ink-soft); margin-left: .4em; }
.dchoices { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .3rem; }
.choice { flex: 1 1 180px; border: 3px solid var(--line); background: #fff; border-radius: 16px; padding: .7em .8em; font-weight: 800; font-size: 1.05rem; }
.choice.ok { background: var(--grass); border-color: #2f9a48; color: #fff; }
.choice.ko { background: #eceef4; color: #9aa3b8; text-decoration: line-through; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .5rem; }
.itemcard { position: relative; border: 3px solid var(--line); background: #fff; border-radius: 16px; padding: .5rem .4rem .6rem; display: grid; justify-items: center; gap: .1rem; line-height: 1.2; }
.itemcard .emoji { font-size: 2.1rem; line-height: 1.15; }
.itemcard b { font-size: .92rem; }
.itemcard small { color: var(--ink-soft); font-size: .8rem; }
.itemcard.on { border-color: var(--beret); background: #fff5f6; }
.itemcard .qty { position: absolute; top: 6px; right: 8px; font-style: normal; font-weight: 900; color: var(--beret); }
.itemcard .minus { position: absolute; top: 4px; left: 6px; width: 1.6em; height: 1.6em; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-style: normal; font-weight: 900; }
.clues { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; font-weight: 700; }
.clues li { background: #f4f6fd; border-radius: 12px; padding: .4em .7em; }
.clues li.done { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(31, 42, 92, .3); }
.clues small { display: block; font-weight: 600; text-decoration: none; background: none; padding: 0; }
/* 过场动画：隐藏操作界面，上下加黑边，底部是字幕 */
.town.cinema .town-top, .town.cinema #t-map, .town.cinema .prompt, .town.cinema .gpsline, .town.cinema .tpad { display: none; }
.town.mars #t-phone, .town.mars #t-gps, .town.mars #t-book { display: none; }
.cine { position: absolute; inset: 0; pointer-events: none !important; }
.cine::before, .cine::after { content: ""; position: absolute; left: 0; right: 0; height: 9vh; background: #000; }
.cine::before { top: 0; } .cine::after { bottom: 0; }
.cine .caption { position: absolute; left: 50%; bottom: 11vh; transform: translateX(-50%); text-align: center; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .8); max-width: 92vw; }
.cine .caption b { display: block; font-size: clamp(1.2rem, 3.4vw, 2rem); }
.cine .caption small { font-size: clamp(.9rem, 2vw, 1.15rem); opacity: .9; }
.cine .count { position: absolute; left: 7%; top: 16%; font-size: clamp(4rem, 16vw, 9rem); font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 6px 0 rgba(31, 42, 92, .55), 0 0 40px rgba(255, 180, 60, .6); }
.cine #t-skip { position: absolute; right: 14px; top: calc(9vh + 12px); pointer-events: auto; z-index: 2; background: rgba(255, 255, 255, .85); }
.fade { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .7s; pointer-events: none !important; }
.fade.on { opacity: 1; }
.tdialog { z-index: 3; }
.tpad { display: none; }
@media (pointer: coarse) {
  .tpad { display: block; }
  .tpad .arrows { position: absolute; left: 14px; bottom: calc(16px + var(--safe-bottom)); display: grid; grid-template-areas: ". u ." "l d r"; gap: 6px; }
  .tpad .arrows button { width: 58px; height: 58px; border-radius: 16px; border: 0; background: rgba(255, 255, 255, .85); font-size: 1.3rem; box-shadow: 0 4px 0 rgba(31, 42, 92, .2); touch-action: none; }
  .tpad [data-k=up] { grid-area: u; } .tpad [data-k=left] { grid-area: l; } .tpad [data-k=down] { grid-area: d; } .tpad [data-k=right] { grid-area: r; }
  .tpad .acts { position: absolute; right: 14px; bottom: calc(16px + var(--safe-bottom)); display: flex; gap: 8px; }
  .tpad .acts button { width: 68px; height: 68px; border-radius: 50%; border: 0; background: var(--beret); color: #fff; font-weight: 900; font-size: 1.4rem; box-shadow: 0 5px 0 var(--beret-dark); }
  .prompt { bottom: calc(150px + var(--safe-bottom)); }
}
.dockbtn.ville { background: var(--sun); }

/* 结算 */
.result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 94vw); max-height: 94vh; overflow: auto; background: var(--paper); border-radius: 28px;
  padding: 1.6rem 1.4rem; box-shadow: var(--shadow); display: grid; gap: .5rem; justify-items: center; text-align: center; }
.bigstars { font-size: clamp(3rem, 12vw, 4.6rem); line-height: 1; display: flex; gap: .1em; }
.bigstars i.on { color: var(--sun); text-shadow: 0 4px 0 #e09a00; animation: starIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.score { font-weight: 700; color: var(--ink-soft); }
.gains { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: .5rem 0; }
.gains .chip { background: #eef1fb; box-shadow: none; }
.levelup { font-weight: 900; color: var(--beret); font-size: 1.15rem; }
.badge-new { background: #fff1c2; border-radius: 12px; padding: .4em .9em; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-top: 1rem; }
.actions.left { justify-content: flex-start; }

/* 弹窗 */
#modal { position: fixed; inset: 0; background: rgba(31, 42, 92, .5); display: grid; place-items: center; padding: 12px; z-index: 20; }
.sheet { background: var(--paper); border-radius: 24px; padding: 1.4rem; width: min(440px, 100%); max-height: 92vh; overflow: auto; display: grid; gap: .7rem; align-content: start; }
.sheet.wide { width: min(820px, 100%); }
.form { display: grid; gap: .8rem; }
.form label { display: grid; gap: .25rem; font-weight: 700; font-size: .92rem; }
.form.inline { background: #f4f6fd; border-radius: 16px; padding: 1rem; margin-top: .6rem; }
.form.inline h3 { margin-top: 0; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
legend { font-weight: 700; font-size: .92rem; padding: 0; margin-bottom: .3rem; }
.check { display: flex !important; align-items: center; gap: .5em; font-weight: 600 !important; grid-template-columns: none; }
.coins { font-weight: 800; }
.shop, .trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.item { border: 3px solid var(--line); background: #fff; border-radius: 16px; padding: .8rem .5rem; display: grid; gap: .1rem; justify-items: center; }
.item span { font-size: .85rem; color: var(--ink-soft); }
.item em { font-style: normal; font-weight: 800; font-size: .88rem; margin-top: .3rem; }
.item.owned { border-color: var(--grass); }
.item.worn { background: #d8f3dd; border-color: var(--grass); }
.trophy { display: grid; justify-items: center; text-align: center; gap: .1rem; padding: .8rem .4rem; border-radius: 16px; background: #eef0f6; opacity: .55; filter: grayscale(1); }
.trophy.on { background: #fff1c2; opacity: 1; filter: none; }
.trophy span { font-size: 2rem; line-height: 1.2; }
.trophy small { font-size: .76rem; color: var(--ink-soft); }

/* 家长专区 */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: .5rem; }
.tabs button { border: 0; background: none; padding: .45em .9em; border-radius: 10px; font-weight: 800; color: var(--ink-soft); }
.tabs button.on { background: var(--ink); color: #fff; }
.tabs .x { margin-left: auto; }
.pbody { display: grid; gap: .5rem; }
.rows { display: grid; gap: .5rem; }
.rowcard { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: .7rem .9rem; }
.rowbtns { display: flex; gap: .4rem; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; }
.stats div { background: #f4f6fd; border-radius: 14px; padding: .6rem; text-align: center; display: grid; }
.stats b { font-size: 1.6rem; line-height: 1.2; }
.stats span { font-size: .8rem; color: var(--ink-soft); }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 110px; align-items: end; }
.bars div { height: 100%; display: grid; grid-template-rows: 1fr auto; align-items: end; text-align: center; }
.bars i { display: block; background: var(--lagoon); border-radius: 5px 5px 0 0; min-height: 2px; }
.bars span { font-size: .68rem; color: var(--ink-soft); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; color: var(--ink-soft); font-size: .8rem; padding: .3em .5em; border-bottom: 2px solid var(--line); }
.tbl td { padding: .4em .5em; border-bottom: 1px solid #e6eaf7; vertical-align: top; }
.weak { margin: 0; padding-left: 1.2rem; display: grid; gap: .4rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .7rem; }
.plan { border: 3px solid var(--line); border-radius: 18px; padding: .9rem; display: grid; gap: .1rem; background: #fff; cursor: pointer; position: relative; }
.plan input { position: absolute; top: .8rem; right: .8rem; }
.plan b { font-size: 1.5rem; }
.plan:has(input:checked) { border-color: var(--beret); background: #fff5f6; }
.notice { background: #d8f3dd; border-radius: 14px; padding: .8rem 1rem; margin-top: .6rem; }

/* 提示条 */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: .6em 1.2em; border-radius: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: 92vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--beret-dark); }
.card.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--paper); padding: 2rem; border-radius: 24px; text-align: center; }

@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-aspect-ratio: 5/4) {
  #pick { left: auto; right: 3vw; transform: none; bottom: auto; top: 50%; translate: 0 -50%; width: min(340px, 34vw); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  #t-map { width: 150px; height: 110px; top: calc(112px + var(--safe-top)); }
  .camkeys { top: calc(228px + var(--safe-top)); }
  .town-top { flex-wrap: wrap; }
  .objective { order: 3; flex-basis: 100%; }
  .gpsline { top: calc(176px + var(--safe-top)); font-size: .85rem; }
  .hero { right: 50%; transform: translate(50%, 0); top: auto; bottom: 12px; padding: 1.2rem; gap: .6rem; }
  .hero .lead, .hero > .small { display: none; }
  .hero h1 { font-size: 1.55rem; }
  .hero .zh-title { font-size: 1rem; margin-top: 0; }
  .auth label:has(input[name=password][autocomplete=new-password]) { font-size: .85rem; }
  .isles { top: calc(64px + var(--safe-top)); }
  .isle-name { top: calc(116px + var(--safe-top)); }
  .who strong { max-width: 5.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .who small { white-space: nowrap; }
  .who .bar { display: none; }
  .hud { left: 6px; right: 6px; }
  .counters { flex-wrap: nowrap; gap: .25rem; }
  .counters .chip { padding: .32em .55em; font-size: .88rem; }
  .counters .chip.icon { width: 2.3em; height: 2.3em; }
  .dock { gap: 4px; padding: 0 6px; }
  .dockbtn { font-size: .66rem; flex: 1 1 0; min-width: 0; padding: .35rem .05rem .4rem; border-radius: 14px; overflow: hidden; white-space: nowrap; }
  .dockbtn span { font-size: 1.3rem; }
  .dockbtn small { display: none; }
  .seyes { padding: .6rem .9rem .8rem 2.9rem; }
  .qtitle { display: none; }
  .kid { width: 142px; }
}
@media (max-height: 520px) {
  .qtitle { display: none; }
  .seyes { padding-top: .4rem; padding-bottom: .5rem; }
  #pick { bottom: calc(84px + var(--safe-bottom)); }
  .pick p { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
