/* 我愛區段 — 視覺：炭黑、黃銅細框、暖黃桌燈（依參考圖 S__47570946.jpg） */
:root {
  color-scheme: dark;
  --bg: #090b0e; --panel: rgba(13, 16, 21, .93); --panel-solid: #10141a; --panel-2: #171c24;
  --line: rgba(196, 164, 108, .34); --line-strong: rgba(214, 180, 118, .62);
  --text: #efe6d2; --dim: #b9ad95; --muted: #7d7567;
  --accent: #e8b65a; --accent-press: #c9983f; --on-accent: #17120a;
  --prep: #d9c39a; --energy: #6dbb68; --mood: #5a94e0; --money: #e0a93b;
  --up: #7fb4f0; --down: #e2705f; --good: #7ccf8a;
  --r-panel: .7rem; --r-ctl: .45rem;
  --focus: 0 0 0 2px rgba(232, 182, 90, .55);
  --serif: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
  --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; }
html { font-size: clamp(14px, .62vw + 1.02vh, 24px); height: 100%; }
body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.6; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
button:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--focus); }
button:disabled { cursor: not-allowed; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; }

/* ---------- 場景 ---------- */
#scene { position: absolute; inset: 0; background: #07090b; }
#scene .bg { position: absolute; inset: -2%; width: 104%; height: 104%; object-fit: cover; object-position: 62% 32%; opacity: 0; transition: opacity 1.1s ease; will-change: opacity, transform; }
#scene .bg.on { opacity: 1; animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.0) translate(0, 0); } to { transform: scale(1.045) translate(-.8%, -.6%); } }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .6s; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity .6s; touch-action: none; cursor: pointer; }
#app.world-on #world { opacity: 1; pointer-events: auto; }
#app.world-on #scene .bg, #app.world-on #scene .lamp, #app.world-on #fx { opacity: 0; }
#app.world-on #scene .grade { pointer-events: none; background: radial-gradient(130% 100% at 55% 45%, transparent 55%, rgba(5, 6, 8, .7) 100%), linear-gradient(to right, rgba(7, 9, 12, .6) 0%, transparent 30%), linear-gradient(to top, rgba(7, 9, 12, .8) 0%, transparent 22%); }
#wlabels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.wl { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: .4rem; padding: .16rem .6rem; border-radius: 1rem; border: 1px solid var(--line); background: rgba(13, 16, 21, .78); font-size: .74rem; color: var(--dim); white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.wl b { font-weight: 500; } .wl kbd, .wl span { display: none; }
.wl:hover { border-color: var(--line-strong); color: var(--text); }
.wl.near { border-color: var(--accent); color: var(--text); background: rgba(18, 20, 25, .96); font-size: .9rem; padding: .3rem .8rem .3rem .4rem; z-index: 2; }
.wl.near kbd { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: var(--r-ctl); background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-size: .74rem; font-weight: 700; }
.wl.near span { display: inline; color: var(--dim); font-size: .78rem; }
.wl.off b { color: var(--muted); } .wl.off.near span { color: var(--down); }
.wbar { display: flex; align-items: center; gap: 1.2rem; padding: .7rem 1.1rem; width: fit-content; max-width: 100%; margin: 0 auto; }
.wbar h2 { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.wbar p { font-size: .8rem; color: var(--dim); }
.wbar p kbd, .linkish kbd { font-family: var(--mono); font-size: .7rem; padding: .05rem .35rem; border: 1px solid var(--line); border-radius: var(--r-ctl); color: var(--text); }
.linkish { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: var(--r-ctl); font-size: .8rem; color: var(--dim); white-space: nowrap; transition: border-color .15s, color .15s; }
.linkish:hover { border-color: var(--line-strong); color: var(--accent); }
.talk .walkhint { margin-top: .7rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; font-size: .86rem; color: var(--accent); }
#scene .grade { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 62% 30%, transparent 35%, rgba(5, 6, 8, .62) 100%),
    linear-gradient(to right, rgba(7, 9, 12, .82) 0%, rgba(7, 9, 12, .35) 26%, transparent 46%),
    linear-gradient(to top, rgba(7, 9, 12, .97) 0%, rgba(7, 9, 12, .86) 24%, rgba(7, 9, 12, .3) 52%, transparent 70%); }
#scene .lamp { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(38% 34% at 72% 26%, rgba(255, 196, 110, .16), transparent 70%); mix-blend-mode: screen; animation: flicker 7s infinite; }
@keyframes flicker { 0%, 100% { opacity: .9; } 42% { opacity: 1; } 44% { opacity: .72; } 46% { opacity: 1; } 78% { opacity: .84; } }
#app.urgent #scene { animation: shake .5s; }
#app.urgent #scene .grade { box-shadow: inset 0 0 12rem rgba(226, 112, 95, .32); }
@keyframes shake { 10%, 90% { transform: translate(-2px, 0); } 30%, 70% { transform: translate(4px, 1px); } 50% { transform: translate(-5px, -1px); } }

