/* =====================================================================================================
   閉園後 — night UI: dark glass panels over the 3D view, a phone app, cards and puzzle windows.
   Component patterns (chips, stepper, cards, tabs, kanban-like lists) follow ひだまり薬局's board.css,
   re-themed for the night. Readable on phones: 16px gutters, no horizontal scroll.
   ===================================================================================================== */
:root {
  --fs: 1;
  --ink: #e8ecf2;
  --ink2: #b8c2cf;
  --dim: #7f8b99;
  --glass: rgba(12, 16, 23, 0.74);
  --glass2: rgba(20, 26, 36, 0.86);
  --solid: #10151d;
  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.16);
  --amber: #f2b350;
  --amber2: #ffd58a;
  --green: #5fd39a;
  --red: #ff5f52;
  --cyan: #74c8ff;
  --violet: #b59cff;
  --east: #e8c060;
  --west: #74c8ff;
  --r: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --gut: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05070a; color: var(--ink);
  font-family: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif; font-size: calc(15px * var(--fs)); -webkit-tap-highlight-color: transparent; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 0.85em; }
.num { font-variant-numeric: tabular-nums; }
button { font-family: inherit; color: inherit; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 0.4em; border-radius: 5px; border: 1px solid var(--line2); border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.06); font: 700 0.82em/1.6 'Zen Kaku Gothic New', sans-serif; text-align: center; color: var(--ink); }

