@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(fonts/fredoka-latin.woff2) format('woff2');
}

:root {
  --pink: #ff3d8b;
  --pink-2: #ff7ab8;
  --green: #2bd96b;
  --green-2: #19a84f;
  --gold: #ffc83d;
  --text: #fff;
  --muted: rgba(255, 255, 255, .62);
  --glass: rgba(255, 255, 255, .08);
  --glass-2: rgba(255, 255, 255, .14);
  --line: rgba(255, 255, 255, .14);
  --sheet: #1a1036;
  --accent: #ff4d9d;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #0b0620; color: var(--text);
  font-family: "Fredoka", ui-rounded, "Segoe UI", system-ui, sans-serif;
  user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none;
}
button { touch-action: manipulation; font-family: inherit; cursor: pointer; color: inherit; border: 0; background: none; padding: 0; }
svg { width: 1em; height: 1em; flex: none; }
.hidden { display: none !important; }

#cv { position: fixed; inset: 0; display: block; }

/* ---------- shared ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .32); border: 1px solid var(--line); font-weight: 700; font-size: 17px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pill svg { width: 22px; height: 22px; }
.coins span { color: #ffe27a; min-width: 1.5em; }
.coins.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.18); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border-radius: 18px; font-weight: 700; font-size: 18px; letter-spacing: .02em;
  background: var(--glass-2); border: 1px solid var(--line); transition: transform .08s;
}
.btn:active { transform: scale(.96); }
.btn svg { width: 22px; height: 22px; }
.btn.primary { background: linear-gradient(180deg, var(--pink-2), var(--pink)); border: 0; box-shadow: 0 6px 0 #b0185a, 0 10px 24px rgba(255, 61, 139, .4); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #b0185a; }
.btn.ad { background: linear-gradient(180deg, #4ff08a, var(--green)); color: #05301a; border: 0; box-shadow: 0 6px 0 var(--green-2); }
.btn.ad:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--green-2); }
.btn.gold { background: linear-gradient(180deg, #ffe27a, var(--gold)); color: #5a3a00; border: 0; box-shadow: 0 6px 0 #c48a00; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn small { font-weight: 600; font-size: 13px; opacity: .85; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(0, 0, 0, .32); border: 1px solid var(--line);
}
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- home ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; padding: calc(12px + var(--safe-top)) 16px calc(18px + var(--safe-bottom)); }
.topbar { width: 100%; max-width: 480px; display: flex; justify-content: space-between; }
.streak span { color: #ffb36b; }
.stars-pill span { color: #ffe9a3; }
.topgroup { display: flex; gap: 8px; }
.logo { margin-top: auto; text-align: center; pointer-events: none; position: relative; }
.logo::before { content: ""; position: absolute; left: 50%; top: 50%; width: 130%; height: 190%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(8, 3, 24, .72), rgba(8, 3, 24, 0)); z-index: -1; }
.logo h1 { margin: 0; font-size: clamp(64px, 21vw, 112px); line-height: .95; letter-spacing: .01em; font-weight: 700; }
.logo h1 span {
  display: inline-block; background: linear-gradient(180deg, #fff 10%, var(--c, #ff4d9d) 90%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px var(--c, #ff4d9d)); animation: bob 2.4s ease-in-out infinite;
}
.logo h1 span:nth-child(1) { --c: #ff4d9d; animation-delay: 0s; }
.logo h1 span:nth-child(2) { --c: #ffd23f; animation-delay: .12s; }
.logo h1 span:nth-child(3) { --c: #38e1ff; animation-delay: .24s; }
.logo h1 span:nth-child(4) { --c: #7cff6b; animation-delay: .36s; }
.logo h1 span:nth-child(5) { --c: #b06bff; animation-delay: .48s; }
.logo h1 span:nth-child(6) { --c: #ff8a3d; animation-delay: .6s; }
@keyframes bob { 50% { transform: translateY(-8px) scale(1.04); } }
.logo p { margin: 8px 0 0; color: var(--muted); font-size: 18px; font-weight: 500; }

.home-actions { margin-top: auto; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.btn.big { min-height: 76px; font-size: 30px; border-radius: 24px; flex-direction: row; }
.btn.big svg { width: 30px; height: 30px; }
.btn.big small { font-size: 16px; padding: 4px 10px; border-radius: 10px; background: rgba(0, 0, 0, .18); margin-left: 4px; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px;
  border-radius: 18px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); font-weight: 600; font-size: 14px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tile:active { transform: scale(.95); }
.tile svg { width: 28px; height: 28px; }
.badge, .dot { position: absolute; top: -6px; right: -4px; background: var(--pink); color: #fff; font-style: normal; font-weight: 700; font-size: 12px; border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid #0b0620; }
.dot { min-width: 14px; height: 14px; top: -3px; right: 2px; background: var(--green); }
.home-stats { text-align: center; color: var(--muted); font-size: 14px; min-height: 18px; }
.home-stats b { color: #fff; }

/* ---------- HUD ---------- */
#hud { position: fixed; left: 0; right: 0; top: 0; padding: calc(8px + var(--safe-top)) 12px 0; display: flex; align-items: center; gap: 10px; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hud-mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none !important; }
.hud-title { font-weight: 700; font-size: 15px; letter-spacing: .14em; opacity: .9; margin-bottom: 14px; }
.hud-count small { font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: .08em; margin-left: 4px; }
.hud-count { font-weight: 700; font-size: 15px; }
.hud-count.hit { color: #7cff6b; }
.bar { position: relative; width: 100%; max-width: 240px; height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: visible; }
.bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #ffd23f); transition: width .12s; }
.bar.hit .fill { background: linear-gradient(90deg, #2bd96b, #b6ff6b); }
.bar .mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #fff; box-shadow: 0 0 8px #fff; }
.bar .mark svg { position: absolute; left: 0; bottom: 100%; width: 16px; height: 16px; margin-bottom: -2px; color: #fff; filter: drop-shadow(0 0 4px rgba(255,255,255,.6)); }
.bar.hit .mark { background: #7cff6b; box-shadow: 0 0 8px #7cff6b; }
.bar.hit .mark svg { color: #7cff6b; }
.bar.pulse { animation: barpulse .5s; }
@keyframes barpulse { 30% { transform: scale(1.12); } }

#hint {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, .45); border: 1px solid var(--line); font-weight: 600; pointer-events: none;
  animation: hint 1.6s ease-in-out infinite; white-space: nowrap; max-width: calc(100vw - 32px);
}
#hint svg { width: 26px; height: 26px; }
@keyframes hint { 50% { transform: translateX(-50%) translateY(-6px); } }
#hint.big { bottom: calc(110px + var(--safe-bottom)); font-size: 18px; padding: 14px 20px; white-space: normal; text-align: left; width: max-content; line-height: 1.25; border-radius: 22px; border-color: rgba(255, 255, 255, .3); }

.chip {
  position: fixed; left: 50%; bottom: calc(22px + var(--safe-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 12px; border-radius: 999px; background: rgba(0, 0, 0, .5); border: 1.5px solid rgba(255, 210, 63, .5);
  font-weight: 700; font-size: 16px; white-space: nowrap;
}
.chip .bolt { width: 22px; height: 22px; color: #ffd23f; }
.chip .cost { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 14px; }
.chip .cost svg { width: 18px; height: 18px; }
.chip .cost.ad { background: var(--green); color: #05301a; }
.chip.on { background: linear-gradient(180deg, #ffe27a, #ffb21f); color: #4a2a00; border-color: #fff; box-shadow: 0 0 24px rgba(255, 210, 63, .7); }
.chip.on .bolt { color: #4a2a00; }

#intro {
  position: fixed; left: 50%; top: calc(86px + var(--safe-top)); transform: translateX(-50%); width: min(92vw, 360px);
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: rgba(20, 10, 50, .85);
  border: 1px solid var(--line); pointer-events: none; animation: introIn .4s both;
}
#intro svg { width: 40px; height: 40px; }
#intro b { display: block; font-size: 16px; }
#intro span { font-size: 14px; color: var(--muted); }
@keyframes introIn { from { opacity: 0; transform: translateX(-50%) translateY(-12px); } }

/* ---------- modal sheets ---------- */
#modal { position: fixed; inset: 0; background: rgba(5, 2, 15, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 10; animation: fade .2s; }
#modal.center { align-items: center; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; background: linear-gradient(180deg, #24154a, var(--sheet));
  border: 1px solid var(--line); border-radius: 28px 28px 0 0; padding: 22px 18px calc(22px + var(--safe-bottom));
  animation: up .28s cubic-bezier(.2, .9, .3, 1.2); touch-action: pan-y;
}
#modal.center .sheet { border-radius: 28px; margin: 16px; width: calc(100% - 32px); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { margin: 0 0 4px; font-size: 28px; text-align: center; }
.sheet .sub { text-align: center; color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.sheet .close { position: absolute; }
.sheet-head { position: relative; }
.sheet-head .icon-btn { position: absolute; right: 0; top: -4px; }
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.actions .row { display: flex; gap: 10px; }
.actions .row > * { flex: 1; }
.actions .row .btn { min-height: 48px; font-size: 16px; padding: 0 10px; }

.stars { display: flex; justify-content: center; gap: 6px; margin: 6px 0 10px; }
.stars svg { width: 58px; height: 58px; opacity: 0; transform: scale(.3); }
.stars svg:nth-child(2) { width: 72px; height: 72px; margin-top: -12px; }
.stars svg.in { animation: starIn .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes starIn { to { opacity: 1; transform: scale(1); } }

.big-num { text-align: center; font-size: 64px; font-weight: 700; line-height: 1; margin: 6px 0; }
.big-num.miss { color: #ff7ab8; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.stat { background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 10px 6px; text-align: center; }
.stat .k { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.stat .v svg { width: 20px; height: 20px; }
.near { text-align: center; font-size: 15px; color: var(--muted); }
.prog { position: relative; height: 16px; border-radius: 99px; background: rgba(255, 255, 255, .1); margin: 12px 0 2px; overflow: hidden; }
.prog i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), #ffd23f); border-radius: 99px; }
.new-best { display: block; text-align: center; color: #7cff6b; font-weight: 700; letter-spacing: .1em; margin-top: -2px; }

/* lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; font-size: 16px; }
.item .s { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.item .s svg { width: 16px; height: 16px; }
.item .mini { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); margin-top: 8px; overflow: hidden; }
.item .mini i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffd23f); }
.item .btn { min-height: 42px; padding: 0 14px; font-size: 15px; border-radius: 14px; }
.item .btn.ad, .item .btn.primary, .item .btn.gold { box-shadow: none; }
.item.done { opacity: .55; }
.swatch { width: 64px; height: 52px; border-radius: 14px; flex: none; position: relative; overflow: hidden; }
.swatch i { position: absolute; width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.item.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); width: 100%; font-size: 17px; font-weight: 600; }
.toggle svg { width: 24px; height: 24px; }
.toggle .sw { margin-left: auto; width: 50px; height: 30px; border-radius: 99px; background: rgba(255, 255, 255, .2); position: relative; transition: background .2s; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle.on .sw { background: var(--green); }
.toggle.on .sw::after { transform: translateX(20px); }
.note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 14px; line-height: 1.5; }
.daily-hero { display: flex; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.legend div { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); padding: 8px 12px; border-radius: 14px; background: var(--glass); }
.legend svg { width: 32px; height: 32px; }
.legend b { color: #fff; display: block; font-size: 15px; }
.section-title { margin: 20px 0 0; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* toast */
#toast {
  position: fixed; left: 50%; top: calc(96px + var(--safe-top)); transform: translateX(-50%); z-index: 30; padding: 10px 18px; border-radius: 999px;
  background: rgba(0, 0, 0, .75); border: 1px solid var(--line); font-weight: 600; white-space: nowrap; animation: introIn .3s both;
}

/* mock ad */
.ad-mock { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .92); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.ad-mock.show { opacity: 1; }
.ad-box { width: min(88vw, 340px); text-align: center; padding: 24px; border-radius: 24px; background: #15151f; border: 1px solid #333; }
.ad-tag { display: inline-block; font-size: 11px; letter-spacing: .14em; padding: 3px 8px; border-radius: 6px; background: #333; }
.ad-title { font-size: 24px; font-weight: 700; margin-top: 12px; }
.ad-sub { color: #999; font-size: 13px; margin-top: 4px; }
.ad-ring { width: 84px; height: 84px; margin: 18px auto; border-radius: 50%; border: 6px solid var(--green); display: grid; place-items: center; font-size: 30px; font-weight: 700; }
.ad-note { color: #888; font-size: 13px; }
.ad-close { width: 100%; margin-top: 8px; }

@media (min-height: 760px) { .home-actions { gap: 20px; } }

/* ---------- v1.2: chest, map, boss, star marks, login ---------- */
.tile { font-size: 13px; }
.tile svg { width: 26px; height: 26px; }
.chest-bar {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px 8px 10px; border-radius: 18px;
  background: rgba(0, 0, 0, .32); border: 1px solid var(--line); text-align: left; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.chest-bar .chest-ic { width: 34px; height: 34px; }
.chest-bar .cb-mid { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.chest-bar .cb-mid b { font-size: 14px; }
.cb-track { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; display: block; }
.cb-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb21f, #ffe27a); border-radius: 99px; }
.cb-text { font-weight: 700; font-size: 14px; color: #ffe9a3; }
.chest-bar.ready { border-color: #ffd23f; box-shadow: 0 0 0 2px rgba(255, 210, 63, .35), 0 0 24px rgba(255, 210, 63, .35); animation: chestPulse 1.4s ease-in-out infinite; }
.chest-bar.ready .chest-ic { animation: wiggle 1.4s ease-in-out infinite; }
@keyframes chestPulse { 50% { transform: scale(1.02); } }
@keyframes wiggle { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-10deg); } 80% { transform: rotate(10deg); } 90% { transform: rotate(-6deg); } }
.chest-hero { display: grid; place-items: center; margin: 6px 0 10px; }
.chest-hero svg { width: 96px; height: 96px; filter: drop-shadow(0 8px 24px rgba(255, 178, 31, .45)); }
.chest-hero.open svg { animation: starIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.stat-row.two { grid-template-columns: 1fr 1fr; }
.gate-note { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: #ffe9a3; background: rgba(255, 210, 63, .1); border: 1px solid rgba(255, 210, 63, .3); padding: 10px 12px; border-radius: 14px; margin: 10px 0 0; line-height: 1.35; }
.gate-note svg { width: 18px; height: 18px; margin-top: 1px; }

.bar .smark { position: absolute; top: 50%; transform: translate(-50%, -50%); display: flex; pointer-events: none; }
.bar .smark svg { width: 14px; height: 14px; opacity: .5; filter: grayscale(1); transition: all .2s; }
.bar .smark.s3 svg { width: 11px; height: 11px; margin: 0 -2px; }
.bar .smark.got svg { opacity: 1; filter: none; transform: scale(1.15); }
.tap-pip { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ffd23f; margin-left: 3px; box-shadow: 0 0 6px #ffd23f; }
.chip .cost.own { background: #ffd23f; color: #4a2a00; }
#intro svg { flex: none; }

#map { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(11, 6, 32, .97), rgba(20, 8, 50, .98)); }
.map-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top)) 16px 10px; }
.map-top h2 { flex: 1; margin: 0; font-size: 22px; }
.map-stars span { color: #ffe9a3; }
.map-list { flex: 1; overflow-y: auto; padding: 4px 16px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.chapter { border-radius: 22px; padding: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); max-width: 480px; width: 100%; margin: 0 auto; }
.chapter header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chapter header small { display: block; font-size: 11px; letter-spacing: .16em; color: var(--muted); font-weight: 700; }
.chapter header b { font-size: 19px; }
.ch-stars { display: flex; align-items: center; gap: 4px; font-weight: 700; color: #ffe9a3; }
.ch-stars svg { width: 18px; height: 18px; }
.chapter.gated .nodes, .chapter.far .nodes { opacity: .45; }
.gate { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255, 210, 63, .1); border: 1px solid rgba(255, 210, 63, .3); color: #ffe9a3; font-size: 14px; margin-bottom: 12px; line-height: 1.35; }
.gate svg { width: 22px; height: 22px; flex: none; }
.nodes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px 10px; padding-bottom: 8px; }
.node { position: relative; aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 700; font-size: 18px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, .08) 60%); border: 2px solid rgba(255, 255, 255, .25); }
.node.open { background: radial-gradient(circle at 35% 30%, #fff 0%, var(--accent) 35%, rgba(0, 0, 0, .25) 100%); border-color: rgba(255, 255, 255, .55); box-shadow: 0 0 14px rgba(255, 77, 157, .35); }
.node.open.done { background: radial-gradient(circle at 35% 30%, #fff 0%, #7b5cff 40%, #2a145c 100%); box-shadow: none; }
.node.bonus.open { background: radial-gradient(circle at 35% 30%, #fff 0%, #ffb21f 40%, #6b3d00 100%); }
.node.boss { border-color: #ffd23f; }
.node.boss.open { background: radial-gradient(circle at 35% 30%, #fff 0%, #ff3d6e 40%, #4a0820 100%); }
.node.locked { color: rgba(255, 255, 255, .5); }
.node.locked .num svg { width: 18px; height: 18px; }
.node.current { animation: nodePulse 1.3s ease-in-out infinite; border-color: #fff; }
@keyframes nodePulse { 50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255, 255, 255, .15), 0 0 22px var(--accent); } }
.node .crown { position: absolute; top: -12px; width: 26px; height: 26px; }
.node .num { line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.mini-stars { display: flex; gap: 2px; position: absolute; bottom: -14px; }
.mini-stars i { width: 9px; height: 9px; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 78%, 20% 100%, 30% 60%, 0 38%, 38% 35%); background: rgba(255, 255, 255, .22); }
.mini-stars i.on { background: #ffd23f; }

.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.day { position: relative; border-radius: 16px; padding: 10px 4px; text-align: center; background: var(--glass); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 84px; justify-content: center; }
.day small { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.day span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; font-size: 14px; }
.day span svg { width: 18px; height: 18px; }
.day.big { grid-column: span 2; background: linear-gradient(160deg, rgba(255, 210, 63, .18), rgba(255, 77, 157, .18)); }
.day .gift { width: 26px; height: 26px; color: #ffd23f; }
.day.past { opacity: .5; }
.day .ok { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; color: #7cff6b; }
.day.today { border-color: #ffd23f; box-shadow: 0 0 0 2px rgba(255, 210, 63, .4); animation: chestPulse 1.4s ease-in-out infinite; }
.day span { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; }

/* ---------- v1.3 layout pass ---------- */
/* desktop: HUD and map header stay over the board column instead of the window edges */
#hud { max-width: 520px; margin: 0 auto; }
.map-top { width: 100%; max-width: 512px; margin: 0 auto; }
.home-stats svg { width: 15px; height: 15px; vertical-align: -2px; color: #ffd23f; }

/* intro card: lighter, so the board under it stays readable */
#intro { background: rgba(20, 10, 50, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: 10px 12px; }
#intro svg { width: 34px; height: 34px; }
#intro b { font-size: 15px; }
#intro span { font-size: 13px; }

/* result stars: empty slots are visible from the start so 1 star reads as 1 of 3 */
.stars svg { opacity: .2; transform: scale(.85); }
.stars.shown svg { opacity: 1; transform: none; }
.stars.shown svg:nth-child(2) { width: 60px; height: 60px; margin-top: -8px; }
.stars.shown svg { width: 48px; height: 48px; }

.tip { display: flex; gap: 10px; align-items: center; margin: 4px 0 14px; padding: 10px 12px; border-radius: 14px; background: rgba(124, 255, 107, .08); border: 1px solid rgba(124, 255, 107, .25); font-size: 14px; line-height: 1.35; color: #d9ffd2; }
.tip svg { width: 22px; height: 22px; flex: none; color: #7cff6b; }

.goals { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.goals-h { margin: 0 0 2px; text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.goal { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); font-size: 15px; }
.goal span { display: flex; align-items: center; gap: 8px; }
.goal span svg { width: 20px; height: 20px; color: #ffd23f; }
.goal .gs { gap: 2px; }
.goal .gs svg { width: 18px; height: 18px; }
.spec-row { display: flex; justify-content: center; gap: 10px; margin: 10px 0 2px; }
.spec-row svg { width: 30px; height: 30px; }

.mini-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.mini-row .mini { flex: 1; margin-top: 0; }
.mini-row span { font-size: 13px; color: var(--muted); font-weight: 600; min-width: 34px; text-align: right; }
.reward { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 210, 63, .12); color: #ffe9a3; font-weight: 700; font-size: 14px; }
.reward svg, .claim-col svg { width: 16px; height: 16px; }
.claim-col { display: flex; flex-direction: column; gap: 6px; }
.claimed { color: #7cff6b; width: 28px; height: 28px; }
.claimed svg { width: 28px; height: 28px; }

.btn.gold.short { filter: saturate(.35) brightness(.8); box-shadow: 0 6px 0 #6b5520; }
.wallet { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 10px 10px 14px; border-radius: 18px; background: rgba(255, 210, 63, .08); border: 1px solid rgba(255, 210, 63, .25); }
.wallet > svg { width: 20px; height: 20px; }
.wallet span { flex: 1; color: var(--muted); }
.wallet span b { color: #fff; }
.wallet .btn { min-height: 42px; padding: 0 14px; font-size: 15px; border-radius: 14px; box-shadow: none; width: auto; }

/* map: progress per chapter, collapsed far chapters, a sticky continue button */
.ch-prog { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: -4px 0 14px; }
.ch-prog i { display: block; height: 100%; background: linear-gradient(90deg, #ffb21f, #ffd23f); }
.chapter.here { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); }
.chapter.mini { padding: 12px 14px; opacity: .6; }
.chapter.mini header { margin: 0; }
.chapter.mini header b { font-size: 16px; }
.ch-lock { display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--muted); font-size: 14px; }
.ch-lock svg { width: 16px; height: 16px; }
.ch-lock::after { content: "★"; color: #ffd23f; margin-left: 1px; }
.map-list { padding-bottom: calc(96px + var(--safe-bottom)); }
.map-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(14px + var(--safe-bottom)); background: linear-gradient(180deg, rgba(11, 6, 32, 0), rgba(11, 6, 32, .95) 40%); display: flex; justify-content: center; pointer-events: none; }
.map-foot .btn { pointer-events: auto; width: 100%; max-width: 480px; }
.big-num.word { font-size: 40px; }