/* ---------- 面板共用 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); }
.micro { font-family: var(--mono); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* ---------- HUD ---------- */
#hud { position: absolute; top: 1rem; left: 1rem; width: 17.5rem; display: grid; gap: .5rem; z-index: 3; }
.who { display: flex; gap: .8rem; align-items: center; padding: .1rem .1rem .3rem; }
.avatar { width: 4.6rem; height: 4.6rem; border-radius: 50%; border: 2px solid var(--line-strong); overflow: hidden; background: #111; flex: none; box-shadow: 0 0 0 4px rgba(0, 0, 0, .35); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: opacity .5s; }
.who small { display: block; color: var(--dim); font-size: .74rem; }
.who b { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 700; letter-spacing: .06em; line-height: 1.25; }
.stat { padding: .5rem .7rem .55rem; display: grid; grid-template-columns: 1.7rem 1fr auto; column-gap: .6rem; align-items: center; position: relative; }
.stat .icon { font-size: 1.45rem; }
.stat .label { font-size: .86rem; font-weight: 500; }
.stat .val { font-size: .8rem; color: var(--dim); }
.stat .bar { grid-column: 2 / 4; height: .42rem; border-radius: 1rem; background: rgba(255, 255, 255, .09); overflow: hidden; margin-top: .2rem; }
.stat .bar i { display: block; height: 100%; border-radius: 1rem; width: 0; transition: width .7s cubic-bezier(.2, .7, .2, 1); }
.stat.prep .icon, .stat.prep .bar i { color: var(--prep); background-color: var(--prep); }
.stat.energy .icon { color: var(--energy); } .stat.energy .bar i { background: var(--energy); }
.stat.mood .icon { color: var(--mood); } .stat.mood .bar i { background: var(--mood); }
.stat.money .icon { color: var(--money); } .stat.money .bar i { background: var(--money); }
.stat.prep .icon { background: none; }
.stat.low .bar i { background: var(--down); }
.stat.low { border-color: rgba(226, 112, 95, .6); animation: lowpulse 1.6s infinite; }
@keyframes lowpulse { 50% { border-color: rgba(226, 112, 95, .2); } }
.topics { grid-column: 1 / 4; display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-top: .45rem; }
.topics div { font-size: .68rem; color: var(--dim); position: relative; }
.topics div span { display: flex; justify-content: space-between; }
.topics div em { font-style: normal; color: var(--accent); }
.topics div u { display: block; height: .22rem; border-radius: 1rem; background: rgba(255, 255, 255, .09); margin-top: .12rem; overflow: hidden; text-decoration: none; }
.topics div u b { display: block; height: 100%; background: var(--prep); transition: width .7s; }
.float { position: absolute; right: .6rem; top: -.2rem; font-family: var(--mono); font-size: .92rem; font-weight: 700; pointer-events: none; animation: floatup 1.5s ease-out forwards; text-shadow: 0 1px 4px #000; }
.float.up { color: var(--good); } .float.down { color: var(--down); }
@keyframes floatup { from { opacity: 0; transform: translateY(.4rem); } 15% { opacity: 1; } to { opacity: 0; transform: translateY(-1.5rem); } }
.buffs { display: flex; flex-wrap: wrap; gap: .3rem; }
.buffs span { font-size: .68rem; padding: .12rem .5rem; border-radius: 1rem; border: 1px solid var(--line); background: var(--panel); color: var(--dim); }
.buffs span.bad { color: var(--down); border-color: rgba(226, 112, 95, .45); }
.buffs span.good { color: var(--good); border-color: rgba(124, 207, 138, .4); }

/* ---------- 日期／工具 ---------- */
#right { position: absolute; top: 1rem; right: 1rem; z-index: 3; display: grid; gap: .5rem; justify-items: end; }
#clock { width: 13.5rem; padding: .7rem .9rem .75rem; text-align: center; }
#clock .date { font-size: 1rem; font-weight: 500; }
#clock .slot { display: flex; justify-content: center; align-items: center; gap: .45rem; font-family: var(--serif); font-size: 1.45rem; font-weight: 700; margin: .1rem 0 .35rem; }
#clock .slot .icon { color: var(--accent); font-size: 1.3rem; }
#clock .pips { display: flex; justify-content: center; gap: .3rem; margin-bottom: .5rem; }
#clock .pips i { width: 1.5rem; height: .22rem; border-radius: 1rem; background: rgba(255, 255, 255, .13); }
#clock .pips i.done { background: var(--muted); } #clock .pips i.now { background: var(--accent); }
#clock .count { border-top: 1px solid var(--line); padding-top: .45rem; font-size: .84rem; color: var(--dim); }
#clock .count b { font-family: var(--serif); font-size: 1.9rem; color: var(--accent); margin: 0 .25rem; line-height: 1; vertical-align: -.12em; }
#clock .todo { margin-top: .4rem; font-size: .72rem; color: var(--accent); }
#tools { display: flex; gap: .4rem; }
#tools button { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; font-size: 1.15rem; color: var(--dim); position: relative; transition: color .15s, border-color .15s, transform .15s; }
#tools button:hover { color: var(--accent); border-color: var(--line-strong); transform: translateY(-1px); }
#tools button .dot { position: absolute; top: .3rem; right: .3rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--down); }

/* ---------- 下方操作區 ---------- */
#dock { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 1.2rem 1.2rem; z-index: 4; display: flex; justify-content: center; pointer-events: none; }
#dock > section { width: min(100%, 72rem); pointer-events: none; }
#dock > section > * { pointer-events: auto; }
.prompt { display: flex; align-items: baseline; gap: 1rem; margin: 0 .2rem .6rem; }
.prompt h2 { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: .04em; text-shadow: 0 2px 10px #000; }
.prompt p { color: var(--dim); font-size: .86rem; text-shadow: 0 1px 6px #000; }
.prompt .shop { margin-left: auto; padding: .4rem .9rem; display: flex; align-items: center; gap: .5rem; font-size: .88rem; transition: border-color .15s, color .15s; }
.prompt .shop:hover { border-color: var(--line-strong); color: var(--accent); }
.prompt .shop .icon { font-size: 1.1rem; color: var(--accent); }
.acts { display: grid; grid-template-columns: repeat(6, 1fr); gap: .7rem; }
.act { padding: .85rem .7rem .8rem; text-align: center; display: grid; justify-items: center; gap: .1rem; position: relative; transition: transform .16s, border-color .16s, background .16s; }
.act .icon { font-size: 2.3rem; color: var(--prep); margin-bottom: .25rem; stroke-width: 1.4; }
.act h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; letter-spacing: .08em; }
.act p { font-size: .76rem; color: var(--dim); }
.act kbd { position: absolute; top: .4rem; left: .55rem; font-family: var(--mono); font-size: .62rem; color: var(--muted); }
.act:not(:disabled):hover { transform: translateY(-3px); border-color: var(--line-strong); background: rgba(24, 28, 36, .94); }
.act:not(:disabled):hover .icon { color: var(--accent); }
.act:disabled { opacity: .46; }
.act:disabled p { color: var(--down); }

/* 對話／結果 */
.talk { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; padding: 1.1rem 1.3rem 1.2rem; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(.8rem); } }
@keyframes risein { from { opacity: 0; transform: translateY(.6rem); } to { opacity: 1; transform: none; } }
.talk .face { width: 6.2rem; }
.talk .face .ph { width: 6.2rem; height: 6.2rem; border-radius: 50%; border: 2px solid var(--line-strong); overflow: hidden; background: var(--panel-2); display: grid; place-items: center; font-family: var(--serif); font-size: 2rem; color: var(--accent); }
.talk .face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.talk .face span { display: block; text-align: center; margin-top: .35rem; font-size: .82rem; color: var(--dim); }
.talk .tag { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.talk .tag h2 { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; letter-spacing: .04em; }
.talk.urgent { border-color: rgba(226, 112, 95, .7); }
.talk.urgent .tag h2 { color: var(--down); }
.talk .body { font-size: 1.02rem; line-height: 1.85; white-space: pre-line; min-height: 3.6rem; max-width: 52rem; cursor: default; }
.talk .choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .55rem; margin-top: .9rem; }
.choice { padding: .6rem .9rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: rgba(255, 255, 255, .03); display: grid; gap: .05rem; transition: border-color .15s, background .15s, transform .15s; opacity: 0; animation: risein .3s ease-out forwards; }
.choice b { font-weight: 500; font-size: .98rem; }
.choice small { font-size: .74rem; color: var(--dim); }
.choice:not(:disabled):hover { border-color: var(--accent); background: rgba(232, 182, 90, .1); transform: translateX(3px); }
.choice:disabled { filter: saturate(.4) brightness(.6); }
.choice:disabled small { color: var(--down); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.chip { font-family: var(--mono); font-size: .8rem; padding: .16rem .6rem; border-radius: 1rem; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); opacity: 0; animation: risein .3s ease-out forwards; }
.chip.up { color: var(--up); border-color: rgba(127, 180, 240, .4); } .chip.down { color: var(--down); border-color: rgba(226, 112, 95, .4); }
.go { margin-top: .9rem; display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1.4rem; border-radius: var(--r-ctl); background: var(--accent); color: var(--on-accent); font-weight: 700; transition: background .15s, transform .15s; }
.go:hover { background: #f3c672; transform: translateY(-1px); }
.go:active { background: var(--accent-press); }
.go kbd { font-family: var(--mono); font-size: .68rem; opacity: .6; font-weight: 400; }

/* 新的一天 */
#daycard { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(6, 7, 9, .9); animation: fade .5s; text-align: center; padding: 2rem; }
@keyframes fade { from { opacity: 0; } }
#daycard .in { max-width: 34rem; }
#daycard h2 { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; letter-spacing: .1em; margin: .5rem 0 .2rem; }
#daycard .big { font-family: var(--serif); font-size: 1.1rem; color: var(--dim); }
#daycard .big b { font-size: 3.6rem; color: var(--accent); margin: 0 .5rem; vertical-align: -.1em; }
#daycard p { color: var(--dim); margin-top: 1rem; line-height: 1.9; }
#daycard .chips { justify-content: center; }

/* LINE 通知 */
#banner { position: absolute; top: 1rem; left: 50%; width: min(26rem, 92vw); transform: translate(-50%, -160%); z-index: 9; padding: .7rem .9rem; display: flex; gap: .7rem; align-items: center; transition: transform .45s cubic-bezier(.2, .9, .3, 1.2); }
#banner.on { transform: translate(-50%, 0); animation: buzz .5s .35s 2; }
@keyframes buzz { 20% { margin-left: -4px; } 40% { margin-left: 4px; } 60% { margin-left: -3px; } 80% { margin-left: 3px; } }
#banner .ph { width: 2.6rem; height: 2.6rem; border-radius: 50%; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; font-family: var(--serif); color: var(--accent); flex: none; border: 1px solid var(--line); }
#banner .ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
#banner b { display: block; font-size: .84rem; } #banner span { display: block; font-size: .8rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 19rem; }
#banner .micro { margin-left: auto; align-self: flex-start; }

/* ---------- 對話框（選單／商店／日誌） ---------- */
dialog { border: 1px solid var(--line-strong); border-radius: var(--r-panel); background: var(--panel-solid); color: var(--text); padding: 0; width: min(46rem, 94vw); max-height: 88vh; margin: auto; }
dialog::backdrop { background: rgba(4, 5, 7, .78); }
dialog[open] { animation: rise .25s ease-out; }
dialog header { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem .8rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel-solid); z-index: 1; }
dialog header h2 { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; letter-spacing: .06em; }
dialog header p { color: var(--dim); font-size: .82rem; }
dialog header .x { margin-left: auto; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: var(--r-ctl); border: 1px solid var(--line); color: var(--dim); font-size: 1rem; }
dialog header .x:hover { color: var(--accent); border-color: var(--line-strong); }
dialog .in { padding: 1rem 1.2rem 1.3rem; overflow: auto; }
.tsel { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1rem; }
.tsel button { padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: rgba(255, 255, 255, .03); transition: border-color .15s, background .15s; }
.tsel button:hover { border-color: var(--line-strong); }
.tsel button[aria-pressed="true"] { border-color: var(--accent); background: rgba(232, 182, 90, .12); }
.tsel b { display: flex; justify-content: space-between; font-size: .95rem; font-weight: 500; }
.tsel b em { font-style: normal; color: var(--accent); font-size: .74rem; }
.tsel u { display: block; height: .3rem; border-radius: 1rem; background: rgba(255, 255, 255, .1); margin: .3rem 0 .15rem; overflow: hidden; text-decoration: none; }
.tsel u i { display: block; height: 100%; background: var(--prep); }
.tsel small { font-size: .7rem; color: var(--dim); }
.hintline { font-size: .8rem; color: var(--dim); margin-bottom: .8rem; }
.hintline b { color: var(--accent); font-weight: 500; }
.opt { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; align-items: center; padding: .75rem .95rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: rgba(255, 255, 255, .03); margin-bottom: .55rem; transition: border-color .15s, background .15s, transform .15s; }
.opt h3 { font-size: 1.05rem; font-weight: 500; }
.opt p { font-size: .8rem; color: var(--dim); grid-column: 1; }
.opt .fx { grid-row: 1 / 3; grid-column: 2; display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; max-width: 17rem; }
.opt .fx span { font-family: var(--mono); font-size: .74rem; padding: .1rem .5rem; border-radius: 1rem; border: 1px solid var(--line); white-space: nowrap; }
.opt .fx .up { color: var(--up); } .opt .fx .down { color: var(--down); } .opt .fx .gold { color: var(--accent); }
.opt:not(:disabled):hover { border-color: var(--accent); background: rgba(232, 182, 90, .09); transform: translateX(3px); }
.opt:disabled { opacity: .45; } .opt:disabled p { color: var(--down); }
.logrow { padding: .7rem 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.logrow time { font-family: var(--mono); font-size: .68rem; color: var(--muted); letter-spacing: .08em; }
.logrow h3 { font-size: .98rem; font-weight: 500; margin: .1rem 0; }
.logrow p { font-size: .84rem; color: var(--dim); white-space: pre-line; }
.empty { color: var(--muted); text-align: center; padding: 2rem 0; }
.notes h3 { font-family: var(--serif); font-size: 1.05rem; margin: 1rem 0 .4rem; color: var(--accent); }
.notes h3:first-child { margin-top: 0; }
.notes li { margin-left: 1.2rem; font-size: .9rem; color: var(--dim); padding: .12rem 0; }
.notes p { font-size: .9rem; color: var(--dim); }

/* ---------- 全螢幕畫面：標題／考試／結局 ---------- */
.screen { position: absolute; inset: 0; z-index: 6; display: grid; overflow: auto; }
#title { align-content: center; justify-items: start; padding: 0 clamp(1.5rem, 8vw, 9rem); background: linear-gradient(to right, rgba(6, 7, 9, .94) 0%, rgba(6, 7, 9, .72) 38%, rgba(6, 7, 9, .1) 70%); }
#title .micro { margin-bottom: .8rem; }
#title h1 { font-family: var(--serif); font-size: clamp(3.4rem, 7.2vw, 6.4rem); font-weight: 900; letter-spacing: .14em; line-height: 1.15; text-shadow: 0 4px 30px rgba(0, 0, 0, .8); }
#title h1 em { font-style: normal; color: var(--accent); }
#title .sub { font-family: var(--serif); font-size: 1.2rem; color: var(--dim); margin: .9rem 0 2rem; line-height: 1.9; }
#title .menu { display: grid; gap: .6rem; width: 17rem; }
#title .menu button { padding: .75rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: rgba(13, 16, 21, .8); font-size: 1.02rem; display: flex; justify-content: space-between; align-items: center; transition: border-color .15s, background .15s, transform .15s; }
#title .menu button:hover { border-color: var(--accent); transform: translateX(4px); }
#title .menu button.main { background: var(--accent); color: var(--on-accent); font-weight: 700; border-color: var(--accent); }
#title .menu button.main:hover { background: #f3c672; }
#title .menu small { font-family: var(--mono); font-size: .7rem; opacity: .7; }
#title .foot { margin-top: 2rem; font-size: .76rem; color: var(--muted); max-width: 30rem; line-height: 1.8; }
#loading { position: absolute; inset: 0; z-index: 20; background: var(--bg); display: grid; place-items: center; text-align: center; transition: opacity .6s; }
#loading.off { opacity: 0; pointer-events: none; }
#loading .barwrap { width: 14rem; height: .25rem; border-radius: 1rem; background: rgba(255, 255, 255, .1); margin: 1rem auto 0; overflow: hidden; }
#loading .barwrap i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

#exam { place-items: start center; padding: 2rem 1.2rem; background: rgba(6, 7, 9, .55); }
#exam .sheet { width: min(44rem, 100%); padding: 1.6rem 1.8rem 1.8rem; margin: auto 0; }
#exam h2 { font-family: var(--serif); font-size: 1.9rem; letter-spacing: .1em; }
#exam .lead { color: var(--dim); margin: .3rem 0 1.2rem; }
.round { display: grid; grid-template-columns: 5.5rem 1fr 4.2rem; gap: .9rem; align-items: center; padding: .65rem 0; border-top: 1px solid rgba(255, 255, 255, .07); animation: rise .4s ease-out; }
.round h3 { font-family: var(--serif); font-size: 1.2rem; }
.round h3 small { display: block; font-family: var(--mono); font-size: .68rem; color: var(--muted); font-weight: 400; letter-spacing: .05em; }
.round.boss h3 small { color: var(--down); }
.round p { font-size: .88rem; color: var(--dim); }
.round .pct { font-family: var(--mono); font-size: 1.5rem; text-align: right; }
.round .pct.hi { color: var(--good); } .round .pct.mid { color: var(--text); } .round .pct.low { color: var(--money); } .round .pct.bad { color: var(--down); }
.modrow { display: flex; justify-content: space-between; font-size: .88rem; color: var(--dim); padding: .22rem 0; animation: rise .3s ease-out; }
.modrow b { font-family: var(--mono); font-weight: 500; }
.modrow b.up { color: var(--good); } .modrow b.down { color: var(--down); }
#exam .ask { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); animation: rise .4s ease-out; }
#exam .ask p { margin-bottom: .7rem; line-height: 1.8; }
#exam .ask .choices { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.final { text-align: center; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.final .score { font-family: var(--serif); font-size: 5rem; font-weight: 900; line-height: 1; color: var(--accent); }
.final .score small { font-size: 1.2rem; color: var(--dim); font-weight: 400; }
.final .stamp { display: inline-block; margin: .8rem 0 1rem; padding: .2rem 1.4rem; border: 3px solid currentColor; border-radius: var(--r-ctl); font-family: var(--serif); font-size: 1.6rem; font-weight: 900; letter-spacing: .3em; transform: rotate(-6deg); animation: stamp .45s cubic-bezier(.3, 1.6, .5, 1); }
.final .stamp.pass { color: var(--good); } .final .stamp.fail { color: var(--down); }
@keyframes stamp { from { transform: rotate(-6deg) scale(2.6); opacity: 0; } }

#ending { padding: 2.2rem 1.2rem 3rem; justify-items: center; align-content: start; background: linear-gradient(to bottom, rgba(6, 7, 9, .35), rgba(6, 7, 9, .9) 55%); }
#ending .wrap { width: min(52rem, 100%); }
#ending .head { text-align: center; margin: 9vh 0 1.6rem; }
#ending .head h2 { font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 900; letter-spacing: .1em; margin: .5rem 0; text-shadow: 0 3px 20px #000; }
#ending .head .rank { font-family: var(--mono); color: var(--accent); font-size: 1rem; letter-spacing: .2em; }
#ending .story { padding: 1.3rem 1.6rem; font-family: var(--serif); font-size: 1.08rem; line-height: 2.1; white-space: pre-line; }
#ending .grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .8rem; }
#ending .box { padding: 1rem 1.2rem; }
#ending .box h3 { font-family: var(--serif); font-size: 1.05rem; color: var(--accent); margin-bottom: .5rem; letter-spacing: .06em; }
#ending .box li { list-style: none; font-size: .86rem; color: var(--dim); padding: .25rem 0 .25rem 1rem; position: relative; line-height: 1.6; }
#ending .box li::before { content: ''; position: absolute; left: 0; top: .78rem; width: .35rem; height: .35rem; border-radius: 50%; background: var(--line-strong); }
#ending .box li time { font-family: var(--mono); font-size: .68rem; color: var(--muted); margin-right: .4rem; }
.alloc { display: grid; grid-template-columns: 4rem 1fr 2rem; gap: .5rem; align-items: center; font-size: .82rem; color: var(--dim); padding: .14rem 0; }
.alloc u { height: .4rem; border-radius: 1rem; background: rgba(255, 255, 255, .08); overflow: hidden; }
.alloc u i { display: block; height: 100%; background: var(--prep); }
#ending .ask { text-align: center; font-family: var(--serif); font-size: 1.15rem; margin: 1.6rem 0 1rem; color: var(--text); }
#ending .btns { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.btn { padding: .65rem 1.4rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: rgba(13, 16, 21, .85); transition: border-color .15s, transform .15s, background .15s; }
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.main { background: var(--accent); color: var(--on-accent); font-weight: 700; border-color: var(--accent); }
.gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.gal div { padding: .8rem; border: 1px solid var(--line); border-radius: var(--r-ctl); min-height: 5.4rem; }
.gal div.lock { opacity: .4; }
.gal h3 { font-family: var(--serif); font-size: .98rem; margin-bottom: .2rem; }
.gal p { font-size: .74rem; color: var(--dim); }

/* ---------- 衝刺小遊戲 ---------- */
#mini { position: absolute; inset: 0; z-index: 10; display: grid; place-items: end center; padding: 0 1.2rem 9vh; background: linear-gradient(to top, rgba(6, 7, 9, .88), rgba(6, 7, 9, .1) 60%); }
#mini .box { width: min(40rem, 100%); padding: 1.2rem 1.4rem 1.4rem; text-align: center; border-color: rgba(226, 112, 95, .6); }
#mini h2 { font-family: var(--serif); font-size: 1.7rem; letter-spacing: .08em; }
#mini p { color: var(--dim); font-size: .9rem; margin: .2rem 0 .9rem; }
#mini .track { height: 1.1rem; border-radius: 1rem; background: rgba(255, 255, 255, .1); overflow: hidden; position: relative; border: 1px solid var(--line); }
#mini .track i { display: block; height: 100%; width: 0; background: linear-gradient(to right, var(--accent-press), var(--accent)); transition: width .08s; }
#mini .meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .86rem; margin: .5rem 0 1rem; color: var(--dim); }
#mini .meta b { color: var(--down); font-size: 1.3rem; }
#mini .tap { width: 100%; padding: 1.1rem; border-radius: var(--r-ctl); background: var(--accent); color: var(--on-accent); font-size: 1.3rem; font-weight: 900; letter-spacing: .2em; user-select: none; touch-action: manipulation; }
#mini .tap:active { background: var(--accent-press); transform: scale(.985); }

#toast { position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 30; padding: .5rem 1.1rem; font-size: .88rem; animation: rise .25s; max-width: 92vw; }

/* ---------- 直式（手機） ---------- */
@media (max-aspect-ratio: 1/1) {
  html { font-size: clamp(13px, 3.55vw, 20px); }
  #scene .bg { height: 56%; inset: -1% -2% auto; object-position: 66% 30%; }
  #scene .grade { background: linear-gradient(to bottom, rgba(7, 9, 12, .55) 0%, transparent 18%, transparent 36%, rgba(7, 9, 12, .96) 54%, var(--bg) 60%), linear-gradient(to right, rgba(7, 9, 12, .7), transparent 55%); }
  #hud { top: .6rem; left: .6rem; width: 12.4rem; gap: .3rem; }
  .avatar { width: 3.3rem; height: 3.3rem; } .who b { font-size: 1.15rem; } .who small { font-size: .66rem; }
  .stat { padding: .32rem .5rem .38rem; grid-template-columns: 1.2rem 1fr auto; column-gap: .4rem; }
  .stat .icon { font-size: 1.05rem; } .stat .label { font-size: .76rem; } .stat .val { font-size: .7rem; }
  .topics { gap: .25rem; } .topics div { font-size: .6rem; }
  #right { top: .6rem; right: .6rem; gap: .35rem; }
  #clock { width: 9.6rem; padding: .5rem .6rem; }
  #clock .date { font-size: .82rem; } #clock .slot { font-size: 1.15rem; } #clock .count b { font-size: 1.5rem; } #clock .count { font-size: .74rem; }
  #clock .pips i { width: 1rem; }
  #tools button { width: 2.2rem; height: 2.2rem; font-size: 1rem; }
  #dock { padding: 0 .7rem .8rem; }
  .acts { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .act { padding: .7rem .4rem; } .act .icon { font-size: 2rem; } .act kbd { display: none; }
  .prompt { flex-wrap: wrap; gap: .1rem .8rem; } .prompt p { order: 3; width: 100%; }
  .talk { grid-template-columns: 1fr; gap: .5rem; padding: .9rem 1rem 1rem; }
  .talk .face { width: auto; display: flex; align-items: center; gap: .6rem; } .talk .face .ph { width: 3rem; height: 3rem; font-size: 1.2rem; } .talk .face span { margin: 0; }
  .talk .choices { grid-template-columns: 1fr; }
  .tsel { grid-template-columns: repeat(2, 1fr); }
  .opt { grid-template-columns: 1fr; } .opt .fx { grid-row: auto; grid-column: 1; justify-content: flex-start; max-width: none; margin-top: .3rem; }
  #title { padding: 0 1.4rem; align-content: end; padding-bottom: 12vh; background: linear-gradient(to top, rgba(6, 7, 9, .97) 30%, rgba(6, 7, 9, .3) 70%); }
  #ending .grid { grid-template-columns: 1fr; } .gal { grid-template-columns: 1fr 1fr; }
  #exam .ask .choices { grid-template-columns: 1fr; }
  .round { grid-template-columns: 4.4rem 1fr 3.4rem; }
}
/* 手機橫向（高度很矮） */
@media (max-height: 480px) and (min-aspect-ratio: 1/1) {
  html { font-size: 11.5px; }
  #hud { width: 15rem; gap: .25rem; top: .5rem; left: .5rem; } .avatar { width: 3rem; height: 3rem; } .who { padding: 0; }
  .stat { padding: .25rem .5rem .3rem; } .topics { display: none; } .buffs { display: none; }
  #right { top: .5rem; right: .5rem; grid-auto-flow: column; align-items: start; }
  #clock { padding: .4rem .6rem; order: 2; } #clock .pips { margin-bottom: .25rem; }
  #dock { padding: 0 .6rem .5rem; } .act { padding: .45rem .4rem; } .act .icon { font-size: 1.6rem; margin: 0; } .prompt { margin-bottom: .3rem; }
  .talk { padding: .7rem .9rem; } .talk .face, .talk .face .ph { width: 4rem; height: 4rem; } .talk .face span { display: none; }
  .talk .body { line-height: 1.6; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print { #app { position: static; } #scene, #world, #fx { display: none; } body { background: #fff; color: #000; overflow: visible; } }

/* ASTRA edition — a campus journal in pine ink, uncoated stock and copper. */
:root {
  --paper: #f4eedc; --paper-ink: #203d37; --paper-muted: #566258; --paper-rule: #c6c6ad;
  --pine: #143e36; --copper: #a34c32; --bg: #10211f; --panel: rgba(19,38,35,.97);
  --panel-solid: #162c28; --panel-2: #233b35; --line: rgba(212,212,182,.29); --line-strong: rgba(216,212,173,.57);
  --text: #f5eedb; --dim: #d1ceba; --muted: #aaa995; --accent: #f3c578; --on-accent: #263128;
  --r-panel: .7rem; --r-ctl: .4rem; --serif: 'Songti TC','Noto Serif TC','PMingLiU',Georgia,serif;
}
#title { z-index:7; display:grid; grid-template-columns:minmax(20rem,36%) minmax(0,1fr); align-content:stretch; justify-items:stretch; padding:0; background:var(--paper); color:var(--paper-ink); }
.cover-paper { padding:clamp(1.15rem,3.1vh,2.8rem) clamp(1.5rem,3.9vw,5rem); display:flex; flex-direction:column; justify-content:space-between; position:relative; min-width:0; background:radial-gradient(ellipse at 10% 30%,#fff9e8,transparent 75%),var(--paper); }
.imprint,.cover-colophon { display:flex; align-items:center; gap:.7rem; }
.imprint { font:700 .72rem/1.2 var(--mono); letter-spacing:.19em; }
.asterism { color:var(--copper); font:normal 2.6rem/1 Georgia,serif; }
.cover-copy { padding:1.4rem 0; }
.cover-kicker { font:italic clamp(1.45rem,2.2vw,2.6rem)/1.2 Georgia,serif; color:var(--copper); margin-bottom:.55rem; }
#title h1 { font-family:var(--serif); font-size:clamp(3.9rem,min(7.5vw,10.7vh),8rem); font-weight:800; line-height:1.09; letter-spacing:.035em; text-shadow:none; }
#title h1 span { display:block; }
#title .sub { font:500 1rem/1.85 var(--sans); color:var(--paper-muted); margin:1.05rem 0 1.6rem; }
#title .menu { width:100%; gap:.48rem; }
#title .menu button { color:var(--paper-ink); border:1px solid var(--paper-rule); background:transparent; border-radius:.2rem; padding:.64rem .9rem; min-height:2.6rem; font-size:.97rem; line-height:1.4; }
#title .menu button:hover { color:var(--pine); border-color:var(--pine); background:#e2e3d0; transform:none; }
#title .menu button.main { color:var(--paper); background:var(--pine); border-color:var(--pine); }
#title .menu button.main:hover { background:#25594b; }
#title .menu button>span { font:1.25rem/1 Georgia,serif; }
.menu-links { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.4rem; }
#title .menu-links button { padding:.37rem 0; border:0; border-bottom:1px solid transparent; border-radius:0; font-size:.84rem; min-height:1.9rem; }
#title .menu-links button:hover { background:transparent; border-color:var(--copper); }
#title .menu-links small { margin-left:.5rem; }
#title button:focus-visible { outline:3px solid var(--copper); outline-offset:3px; }
.cover-colophon { border-top:1px solid var(--paper-rule); color:var(--paper-muted); padding-top:.8rem; font:.76rem/1.5 var(--sans); justify-content:space-between; }
.cover-plate { position:relative; overflow:hidden; background:var(--pine); min-width:0; margin:0; }
.cover-plate>img { width:100%; height:100%; object-fit:cover; object-position:67% 53%; display:block; position:absolute; inset:0; }
.cover-plate:after { content:''; position:absolute; inset:56% 0 0; background:linear-gradient(transparent,rgba(8,24,22,.76)); pointer-events:none; }
.cover-plate figcaption { position:absolute; z-index:1; bottom:clamp(1.25rem,4vh,3rem); left:clamp(1.2rem,2.8vw,3rem); right:clamp(1.2rem,2.8vw,3rem); color:var(--paper); display:flex; align-items:end; justify-content:space-between; gap:.8rem; }
.cover-plate figcaption small,.tour-heading small { display:block; font:600 .65rem/1.2 var(--mono); letter-spacing:.16em; }
.cover-plate figcaption strong { font:600 1.32rem/1.7 var(--serif); }
.plate-controls { display:flex; gap:.4rem; }
.plate-controls button { display:grid; place-items:center; border:1px solid rgba(239,235,211,.7); background:rgba(16,31,27,.4); width:2.55rem; height:2.55rem; border-radius:50%; font:1.3rem/1 Georgia,serif; color:var(--paper); }
.plate-controls button:hover { background:var(--paper); color:var(--pine); }
#tour { position:absolute; inset:0; z-index:5; pointer-events:none; padding:clamp(.9rem,2vw,2rem); display:flex; flex-direction:column; align-items:center; justify-content:end; gap:.55rem; }
.tour-heading { align-self:stretch; display:flex; align-items:start; justify-content:space-between; margin-bottom:auto; color:var(--paper-ink); }
.tour-heading>div,.tour-heading button,.tour-controls,.tour-options button,#tour-hint { background:var(--paper); color:var(--paper-ink); }
.tour-heading>div { border-left:3px solid var(--copper); padding:.65rem 1rem; }
.tour-heading h2 { font:700 1.65rem/1.4 var(--serif); }
.tour-heading small { color:var(--copper); }
#tour button { pointer-events:auto; min-height:2.45rem; padding:.38rem .77rem; border-radius:.3rem; font-size:.88rem; font-weight:600; }
#tour button:hover { text-decoration:underline; text-underline-offset:.22em; }
#tour button:focus-visible { outline:2px solid var(--copper); outline-offset:2px; }
.tour-controls,.tour-options,#tour-rooms { display:flex; align-items:center; gap:.25rem; }
.tour-controls { pointer-events:auto; border:1px solid var(--paper-rule); padding:.32rem; border-radius:.55rem; }
.tour-options { padding-left:.35rem; border-left:1px solid var(--paper-rule); }
#tour-rooms button[aria-pressed=true],#tour-lens[aria-pressed=true] { background:var(--pine); color:var(--paper); }
#tour-hint { border-radius:1rem; padding:.1rem .7rem; font-size:.72rem; }
#app.world-on #scene .grade { background:linear-gradient(to top,rgba(19,32,30,.21),transparent 16%); }
#app.world-on .wl { background:var(--paper); color:var(--paper-ink); border:1px solid #75877b; border-radius:.36rem; padding:.25rem .53rem; font-weight:600; }
#app.world-on .wl.near { background:var(--pine); color:var(--paper); border-color:var(--accent); }
#app.world-on .wl.off:not(.near) b { color:var(--paper-muted); }
#app.world-on .wl.near.off b { color:var(--dim); }
#hud .who { background:var(--panel); border:1px solid var(--line); border-radius:var(--r-panel); padding:.55rem .75rem; }
#hud .avatar { border-radius:.36rem; width:3.15rem; height:3.6rem; border:1px solid var(--line); box-shadow:none; }
#hud .who b { font-size:1.25rem; }
.stat .bar i { border-radius:1rem; }
#clock .count br { display:none; }
.talk.panel { border-left:.24rem solid var(--accent); }
.talk .face .ph { border-radius:.42rem; border-width:1px; }
.wbar { border-radius:.48rem; }
#daycard { overflow:auto; background:linear-gradient(90deg,rgba(10,30,26,.94),rgba(12,28,26,.63) 50%,rgba(12,28,26,.14)),var(--day-art) center/cover; text-align:left; justify-items:start; padding:clamp(1.5rem,10vw,9rem); }
#daycard .in { max-width:32rem; }
#daycard .micro { color:var(--accent); }
#daycard .chips { justify-content:start; }
.act { overflow:hidden; padding-top:0; gap:.18rem; }
.act-art { display:block; width:calc(100% + 1.4rem); max-width:none; height:clamp(3rem,8vh,6.2rem); object-fit:cover; }
.act kbd { color:var(--paper); background:var(--pine); border-radius:.25rem; min-width:1rem; text-align:center; }
.act h3 { margin:.3rem 0 0; }
.privacy-note { margin-top:1rem; color:var(--dim); font-size:.85rem; }
@media (max-aspect-ratio:1/1) {
  #title { display:flex; flex-direction:column; padding:0; }
  .cover-plate { order:-1; flex:1 0 34%; min-height:9.5rem; }
  .cover-plate>img { object-position:60% 48%; }
  .cover-plate figcaption { bottom:.8rem; left:1.2rem; right:1.2rem; }
  .cover-plate figcaption strong { font-size:1.05rem; }
  .plate-controls button { width:2.65rem; height:2.65rem; }
  .cover-paper { flex:none; padding:1rem max(1.4rem,6vw) max(1rem,env(safe-area-inset-bottom)); }
  .imprint { font-size:.65rem; }
  .asterism { font-size:1.7rem; }
  .cover-copy { padding:.65rem 0 .5rem; }
  .cover-kicker { font-size:1.35rem; margin:0 0 .15rem; }
  #title h1 { font-size:clamp(3.4rem,12vw,5.5rem); }
  #title h1 span { display:inline; }
  #title .sub { margin:.55rem 0 .8rem; }
  #title .menu button { min-height:2.75rem; }
  .cover-colophon { padding-top:.45rem; }
  .tour-controls { flex-wrap:wrap; justify-content:center; }
  #tour button { padding:.4rem .65rem; min-height:2.7rem; }
  #hud .who { padding:.25rem .4rem; }
  #hud .avatar { width:2.6rem; height:2.8rem; }
  #daycard { background:linear-gradient(to top,rgba(11,30,26,.95) 8%,rgba(12,28,26,.81) 44%,transparent 90%),var(--day-art) 58% center/cover; align-items:end; padding:2.1rem 1.6rem 4rem; }
  #dock { max-height:58dvh; overflow-y:auto; }
  #dock .talk { gap:.3rem; }
  .act-art { height:3.1rem; }
}
@media (max-height:580px) and (min-aspect-ratio:1/1) {
  .cover-paper { padding:.7rem 2rem; }
  .cover-copy { padding:.45rem 0; }
  #title h1 { font-size:3.4rem; }
  #title h1 span { display:inline; }
  .cover-kicker { font-size:1.3rem; margin-bottom:.3rem; }
  #title .sub { margin:.4rem 0 .55rem; font-size:.9rem; }
  #title .menu { gap:.25rem; }
  #title .menu button { min-height:2rem; padding:.34rem .75rem; }
}
dialog header { color:var(--paper-ink); background:var(--paper); border-color:var(--paper-rule); }
dialog header p, dialog header .x { color:var(--paper-muted); }
dialog header .x { border-color:var(--paper-rule); }
dialog header .x:hover { color:var(--pine); border-color:var(--pine); }
.gallery-print { position:relative; overflow:hidden; padding:.65rem; background:var(--paper); color:var(--paper-ink); border-radius:var(--r-ctl); }
.gallery-print img { width:100%; height:5.3rem; object-fit:cover; display:block; margin-bottom:.45rem; border-radius:.15rem; }
.gallery-print small { color:var(--copper); font:600 .64rem/1.5 var(--mono); letter-spacing:.1em; }
.gal .gallery-print h3 { margin:0; font:600 .98rem/1.6 var(--serif); color:var(--paper-ink); }
.gallery-print.locked { background:transparent; border:1px dashed var(--line); }
.gallery-print.locked small { color:var(--muted); }
.gal .gallery-print.locked h3 { font-weight:400; color:var(--dim); }
#ending { background:rgba(13,29,25,.88); }
.ending-print { background:var(--paper); color:var(--paper-ink); padding:.55rem .55rem 0; margin:0 0 1rem; }
.ending-print>img { display:block; width:100%; height:clamp(10rem,35vh,24rem); object-fit:cover; object-position:center 39%; }
#ending .ending-print .head { text-align:left; margin:0; padding:1.1rem 1.4rem 1.35rem; }
#ending .ending-print .micro { color:var(--copper); }
#ending .ending-print h2 { text-shadow:none; font-size:clamp(1.8rem,3.7vw,3rem); letter-spacing:0; margin:.18rem 0; }
#ending .ending-print .rank { color:var(--paper-muted); }
@media (max-width:620px) and (orientation:portrait) {
  #hud { width:min(53vw,17rem); display:grid; grid-template-columns:1fr 1fr; }
  #hud .who,#st-prep,#buffs { grid-column:1/-1; }
  #hud .who { gap:.55rem; }
  #hud .who small:last-child { display:none; }
  #st-money { grid-column:1/-1; }
  #hud .stat { grid-template-columns:auto 1fr; gap:.14rem .24rem; }
  #hud .stat .icon { display:none; }
  #hud .stat .val { justify-self:end; }
  #hud .stat .bar,#hud .topics { grid-column:1/-1; }
  #hud .topics { gap:.2rem; }
  #hud .who b { font-size:1rem; }
  #hud .avatar { width:2.1rem;height:2.2rem; }
  #clock { width:8.65rem; }
  #tools { gap:.22rem; }
  #banner { top:auto; bottom:42%; transform:translate(-50%,1.4rem); visibility:hidden; opacity:0; pointer-events:none; }
  #banner.on { opacity:1; visibility:visible; transform:translate(-50%,0); }
  .wl { min-height:2.05rem; }
}
.lecture-view img {display:block;width:100%;height:auto;border-radius:var(--r-ctl)}
#sheet:has(.lecture-view) {width:min(68rem,96vw)}
.lecture-tabs {display:flex;flex-wrap:wrap;justify-content:center;gap:.4rem;margin-top:.8rem}
.lecture-tabs button[aria-pressed=true]{background:var(--paper);color:var(--pine)}
.lecture-link {margin-left:auto}
#hud .who small:first-child {line-height:1.35}
@media(max-width:620px){.tour-options{flex-wrap:wrap;justify-content:center}.lecture-view{margin:0 -.36rem}}

.wayfinder-lines { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.wayfinder-line { opacity:.78; }
.wayfinder-line path { fill:none; stroke-linecap:round; }
.wayfinder-line .ink { stroke:#213e34; stroke-width:3.4px; }
.wayfinder-line .fill { stroke:#fff8dd; stroke-width:1.55px; }
.wayfinder-line circle { fill:#fff3ce; stroke:#31463a; stroke-width:1.5px; }
.wayfinder-line.objective,.wayfinder-line.selected { opacity:1; }
.wayfinder-line.objective .ink,.wayfinder-line.selected .ink { stroke-width:4.6px; }
.wayfinder-line.objective .fill,.wayfinder-line.selected .fill { stroke:#ffc45e; stroke-width:2.7px; }
.wayfinder-line.objective circle { fill:#ffd58b; }
#app.world-on .wl { min-height:1.8rem; box-shadow:0 2px 6px #1a292b33; }
#app.world-on .wl.goal { padding:.24rem .64rem .24rem .38rem; gap:.43rem; border:2px solid #fbca73; background:#25483c; color:#fff6dd; }
.wl.goal::before { content:'目的地'; border-radius:.18rem; padding:.12rem .28rem; background:#ffd38b; color:#304332; font-size:.68rem; line-height:1.3; }
#app.world-on .wl:focus-visible { outline:3px solid #fff2bf; outline-offset:2px; }
@media (pointer:coarse) { #app.world-on .wl { min-height:2.15rem; } }
.lecture-notes { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); }
@media(max-width:620px) {
  .lecture-notes { position:static; width:auto; height:auto; margin:.65rem .36rem 0; overflow:visible; clip-path:none; }
  .lecture-notes h3 { margin:0 0 .25rem; font:700 1.08rem/1.4 var(--serif); color:var(--paper); }
  .lecture-notes p { margin:0; color:var(--paper); font-size:1rem; line-height:1.65; }
}

.wayfinder-line path.pointer { fill:#ffd074; stroke:#263f36; stroke-width:1.6px; stroke-linejoin:round; }

#app.lecture-on #hud, #app.lecture-on #clock { display:none; }

/* The classroom notes share the paper, ink and copper of the game's cover. */
:root {
  --field-stock:#f8f1e3; --field-seam:#cfbea6; --field-positive:#306451;
  --field-negative:#98503c; --field-ink:#233e3b; --field-faint:#e1d7c5;
}
#dock .field-note {
  position:relative; width:min(100%,62rem); margin-inline:auto;
  background:var(--field-stock); color:var(--field-ink); border:1px solid var(--field-seam);
  border-left:.29rem solid var(--copper); border-radius:.38rem;
  box-shadow:0 .2rem .9rem #172a2726;
}
.field-note .face { border-right:1px solid var(--field-faint); padding-right:1rem; width:auto; }
.field-note .face .ph { border:2px solid var(--field-stock); outline:1px solid var(--field-seam); width:4.5rem; height:5rem; border-radius:.18rem; }
.field-note .face span { color:var(--copper); font-size:.79rem; }
.field-note .tag { align-items:center; padding-bottom:.45rem; border-bottom:1px solid var(--field-faint); }
.field-note .tag h2 { color:var(--field-ink); letter-spacing:0; }
.field-note .body { color:var(--field-ink); min-height:2.5rem; line-height:1.7; }
.field-note .walkhint { color:var(--copper); gap:.6rem; }
.field-note .walkhint span { margin-right:auto; }
.field-note .linkish { color:var(--paper-ink); background:transparent; border-color:var(--field-seam); }
.field-note .linkish:hover,.field-note .linkish:focus-visible { color:var(--pine); border-color:var(--pine); }
.field-note .go { color:var(--paper); background:var(--pine); }
.field-note .go:hover { color:var(--paper); background:var(--paper-ink); }
.field-note .chips { margin-top:.42rem; }
.field-note .chip { padding:.13rem .5rem; font:600 .78rem/1.5 var(--sans); border-radius:.18rem; }
.field-note .chip.up { color:var(--field-positive); background:#e3ece0; border-color:#b6cbb6; }
.field-note .chip.down { color:var(--field-negative); background:#f4e5d9; border-color:#dec0aa; }
#title #m-tour { display:grid; grid-template-columns:3.85rem 1fr auto; gap:.75rem; align-items:center; text-align:left; padding:.25rem .85rem .25rem .28rem; }
#m-tour img { width:3.85rem; height:2.3rem; object-fit:cover; border-radius:.12rem; }
.cover-paper { box-shadow:inset .34rem 0 var(--pine); }
.cover-plate::before { content:''; position:absolute; z-index:1; pointer-events:none; inset:.75rem; border:1px solid #efe1c049; }
#tour .tour-controls { padding:.34rem; gap:.45rem; box-shadow:0 .25rem 1.35rem #142b2533; }
#tour #tour-rooms button { display:flex; align-items:center; gap:.49rem; padding:.28rem .65rem .28rem .28rem; }
#tour-rooms img { width:3.15rem; height:2.15rem; object-fit:cover; border-radius:.14rem; }
#tour #tour-rooms button[aria-pressed=true] { outline:1px solid var(--pine); outline-offset:-1px; }
@media(max-width:680px) {
  #dock .field-note .face { border:0; padding:0; }
  #dock .field-note .face .ph { width:2.45rem; height:2.6rem; }
  .field-note .tag h2 { font-size:1.12rem; }
  .field-note .walkhint { margin-top:.4rem; }
  .field-note .walkhint .linkish { padding:.27rem .5rem; }
  #tour-rooms img { width:2.5rem; height:1.8rem; }
  #tour .tour-controls { gap:.2rem; width:max-content; max-width:100%; }
  #tour .tour-options { padding-left:0; border:0; }
  .cover-plate::before { inset:.45rem; }
}
@media(max-width:360px),(max-height:540px) { #tour-rooms img { width:1.9rem; height:1.53rem; } }
