:root {
  --ink: #23324a;
  --ink-soft: #5b6b85;
  --paper: #fffdf7;
  --line: #e7e1d3;
  --sky: #7cc8ff;
  --go: #2fbf71;
  --go-dark: #22995a;
  --bad: #ff6b6b;
  --gold: #ffc531;
  --accent: #ff8a5c;
  --q: #6c5ce7;
  --shadow: 0 6px 0 rgba(35, 50, 74, .18), 0 10px 24px rgba(35, 50, 74, .18);
  /* notches and home bars */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --tap: 48px;
  --font: 'Baloo 2', 'Nunito', 'Comic Sans MS', system-ui, 'PingFang HK', 'Microsoft JhengHei', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fd3ff; color: var(--ink); font-family: var(--font); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; touch-action: manipulation; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body { position: fixed; inset: 0; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button, a, input, select, label { touch-action: manipulation; }
#scene.reveal { animation: iris .7s cubic-bezier(.3,.7,.3,1); }
@keyframes iris { from { clip-path: circle(6% at 50% 55%); } to { clip-path: circle(75% at 50% 55%); } }
@media (prefers-reduced-motion: reduce) { #scene.reveal { animation: none; } }
.panel, .levels, .game-cards { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: inherit; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.screen { position: fixed; inset: 0; pointer-events: none; }
.screen > * { pointer-events: auto; }

/* ---------- shared bits ---------- */
.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--sat)) calc(12px + var(--sar)) 10px calc(12px + var(--sal)); flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; min-height: 36px; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 0 3px 0 rgba(35, 50, 74, .15); font-weight: 700; font-size: 18px; white-space: nowrap; }
.chip.me { cursor: pointer; }
.chip.me .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--me, #ff8a5c); }
.chip.combo { background: #ffedd1; color: #c65a00; animation: pulse .5s ease; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 14px; background: rgba(255, 255, 255, .92); box-shadow: 0 3px 0 rgba(35, 50, 74, .15); font-size: 24px; display: inline-grid; place-items: center; transition: transform .1s; }
.icon-btn:active { transform: translateY(2px); box-shadow: none; }
.icon-btn.small { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; }
.icon-btn.mic.on { background: var(--bad); color: #fff; animation: micpulse 1.4s infinite; }
.btn { padding: 12px 22px; border-radius: 16px; font-weight: 800; font-size: 20px; background: #fff; box-shadow: var(--shadow); transition: transform .1s; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(35, 50, 74, .2); }
.btn.go { background: var(--go); color: #fff; }
.btn.ghost { background: #eef1f6; box-shadow: none; }
.btn.gold { background: var(--gold); }
.btn:disabled { opacity: .45; pointer-events: none; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--q); color: #fff; font-size: 15px; font-weight: 700; margin-left: 8px; vertical-align: middle; }
.panel { background: var(--paper); border-radius: 28px; box-shadow: var(--shadow); padding: 22px; max-width: min(640px, calc(100vw - 32px - var(--sal) - var(--sar))); max-height: calc(100vh - 32px - var(--sat) - var(--sab)); max-height: calc(100dvh - 32px - var(--sat) - var(--sab)); overflow: auto; }
.panel h2 { margin: 0 0 8px; font-size: 28px; line-height: 1.1; }
.panel h3 { margin: 14px 0 6px; font-size: 20px; }
.panel p { margin: 4px 0; color: var(--ink-soft); }
.panel.center { text-align: center; }
.muted { color: var(--ink-soft); }

@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, .6); } 50% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- profiles ---------- */
#profiles { display: grid; place-items: center; background: rgba(124, 200, 255, .35); }
.logo { margin: 0 0 6px; font-size: clamp(30px, 7vw, 48px); line-height: 1; color: var(--ink); }
.logo span { color: var(--accent); }
.profile-list { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 14px 0; }
.profile { width: 120px; padding: 14px 8px 10px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); display: grid; justify-items: center; gap: 4px; position: relative; }
.profile .face { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; }
.profile b { font-size: 19px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.profile small { color: var(--ink-soft); }
.profile .del { position: absolute; top: 4px; right: 6px; font-size: 14px; opacity: .45; }
.profile.add .face { background: #eef1f6; }
.profile-new { display: grid; gap: 12px; justify-items: center; }
.profile-new input { font-size: 24px; padding: 10px 16px; border-radius: 14px; border: 3px solid var(--line); text-align: center; width: 260px; max-width: 100%; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.swatch { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- home ---------- */
.quests { position: absolute; top: calc(70px + var(--sat)); left: calc(12px + var(--sal)); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; }
.quests > * { pointer-events: auto; }
.daily { min-height: var(--tap); animation: rise .4s ease both; padding: 10px 16px; border-radius: 18px; background: linear-gradient(135deg, #ffe17a, #ffb547); box-shadow: var(--shadow); text-align: left; font-weight: 700; font-size: 16px; line-height: 1.2; max-width: 300px; }
.daily b { display: block; font-size: 19px; }
.daily.done { background: linear-gradient(135deg, #c9f2d6, #8fe0ae); }
.daily.weekly { background: linear-gradient(135deg, #b9a5ff, #ff8fb4); color: #fff; text-shadow: 0 1px 0 rgba(43, 33, 64, .3); animation-delay: .1s; }
.daily.weekly .wk-em { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
.daily.weekly.done { background: linear-gradient(135deg, #d9d2f5, #f5c9da); color: var(--ink); text-shadow: none; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-4px) rotate(6deg); } }
.home-hint { position: absolute; bottom: calc(150px + var(--sab)); left: 0; right: 0; text-align: center; margin: 0; font-weight: 700; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .35); pointer-events: none; }
.game-cards { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; padding: 10px calc(12px + var(--sar)) calc(14px + var(--sab)) calc(12px + var(--sal)); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x; }
.game-cards::-webkit-scrollbar { display: none; }
.gcard { flex: 0 0 auto; width: 150px; scroll-snap-align: start; border-radius: 20px; padding: 10px 12px; background: #fff; box-shadow: var(--shadow); text-align: left; border-top: 7px solid var(--c); animation: rise .35s ease both; }
.gcard .em { font-size: 30px; line-height: 1; }
.gcard b { display: block; font-size: 17px; line-height: 1.1; margin-top: 4px; }
.gcard small { display: block; color: var(--ink-soft); font-size: 13px; line-height: 1.15; }
.gcard .gstars { margin-top: 4px; font-weight: 700; font-size: 14px; }
.gcard.new::after { content: 'NEW'; position: absolute; }

/* ---------- level picker ---------- */
.lv-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.lv-head .em { font-size: 48px; width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--c); }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.lv { border-radius: 18px; padding: 10px; background: #fff; border: 3px solid var(--line); text-align: left; display: grid; gap: 2px; min-height: 88px; }
.lv .n { font-weight: 800; font-size: 15px; color: var(--c2, var(--q)); }
.lv b { font-size: 16px; line-height: 1.15; }
.lv small { color: var(--ink-soft); font-size: 13px; line-height: 1.15; }
.lv .st { font-size: 16px; letter-spacing: 1px; }
.lv.boss { background: linear-gradient(160deg, #fff8dc, #ffe9a8); border-color: #f5c542; }
.lv.boss.locked { background: #f3efe0; }
.chest { margin: 6px auto 4px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; }
.chest .lid { font-size: 46px; display: inline-block; animation: chest 1s ease .5s both; }
@keyframes chest { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 50% { transform: scale(1.3) rotate(10deg); opacity: 1; } 70% { transform: scale(.95) rotate(-6deg); } 100% { transform: none; } }
.chip.prize { background: #e9f7ff; }
.lv.locked { opacity: .5; background: #f3f1ea; }
.lv.next { border-color: var(--go); box-shadow: 0 0 0 3px rgba(47, 191, 113, .25); }
.lv:not(.locked):hover { transform: translateY(-2px); }

/* ---------- HUD ---------- */
#hud .topbar { flex-wrap: nowrap; }
.hud-title b { overflow: hidden; text-overflow: ellipsis; }
.hud-title { min-width: 0; flex: 0 1 auto; display: flex; align-items: center; background: rgba(255, 255, 255, .92); padding: 4px 14px; border-radius: 999px; box-shadow: 0 3px 0 rgba(35, 50, 74, .15); font-size: 18px; white-space: nowrap; overflow: hidden; }
.dots { position: absolute; top: calc(66px + var(--sat)); left: 0; right: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 0 12px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 2px rgba(35, 50, 74, .2); }
.dots i.cur { background: #fff; box-shadow: inset 0 0 0 3px var(--q); transform: scale(1.25); }
.dots i.ok { background: var(--go); box-shadow: none; }
.dots i.meh { background: var(--gold); box-shadow: none; }
.dots i.miss { background: var(--bad); box-shadow: none; }
.qcard { position: absolute; top: calc(90px + var(--sat)); left: 50%; transform: translateX(-50%); background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 8px 54px 8px 24px; text-align: center; max-width: calc(100vw - 24px); animation: pop .35s ease; }
.qcard.shake { animation: shake .4s ease; }
.qtext { font-size: clamp(30px, 7vw, 50px); font-weight: 800; line-height: 1.15; white-space: nowrap; }
.qtext .op { color: var(--accent); margin: 0 .12em; }
.qtext .qbox { display: inline-block; min-width: 1.3em; padding: 0 .15em; border-radius: 12px; background: #efeaff; color: var(--q); box-shadow: inset 0 0 0 3px var(--q); }
.qtext .qbox.typed { background: #fff6d5; color: var(--ink); box-shadow: inset 0 0 0 3px var(--gold); }
.qtext .qbox.right { background: #d9f7e5; color: var(--go-dark); box-shadow: inset 0 0 0 3px var(--go); }
.qtext .xv { color: var(--q); font-style: italic; }
.qprompt { font-size: 18px; color: var(--ink-soft); font-weight: 700; line-height: 1.15; }
.qprompt:empty { display: none; }
.qcard .say { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); box-shadow: none; background: #f2f0ff; }
.answer { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: flex-end; gap: 12px; padding: 12px calc(12px + var(--sar)) calc(18px + var(--sab)) calc(12px + var(--sal)); flex-wrap: wrap; }
.answer:empty { display: none; }
.choice { min-width: 92px; height: 92px; padding: 0 16px; border-radius: 24px; font-size: 46px; font-weight: 800; background: #fff; box-shadow: 0 7px 0 var(--cc, #c9c1ff), 0 12px 22px rgba(35, 50, 74, .2); transition: transform .1s; animation: rise .3s ease both; }
.choice:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--cc, #c9c1ff); }
.choice.wrong { background: #ffe3e3; color: #d14b4b; opacity: .6; pointer-events: none; box-shadow: none; transform: translateY(5px); }
.choice.right { background: #d9f7e5; color: var(--go-dark); box-shadow: 0 7px 0 var(--go); }
.choice.wide { font-size: 30px; }
.numpad { display: grid; grid-template-columns: repeat(6, 64px); gap: 8px; background: rgba(255, 255, 255, .55); padding: 10px; border-radius: 24px; backdrop-filter: blur(4px); }
.numpad button { height: 58px; border-radius: 16px; background: #fff; font-size: 30px; font-weight: 800; box-shadow: 0 5px 0 #d6d0c2; }
.numpad button:active { transform: translateY(4px); box-shadow: none; }
.numpad .ok { background: var(--go); color: #fff; box-shadow: 0 5px 0 var(--go-dark); }
.numpad .del { background: #ffe9e1; }
.action-btn { height: 72px; padding: 0 30px; border-radius: 22px; font-size: 28px; font-weight: 800; background: var(--go); color: #fff; box-shadow: 0 7px 0 var(--go-dark); }
.action-btn.alt { background: #fff; color: var(--ink); box-shadow: 0 7px 0 #d6d0c2; }
.action-btn:active { transform: translateY(5px); box-shadow: none; }
.toast { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); font-size: clamp(34px, 8vw, 60px); font-weight: 800; color: #fff; text-shadow: 0 4px 0 rgba(35, 50, 74, .35), 0 0 20px rgba(0, 0, 0, .2); pointer-events: none; opacity: 0; white-space: nowrap; }
.toast.show { animation: toast 1.1s ease forwards; }
.toast.bad { color: #ffe1e1; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 75% { opacity: 1; transform: translate(-50%, -55%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -75%) scale(1); } }
.voice-bubble { position: absolute; right: calc(12px + var(--sar)); top: calc(66px + var(--sat)); background: #fff; border-radius: 16px; padding: 6px 12px; box-shadow: 0 3px 0 rgba(35, 50, 74, .15); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; max-width: 240px; }
.vb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: micpulse 1.4s infinite; flex: none; }
#vb-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(35, 50, 74, .35); display: grid; place-items: center; padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); z-index: 10; animation: rise .2s ease; }
.modal .panel { position: relative; width: 100%; animation: pop .3s ease; }
.modal .close { position: absolute; top: 12px; right: 12px; }
.result { text-align: center; }
.result .big-stars { font-size: 64px; letter-spacing: 6px; margin: 4px 0; }
.result .big-stars span { display: inline-block; animation: pop .45s ease both; filter: grayscale(1) opacity(.35); }
.result .big-stars span.on { filter: none; }
.result .stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 16px; }
.result .stats .chip { box-shadow: none; background: #f2efe6; }
.new-trophy { margin: 8px auto; padding: 8px 14px; border-radius: 16px; background: #fff3c4; font-weight: 700; display: inline-block; animation: pop .4s ease both; }

.trophies, .shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.trophy { border-radius: 18px; padding: 10px; background: #fff; border: 3px solid var(--line); text-align: center; }
.trophy .em { font-size: 36px; }
.trophy b { display: block; line-height: 1.1; }
.trophy small { color: var(--ink-soft); line-height: 1.1; display: block; }
.trophy.off { opacity: .4; filter: grayscale(1); }
.shop-item { border-radius: 18px; padding: 10px; background: #fff; border: 3px solid var(--line); text-align: center; display: grid; gap: 4px; justify-items: center; }
.shop-item .em { font-size: 34px; height: 44px; display: grid; place-items: center; }
.shop-item .sw { width: 40px; height: 40px; border-radius: 50%; }
.shop-item.on { border-color: var(--go); background: #effcf4; }
.shop-item .price { font-weight: 800; }
.tabs { display: flex; gap: 8px; margin: 8px 0 12px; }
.tabs button { padding: 6px 16px; min-height: 44px; border-radius: 999px; background: #eef1f6; font-weight: 700; }
.tabs button.on { background: var(--ink); color: #fff; }

.settings label { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 2px solid var(--line); font-weight: 700; }
.settings label small { display: block; font-weight: 500; color: var(--ink-soft); }
.settings select { padding: 6px 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; }
.settings input[type=checkbox] { width: 30px; height: 30px; accent-color: var(--go); }
.settings select { min-height: 44px; }

.report table { width: 100%; border-collapse: collapse; font-size: 16px; }
.report th, .report td { padding: 6px 8px; border-bottom: 2px solid var(--line); text-align: left; }
.report td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 10px; border-radius: 6px; background: #eef1f6; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--go); }
.missed { display: flex; flex-wrap: wrap; gap: 6px; }
.missed span { padding: 3px 10px; border-radius: 10px; background: #ffe9e1; font-weight: 700; }

.popups { position: fixed; top: calc(70px + var(--sat)); right: calc(12px + var(--sar)); display: grid; gap: 8px; z-index: 20; pointer-events: none; }
.popup { background: #fff; border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); font-weight: 700; display: flex; gap: 10px; align-items: center; animation: rise .3s ease; max-width: 300px; }
.popup .em { font-size: 30px; }
.popup small { display: block; font-weight: 500; color: var(--ink-soft); }

@media (max-width: 600px) {
  .icon-btn { width: 46px; height: 46px; font-size: 21px; }
  .chip { font-size: 15px; padding: 3px 9px; }
  .hud-title { font-size: 15px; }
  .hud-title .badge { font-size: 12px; }
  .qcard { top: calc(78px + var(--sat)); padding: 6px 52px 6px 16px; }
  #hud-sound { display: none; }
  .hud-title .nm { display: none; }
  .topbar { gap: 6px; padding: 8px 10px; }
  .choice { min-width: 74px; height: 78px; font-size: 38px; }
  .numpad { grid-template-columns: repeat(6, 1fr); width: 100%; }
  .numpad button { height: 52px; }
  .gcard { width: 128px; }
  .quests { top: calc(116px + var(--sat)); gap: 6px; }
  .daily { font-size: 14px; max-width: 260px; padding: 8px 12px; }
  .daily b { font-size: 16px; }
  .dots { top: calc(60px + var(--sat)); }
  .dots i { width: 11px; height: 11px; }
  .voice-bubble { top: auto; bottom: calc(150px + var(--sab)); right: 50%; transform: translateX(50%); }
}

/* short landscape screens (small laptops, phones on their side): keep the HUD compact */
@media (max-height: 640px) and (min-width: 601px) {
  .topbar { padding: calc(6px + var(--sat)) calc(10px + var(--sar)) 6px calc(10px + var(--sal)); }
  .icon-btn { width: 46px; height: 46px; font-size: 21px; }
  .dots { top: calc(56px + var(--sat)); }
  .qcard { top: calc(68px + var(--sat)); padding: 4px 52px 4px 18px; }
  .qtext { font-size: 34px; }
  .qprompt { font-size: 15px; }
  .answer { padding: 6px 12px 8px; gap: 10px; }
  .choice { min-width: 70px; height: 64px; font-size: 32px; border-radius: 18px; }
  .choice.wide { font-size: 22px; }
  .numpad { grid-template-columns: repeat(12, 46px); gap: 6px; padding: 6px; }
  .numpad button { height: 48px; font-size: 24px; border-radius: 12px; }
  .action-btn { height: 56px; font-size: 22px; padding: 0 22px; }
  /* landscape phone home: smaller game cards so the island has room */
  .game-cards { padding-top: 6px; padding-bottom: calc(8px + var(--sab)); gap: 8px; }
  .gcard { width: 150px; min-height: 52px; padding: 5px 10px 5px 48px; border-top-width: 0; border-left: 6px solid var(--c); position: relative; border-radius: 16px; }
  .gcard .em { font-size: 26px; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }
  .gcard b { font-size: 14px; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gcard small { display: none; }
  .gcard .gstars { font-size: 12px; margin-top: 0; }
  .home-hint { bottom: calc(76px + var(--sab)); font-size: 13px; }
  .quests { top: calc(62px + var(--sat)); gap: 6px; }
  .daily { padding: 6px 12px; font-size: 14px; }
  .daily b { font-size: 16px; }
}

/* ---------- success particles (DOM) ---------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.fx-star, .fx-coin { position: absolute; left: 0; top: 0; font-weight: 800; line-height: 1; text-shadow: 0 2px 0 rgba(35, 50, 74, .18); will-change: transform, opacity; }
.fx-coin { font-size: 26px; }
.fx-paper { position: absolute; top: 0; width: 10px; height: 14px; border-radius: 2px; will-change: transform; }
.choice, .btn, .icon-btn, .gcard, .lv, .action-btn, .numpad button { -webkit-tap-highlight-color: transparent; }
.gcard:active, .lv:not(.locked):active { transform: scale(.95); transition: transform .08s; }
.choice:hover { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .fx-layer { display: none; } }

/* ---------- daily quests ---------- */
.quest-btn { position: relative; }
.quest-btn .pip { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 0 rgba(35, 50, 74, .2); }
.quest-btn .pip:empty { display: none; }
.quest-btn .pip.all { background: var(--go); }
.quest-list { display: grid; gap: 10px; margin: 10px 0; }
.quest { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 18px; background: #fff; border: 3px solid var(--line); animation: rise .3s ease both; }
.quest .em { font-size: 32px; text-align: center; }
.quest b { display: block; font-size: 18px; line-height: 1.15; }
.quest .qbar { height: 12px; border-radius: 6px; background: #eef1f6; overflow: hidden; margin-top: 6px; }
.quest .qbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ffd23f, #ff9f43); transition: width .6s ease; }
.quest .rew { font-weight: 800; white-space: nowrap; }
.quest.done { border-color: var(--go); background: #effcf4; }
.quest.done .qbar i { background: var(--go); }
.quest-bonus { text-align: center; font-weight: 700; color: var(--ink-soft); }

/* ---------- report chart ---------- */
.week-chart { margin: 4px 0 10px; }
.week-chart svg { width: 100%; max-width: 520px; height: auto; display: block; font-family: var(--font); }
.week-chart .legend { display: flex; gap: 14px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.week-chart .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.week-chart g:hover rect[fill="transparent"] { fill: rgba(35, 50, 74, .05); }
.skills { display: grid; gap: 6px; margin: 6px 0 12px; }
.skills .chip { box-shadow: none; background: #f2efe6; font-size: 15px; }
.report table { display: block; overflow-x: auto; }

.print-btn { position: absolute; top: 12px; right: 70px; padding: 8px 14px; font-size: 16px; min-height: 44px; }
.print-only { display: none; }
@media print {
  body { position: static; background: #fff; overflow: visible; }
  body > *:not(#modal) { display: none !important; }
  #modal { position: static; background: none; padding: 0; display: block; }
  #modal .panel { box-shadow: none; max-width: none; max-height: none; overflow: visible; }
  .close, .print-btn { display: none !important; }
  .print-only { display: block; }
  .report table { display: table; }
}
