:root {
  --bg: #120f1c;
  --bg2: #191527;
  --card: #1f1a30;
  --card2: #2a2440;
  --line: #352d50;
  --text: #f4efe6;
  --soft: #b3aac6;
  --dim: #7f7796;
  --ember: #ffb35c;
  --ember2: #ff8a3d;
  --green: #6fe0a0;
  --red: #ff7b6b;
  --blue: #8fd3ff;
  --violet: #b9a6ff;
  --gold: #ffd36b;
  --r: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.4; overscroll-behavior: none;
  background:
    radial-gradient(120% 60% at 50% -10%, #2b1f3f 0%, rgba(43,31,63,0) 60%),
    var(--bg);
  background-attachment: fixed;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }

#app { max-width: 560px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 14px calc(96px + env(safe-area-inset-bottom)); }

.top { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 24px; letter-spacing: -0.5px; }
.logo { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 50% 60%, #fff4d1 0 35%, #ffb35c 36% 60%, rgba(255,140,60,0) 61%); box-shadow: 0 0 18px 4px rgba(255,160,70,0.45); }
.ember-chip { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); padding: 7px 14px 7px 10px; border-radius: 999px; font-size: 18px; }
.ember-chip.pop { animation: pop 0.45s ease; }
@keyframes pop { 40% { transform: scale(1.18); box-shadow: 0 0 22px rgba(255,170,80,0.6); } }
.ember-ico { width: 14px; height: 14px; transform: rotate(45deg); background: linear-gradient(135deg, #ffe0a0, var(--ember2)); border-radius: 3px; box-shadow: 0 0 10px rgba(255,150,60,0.8); display: inline-block; }

/* hero */
.hero { display: flex; gap: 14px; align-items: center; background: linear-gradient(160deg, #241d38, #1a1529); border: 1px solid var(--line); border-radius: 24px; padding: 10px 16px 10px 6px; margin-bottom: 12px; overflow: hidden; }
#heroCanvas { width: 120px; height: 120px; flex: none; }
.hero-text { flex: 1; min-width: 0; }
.hero-big { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.hero-small { color: var(--soft); font-size: 14px; margin: 4px 0 10px; }
.nz-bar { height: 8px; background: #0e0b16; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.nz-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ember2), var(--gold)); border-radius: 8px; transition: width 0.6s ease; }
.nz span { display: block; color: var(--dim); font-size: 12.5px; margin-top: 5px; }

/* buttons */
.btn { display: block; border-radius: 16px; padding: 14px 16px; font-weight: 700; text-align: center; }
.btn.play {
  width: 100%; font-size: 22px; letter-spacing: 0.5px; padding: 16px; color: #2a1606;
  background: linear-gradient(180deg, #ffd27a, #ff9a45); box-shadow: 0 5px 0 #b85a1d, 0 10px 30px rgba(255,140,60,0.35);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn.play:active { transform: translateY(4px); box-shadow: 0 1px 0 #b85a1d, 0 4px 14px rgba(255,140,60,0.3); }
.btn.ghost { background: var(--card2); border: 1px solid var(--line); color: var(--soft); font-weight: 600; }
.btn.small { padding: 10px 14px; font-size: 15px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.btn.gold { background: linear-gradient(180deg, #ffe08a, #f2b13a); color: #3a2400; border: 0; box-shadow: 0 3px 0 #a8721a; }
.btn.gold:disabled { background: var(--card2); color: var(--dim); box-shadow: none; border: 1px solid var(--line); }
.wide { width: 100%; margin-top: 10px; }

/* play */
.play-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.zone-pick { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.zarrow { width: 44px; height: 44px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); font-size: 26px; line-height: 1; color: var(--soft); }
.zarrow:disabled { opacity: 0.3; }
.zone-name { text-align: center; }
.zone-name small { display: block; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.zone-name b { font-size: 18px; }
.start-with { color: var(--soft); font-size: 13.5px; text-align: center; margin-top: 12px; }
.start-with b { color: var(--green); font-weight: 700; }

.sos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.sos-btn { text-align: left; border-radius: 18px; padding: 14px; border: 1px solid; display: flex; flex-direction: column; gap: 4px; min-height: 104px; }
.sos-btn b { font-size: 16.5px; }
.sos-btn span { font-size: 13px; opacity: 0.85; }
.sos-btn.urge { background: linear-gradient(160deg, #3d2516, #2a1a12); border-color: #6e4220; color: #ffd1a1; }
.sos-btn.itch { background: linear-gradient(160deg, #23253f, #1b1c31); border-color: #3c4170; color: #c9ceff; }
.sos-btn:active { transform: scale(0.98); }

.task-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #2d2215; border: 1px solid #6e4a20; border-radius: 18px; padding: 12px 14px; margin-bottom: 12px; }
.task-card b { display: block; color: var(--gold); }
.task-card span { color: #e9d2b0; font-size: 14px; }

/* check-in */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 4px 10px; gap: 10px; }
.sec-head h2 { margin: 0; font-size: 20px; }
.hint { color: var(--dim); font-size: 13px; }
.hint.block { margin: -4px 4px 12px; }
.day-switch { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; display: flex; }
.day-switch button { padding: 6px 12px; border-radius: 9px; font-size: 14px; color: var(--soft); }
.day-switch button.on { background: var(--card2); color: var(--text); }

.habit { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.habit-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 10px; }
.habit-top b { font-size: 18px; display: block; }
.streak { color: var(--soft); font-size: 13.5px; }
.reward { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--ember); background: #2b2016; border: 1px solid #5a3d1f; padding: 5px 10px; border-radius: 999px; font-size: 14px; white-space: nowrap; }
.reward::before { content: ""; width: 9px; height: 9px; transform: rotate(45deg); background: var(--ember); border-radius: 2px; }
.reward.got { color: var(--green); background: #16291f; border-color: #2c5a3e; }
.reward.got::before { background: var(--green); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 13px 8px; font-weight: 600; min-height: 50px; transition: background 0.15s, border-color 0.15s; }
.pick.good.on { background: #1d4430; border-color: var(--green); color: #d9ffe9; }
.pick.bad.on { background: #48231f; border-color: var(--red); color: #ffd9d3; }
.pick:active { transform: scale(0.98); }
.mini-r { font-size: 12px; color: var(--ember); margin-left: 4px; font-weight: 700; }
.pick.on .mini-r { color: var(--green); }
.feeds { color: var(--dim); font-size: 13px; margin-top: 10px; }
.feeds b { color: var(--soft); }
details.how { margin-top: 10px; }
details.how summary { color: var(--blue); cursor: pointer; font-size: 14.5px; }
details.how li, details.how p { color: var(--soft); font-size: 14px; }
details.how ol { padding-left: 20px; margin: 8px 0; }

.chest-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(160deg, #2b2316, #1f1a14); border: 1px solid #5a4520; border-radius: var(--r); padding: 14px; }
.chest-text { flex: 1; }
.chest-text b { display: block; font-size: 17px; color: var(--gold); }
.chest-text span { color: #d9c9a8; font-size: 13.5px; }
.chest-art { position: relative; width: 52px; height: 44px; flex: none; }
.chest-art .box, .chest-big .box { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: linear-gradient(180deg, #a0622a, #6b3d16); border-radius: 4px 4px 8px 8px; border: 2px solid #3a1f0a; }
.chest-art .lid, .chest-big .lid { position: absolute; left: -2px; right: -2px; top: 0; height: 46%; background: linear-gradient(180deg, #c27a35, #8a4f1d); border-radius: 14px 14px 3px 3px; border: 2px solid #3a1f0a; transform-origin: 10% 100%; transition: transform 0.4s cubic-bezier(.3,1.6,.5,1); z-index: 2; }
.chest-art .box::after, .chest-big .box::after { content: ""; position: absolute; left: 50%; top: -4px; width: 10px; height: 12px; margin-left: -5px; background: var(--gold); border-radius: 3px; }
.chest-card.ready .chest-art { animation: wiggle 1.6s ease-in-out infinite; }
.chest-card.opened .chest-art .lid { transform: rotate(-28deg); }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-6deg); } 85% { transform: rotate(6deg); } 92% { transform: rotate(-3deg); } }

/* shop */
.shop { display: grid; gap: 10px; }
.shop-item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px 12px 14px; }
.shop-item .si-text { flex: 1; min-width: 0; }
.shop-item b { display: block; }
.shop-item .si-desc { color: var(--soft); font-size: 13.5px; }
.pips { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: var(--card2); }
.pips i.on { background: var(--ember); }
.buy { min-width: 84px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 12px; border-radius: 12px; font-weight: 800; background: linear-gradient(180deg, #ffd27a, #ff9a45); color: #2a1606; box-shadow: 0 3px 0 #b85a1d; }
.buy .ember-ico { width: 9px; height: 9px; box-shadow: none; background: #2a1606; }
.buy:disabled { background: var(--card2); color: var(--dim); box-shadow: none; }
.buy:disabled .ember-ico { background: var(--dim); }
.buy.max { background: #1d4430; color: var(--green); box-shadow: none; }

.arsenal { display: grid; gap: 10px; }
.weap { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; border-left: 4px solid var(--c, var(--line)); }
.weap-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.weap b { font-size: 16.5px; }
.weap .tag { font-size: 12px; color: var(--dim); }
.weap p { margin: 6px 0 0; color: var(--soft); font-size: 13.5px; }
.weap .lvbar { display: flex; gap: 4px; margin-top: 8px; }
.weap .lvbar i { flex: 1; height: 7px; border-radius: 4px; background: #0e0b16; border: 1px solid var(--line); }
.weap .lvbar i.on { background: var(--c); border-color: var(--c); }
.weap.locked { opacity: 0.7; }

.relics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.relic { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px; text-align: center; font-size: 13px; color: var(--soft); }
.relic b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 2px; }
.relic .cnt { color: var(--ember); font-weight: 800; }
.relic.none { opacity: 0.35; }
.relic.rare { border-color: #4a6fb0; }
.relic.legend { border-color: #b08a2a; }

/* journey */
.zones { display: grid; gap: 10px; }
.zone { display: flex; gap: 12px; align-items: center; border-radius: 18px; padding: 14px; border: 1px solid var(--line); background: var(--card); position: relative; overflow: hidden; }
.zone .dot { width: 40px; height: 40px; border-radius: 50%; flex: none; box-shadow: 0 0 18px var(--zc); background: radial-gradient(circle at 40% 35%, #fff 0 10%, var(--zc) 40%, rgba(0,0,0,0.3) 100%); }
.zone.locked .dot { background: #2a2440; box-shadow: none; }
.zone .zt { flex: 1; }
.zone b { display: block; }
.zone span { color: var(--soft); font-size: 13.5px; }
.zone.locked b { color: var(--dim); }
.zone.here { border-color: var(--zc); }
.history { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.hrow { display: grid; grid-template-columns: 74px repeat(14, 1fr); gap: 3px; align-items: center; margin: 4px 0; }
.hrow span { font-size: 12.5px; color: var(--soft); }
.hrow i { aspect-ratio: 1; border-radius: 50%; background: #0e0b16; border: 1px solid var(--line); }
.hrow i.good { background: var(--green); border-color: var(--green); }
.hrow i.half { background: var(--gold); border-color: var(--gold); }
.hrow i.bad { background: var(--red); border-color: var(--red); }
.hrow i.today { outline: 2px solid var(--soft); outline-offset: 1px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--soft); font-size: 13px; }

/* nav */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(18,15,28,0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 5; }
.tabs button { flex: 1; max-width: 180px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12.5px; color: var(--dim); padding: 6px; border-radius: 12px; }
.tabs button.on { color: var(--text); background: var(--card); }
.ti { width: 22px; height: 22px; border-radius: 7px; border: 2px solid currentColor; position: relative; }
.ti-today { border-radius: 50%; }
.ti-today::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: currentColor; }
.ti-up { border: 0; }
.ti-up::before { content: ""; position: absolute; left: 3px; right: 3px; top: 2px; bottom: 6px; background: currentColor; clip-path: polygon(50% 0, 100% 60%, 70% 60%, 70% 100%, 30% 100%, 30% 60%, 0 60%); }
.ti-map::after { content: ""; position: absolute; left: 4px; right: 4px; top: 8px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #2a2440; border: 1px solid var(--line); color: var(--text); padding: 12px 18px; border-radius: 16px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 50; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ember { color: var(--ember); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(8,6,14,0.78); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 20px; }
.modal-box { background: linear-gradient(170deg, #261f3a, #1a1529); border: 1px solid var(--line); border-radius: 26px; padding: 24px 22px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal-box h2 { margin: 8px 0 10px; font-size: 24px; }
.modal-box p { color: var(--soft); margin: 8px 0; }
.modal-box .btn.play { margin-top: 18px; }
#introCanvas { width: 140px; height: 140px; }
.sub { color: var(--soft); }

.chest-big { position: relative; width: 140px; height: 118px; margin: 20px auto 10px; }
.chest-big.shake { animation: shake 0.7s ease-in-out; }
.chest-big.open .lid { transform: rotate(-35deg) translateY(-6px); }
.chest-big .rays { position: absolute; left: 50%; top: 40%; width: 260px; height: 260px; margin: -130px; background: conic-gradient(from 0deg, rgba(255,211,107,0.35) 0 10deg, transparent 10deg 30deg, rgba(255,211,107,0.35) 30deg 40deg, transparent 40deg 60deg, rgba(255,211,107,0.35) 60deg 70deg, transparent 70deg 90deg, rgba(255,211,107,0.35) 90deg 100deg, transparent 100deg 120deg, rgba(255,211,107,0.35) 120deg 130deg, transparent 130deg 150deg, rgba(255,211,107,0.35) 150deg 160deg, transparent 160deg 180deg, rgba(255,211,107,0.35) 180deg 190deg, transparent 190deg 210deg, rgba(255,211,107,0.35) 210deg 220deg, transparent 220deg 240deg, rgba(255,211,107,0.35) 240deg 250deg, transparent 250deg 270deg, rgba(255,211,107,0.35) 270deg 280deg, transparent 280deg 300deg, rgba(255,211,107,0.35) 300deg 310deg, transparent 310deg 330deg, rgba(255,211,107,0.35) 330deg 340deg, transparent 340deg 360deg); border-radius: 50%; mask: radial-gradient(circle, #000 20%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); opacity: 0; z-index: 0; }
.chest-big.open .rays { opacity: 1; animation: spin 8s linear infinite; }
.chest-big .box, .chest-big .lid { z-index: 1; }
.chest-big .lid { z-index: 2; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-8deg); } 30% { transform: rotate(8deg); } 45% { transform: rotate(-8deg); } 60% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }
.loot { display: flex; flex-direction: column; gap: 4px; animation: rise 0.4s ease; }
.loot b { font-size: 24px; }
.loot span { color: var(--soft); }
.loot .loot-rar { text-transform: uppercase; letter-spacing: 1.5px; font-size: 12px; font-weight: 800; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.mouth { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px auto; max-width: 260px; }
.mouth .q { height: 64px; border-radius: 16px; background: #fffbe8; color: #6b5a2c; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; position: relative; opacity: 0.4; transition: opacity 0.3s, box-shadow 0.3s, background 0.3s; overflow: hidden; }
.mouth .q.on { opacity: 1; box-shadow: 0 0 0 3px var(--blue), 0 0 24px rgba(143,211,255,0.5); }
.mouth .q.done { opacity: 0.9; background: #e9fff2; color: #2c7a4e; }
.mouth .q::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 25% 40%, #e3c34f 0 7px, transparent 8px), radial-gradient(circle at 70% 65%, #e3c34f 0 6px, transparent 7px), radial-gradient(circle at 55% 25%, #e3c34f 0 5px, transparent 6px); opacity: var(--plaque, 1); transition: opacity 0.4s; }
.brush-clock { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* game */
#game { position: fixed; inset: 0; z-index: 30; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; }
#gc { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; left: 0; right: 0; top: 0; padding: env(safe-area-inset-top) 12px 0; pointer-events: none; }
.xpbar { height: 6px; background: rgba(0,0,0,0.5); border-radius: 0 0 6px 6px; overflow: hidden; margin: 0 -12px; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6fd8ff, #b4f0ff); box-shadow: 0 0 10px #6fd8ff; transition: width 0.1s; }
.hud-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.hp { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 170px; }
.hpbar { flex: 1; height: 12px; border-radius: 8px; background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.15); overflow: hidden; }
.hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff5f76, #ff9a7a); transition: width 0.15s; }
.hp span { font-size: 12px; color: #ffd9d3; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.clock { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 2px 6px rgba(0,0,0,0.7); }
.hud-right { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; font-weight: 700; font-size: 14px; text-shadow: 0 1px 3px #000; }
.kills { display: flex; align-items: center; gap: 5px; color: #d8cff0; }
.kills i { width: 10px; height: 10px; border-radius: 50%; background: #a99ccc; display: inline-block; }
#hPause { pointer-events: auto; width: 40px; height: 40px; border-radius: 12px; background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.2); font-weight: 800; letter-spacing: -1px; }
.bossbar { margin: 10px auto 0; max-width: 360px; text-align: center; }
.bossbar span { font-size: 13px; font-weight: 800; color: #e7d6ff; text-shadow: 0 1px 3px #000; letter-spacing: 1px; text-transform: uppercase; }
.bb { height: 10px; border-radius: 6px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.2); overflow: hidden; margin-top: 4px; }
.bb i { display: block; height: 100%; background: linear-gradient(90deg, #a35cff, #ff6bd0); transition: width 0.15s; }
.task-banner { margin: 10px auto 0; max-width: 360px; text-align: center; background: rgba(45,34,21,0.85); border: 1px solid #6e4a20; color: #ffd9a8; border-radius: 12px; padding: 7px 12px; font-size: 14px; font-weight: 600; }
.task-banner.done { background: rgba(29,68,48,0.9); border-color: var(--green); color: #d9ffe9; }
.g-banner { position: absolute; left: 50%; top: 28%; transform: translate(-50%, 10px); font-size: 20px; font-weight: 800; text-align: center; padding: 10px 18px; border-radius: 14px; background: rgba(10,8,18,0.6); color: #fff2d6; opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; max-width: 86%; text-shadow: 0 2px 6px #000; }
.g-banner.show { opacity: 1; transform: translate(-50%, 0); }
.g-help { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); color: rgba(255,255,255,0.55); font-size: 13px; pointer-events: none; text-align: center; white-space: nowrap; transition: opacity 1s; }
.ov { position: absolute; inset: 0; background: rgba(8,6,14,0.72); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 5; }
.ov-box { width: 100%; max-width: 640px; text-align: center; }
.ov-box.narrow { max-width: 360px; background: linear-gradient(170deg, #261f3a, #1a1529); border: 1px solid var(--line); border-radius: 26px; padding: 24px 20px; }
.ov-box h2 { font-size: 26px; margin: 0 0 14px; text-shadow: 0 2px 8px #000; }
.up-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .up-cards { grid-template-columns: 1fr; } }
.up-card { position: relative; text-align: left; background: linear-gradient(170deg, #2a2342, #1d182d); border: 2px solid var(--c, var(--line)); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 5px; animation: rise 0.3s ease backwards; box-shadow: 0 0 24px -8px var(--c); }
.up-card:nth-child(2) { animation-delay: 0.06s; }
.up-card:nth-child(3) { animation-delay: 0.12s; }
.up-card:active { transform: scale(0.98); }
.up-card b { font-size: 19px; color: var(--c, var(--text)); }
.up-tag { font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); font-weight: 800; }
.up-desc { color: var(--soft); font-size: 14.5px; }
.up-badge { margin-top: 4px; align-self: flex-start; font-size: 12px; color: var(--green); background: #16291f; border: 1px solid #2c5a3e; border-radius: 999px; padding: 3px 9px; }
.up-key { position: absolute; right: 12px; top: 10px; font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
@media (pointer: coarse) { .up-key { display: none; } }
.lvl-hint { margin-top: 14px; color: #ffd9a8; font-size: 14px; background: rgba(45,34,21,0.85); border: 1px solid #6e4a20; border-radius: 12px; padding: 8px 12px; display: inline-block; }
.ov-box .btn { margin-top: 10px; }
.e-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.e-stats div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px; }
.e-stats b { display: block; font-size: 22px; }
.e-stats span { color: var(--soft); font-size: 12.5px; }
.e-embers { font-size: 26px; font-weight: 800; color: var(--ember); text-shadow: 0 0 20px rgba(255,150,60,0.5); }
.e-note { color: #ffd9a8; font-size: 14px; }