/* ---- buttons, chips ---- */
.btn { font: inherit; font-size: 0.95em; padding: 9px 16px; margin: 3px; border-radius: 10px; border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.05); color: var(--ink); cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.05s; }
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #f6be60, #e09a30); border-color: #f2b350; color: #1a1206; font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffcb74, #e8a440); }
.btn.big { font-size: 1.12em; padding: 12px 36px; margin: 6px; }
.btn.small { font-size: 0.82em; padding: 5px 10px; }
.btn.ghost { background: transparent; border-style: dashed; color: var(--ink2); }
.btn.danger { border-color: rgba(255, 95, 82, 0.6); color: #ffb0a8; }
.btn .k { display: inline-block; min-width: 1.4em; margin-right: 6px; padding: 0 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); font-size: 0.8em; }
.btn.choice { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; margin: 6px 0; padding: 11px 14px; }
.btn.choice.ok { border-color: var(--green); background: rgba(95, 211, 154, 0.12); }
.btn.choice.ng { border-color: var(--red); background: rgba(255, 95, 82, 0.1); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72em; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  white-space: nowrap; line-height: 1.75; border: 1px solid var(--line2); color: var(--ink2); background: rgba(255, 255, 255, 0.05); }
.chip.east { color: #1a1306; background: var(--east); border-color: var(--east); }
.chip.west { color: #04121c; background: var(--west); border-color: var(--west); }
.chip.bridge { color: #1a1306; background: #c8b070; border-color: #c8b070; }
.chip.ok { color: #04170e; background: var(--green); border-color: var(--green); }
.chip.warn { color: #1a1206; background: var(--amber); border-color: var(--amber); }
.chip.danger { color: #fff; background: var(--red); border-color: var(--red); }
.chip.info { color: #04121c; background: var(--cyan); border-color: var(--cyan); }
.chip.ghost { background: transparent; }
.chip.violet { color: #120a24; background: var(--violet); border-color: var(--violet); }

/* ---- title ---- */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: var(--gut); background: #05070a; }
.title-bg { position: fixed; inset: 0; background-size: cover; background-position: center; filter: saturate(0.85); opacity: 0.55; }
.title-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(5, 7, 10, 0.2), rgba(5, 7, 10, 0.92) 75%), linear-gradient(180deg, rgba(5, 7, 10, 0.2), rgba(5, 7, 10, 0.95)); }
.title-box { position: relative; max-width: 760px; width: 100%; text-align: center; margin: auto; }
.kicker { letter-spacing: 0.3em; color: var(--amber2); font-size: 0.8em; margin: 0 0 6px; }
.logo { font-family: 'Shippori Mincho', serif; font-weight: 800; font-size: calc(64px * var(--fs)); margin: 0; letter-spacing: 0.16em; line-height: 1.1;
  text-shadow: 0 0 30px rgba(242, 179, 80, 0.25); }
.logo span { display: block; font-family: 'Zen Kaku Gothic New', sans-serif; font-size: 0.24em; letter-spacing: 0.6em; color: var(--ink2); margin-top: 10px; font-weight: 500; }
.sub { margin: 10px 0 14px; color: var(--ink2); font-size: 1.05em; }
.lead { line-height: 1.95; margin: 0 auto 18px; color: var(--ink2); max-width: 640px; }
.appeal { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; text-align: left; }
.appeal li { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.appeal b { display: block; color: var(--amber2); margin-bottom: 4px; }
.appeal span { font-size: 0.86em; color: var(--ink2); line-height: 1.7; }
.hint { color: var(--dim); font-size: 0.84em; line-height: 1.85; }
.keys-hint { max-width: 680px; margin: 10px auto; }
.notice { font-size: 0.78em; color: #c9b48a; background: rgba(242, 179, 80, 0.06); border: 1px solid rgba(242, 179, 80, 0.25); padding: 8px 12px; border-radius: 10px; line-height: 1.75; text-align: left; }
.seg { display: inline-flex; gap: 0; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; margin: 8px 0 4px; flex-wrap: wrap; justify-content: center; }
.seg button { border: none; background: transparent; padding: 8px 16px; cursor: pointer; font-size: 0.9em; color: var(--ink2); }
.seg button.on { background: rgba(242, 179, 80, 0.18); color: var(--amber2); font-weight: 700; }
.seg-desc { font-size: 0.8em; color: var(--dim); min-height: 1.6em; margin: 0 0 6px; }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55)); }
#hurt { position: absolute; inset: 0; box-shadow: inset 0 0 160px rgba(200, 20, 10, 0.0); transition: box-shadow 0.4s; }
#hurt.on { box-shadow: inset 0 0 180px rgba(200, 20, 10, 0.55); }
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }

#hud-left { position: absolute; left: var(--gut); top: var(--gut); width: min(360px, calc(100vw - 2 * var(--gut))); display: flex; flex-direction: column; gap: 8px; }
#objective { padding: 10px 12px; }
.obj-top { display: flex; align-items: center; gap: 6px; font-size: 0.86em; }
.obj-top .where { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obj-top .clock { color: var(--amber2); font-weight: 700; }
.obj-label { margin-top: 8px; font-size: 0.7em; letter-spacing: 0.18em; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.obj-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.obj-title { margin-top: 3px; font-weight: 700; font-size: 1.02em; line-height: 1.5; display: flex; gap: 8px; }
.obj-title .dia { color: var(--amber); }
.obj-find { font-size: 0.84em; color: var(--ink2); margin: 2px 0 0 20px; }
.obj-nav { display: flex; align-items: center; gap: 8px; margin: 6px 0 0 20px; font-size: 0.86em; }
.obj-nav .arrow { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(242, 179, 80, 0.16); color: var(--amber2); transition: transform 0.1s linear; }
.obj-nav .old { text-decoration: line-through; color: var(--dim); }
.obj-steps { display: flex; gap: 3px; margin-top: 8px; }
.obj-steps i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.obj-steps i.done { background: var(--green); }
.obj-steps i.cur { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.obj-meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

#compass { position: absolute; left: 50%; top: var(--gut); transform: translateX(-50%); width: min(420px, 46vw); height: 30px; overflow: hidden; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
#compass-strip { position: absolute; top: 0; height: 100%; white-space: nowrap; font-size: 0.75em; color: var(--ink2); }
#compass-strip span { position: absolute; top: 7px; transform: translateX(-50%); }
#compass-strip span.c { color: var(--ink); font-weight: 700; }
#compass-strip span.t { top: 12px; width: 1px; height: 8px; background: var(--dim); }
#compass-mark { position: absolute; top: 3px; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); background: var(--amber); box-shadow: 0 0 8px var(--amber); border-radius: 2px; }
#compass-mark.off { display: none; }
#compass-dist { position: absolute; left: 50%; top: 32px; transform: translateX(-50%); }
#compass::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.35); }
#sound-dir { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; top: 56px; padding: 5px 12px; font-size: 0.84em; display: flex; gap: 8px; align-items: center; }
#sound-dir .wave { color: var(--cyan); font-weight: 700; }
#sound-dir .ar { display: inline-block; transition: transform 0.15s; color: var(--cyan); font-size: 1.2em; }

#tutorial { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 196px; padding: 10px 14px; max-width: min(520px, calc(100vw - 2 * var(--gut))); font-size: 0.92em; display: flex; gap: 10px; align-items: center; animation: rise 0.4s ease-out; }
#tutorial .lab { color: var(--amber2); font-size: 0.75em; letter-spacing: 0.15em; white-space: nowrap; }

#crosshair { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); transition: all 0.12s; }
#crosshair.on { width: 22px; height: 22px; margin: -11px 0 0 -11px; background: transparent; border: 2px solid var(--amber); box-shadow: 0 0 10px rgba(242, 179, 80, 0.5); }
#crosshair.aim { width: 26px; height: 26px; margin: -13px 0 0 -13px; background: transparent; border: 2px dashed var(--cyan); }
#prompt { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; top: calc(50% + 28px); padding: 7px 14px; border-radius: 10px; background: var(--glass2); border: 1px solid var(--line2);
  max-width: min(460px, calc(100vw - 2 * var(--gut))); text-align: center; line-height: 1.5; }
#prompt:empty { display: none; }
#prompt .act { font-weight: 700; }
#prompt .desc { display: block; font-size: 0.8em; color: var(--ink2); }
#prompt kbd { margin-right: 6px; border-color: var(--amber); color: var(--amber2); }
#prompt.blocked .act { color: var(--ink2); }

#say { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 120px; max-width: min(760px, calc(100vw - 2 * var(--gut))); padding: 10px 18px;
  background: rgba(6, 8, 12, 0.82); border-radius: 12px; line-height: 1.8; opacity: 0; transition: opacity 0.3s; text-align: center; border: 1px solid var(--line); }
#say.on { opacity: 1; }
#say .who { display: inline-block; margin-right: 8px; font-size: 0.78em; font-weight: 700; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: var(--ink2); vertical-align: 1px; }
#say .who.misaki { background: #e88aa0; color: #2a0a12; }
#say .who.radio { background: var(--cyan); color: #04121c; }
#say .who.ryo { background: rgba(242, 179, 80, 0.25); color: var(--amber2); }

#areacard { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; top: 64px; opacity: 0; transform: translateY(-10px); transition: opacity 0.6s, transform 0.6s; pointer-events: none; text-align: center; max-width: calc(100vw - 2 * var(--gut)); }
#areacard.on { opacity: 1; transform: none; }
#areacard .sec { font-size: 0.78em; letter-spacing: 0.3em; color: var(--amber2); }
#areacard .nm { font-family: 'Shippori Mincho', serif; font-size: 2em; font-weight: 800; text-shadow: 0 2px 12px #000; }
#areacard .id { font-size: 0.8em; color: var(--dim); }
#areacard .bar { width: 120px; height: 2px; background: var(--amber); margin: 6px auto 0; }

#toasts { position: absolute; right: var(--gut); top: var(--gut); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; max-width: min(380px, 60vw); }
.toast { display: flex; gap: 10px; align-items: center; background: var(--glass2); border: 1px solid var(--line); border-left: 3px solid var(--amber); padding: 8px 12px; border-radius: 10px;
  transition: opacity 0.6s, transform 0.6s; line-height: 1.5; animation: slidein 0.3s ease-out; font-size: 0.9em; }
.toast .ic { font-size: 1.3em; width: 1.4em; text-align: center; }
.toast .t2 { display: block; font-size: 0.82em; color: var(--ink2); }
.toast.ok { border-left-color: var(--green); }
.toast.clue { border-left-color: var(--violet); }
.toast.save { border-left-color: var(--cyan); }
.toast.bad { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateX(24px); }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

#vitals { position: absolute; left: var(--gut); bottom: var(--gut); width: min(300px, 46vw); padding: 10px 12px; display: grid; gap: 7px; }
.vrow { display: grid; grid-template-columns: 4.6em 1fr auto; align-items: center; gap: 8px; font-size: 0.8em; }
.vrow .lab { color: var(--ink2); }
.vrow .val { font-weight: 700; min-width: 3em; text-align: right; }
.bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--green); transition: width 0.25s; }
.bar.hp > i { background: linear-gradient(90deg, #ff6a5a, #ff9a6a); }
.bar.hp.low > i { animation: blink 0.8s infinite; }
.bar.st > i { background: #a8d8ff; }
.bar.lt > i { background: var(--amber); }
.bar.lt.off > i { background: #6a6050; }
@keyframes blink { 50% { opacity: 0.35; } }
.noise { display: flex; gap: 3px; align-items: flex-end; height: 12px; }
.noise i { width: 6px; border-radius: 1px; background: rgba(255, 255, 255, 0.14); }
.noise i:nth-child(1) { height: 5px; } .noise i:nth-child(2) { height: 8px; } .noise i:nth-child(3) { height: 12px; }
.noise.l1 i:nth-child(1), .noise.l2 i:nth-child(-n+2), .noise.l3 i { background: var(--ink2); }
.noise.l3 i { background: var(--amber); }
.vtags { display: flex; gap: 5px; flex-wrap: wrap; }

#gear { position: absolute; right: var(--gut); bottom: var(--gut); padding: 10px 12px; width: min(320px, 46vw); }
.gear-main { display: flex; align-items: center; gap: 10px; }
.gear-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(242, 179, 80, 0.12); border: 1px solid rgba(242, 179, 80, 0.4); font-size: 1.4em; }
.gear-name { font-weight: 700; font-size: 0.92em; }
.gear-sub { font-size: 0.76em; color: var(--ink2); }
.gear-ammo { margin-left: auto; font-size: 1.5em; font-weight: 900; font-variant-numeric: tabular-nums; }
.gear-ammo small { font-size: 0.55em; color: var(--ink2); font-weight: 500; }
.gear-ammo.empty { color: var(--red); }
.slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 8px; }
.slot { position: relative; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; font-size: 1.05em; }
.slot.on { border-color: var(--amber); background: rgba(242, 179, 80, 0.14); }
.slot.off { opacity: 0.3; }
.slot .k { position: absolute; left: 3px; top: 1px; font-size: 0.55em; color: var(--dim); }
.slot .n { position: absolute; right: 3px; bottom: 0; font-size: 0.6em; font-weight: 700; }
.reload { margin-top: 6px; font-size: 0.78em; color: var(--amber2); }
.reload .bar > i { background: var(--amber); }

#threat { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; top: calc(50% - 86px); padding: 6px 12px; display: flex; gap: 10px; align-items: center; min-width: 210px; }
#threat .eye { width: 26px; height: 16px; border-radius: 50%; border: 2px solid currentColor; position: relative; }
#threat .eye::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: currentColor; }
#threat .tx { font-size: 0.84em; line-height: 1.3; }
#threat .tx b { display: block; font-size: 1.05em; }
#threat .bar { width: 80px; }
#threat.s0 { color: var(--ink2); }
#threat.s1 { color: var(--amber); }
#threat.s2 { color: var(--red); animation: pulse 0.7s infinite; }
#threat.s2 .bar > i, #threat.s1 .bar > i { background: currentColor; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 95, 82, 0.25); } }
#threat-arrow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#threat-arrow i { position: absolute; left: -11px; top: -150px; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 18px solid var(--red); filter: drop-shadow(0 0 6px rgba(255, 60, 40, 0.8)); }

#pz01 { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
#pz01 .ghost { width: min(64vw, 720px); aspect-ratio: 3 / 2; background-size: cover; background-position: center; opacity: 0.38; border: 3px solid rgba(255, 255, 255, 0.7); border-radius: 6px; filter: sepia(0.4); }
#pz01 .info { position: absolute; bottom: 18%; left: 50%; transform: translateX(-50%); padding: 8px 14px; text-align: center; }
#pz01 .meter { width: 220px; margin: 6px auto 0; }

#debug { position: absolute; right: 8px; bottom: 120px; font: 11px monospace; color: #9ab; white-space: pre; }

#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.8s; z-index: 15; }
#fade.on { opacity: 1; }

/* ---- touch ---- */
#touch { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
#t-look { position: absolute; right: 0; top: 0; width: 60%; height: 100%; pointer-events: auto; touch-action: none; }
#t-stick { position: absolute; left: 22px; bottom: 140px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line2); pointer-events: auto; touch-action: none; }
#t-knob { position: absolute; left: 36px; top: 36px; width: 48px; height: 48px; border-radius: 50%; background: rgba(242, 179, 80, 0.5); }
#t-buttons { position: absolute; right: 12px; bottom: 140px; display: grid; grid-template-columns: repeat(3, 62px); gap: 8px; pointer-events: auto; }
#t-buttons button, #t-top button { height: 48px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(12, 16, 23, 0.7); font-size: 0.8em; touch-action: manipulation; }
#t-buttons .big { background: rgba(242, 179, 80, 0.3); border-color: var(--amber); font-weight: 700; }
#t-buttons .fire { background: rgba(116, 200, 255, 0.2); border-color: var(--cyan); }
#t-buttons button.on, #t-top button.on { background: rgba(242, 179, 80, 0.5); }
#t-top { position: absolute; right: 12px; top: 64px; display: flex; gap: 6px; pointer-events: auto; }
#t-top button { height: 38px; padding: 0 12px; }
body.touch #vitals { bottom: 8px; }
body.touch #gear { bottom: 8px; }

/* ---- windows ---- */
#ui { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.win-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(2, 4, 8, 0.55); pointer-events: auto; padding: var(--gut); animation: fadein 0.18s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.win { background: var(--solid); border-radius: 18px; width: min(640px, 100%); max-height: calc(100vh - 2 * var(--gut)); display: flex; flex-direction: column; box-shadow: var(--shadow);
  border: 1px solid var(--line2); overflow: hidden; animation: pop 0.2s ease-out; }
@keyframes pop { from { transform: scale(0.97); opacity: 0; } }
.win.wide { width: min(1080px, 100%); }
.win.mid { width: min(820px, 100%); }
.win-head { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); position: relative; display: flex; align-items: center; gap: 10px; }
.win-head .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(242, 179, 80, 0.12); font-size: 1.2em; flex: 0 0 auto; }
.win-title { font-weight: 700; font-size: 1.1em; }
.win-sub { color: var(--dim); font-size: 0.84em; }
.win-x { margin-left: auto; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); width: 34px; height: 34px; border-radius: 10px; font-size: 18px; cursor: pointer; color: var(--ink2); flex: 0 0 auto; }
.win-body { padding: 14px 18px; overflow-y: auto; line-height: 1.75; }
.win-foot { padding: 10px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-items: center; }
.win-foot .hint { margin-right: auto; }
.sec { font-weight: 700; color: var(--amber2); margin: 14px 0 6px; font-size: 0.86em; letter-spacing: 0.12em; display: flex; align-items: center; gap: 8px; }
.sec::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.fb { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.fb.ok { background: rgba(95, 211, 154, 0.1); border-color: rgba(95, 211, 154, 0.4); }
.fb.bad { background: rgba(255, 95, 82, 0.08); border-color: rgba(255, 95, 82, 0.35); }
.hero { height: 150px; border-radius: 12px; background-size: cover; background-position: center; position: relative; margin-bottom: 12px; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.75)); }
.hero .cap { position: absolute; left: 12px; bottom: 8px; z-index: 1; font-weight: 700; text-shadow: 0 1px 6px #000; }

/* the clue card (front / back) */
.card3d { perspective: 1000px; margin: 4px auto 10px; width: min(440px, 100%); }
.card-in { position: relative; width: 100%; aspect-ratio: 1.6; transition: transform 0.6s; transform-style: preserve-3d; cursor: pointer; }
.card-in.flip { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 12px; padding: 18px 20px; color: #2a2016;
  background: linear-gradient(135deg, #fbf4e4, #efe2c6); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; }
.card-face.back { transform: rotateY(180deg); background: linear-gradient(135deg, #fffaf0, #f4ead4); }
.card-face .no { font-family: 'Shippori Mincho', serif; font-size: 0.85em; color: #a0583a; letter-spacing: 0.2em; }
.card-face .ttl { font-family: 'Shippori Mincho', serif; font-size: 1.5em; font-weight: 800; margin-top: 4px; }
.card-face .doodle { margin: auto; width: 96px; height: 96px; opacity: 0.85; }
.card-face .msg { font-family: 'Shippori Mincho', serif; font-size: 1.06em; line-height: 2; margin: auto 0; }
.card-face .msg mark { background: linear-gradient(transparent 60%, rgba(220, 80, 60, 0.35) 60%); color: inherit; font-weight: 800; }
.card-face .sig { text-align: right; font-family: 'Shippori Mincho', serif; color: #7a5a3a; }
.card-face .ribbon { position: absolute; right: 18px; top: -6px; width: 22px; height: 58px; background: #c8302a; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); }
.flip-hint { text-align: center; font-size: 0.82em; color: var(--dim); }

/* photos */
.photo { background: #f4f1ea; padding: 10px 10px 34px; border-radius: 4px; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55); color: #2a2a2a; position: relative; }
.photo .img { aspect-ratio: 3 / 2; background-size: cover; background-position: center; background-color: #556; }
.photo .stamp { position: absolute; right: 16px; bottom: 44px; font: 700 14px/1 monospace; color: #ff8a3a; text-shadow: 0 0 4px rgba(255, 120, 40, 0.7); }
.photo .cap { position: absolute; left: 12px; bottom: 8px; font-family: 'Shippori Mincho', serif; font-size: 0.95em; }
.photos3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photos3 .photo { padding: 6px 6px 26px; cursor: pointer; transition: transform 0.15s; }
.photos3 .photo:hover { transform: translateY(-3px); }
.photos3 .photo.picked { outline: 3px solid var(--amber); }
.photos3 .photo .ord { position: absolute; left: -8px; top: -8px; width: 28px; height: 28px; border-radius: 50%; background: var(--amber); color: #1a1206; display: grid; place-items: center; font-weight: 900; }
.photos3 .photo .stamp { bottom: 34px; right: 10px; font-size: 12px; }
.photos3 .photo .cap { bottom: 5px; font-size: 0.8em; }

/* sorting (PZ09) */
.sort-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid var(--line); margin: 6px 0; background: rgba(255, 255, 255, 0.03); }
.sort-row .th { width: 52px; height: 38px; border-radius: 6px; background-size: cover; background-position: center; background-color: #234; }
.sort-row .seg { margin: 0; }
.sort-row.ng { border-color: var(--red); }

/* dialogue */
.dlg { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; }
.dlg .face { width: 120px; aspect-ratio: 3 / 4; border-radius: 12px; background-size: cover; background-position: center 20%; background-color: #2a2f38; border: 1px solid var(--line2); }
.lines p { margin: 0 0 8px; }
.lines .who { font-size: 0.78em; font-weight: 700; margin-right: 6px; color: var(--ink2); }
.lines .m .who { color: #f2a0b4; }
.lines .r .who { color: var(--amber2); }

/* ---- the phone app ---- */
.phone { width: min(1000px, 100%); height: min(680px, calc(100vh - 2 * var(--gut))); display: grid; grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; background: #0c1017; border-radius: 22px;
  border: 1px solid var(--line2); box-shadow: var(--shadow); overflow: hidden; animation: pop 0.2s ease-out; }
.ph-status { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 8px 16px; font-size: 0.8em; color: var(--ink2); border-bottom: 1px solid var(--line); background: #0a0d13; }
.ph-status .app { font-weight: 700; color: var(--ink); }
.ph-status .sp { flex: 1; }
.ph-status .sig { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.ph-status .sig i { width: 3px; background: var(--dim); border-radius: 1px; }
.ph-status .sig i.on { background: var(--ink); }
.ph-status .bat { display: inline-flex; align-items: center; gap: 4px; }
.ph-status .x { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 2px 10px; cursor: pointer; }
.ph-nav { border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 3px; background: #0a0d13; overflow-y: auto; }
.ph-tab { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: none; background: transparent; cursor: pointer; font-size: 0.92em; text-align: left; color: var(--ink2); position: relative; }
.ph-tab:hover { background: rgba(255, 255, 255, 0.05); }
.ph-tab.on { background: rgba(242, 179, 80, 0.14); color: var(--amber2); font-weight: 700; }
.ph-tab .ic { width: 22px; text-align: center; }
.ph-tab .k { margin-left: auto; font-size: 0.7em; color: var(--dim); }
.ph-tab .badge { position: absolute; left: 24px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.ph-body { overflow-y: auto; padding: 16px 18px; min-width: 0; }
.ph-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.ph-h h2 { margin: 0; font-size: 1.15em; }
.ph-h .sub { font-size: 0.82em; color: var(--dim); margin: 0; }

/* messages */
.chat { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.msg-row { display: flex; gap: 10px; align-items: flex-end; }
.msg-row.me { flex-direction: row-reverse; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background-size: cover; background-position: center 20%; background-color: #3a2a30; flex: 0 0 auto; border: 1px solid var(--line2); display: grid; place-items: center; font-size: 0.8em; }
.bubble { background: #1a212c; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 9px 13px; max-width: 78%; line-height: 1.75; }
.me .bubble { background: #2a3a2a; border-radius: 16px 16px 4px 16px; }
.bubble mark { background: rgba(242, 179, 80, 0.25); color: var(--amber2); padding: 0 2px; border-radius: 3px; }
.msg-meta { font-size: 0.7em; color: var(--dim); white-space: nowrap; }
.msg-meta.fail { color: var(--red); }
.sysmsg { align-self: center; font-size: 0.78em; color: var(--ink2); background: rgba(255, 95, 82, 0.1); border: 1px solid rgba(255, 95, 82, 0.3); padding: 6px 12px; border-radius: 10px; text-align: center; }
.voice { display: flex; gap: 10px; align-items: center; }
.voice .play { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--amber); color: #1a1206; cursor: pointer; font-weight: 900; }
.voice .wf { display: flex; gap: 2px; align-items: center; height: 26px; }
.voice .wf i { width: 3px; border-radius: 2px; background: var(--ink2); }

/* map */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; }
.map-canvas { width: 100%; aspect-ratio: 1.3; border-radius: 14px; border: 1px solid var(--line); background: #0a1410; display: block; cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.76em; color: var(--ink2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.areacard { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.03); }
.areacard .pic { height: 120px; background-size: cover; background-position: center; }
.areacard .in { padding: 10px 12px; }
.areacard h3 { margin: 4px 0; font-size: 1em; }
.areacard ul { margin: 6px 0 0; padding-left: 1.1em; font-size: 0.84em; color: var(--ink2); }
.route { list-style: none; margin: 10px 0 0; padding: 0; font-size: 0.82em; max-height: 220px; overflow-y: auto; }
.route li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.route li:hover { background: rgba(255, 255, 255, 0.05); }
.route .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--dim); flex: 0 0 auto; }
.route li.done .dot { background: var(--green); border-color: var(--green); }
.route li.cur .dot { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 179, 80, 0.25); }
.route li.next .dot { border-color: var(--amber); background: var(--amber); }
.route li.opt { color: var(--dim); }

/* clues */
.clues { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.clue { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(255, 255, 255, 0.03); cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.clue:hover { border-color: var(--line2); transform: translateY(-2px); }
.clue.locked { cursor: default; opacity: 0.45; }
.clue .top { display: flex; gap: 6px; align-items: center; font-size: 0.8em; color: var(--dim); }
.clue h4 { margin: 4px 0; font-size: 0.98em; }
.clue p { margin: 0; font-size: 0.84em; color: var(--ink2); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.clue p mark { background: none; color: var(--amber2); font-weight: 700; }
.clue .to { margin-top: 6px; font-size: 0.78em; color: var(--cyan); }

/* photos tab */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.album .slotp { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); cursor: pointer; }
.album .slotp .im { aspect-ratio: 3 / 2; background-size: cover; background-position: center; }
.album .slotp.locked .im { background: repeating-linear-gradient(45deg, #151b24 0 8px, #11161e 8px 16px); display: grid; place-items: center; color: var(--dim); font-size: 1.6em; }
.album .slotp .t { padding: 6px 8px; font-size: 0.8em; }
.album .slotp .t small { display: block; color: var(--dim); }
.progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 0.86em; }
.progress .bar { flex: 1; height: 8px; }
.progress .bar > i { background: var(--violet); }

/* inventory */
.inv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.inv-slot { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(255, 255, 255, 0.03); min-height: 116px; display: flex; flex-direction: column; gap: 4px; }
.inv-slot.empty { border-style: dashed; color: var(--dim); align-items: center; justify-content: center; font-size: 0.8em; }
.inv-slot .ic { font-size: 1.5em; }
.inv-slot b { font-size: 0.88em; }
.inv-slot .cnt { font-size: 1.2em; font-weight: 900; }
.inv-slot .d { font-size: 0.74em; color: var(--ink2); line-height: 1.5; }
.inv-slot .btn { margin: auto 0 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 0.88em; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }

/* saves */
.saves { display: grid; gap: 8px; }
.save-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: rgba(255, 255, 255, 0.03); }
.save-row .th { width: 70px; height: 46px; border-radius: 8px; background-size: cover; background-position: center; background-color: #1a222c; }
.save-row .t { font-size: 0.86em; line-height: 1.5; }
.save-row .t small { color: var(--dim); }
.save-row.empty { border-style: dashed; color: var(--dim); }

/* field notes */
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.note { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, 0.03); }
.note .im { height: 110px; background-size: cover; background-position: center; }
.note .in { padding: 8px 10px; font-size: 0.82em; line-height: 1.6; }
.note h4 { margin: 0 0 3px; font-size: 1.05em; display: flex; gap: 6px; align-items: center; }
.note.locked .im { filter: brightness(0.15) blur(2px); }

/* pause / settings */
.settings { display: grid; grid-template-columns: auto 1fr auto; gap: 10px 14px; align-items: center; font-size: 0.92em; }
.settings input[type='range'] { width: 100%; accent-color: var(--amber); }
.settings .v { min-width: 3em; text-align: right; color: var(--ink2); }
.toggle { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: rgba(255, 255, 255, 0.15); position: relative; cursor: pointer; transition: background 0.15s; }
.toggle::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.toggle:checked { background: var(--amber); }
.toggle:checked::after { left: 21px; }
.keytable { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-size: 0.86em; }
.keytable div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding: 3px 0; }

/* ending */
.ending { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: var(--gut); overflow-y: auto; background: #000; animation: fadein 1.6s; }
.ending .bg { position: fixed; inset: 0; background-size: cover; background-position: center; opacity: 0.4; }
.ending .box { position: relative; max-width: 760px; width: 100%; text-align: center; margin: auto; }
.ending .tag { letter-spacing: 0.4em; color: var(--amber2); font-size: 0.8em; }
.ending h2 { font-family: 'Shippori Mincho', serif; font-size: 2.6em; margin: 6px 0 12px; letter-spacing: 0.12em; }
.ending .story { line-height: 2.1; color: var(--ink2); text-align: left; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.ending .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.ending .stat { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.ending .stat b { display: block; font-size: 1.3em; }
.ending .stat small { color: var(--dim); font-size: 0.75em; }
.ending .pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }

/* ---- small screens ---- */
@media (max-width: 760px) {
  :root { --fs: 0.94; --gut: 10px; }
  .appeal { grid-template-columns: 1fr; }
  .logo { font-size: 46px; }
  #hud-left { width: calc(100vw - 2 * var(--gut)); }
  #objective { padding: 8px 10px; }
  #todo .todo-area { display: none; }
  #compass { top: auto; bottom: 214px; width: 60vw; height: 24px; display: none; }
  #toasts { top: 150px; max-width: 70vw; }
  #vitals { width: calc(50vw - var(--gut) - 4px); padding: 8px; }
  #gear { width: calc(50vw - var(--gut) - 4px); padding: 8px; }
  .vrow { grid-template-columns: 4.6em 1fr auto; font-size: 0.72em; gap: 5px; }
  .vrow .lab { white-space: nowrap; }
  .gear-ic { width: 32px; height: 32px; }
  .gear-ammo { font-size: 1.15em; }
  .slots { grid-template-columns: repeat(6, 1fr); }
  .slot { height: 26px; font-size: 0.85em; }
  #say { bottom: 256px; }
  #t-top { top: calc(50% - 150px); right: 8px; flex-direction: column; }
  #t-top button { width: 58px; padding: 0; }
  #todo .todo-list li.next, #todo .todo-list li.done:not(.just) { display: none; }
  #areacard { top: 230px !important; }
  #tutorial { margin-left: var(--gut); max-width: calc(100vw - 92px); }
  #areacard { max-width: calc(100vw - 92px); }
  .obj-meta { display: none; }
  #areacard { top: 244px; }
  #areacard .nm { font-size: 1.5em; }
  #threat { top: calc(50% - 70px); min-width: 0; }
  #tutorial { bottom: 372px; }
  .phone { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; height: calc(100vh - 2 * var(--gut)); border-radius: 16px; }
  .ph-nav { grid-row: 3; flex-direction: row; overflow-x: auto; border-right: none; border-top: 1px solid var(--line); padding: 6px; }
  .ph-tab { flex-direction: column; gap: 2px; font-size: 0.68em; padding: 6px 8px; flex: 0 0 auto; }
  .ph-tab .k { display: none; }
  .map-wrap { grid-template-columns: 1fr; }
  .map-canvas { aspect-ratio: 0.95; }
  .inv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlg { grid-template-columns: 1fr; }
  .dlg .face { width: 100px; }
  .ending .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photos3 { gap: 6px; }
  .keytable { grid-template-columns: 1fr; }
  .win-body { padding: 12px 14px; }
}
@media (max-height: 520px) {
  #vitals, #gear { transform: scale(0.85); transform-origin: bottom left; }
  #gear { transform-origin: bottom right; }
}

/* dark scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }
.ending .hint { color: var(--ink2); background: rgba(0, 0, 0, 0.5); border-radius: 10px; padding: 6px 10px; }
mark { background: rgba(242, 179, 80, 0.22); color: var(--amber2); padding: 0 2px; border-radius: 3px; }
.compare { max-width: 460px; margin: 0 auto; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

/* ---- acquired item card ---- */
#acquire { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 2 * var(--gut)); bottom: 128px; opacity: 0; transform: translateY(16px) scale(0.97); transition: opacity 0.35s, transform 0.35s; }
#acquire.on { opacity: 1; transform: none; }
#acquire.out { opacity: 0; transform: translateY(-10px); }
.acq { display: flex; gap: 12px; align-items: center; padding: 10px 16px 10px 10px; border-color: rgba(242, 179, 80, 0.45); box-shadow: 0 0 0 1px rgba(242, 179, 80, 0.15), 0 10px 30px rgba(0, 0, 0, 0.5); }
.acq-img { width: 64px; height: 64px; border-radius: 12px; background: #1a2028 center / cover; display: grid; place-items: center; font-size: 1.8em; color: var(--amber2); flex: 0 0 auto; border: 1px solid var(--line2); }
.acq-tx { display: flex; flex-direction: column; line-height: 1.45; max-width: 360px; }
.acq-tx b { font-size: 1.08em; }
.acq-tx span { font-size: 0.82em; color: var(--ink2); }
.acq-tx .acq-lab { font-size: 0.68em; letter-spacing: 0.3em; color: var(--amber2); }

/* ---- richer windows ---- */
.hero.tall { height: 210px; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.kpi { position: relative; display: flex; gap: 10px; align-items: center; padding: 10px 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.03); overflow: hidden; }
.kpi-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(242, 179, 80, 0.12); color: var(--amber2); font-size: 1.1em; flex: 0 0 auto; }
.kpi b { display: block; font-size: 1.3em; line-height: 1.1; }
.kpi b small { font-size: 0.6em; color: var(--dim); font-weight: 500; }
.kpi span { font-size: 0.75em; color: var(--ink2); }
.kpi-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.06); }
.kpi-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--amber), var(--amber2)); }
.poster-view { width: min(320px, 70vw); aspect-ratio: 832 / 1216; margin: 0 auto 10px; border-radius: 6px; background: #222 center / cover; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); border: 6px solid #e8e2d4; }
.radio-ui { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: linear-gradient(180deg, #232a33, #171c22); border: 1px solid var(--line2); margin-bottom: 10px; }
.radio-dial { position: relative; width: 120px; padding: 8px 10px; border-radius: 8px; background: #0c1a12; color: #7dffa8; font-weight: 700; text-shadow: 0 0 8px rgba(125, 255, 168, 0.6); }
.radio-dial i { position: absolute; left: 60%; top: 4px; bottom: 4px; width: 2px; background: #ff6a4a; }
.radio-wave { flex: 1; display: flex; gap: 3px; align-items: center; height: 36px; }
.radio-wave i { flex: 1; height: 30%; border-radius: 2px; background: var(--cyan); opacity: 0.7; animation: wave 0.9s ease-in-out infinite alternate; }
@keyframes wave { to { height: 100%; opacity: 1; } }
.news { margin: 0; padding-left: 1.2em; line-height: 1.9; }
.news li::marker { color: var(--cyan); }
@media (max-width: 760px) {
  .cols2 { grid-template-columns: 1fr; gap: 0; }
  .hero.tall { height: 160px; }
  #acquire { bottom: 270px; }
  .acq-img { width: 52px; height: 52px; }
}

/* ---- phone: home dashboard / collection ---- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) 150px minmax(0, 1fr); gap: 10px; }
.home-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: rgba(255, 255, 255, 0.03); background-size: cover; background-position: center; min-width: 0; }
.home-goal h3 { margin: 4px 0 6px; font-size: 1.12em; line-height: 1.45; }
.home-goal p { margin: 0 0 8px; color: var(--ink2); }
.home-ring { display: grid; place-items: center; padding: 6px; }
.ring { width: 128px; height: 128px; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--amber); stroke-width: 10; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; transition: stroke-dasharray 0.6s; filter: drop-shadow(0 0 4px rgba(242, 179, 80, 0.6)); }
.ring-v { fill: var(--ink); font: 900 26px 'Zen Kaku Gothic New', sans-serif; }
.ring-l { fill: var(--dim); font: 500 10px 'Zen Kaku Gothic New', sans-serif; }
.home-vit .vrow { font-size: 0.8em; }
.mini-inv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px; }
.mini-inv span { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); color: var(--ink2); }
.mini-inv b { color: var(--ink); font-size: 0.95em; }
.mini-inv small { font-size: 0.62em; color: var(--dim); }
.kpi-btn { cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color 0.15s, transform 0.15s; }
.kpi-btn:hover { border-color: var(--line2); transform: translateY(-2px); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 12px; }
.timeline li { display: flex; align-items: center; gap: 8px; font-size: 0.82em; padding: 4px 0; color: var(--dim); min-width: 0; }
.timeline .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline .a { font-size: 0.85em; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--dim); flex: 0 0 auto; }
.timeline li.done { color: var(--ink2); }
.timeline li.done .dot { background: var(--green); border-color: var(--green); }
.timeline li.cur { color: var(--amber2); font-weight: 700; }
.timeline li.cur .dot { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 179, 80, 0.25); }
.sec .chip { margin-left: 4px; letter-spacing: 0; }
.logs { display: grid; gap: 6px; }
.log { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 0.84em; line-height: 1.6; background: rgba(255, 255, 255, 0.03); }
.log.locked { color: var(--dim); border-style: dashed; }
.inv-img { width: 100%; aspect-ratio: 1.4; border-radius: 8px; background: #151a22 center / cover; margin-bottom: 4px; }
@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
  .home-goal { grid-column: 1 / -1; }
  .ring { width: 104px; height: 104px; }
  .timeline { grid-template-columns: 1fr; }
}

/* ---- sound captions / pinned ---- */
#captions { position: absolute; right: var(--gut); top: 50%; transform: translateY(-50%); align-items: flex-end; display: flex; flex-direction: column; gap: 6px; max-width: min(300px, 46vw); }
.cap { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: rgba(6, 8, 12, 0.78); border: 1px solid var(--line); border-left: 3px solid var(--cyan); font-size: 0.84em; line-height: 1.4; animation: slidein 0.25s ease-out; transition: opacity 0.5s; }
.cap small { display: block; color: var(--dim); font-size: 0.85em; }
.cap .cap-ic { color: var(--cyan); font-size: 1.2em; }
.cap.danger { border-left-color: var(--red); }
.cap.danger .cap-ic { color: var(--red); }
.cap.out { opacity: 0; }
#pin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(120, 10, 0, 0.15), rgba(60, 0, 0, 0.65)); animation: fadein 0.2s; }
.pin-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 22px; border-radius: 14px; background: rgba(10, 4, 4, 0.82); border: 1px solid rgba(255, 95, 82, 0.6); text-align: center; animation: pulse 0.5s infinite; }
.pin-box b { font-size: 1.25em; color: #ffb0a8; }
.pin-box .bar { width: 240px; height: 10px; }
.pin-box .bar > i { background: linear-gradient(90deg, var(--amber), #fff2c8); }
.pin-box kbd { border-color: var(--amber); color: var(--amber2); }
@media (max-width: 760px) { #captions { top: 46%; right: auto; left: var(--gut); align-items: flex-start; max-width: 60vw; } }

/* ---- to-do list (HUD) ---- */
#todo { padding: 8px 12px 10px; font-size: 0.84em; }
#todo:empty { display: none; }
.todo-h { display: flex; align-items: center; gap: 6px; font-size: 0.78em; letter-spacing: 0.14em; color: var(--dim); margin-bottom: 4px; }
.todo-h b { color: var(--ink2); letter-spacing: 0; }
.todo-h .sp { flex: 1; height: 1px; background: var(--line); }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.todo-list li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.45; color: var(--ink2); transition: opacity 0.4s; }
.todo-list li .box { width: 14px; height: 14px; margin-top: 2px; border-radius: 4px; border: 1.5px solid var(--dim); flex: 0 0 auto; display: grid; place-items: center; font-size: 10px; color: #04170e; }
.todo-list li.done { color: var(--dim); text-decoration: line-through; opacity: 0.75; }
.todo-list li.done .box { background: var(--green); border-color: var(--green); }
.todo-list li.cur { color: var(--ink); font-weight: 700; }
.todo-list li.cur .box { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 179, 80, 0.2); }
.todo-list li.next { opacity: 0.55; }
.todo-list li.just .box { animation: tick 0.6s ease-out; }
@keyframes tick { 0% { transform: scale(1.8); } 100% { transform: scale(1); } }
.todo-area { margin-top: 6px; }
.todo-more { font-size: 0.85em; color: var(--dim); margin-top: 2px; }

/* ---- coaching highlight ---- */
.coach-hl { position: relative; animation: coachpulse 1.2s ease-in-out infinite; border-color: var(--amber) !important; }
@keyframes coachpulse { 50% { box-shadow: 0 0 0 4px rgba(242, 179, 80, 0.45), 0 0 24px rgba(242, 179, 80, 0.35); } }
#tutorial .step { font-size: 0.72em; color: var(--dim); margin-left: 6px; white-space: nowrap; }
#tutorial .why { display: block; font-size: 0.82em; color: var(--ink2); margin-top: 2px; }

/* ---- phone: to-do tab ---- */
.qgroup { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.02); }
.qgroup > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-weight: 700; }
.qgroup > summary::-webkit-details-marker { display: none; }
.qgroup > summary .cnt { margin-left: auto; font-size: 0.8em; color: var(--dim); font-weight: 500; }
.qgroup > summary .pbar { width: 80px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.qgroup > summary .pbar i { display: block; height: 100%; background: var(--green); }
.qgroup .todo-list { padding: 0 12px 10px; }
.card-face .doodle-img { margin: 6px auto; width: 58%; flex: 1; border-radius: 6px; background: center / contain no-repeat; mix-blend-mode: multiply; }
