:root {
  --bg: #0a0918;
  --bg-2: #13112b;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.09);
  --border-2: rgba(255, 255, 255, 0.16);
  --text: #f6f4ff;
  --muted: #a7a3cc;
  --dim: #6f6b96;
  --gold: #ffcf5c;
  --gold-2: #ffa63d;
  --a1: #7c5cff;
  --a2: #ff5fa2;
  --a3: #ffb547;
  --grad: linear-gradient(135deg, var(--a1), var(--a2) 55%, var(--a3));
  --grad-gold: linear-gradient(135deg, #fff1b8, #ffcf5c 40%, #ff9f3d);
  --radius: 24px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --out: cubic-bezier(.16, 1, .3, 1);
  --col: 560px;
  --c1: var(--a1);
  --c2: var(--a2);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', system-ui, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.num { font-family: 'Outfit', system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--a2); outline-offset: 3px; border-radius: 10px; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 80% at 50% -10%, #1d1846 0%, var(--bg) 60%); }
.aurora { position: absolute; width: 80vmax; height: 80vmax; border-radius: 50%; opacity: .55; }
.a1 { background: radial-gradient(circle, rgba(124, 92, 255, .45), transparent 62%); top: -40vmax; left: -30vmax; }
.a2 { background: radial-gradient(circle, rgba(255, 95, 162, .32), transparent 62%); top: -30vmax; right: -40vmax; }
.a3 { background: radial-gradient(circle, rgba(255, 181, 71, .2), transparent 62%); bottom: -50vmax; left: -10vmax; }
.stars { position: absolute; inset: 0; background-repeat: repeat; }
.s1 { background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 120px 80px, #fff, transparent), radial-gradient(1.5px 1.5px at 200px 160px, #ffe9b3, transparent), radial-gradient(1px 1px at 60px 200px, #fff, transparent); background-size: 240px 240px; opacity: .35; }
.s2 { background-image: radial-gradient(1px 1px at 50px 90px, #cfc6ff, transparent), radial-gradient(1.5px 1.5px at 170px 20px, #fff, transparent), radial-gradient(1px 1px at 300px 250px, #fff, transparent); background-size: 340px 340px; opacity: .25; }

/* ---------- layout: the app always fits the screen (no page scroll) ---------- */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
#app {
  position: fixed; left: 0; right: 0; top: var(--app-top, 0); margin: 0 auto;
  width: 100%; max-width: var(--col); height: var(--app-h, 100dvh);
  display: flex; flex-direction: column; padding: 0 14px;
}
#view { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 12px 0 10px; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

.topbar {
  flex: none; position: relative; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 -14px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: linear-gradient(to bottom, rgba(10, 9, 24, .85), rgba(10, 9, 24, .4));
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  view-transition-name: topbar;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 30px; height: 30px; filter: drop-shadow(0 4px 14px rgba(255, 95, 162, .45)); }
@media (max-width: 370px) { .brand-name { display: none; } }
.brand-name { white-space: nowrap; font-weight: 900; font-size: 18px; letter-spacing: .04em; background: linear-gradient(90deg, #fff, #ffd9ec 60%, #ffe2a6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); transition: transform .2s var(--spring), background .2s; }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { transform: scale(.9); }
@media (hover: hover) { .icon-btn:hover { background: var(--surface-2); } }

.streak { display: flex; align-items: center; gap: 3px; height: 34px; padding: 0 10px 0 7px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 15px; color: var(--muted); transition: all .3s; }
.flame { width: 18px; height: 18px; fill: #5d5880; transition: fill .4s; }
.flame .flame-in { fill: transparent; }
.streak.lit { color: #ffd8a8; border-color: rgba(255, 138, 61, .35); background: rgba(255, 138, 61, .12); }
.streak.lit .flame { fill: #ff7a2f; filter: drop-shadow(0 0 6px rgba(255, 122, 47, .8)); animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.streak.lit .flame .flame-in { fill: #ffd166; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08, 1.12) rotate(2deg); } }
.streak.ignite { animation: ignite .9s var(--spring); }
@keyframes ignite { 0% { transform: scale(1); } 30% { transform: scale(1.45); box-shadow: 0 0 30px 6px rgba(255, 122, 47, .7); } 100% { transform: scale(1); } }

.lvchip { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 99px; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; position: relative; }
.lv { font-weight: 700; font-size: 11px; color: var(--muted); display: flex; align-items: baseline; gap: 2px; }
.lv b { font-size: 16px; font-weight: 800; color: var(--text); }
.xpbar { width: 50px; height: 7px; border-radius: 9px; background: rgba(255, 255, 255, .1); overflow: hidden; position: relative; }
.xpbar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--grad); box-shadow: 0 0 10px rgba(255, 95, 162, .8); transition: width 1s var(--out); overflow: hidden; }
.xpbar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); transform: translateX(-100%); animation: shimmer 2.4s ease-in-out infinite; }
@keyframes shimmer { 60%, 100% { transform: translateX(200%); } }
.pulse { animation: pulse .6s var(--spring); }
@keyframes pulse { 0% { transform: scale(1); } 35% { transform: scale(1.18); filter: brightness(1.6); } 100% { transform: scale(1); } }

/* ---------- tab bar (in the flow, so content never hides behind it) ---------- */
.tabbar {
  flex: none; align-self: center; margin: 0 0 calc(10px + env(safe-area-inset-bottom)); z-index: 25;
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 26px;
  background: rgba(24, 21, 52, .96); border: 1px solid var(--border-2);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .6);
  view-transition-name: tabbar;
}
.tabbar.hidden { display: none; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 76px; padding: 6px 0 4px; border-radius: 20px; color: var(--dim); font-size: 11px; font-weight: 700; transition: color .25s, background .25s; }
.tabbar a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--text); background: rgba(255, 255, 255, .08); }
.tab-add { width: 52px; height: 52px; border-radius: 18px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 24px -4px rgba(255, 95, 162, .7), inset 0 1px 0 rgba(255, 255, 255, .4); transition: transform .3s var(--spring); }
.tab-add svg { width: 26px; height: 26px; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; fill: none; }
.tab-add:active { transform: scale(.88) rotate(90deg); }

/* ---------- generic ---------- */
.card { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .03)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .07); }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 8px; }
.sec-head h2, .card-head h2 { margin: 0; font-size: 15px; font-weight: 900; letter-spacing: .02em; display: flex; align-items: center; gap: 6px; }
.pill { font-family: 'Outfit'; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.pill.gold { background: rgba(255, 207, 92, .15); color: var(--gold); }
.btn-chip { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border-2); transition: transform .25s var(--spring), background .2s; }
.btn-chip:active { transform: scale(.92); }
.btn-primary { position: relative; overflow: hidden; width: 100%; padding: 16px 20px; border-radius: 18px; background: var(--grad); color: #fff; font-weight: 900; font-size: 16px; letter-spacing: .04em; box-shadow: 0 12px 30px -8px rgba(255, 95, 162, .7), inset 0 1px 0 rgba(255, 255, 255, .35); transition: transform .25s var(--spring), filter .2s, opacity .2s; }
.overlay .btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-100%); animation: sweep 3.2s ease-in-out infinite; }
@keyframes sweep { 55%, 100% { transform: translateX(100%); } }
.btn-primary:active { transform: scale(.96); }
.btn-primary:disabled { opacity: .4; filter: grayscale(.5); pointer-events: none; }
.btn-ghost { width: 100%; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; }
.pressable { transition: transform .3s var(--spring), border-color .25s, box-shadow .3s; }
.pressable:active { transform: scale(.97); }
.rise { animation: rise .8s var(--out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(22px) scale(.98); } }

/* tabs (segmented, with sliding indicator) + swipeable panes */
.tabs { flex: none; position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); padding: 4px; border-radius: 16px; background: rgba(0, 0, 0, .25); border: 1px solid var(--border); }
.tabs button { position: relative; z-index: 1; padding: 8px 4px; font-size: 13px; font-weight: 900; color: var(--dim); border-radius: 12px; transition: color .3s; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.tabs button.on { color: var(--text); }
.tabs .seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: 12px; background: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); transform: translateX(calc(var(--idx, 0) * 100%)); transition: transform .45s var(--spring); }
.panes { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; margin: 0 -14px; }
.panes::-webkit-scrollbar { display: none; }
.pane { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 16px; scrollbar-width: none; }
.pane::-webkit-scrollbar { display: none; }
.panes.single { overflow: hidden; }

/* ---------- home ---------- */
.hero { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 16px 16px 12px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(160deg, rgba(255, 255, 255, .25), transparent 40%, rgba(255, 181, 71, .25)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.hero-head { flex: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: relative; z-index: 1; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .08em; }
.hero-num { font-size: clamp(42px, 8vh, 60px); font-weight: 900; line-height: 1; margin-top: 4px; background: linear-gradient(180deg, #fff 30%, #ffd9a0); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 24px rgba(255, 207, 92, .35)); display: flex; align-items: baseline; gap: 4px; }
.hero-num small { font-family: 'Zen Maru Gothic'; font-size: 17px; color: var(--gold); -webkit-text-fill-color: var(--gold); }
.hero-stats { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.stat-chip { display: flex; align-items: baseline; gap: 6px; padding: 5px 11px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.stat-chip b { font-family: 'Outfit'; font-size: 15px; color: var(--text); font-weight: 800; }
.stat-chip.hot b { color: var(--gold); }
.jar-wrap { position: relative; flex: 1; min-height: 120px; margin: 2px -8px 0; cursor: pointer; touch-action: manipulation; }
.jar-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.jar-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--dim); font-size: 13px; line-height: 1.7; padding-top: 20px; pointer-events: none; }
.jar-empty small { color: var(--gold); opacity: .7; }
.hero-foot { flex: none; position: relative; text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; }
.hero-foot b { color: var(--text); font-family: 'Outfit'; font-size: 15px; }
.hero-foot .up { color: #7df0b8; }
.hero-foot .hint { color: var(--dim); font-size: 11.5px; }

.memo { position: absolute; z-index: 3; width: 210px; transform: translate(-50%, calc(-100% - 16px)); padding: 10px 12px; border-radius: 14px; background: rgba(28, 24, 58, .95); border: 1px solid color-mix(in srgb, var(--c1) 60%, transparent); box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .7), 0 0 20px -6px var(--c1); pointer-events: none; animation: memoIn .45s var(--spring); }
.memo.below { transform: translate(-50%, 16px); }
.memo.out { opacity: 0; transition: opacity .3s; }
@keyframes memoIn { from { opacity: 0; scale: .7; } }
.memo-goal { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memo-text { font-size: 14px; font-weight: 900; line-height: 1.45; margin: 3px 0 5px; word-break: break-word; }
.memo-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); font-family: 'Outfit'; }

@keyframes holo { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.cta-plus { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); flex: none; box-shadow: 0 6px 18px -4px rgba(255, 95, 162, .7); }
.cta-plus svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2.6; fill: none; stroke-linecap: round; }
.trophy-date { font-size: 11.5px; color: var(--gold); margin-top: 4px; font-weight: 700; }
.goal-emoji { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 22px -6px var(--c1), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -6px 12px rgba(0, 0, 0, .12); position: relative; }
.goal-body { flex: 1; min-width: 0; position: relative; }
.goal-title { font-weight: 900; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-meta { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); margin: 3px 0 7px; font-weight: 700; white-space: nowrap; }
.goal-meta .warn, .dh-meta .warn { color: #ff8fa3; }
.bar { height: 7px; border-radius: 9px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 0 12px color-mix(in srgb, var(--c1) 80%, transparent); transition: width 1.3s var(--out); }
.goal-count { position: relative; flex: none; text-align: right; font-size: 26px; font-weight: 800; line-height: 1; min-width: 40px; }
.goal-count small { display: block; font-family: 'Zen Maru Gothic'; font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 3px; }

/* ---------- goal detail ---------- */
.dh { flex: none; padding: 12px; overflow: hidden; }
.dh-glow { position: absolute; inset: -60% -20% auto; height: 160%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c1) 40%, transparent), transparent); opacity: .7; pointer-events: none; animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; } }
.dh-row { position: relative; display: flex; align-items: center; gap: 10px; }
.dh-ring { position: relative; flex: none; width: 72px; height: 72px; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .08); }
.ring-fill { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--out); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c1) 80%, transparent)); }
.dh-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-4px) rotate(4deg); } }
.dh-info { flex: 1; min-width: 0; }
.dh-title { margin: 0 0 4px; font-size: 17px; font-weight: 900; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.dh-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; color: var(--muted); font-weight: 700; }
.dh-meta b { font-size: 15px; color: var(--text); margin-right: 2px; font-weight: 800; display: inline-block; }
.dh-meta .gold b { color: var(--gold); text-shadow: 0 0 14px rgba(255, 207, 92, .5); }
.dh-why { position: relative; margin: 8px 2px 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clear-btn { position: relative; overflow: hidden; width: 100%; margin-top: 10px; padding: 10px; border-radius: 14px; font-weight: 900; font-size: 14px; color: var(--muted); border: 1.5px dashed rgba(255, 207, 92, .35); background: rgba(255, 207, 92, .04); transition: all .4s var(--out); }
.clear-btn.ready { color: #3b2400; border: 0; background: var(--grad-gold); box-shadow: 0 10px 30px -6px rgba(255, 166, 61, .8), inset 0 1px 0 rgba(255, 255, 255, .6); animation: readyPulse 1.8s ease-in-out infinite; }
.clear-btn.ready::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); transform: translateX(-100%); animation: sweep 2.2s ease-in-out infinite; }
@keyframes readyPulse { 50% { transform: scale(1.02); } }
.cleared-banner { position: relative; margin-top: 10px; padding: 10px; border-radius: 14px; background: var(--grad-gold); color: #3b2400; font-weight: 900; text-align: center; box-shadow: 0 10px 30px -10px rgba(255, 166, 61, .8); }

.ai-suggest { width: 100%; margin: 4px 0 10px; padding: 11px; border-radius: 14px; font-weight: 900; font-size: 13.5px; color: #e9e2ff; background: linear-gradient(135deg, rgba(124, 92, 255, .22), rgba(255, 95, 162, .16)); border: 1px solid rgba(160, 130, 255, .35); position: relative; overflow: hidden; transition: transform .25s var(--spring); }
.ai-suggest:active { transform: scale(.97); }

.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.todo-item { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s var(--out), opacity .35s, transform .45s var(--out), margin .45s var(--out); margin-bottom: 8px; }
.todo-inner { overflow: hidden; min-height: 0; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.todo-item.enter { animation: enter .55s var(--spring) both; animation-delay: calc(var(--e, 0) * 90ms); }
@keyframes enter { from { opacity: 0; transform: translateY(14px) scale(.94); } }
.todo-item.collapse { grid-template-rows: 0fr; opacity: 0; transform: translateX(40px) scale(.96); margin-bottom: 0; }
.todo-item.collapse .todo-inner { padding-top: 0; padding-bottom: 0; border-width: 0; }
.todo-text { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.5; word-break: break-word; cursor: pointer; background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-position: 0 55%; background-size: 0% 2px; transition: background-size .45s var(--out) .05s, color .4s; }
.todo-item.checked .todo-text { background-size: 100% 2px; color: var(--muted); }
.todo-item.checked .todo-inner { border-color: color-mix(in srgb, var(--c1) 50%, transparent); background: color-mix(in srgb, var(--c1) 12%, transparent); transition: all .3s; }

.check { flex: none; position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .28); display: grid; place-items: center; transition: border-color .2s, background .2s; }
.check::before { content: ''; position: absolute; inset: -9px; }
.check svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .35s var(--out) .08s; }
.check::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c1); opacity: 0; }
@media (hover: hover) { .check:hover { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 15%, transparent); } .check:hover svg { stroke-dashoffset: 14; stroke: rgba(255,255,255,.5); } }
.todo-item.checked .check { border-color: transparent; background: linear-gradient(135deg, var(--c1), var(--c2)); animation: checkPop .5s var(--spring); box-shadow: 0 0 18px var(--c1); }
.todo-item.checked .check svg { stroke-dashoffset: 0; stroke: #fff; }
.todo-item.checked .check::after { animation: shock .6s var(--out); }
@keyframes checkPop { 0% { transform: scale(.7); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes shock { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
.list-hint { list-style: none; text-align: center; padding: 18px; color: var(--dim); font-size: 13px; border-radius: 18px; border: 1.5px dashed var(--border); line-height: 1.7; }
.list-hint.win { color: var(--gold); border-color: rgba(255, 207, 92, .3); }

/* difficulty stars */
.diff { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 3px 7px; border-radius: 99px; font-size: 11px; font-family: 'Outfit'; font-weight: 800; letter-spacing: 0; line-height: 1.2; color: #c9c3ee; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); white-space: nowrap; }
.diff.t1 { color: #c9c3ee; }
.diff.t2 { color: #ffd9a0; background: rgba(255, 200, 120, .1); }
.diff.t3 { color: #ffd166; background: rgba(255, 207, 92, .14); border-color: rgba(255, 207, 92, .35); text-shadow: 0 0 8px rgba(255, 207, 92, .7); }
.diff.t4 { color: #fff3c4; background: linear-gradient(135deg, rgba(255, 166, 61, .45), rgba(255, 95, 162, .35)); border-color: rgba(255, 220, 140, .6); text-shadow: 0 0 10px rgba(255, 220, 140, 1); }
.diff.t5 { color: #fff; background: linear-gradient(120deg, #ff5fa2, #ffb547, #ffe58a, #7cf0ff, #c18cff); border-color: rgba(255, 255, 255, .7); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); box-shadow: 0 0 14px -2px rgba(255, 200, 120, .9); font-weight: 900; }
.diff.none { color: var(--dim); letter-spacing: 0; }
.diff.pending { gap: 3px; padding: 6px 8px; }
.diff.pending i { width: 4px; height: 4px; border-radius: 50%; background: #b9a8ff; animation: dots 1s ease-in-out infinite; }
.diff.pending i:nth-child(2) { animation-delay: .15s; }
.diff.pending i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.diff.pop { animation: diffPop .7s var(--spring); }
@keyframes diffPop { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }

.timeline { display: flex; flex-direction: column; gap: 14px; }
.tl-day { position: relative; padding-left: 22px; }
.tl-day::before { content: ''; position: absolute; left: 7px; top: 26px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(var(--c1), transparent); opacity: .5; }
.tl-date { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 900; color: var(--muted); margin: 0 0 8px -22px; }
.tl-date::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 0 10px var(--c1); }
.tl-date span { font-family: 'Outfit'; color: var(--gold); }
.tl-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; margin-bottom: 6px; border-radius: 14px; background: rgba(255, 255, 255, .035); cursor: pointer; transition: background .2s; }
.tl-item:active { background: rgba(255, 255, 255, .07); }
.tl-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c1) 30%, transparent); }
.tl-dot svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.tl-item.log .tl-dot { background: rgba(255, 207, 92, .25); }
.tl-item.log .tl-dot svg { stroke: var(--gold); }
.tl-text { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.5; word-break: break-word; }
.tl-item time { flex: none; font-family: 'Outfit'; font-size: 11.5px; color: var(--dim); }
.tl-item.pop { animation: popIn .8s var(--spring); }
@keyframes popIn { 0% { opacity: 0; transform: scale(.6) translateY(-12px); background: rgba(255, 207, 92, .5); } 50% { opacity: 1; background: rgba(255, 207, 92, .3); } 100% { background: rgba(255, 255, 255, .035); } }

/* composer (in the flow at the bottom of the goal screen) */
.composer { flex: none; margin-bottom: env(safe-area-inset-bottom); }
.composer-box { display: flex; gap: 8px; align-items: center; padding: 7px; border-radius: 22px; background: rgba(28, 25, 58, .82); border: 1px solid var(--border-2); box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, .6); }
.composer-box input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 16px; border: 1px solid var(--border); background: rgba(255, 255, 255, .06); font-size: 16px; outline: none; transition: border-color .2s, background .2s; }
.composer-box input:focus { border-color: color-mix(in srgb, var(--c1) 70%, transparent); background: rgba(255, 255, 255, .09); }
.composer-box input::placeholder { color: var(--dim); font-size: 14px; }
.send { flex: none; width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 6px 18px -4px var(--c1); transition: transform .3s var(--spring), background .3s; }
.send svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.send:active { transform: scale(.85); }
.composer.done-mode .send { background: var(--grad-gold); box-shadow: 0 6px 22px -4px rgba(255, 166, 61, .9); }
.composer.done-mode .send svg { stroke: #3b2400; }
.composer.done-mode input:focus { border-color: rgba(255, 207, 92, .6); }

/* AI suggestion sheet */
.sugg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sugg { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border-radius: 16px; text-align: left; background: var(--surface); border: 1.5px solid var(--border); transition: all .25s var(--out); animation: enter .5s var(--spring) both; animation-delay: calc(var(--k, 0) * 70ms); }
.sugg.on { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 16%, transparent); }
.sugg-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .28); display: grid; place-items: center; transition: all .25s; }
.sugg-check svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.sugg.on .sugg-check { background: linear-gradient(135deg, var(--c1), var(--c2)); border-color: transparent; }
.sugg.on .sugg-check svg { opacity: 1; }
.sugg-text { flex: 1; font-size: 14px; font-weight: 700; line-height: 1.45; }
.sugg.skeleton { height: 50px; background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .1), rgba(255, 255, 255, .04)); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- records ---------- */
.records .page { display: flex; flex-direction: column; gap: 10px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { padding: 11px 13px; border-radius: 18px; overflow: hidden; }
.tile-val { font-size: 26px; font-weight: 800; margin-top: 2px; line-height: 1.05; }
.tile-val small { font-family: 'Zen Maru Gothic'; font-size: 12px; color: var(--muted); margin-left: 3px; }
.tile-label { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.tile.feature { grid-column: span 2; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, rgba(124, 92, 255, .3), rgba(255, 95, 162, .2) 60%, rgba(255, 181, 71, .2)); }
.tile.feature .tile-val { font-size: 40px; }
.tile-side { text-align: right; }
.tile-side b { display: block; font-size: 20px; font-weight: 800; color: var(--gold); }
.tile-side span { font-size: 12px; color: var(--muted); font-family: 'Outfit'; }
.records .card { padding: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.card-head span { font-size: 12px; color: var(--muted); font-weight: 700; }
.chart-card { flex: 1; min-height: 150px; display: flex; flex-direction: column; }
.chart { position: relative; flex: 1; min-height: 80px; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .draw { animation: wipe 1.8s var(--out) both .2s; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.chart-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 207, 92, .35), 0 0 20px 4px rgba(255, 207, 92, .8); animation: dotIn .6s var(--spring) both 1.8s; }
@keyframes dotIn { from { transform: scale(0); } }
.chart-label { position: absolute; transform: translate(calc(-100% - 14px), -30%); font-family: 'Outfit'; font-weight: 800; font-size: 20px; color: var(--gold); white-space: nowrap; animation: rise .6s var(--out) both 1.9s; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: 6px; font-family: 'Outfit'; }

.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heatmap i { aspect-ratio: 1; border-radius: 3px; background: rgba(255, 255, 255, .06); animation: cellIn .5s var(--spring) both; animation-delay: calc(var(--c) * 22ms); cursor: pointer; }
.heatmap i.l1 { background: rgba(124, 92, 255, .45); }
.heatmap i.l2 { background: rgba(176, 92, 230, .7); }
.heatmap i.l3 { background: #ff5fa2; box-shadow: 0 0 6px rgba(255, 95, 162, .6); }
.heatmap i.l4 { background: #ffcf5c; box-shadow: 0 0 8px rgba(255, 207, 92, .8); }
.heatmap i.today { outline: 1.5px solid #fff; outline-offset: 1px; }
.heatmap i.future { visibility: hidden; }
@keyframes cellIn { from { transform: scale(0); opacity: 0; } }
.hm-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 11px; color: var(--dim); }
.hm-legend { display: flex; gap: 3px; align-items: center; }
.hm-legend i { width: 10px; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, .06); }
.hm-tip { color: var(--text); font-weight: 700; min-height: 1em; }


.gbars { display: flex; flex-direction: column; gap: 10px; }
.gbar-top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; gap: 10px; }
.gbar-top span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gbar-top b { font-family: 'Outfit'; }

.badges { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.badge { position: relative; padding: 8px 2px 7px; border-radius: 14px; text-align: center; background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: transform .25s var(--spring); }
.badge:active { transform: scale(.94); }
.badge-icon { position: relative; width: 36px; height: 36px; margin: 0 auto 4px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.badge.on .badge-icon { background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .25), rgba(255, 255, 255, .03)); }
.badge.on .badge-icon::before { content: ''; position: absolute; inset: -2px; border-radius: 50%; padding: 2px; background: conic-gradient( #ffcf5c, #ff5fa2, #7c5cff, #22c3ff, #2ed6a1, #ffcf5c); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spinT 6s linear infinite; }
@keyframes spinT { to { transform: rotate(360deg); } }
.badge.on { border-color: rgba(255, 207, 92, .25); background: linear-gradient(170deg, rgba(255, 207, 92, .1), rgba(255, 255, 255, .03)); }
.badge.off .badge-icon { filter: grayscale(1) brightness(.5); opacity: .5; background: rgba(255, 255, 255, .04); }
.badge-name { font-size: 9.5px; letter-spacing: -.02em; font-weight: 900; line-height: 1.3; }
.badge.off .badge-name { color: var(--dim); }
.badge-hint { text-align: center; color: var(--dim); font-size: 11.5px; margin: 4px 0 0; }


/* ---------- toasts ---------- */
#toasts { position: fixed; top: calc(64px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: rgba(30, 26, 62, .97); border: 1px solid var(--border-2); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .7); font-size: 14px; font-weight: 700; animation: toastIn .6s var(--spring); max-width: 100%; }
.toast.out { animation: toastOut .4s var(--out) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px) scale(.95); } }
.toast .t-icon { font-size: 22px; }
.toast small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.toast.praise { border-color: rgba(160, 130, 255, .45); background: linear-gradient(135deg, rgba(44, 34, 92, .96), rgba(30, 26, 62, .96)); }
.toast.praise small { color: #b9a8ff; letter-spacing: .06em; }
.toast button { margin-left: auto; padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, .1); font-weight: 900; font-size: 13px; color: var(--gold); white-space: nowrap; }
.badge-toast { position: relative; overflow: hidden; border-color: rgba(255, 207, 92, .5); background: linear-gradient(135deg, rgba(70, 50, 20, .95), rgba(40, 26, 70, .95)); padding: 12px 18px 12px 12px; }
.badge-toast::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 240, 200, .35) 50%, transparent 70%); transform: translateX(-100%); animation: sweep 1.6s ease-in-out .3s; }
.bt-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .3), rgba(255, 207, 92, .15)); box-shadow: 0 0 20px rgba(255, 207, 92, .5); animation: checkPop .7s var(--spring) .15s both; }
.bt-eyebrow { font-family: 'Outfit'; font-size: 11px; letter-spacing: .14em; color: var(--gold); font-weight: 800; }
.bt-name { font-size: 15px; font-weight: 900; }

/* ---------- float text ---------- */
.float-text { position: fixed; z-index: 65; pointer-events: none; transform: translate(-50%, -50%); font-family: 'Outfit'; font-weight: 900; white-space: nowrap; animation: floatUp 1.1s var(--out) forwards; }
.float-text.xp { font-size: 18px; color: var(--gold); text-shadow: 0 0 12px rgba(255, 207, 92, .8), 0 2px 0 rgba(0, 0, 0, .3); }
.float-text.combo { font-size: 30px; font-style: italic; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgba(255, 95, 162, .7)); animation: comboUp 1.3s var(--spring) forwards; }
.float-text.add { font-size: 15px; color: #c9bfff; }
.float-text.judge { font-size: 13px; color: #c9bfff; font-family: 'Zen Maru Gothic'; text-shadow: 0 0 10px rgba(124, 92, 255, .9); }
.float-text.reveal { font-size: 20px; letter-spacing: -1px; }
.float-text.big { font-size: 34px; font-family: 'Zen Maru Gothic'; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(255, 166, 61, .9)); animation: comboUp 1.5s var(--spring) forwards; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
@keyframes comboUp { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-8deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(-4deg); } 70% { opacity: 1; transform: translate(-50%, -90%) scale(1) rotate(-4deg); } 100% { opacity: 0; transform: translate(-50%, -150%) scale(.9) rotate(-4deg); } }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 24px; background: rgba(6, 5, 16, .86); animation: fadeIn .4s ease both; overflow: hidden; }
.overlay.out { animation: fadeOut .4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.rays { position: absolute; left: 50%; top: 42%; width: 200vmax; height: 200vmax; margin: -100vmax 0 0 -100vmax; background: repeating-conic-gradient(from 0deg, rgba(255, 207, 92, .16) 0deg 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle, #000 0%, transparent 32%); mask: radial-gradient(circle, #000 0%, transparent 32%); animation: rotate 30s linear infinite, raysIn 1s var(--out) both; }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes raysIn { from { opacity: 0; scale: .3; } }
.ov-card { position: relative; text-align: center; max-width: 380px; width: 100%; }
.ov-eyebrow { font-family: 'Outfit'; font-weight: 900; letter-spacing: .18em; font-size: 15px; color: var(--gold); text-shadow: 0 0 20px rgba(255, 207, 92, .7); }
.ov-title { font-family: 'Outfit'; font-weight: 900; font-size: clamp(40px, 12vw, 62px); line-height: 1; margin: 8px 0; display: flex; justify-content: center; flex-wrap: wrap; }
.ov-title span { display: inline-block; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 20px rgba(255, 166, 61, .6)); animation: letter .7s var(--spring) both; animation-delay: calc(.35s + var(--k) * 55ms); }
.ov-title span.sp { width: .3em; }
@keyframes letter { from { opacity: 0; transform: translateY(-60px) scale(.4) rotate(-20deg); } }
.ov-sub { color: var(--muted); font-size: 15px; font-weight: 700; margin: 6px 0 22px; line-height: 1.6; animation: rise .8s var(--out) both 1s; }
.ov-sub strong { color: var(--text); font-size: 18px; }
.ov-card .btn-primary { animation: rise .8s var(--out) both 1.6s; }
.ov-stats { display: flex; gap: 8px; justify-content: center; margin-bottom: 22px; animation: rise .8s var(--out) both 1.2s; }
.ov-stats div { flex: 1; padding: 12px 6px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid var(--border); }
.ov-stats b { display: block; font-family: 'Outfit'; font-size: 26px; font-weight: 800; color: var(--gold); }
.ov-stats span { font-size: 11px; color: var(--muted); font-weight: 700; }

.trophy-art { position: relative; width: 150px; height: 150px; margin: 0 auto 6px; animation: trophyIn 1.1s var(--spring) both .1s; }
.trophy-art svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 30px rgba(255, 166, 61, .7)); }
.trophy-art .t-emoji { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); font-size: 34px; }
@keyframes trophyIn { 0% { opacity: 0; transform: translateY(-120px) scale(.3) rotate(-30deg); } 70% { transform: translateY(6px) scale(1.08) rotate(4deg); } 100% { opacity: 1; transform: none; } }

.lv-big { position: relative; height: 150px; font-size: 140px; font-weight: 900; line-height: 150px; overflow: hidden; }
.lv-big span { position: absolute; inset: 0; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 30px rgba(255, 166, 61, .7)); }
.lv-from { animation: lvOut .5s var(--out) forwards .6s; }
.lv-to { animation: lvIn .9s var(--spring) both .85s; }
@keyframes lvOut { to { transform: translateY(-110%); opacity: 0; } }
@keyframes lvIn { from { transform: translateY(100%) scale(.5); opacity: 0; } }
.lv-label { font-family: 'Outfit'; font-weight: 800; font-size: 16px; letter-spacing: .2em; color: var(--muted); }

.milestone .ms-num, .bigresult .ms-num { font-family: 'Outfit'; font-size: clamp(90px, 30vw, 150px); font-weight: 900; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 40px rgba(255, 95, 162, .7)); animation: msIn 1s var(--spring) both .1s; }
@keyframes msIn { from { opacity: 0; transform: scale(3); filter: blur(20px); } }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 4, 14, .7); opacity: 0; transition: opacity .35s; }
.sheet { position: absolute; left: 50%; bottom: 0; width: min(100%, var(--col)); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: linear-gradient(180deg, #1f1b44, #15122f); border: 1px solid var(--border-2); border-bottom: 0; box-shadow: 0 -30px 60px -20px rgba(0, 0, 0, .7); transform: translate(-50%, 100%); transition: transform .5s var(--out); }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: translate(-50%, 0); }
.sheet-wrap.closing .sheet { transition-duration: .3s; }
.sheet-handle { width: 42px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .2); margin: 4px auto 14px; }
.sheet h3 { margin: 0 0 16px; font-size: 19px; font-weight: 900; }
.sheet p.body { margin: -6px 0 18px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.action { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 15px; text-align: left; transition: background .2s, transform .2s var(--spring); }
.action:active { transform: scale(.98); background: var(--surface-2); }
.action.danger { color: #ff8fa3; }
.action .a-icon { width: 22px; text-align: center; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.btn-danger { padding: 15px; border-radius: 16px; background: linear-gradient(135deg, #ff3d63, #ff7a7a); font-weight: 900; box-shadow: 0 10px 26px -8px rgba(255, 61, 99, .7); }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 13px; font-weight: 900; margin-bottom: 8px; color: var(--muted); }
.field em { font-style: normal; font-weight: 700; color: var(--dim); font-size: 11px; margin-left: 6px; }
.field input, .field textarea { width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border-2); background: rgba(0, 0, 0, .2); font-size: 16px; outline: none; resize: none; transition: border-color .2s; }
.field input:focus, .field textarea:focus { border-color: var(--c1); }
.field input[type=date] { color-scheme: dark; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin: -8px 0 18px; }
.chip { font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: all .2s; }
.chip:active { transform: scale(.94); color: var(--text); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 14px; font-size: 22px; background: var(--surface); border: 1.5px solid transparent; transition: transform .3s var(--spring), border-color .2s, background .2s; }
.emoji-grid button.sel { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 25%, transparent); transform: scale(1.08); }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-row button { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--sw1), var(--sw2)); transition: transform .3s var(--spring); box-shadow: 0 4px 12px -2px var(--sw1); }
.color-row button.sel { transform: scale(1.18); box-shadow: 0 0 0 3px #15122f, 0 0 0 5px #fff, 0 6px 18px var(--sw1); }
.gf-preview { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; margin-bottom: 18px; background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--c1) 25%, transparent), transparent 60%), var(--surface); border: 1px solid var(--border); }
.gf-preview .goal-emoji { transition: background .4s; }
.gf-preview .goal-emoji span { display: inline-block; animation: checkPop .4s var(--spring); }
.gf-title { font-weight: 900; font-size: 16px; min-width: 0; word-break: break-word; }
.gf-title.ph { color: var(--dim); }

.set-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--border); font-weight: 700; }
.set-row small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.switch { position: relative; width: 52px; height: 32px; border-radius: 99px; background: rgba(255, 255, 255, .15); transition: background .3s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .4s var(--spring); }
.switch.on { background: var(--grad); }
.switch.on::after { transform: translateX(20px); }
.set-actions { display: grid; gap: 8px; margin-top: 18px; }
.about { text-align: center; color: var(--dim); font-size: 12px; margin-top: 18px; line-height: 1.7; }

/* ---------- top bar left / goal rows ---------- */
.top-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
@media (max-width: 420px) { .brand-name { display: none; } }
.btn-chip { display: inline-flex; align-items: center; gap: 5px; }
.btn-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.goals-sec { flex: none; }
.goal-rows { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: none; position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 18px; text-align: left; overflow: hidden; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03)); border: 1px solid var(--border); transition: transform .45s var(--out), border-color .2s; }
.grow::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 160% at 0% 50%, color-mix(in srgb, var(--c1) 20%, transparent), transparent 55%); pointer-events: none; }
.grow .goal-emoji { width: 40px; height: 40px; border-radius: 13px; font-size: 21px; }
.grow-body { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.grow-title { font-weight: 900; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow-meta { display: flex; gap: 10px; font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; }
.grow-meta .up { color: #7df0b8; }
.grow-meta.gold { color: var(--gold); }
.grow .bar { height: 6px; }
.grow-count { position: relative; flex: none; text-align: right; font-size: 22px; font-weight: 800; line-height: 1; min-width: 36px; }
.grow-count small { display: block; font-family: 'Zen Maru Gothic'; font-size: 9.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.grow.cur { border-color: color-mix(in srgb, var(--c1) 70%, transparent); background: color-mix(in srgb, var(--c1) 14%, rgba(255, 255, 255, .03)); }
.grow.done { background: linear-gradient(160deg, rgba(255, 207, 92, .12), rgba(255, 255, 255, .02) 60%); border-color: rgba(255, 207, 92, .22); }
.grow.cta { --c1: #2ed6a1; --c2: #a6f28b; border-style: dashed; border-color: rgba(46, 214, 161, .45); }
.cta-plus { position: relative; width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--grad); flex: none; box-shadow: 0 6px 18px -4px rgba(255, 95, 162, .7); }
.cta-plus svg { width: 21px; height: 21px; stroke: #fff; stroke-width: 2.6; fill: none; stroke-linecap: round; }
@media (hover: hover) { .grow:hover { border-color: var(--border-2); transform: translateX(3px); } }

/* long press: elements shrink while held, and must not open the OS menu */
[data-lp] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.grow.pressing, .todo-item.pressing .todo-inner, .tl-item.pressing { transform: scale(.96); transition: transform .45s var(--out); }
.tab-add.pressing { transform: scale(1.14); box-shadow: 0 0 0 8px rgba(255, 207, 92, .25), 0 0 30px 6px rgba(255, 166, 61, .7); transition: transform .45s var(--out), box-shadow .45s var(--out); }

/* ---------- left drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 45; visibility: hidden; }
.drawer.visible { visibility: visible; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(5, 4, 14, .7); opacity: 0; transition: opacity .32s; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.dragging .drawer-scrim { opacity: var(--p, 0); transition: none; }
.drawer-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(86vw, 360px); display: flex; flex-direction: column; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #1d1942, #14112d); border-right: 1px solid var(--border-2); box-shadow: 20px 0 60px -20px rgba(0, 0, 0, .8); transform: translateX(-100%); transition: transform .32s var(--out); }
.drawer.open .drawer-panel { transform: none; }
.drawer.dragging .drawer-panel { transition: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; }
.dr-head h2 { margin: 0; font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.dr-new { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-radius: 16px; font-weight: 900; font-size: 14px; color: #fff; background: var(--grad); box-shadow: 0 8px 22px -8px rgba(255, 95, 162, .8); }
.dr-new svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 2.6; fill: none; stroke-linecap: round; }
.dr-search { width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--border-2); background: rgba(0, 0, 0, .25); font-size: 15px; outline: none; }
.dr-search:focus { border-color: var(--a1); }
.dr-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; margin: 0 -4px; padding: 2px 4px 8px; scrollbar-width: thin; }
.dr-cleared { flex: none; margin-top: 6px; }
.dr-cleared summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 4px; font-weight: 900; font-size: 13.5px; color: var(--gold); }
.dr-cleared summary::-webkit-details-marker { display: none; }
.dr-cleared summary::after { content: '›'; margin-left: auto; transition: transform .25s; font-size: 18px; }
.dr-cleared[open] summary::after { transform: rotate(90deg); }
.dr-cleared .grow { margin-bottom: 8px; }
.dr-empty { color: var(--dim); text-align: center; font-size: 13px; padding: 18px 0; margin: 0; }
.dr-tip { margin: 0; font-size: 11.5px; color: var(--dim); text-align: center; }

/* ---------- quick add ---------- */
.qa-tabs { margin-bottom: 12px; }
.qa-goals { display: flex; flex-wrap: wrap; gap: 6px; max-height: 108px; overflow-y: auto; overscroll-behavior: contain; margin-bottom: 12px; padding: 2px; }
.qa-goal { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 7px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1.5px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all .2s; }
.qa-goal.on { color: var(--text); border-color: var(--c1); background: color-mix(in srgb, var(--c1) 22%, transparent); box-shadow: 0 0 14px -4px var(--c1); }
.qa-goal.new { border-style: dashed; color: #7df0b8; border-color: rgba(46, 214, 161, .45); }
.qa-form { display: flex; gap: 8px; align-items: flex-end; }
.qa-form textarea { flex: 1; min-width: 0; min-height: 52px; max-height: 30vh; padding: 13px 14px; border-radius: 16px; border: 1px solid var(--border-2); background: rgba(0, 0, 0, .22); font-size: 16px; line-height: 1.5; outline: none; resize: none; field-sizing: content; }
.qa-form textarea:focus { border-color: var(--c1); }
.qa-form.done-mode .send { background: var(--grad-gold); box-shadow: 0 6px 22px -4px rgba(255, 166, 61, .9); }
.qa-form.done-mode .send svg { stroke: #3b2400; }
.qa-hint { margin: 8px 2px 0; font-size: 11.5px; color: var(--dim); }
.qa-log { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.qa-done { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 12px; font-size: 13px; background: rgba(46, 214, 161, .1); border: 1px solid rgba(46, 214, 161, .25); animation: enter .5s var(--spring); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-done span { margin-left: auto; color: #7df0b8; font-size: 11.5px; font-weight: 700; flex: none; }

/* ---------- difficulty sheet + histogram ---------- */
.muted { color: var(--muted); font-weight: 700; font-size: .8em; }
.diff-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.diff-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px 8px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--border); transition: transform .25s var(--spring); }
.diff-opt:active { transform: scale(.92); }
.diff-opt b { font-size: 17px; font-weight: 800; }
.diff-opt span { font-size: 9.5px; font-weight: 700; color: var(--muted); white-space: nowrap; letter-spacing: -.03em; }
.diff-opt small { font-size: 10px; color: var(--dim); font-family: 'Outfit'; }
.diff-opt.t1 b { color: #c9c3ee; }
.diff-opt.t2 b { color: #ffd9a0; }
.diff-opt.t3 b { color: #ffd166; }
.diff-opt.t4 b { color: #ffb547; }
.diff-opt.t5 b { background: linear-gradient(120deg, #ff5fa2, #ffb547, #7cf0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.diff-opt.sel { border-color: var(--a2); background: rgba(255, 95, 162, .14); box-shadow: 0 0 16px -4px var(--a2); }
.diff-legend { font-size: 11.5px; color: var(--dim); text-align: center; margin: 10px 0; }
.hist { display: flex; align-items: flex-end; gap: 5px; height: 110px; }
.hcol { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.hcol b { font-size: 10.5px; color: var(--muted); min-height: 13px; }
.hcol i { width: 100%; height: max(3px, var(--h)); border-radius: 5px 5px 2px 2px; transform-origin: bottom; animation: growY .9s var(--out) both; }
.hcol span { font-family: 'Outfit'; font-size: 10.5px; color: var(--dim); }
.hcol i.t1 { background: #7a6fd6; }
.hcol i.t2 { background: #c86fd8; }
.hcol i.t3 { background: #ff8a5c; }
.hcol i.t4 { background: linear-gradient(#ffe08a, #ffb547); box-shadow: 0 0 10px rgba(255, 181, 71, .6); }
.hcol i.t5 { background: linear-gradient(#7cf0ff, #ff5fa2, #ffb547); box-shadow: 0 0 12px rgba(255, 200, 120, .8); }
@keyframes growY { from { transform: scaleY(0); } }

/* ---------- settings + AI ---------- */
.set-ai { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 16px; text-align: left; margin-bottom: 4px; background: linear-gradient(135deg, rgba(124, 92, 255, .2), rgba(255, 95, 162, .12)); border: 1px solid rgba(160, 130, 255, .35); }
.set-ai > span:first-child { font-size: 24px; }
.set-ai b { display: block; font-size: 15px; }
.set-ai small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.set-ai .chev { margin-left: auto; font-size: 22px; color: var(--muted); }
.prov-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.prov { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; text-align: left; background: var(--surface); border: 1.5px solid var(--border); transition: border-color .2s, background .2s; min-width: 0; }
.prov-icon { font-size: 22px; flex: none; }
.prov b { display: block; font-size: 14px; }
.prov small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.prov-dot { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-2); }
.prov.on { border-color: var(--a2); background: rgba(255, 95, 162, .1); }
.prov.on .prov-dot { background: var(--a2); border-color: var(--a2); box-shadow: 0 0 8px var(--a2); }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; min-width: 0; font-family: 'Outfit', monospace; }
.key-link { display: inline-block; font-size: 12.5px; color: #b9a8ff; margin: -8px 0 12px 2px; }
.ai-std { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; line-height: 1.7; color: var(--muted); margin-bottom: 14px; }
.ai-std b { color: var(--text); }
#modelBox { margin: 10px 0; }
.model-cur { padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, .2); font-size: 13px; }
.model-cur small { display: block; color: var(--dim); font-family: 'Outfit'; margin-top: 2px; word-break: break-all; }
.model-search { width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--border-2); background: rgba(0, 0, 0, .25); font-size: 15px; outline: none; margin-bottom: 8px; }
.model-list { max-height: 34vh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.model { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--border); }
.model.on { border-color: var(--a2); background: rgba(255, 95, 162, .12); }
.model-name { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 13.5px; }
.model-name em { font-style: normal; font-family: 'Outfit'; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 1px 6px; border-radius: 99px; color: #3b2400; background: var(--grad-gold); }
.model small { display: block; font-size: 10.5px; color: var(--dim); font-family: 'Outfit'; margin-top: 2px; word-break: break-all; }
.model-note { font-size: 11px; color: var(--dim); margin: 6px 2px 0; }
.ai-test { padding: 12px; border-radius: 14px; font-size: 13px; line-height: 1.6; margin-bottom: 10px; background: rgba(255, 255, 255, .05); }
.ai-test.ok { background: rgba(46, 214, 161, .1); border: 1px solid rgba(46, 214, 161, .3); }
.ai-test.ng { background: rgba(255, 61, 99, .1); border: 1px solid rgba(255, 61, 99, .3); color: #ffb3c1; }
.ai-note { font-size: 11.5px; color: var(--dim); line-height: 1.6; margin: 12px 2px 0; }

/* ---------- tab bar with 5 items ---------- */
.tabbar a { width: 62px; }
@media (max-width: 360px) { .tabbar a { width: 54px; font-size: 10px; } }
.play-chip { color: #ffe2a6; text-decoration: none; border: 1px solid rgba(255, 207, 92, .3); }
.play-chip b { color: var(--gold); }

/* ---------- recurring tasks ---------- */
.rep-chip { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 700; color: #9fe7ff; background: rgba(24, 184, 255, .12); border: 1px solid rgba(24, 184, 255, .3); vertical-align: 1px; white-space: nowrap; }
.rep-chip svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rep-chip.over { color: #ffb3c1; background: rgba(255, 61, 99, .12); border-color: rgba(255, 61, 99, .3); }
.todo-item.rep .todo-inner { border-color: rgba(24, 184, 255, .25); background: linear-gradient(90deg, rgba(24, 184, 255, .08), var(--surface)); }
.rep-later { list-style: none; margin-top: 10px; padding: 10px 12px; border-radius: 16px; border: 1.5px dashed rgba(24, 184, 255, .25); }
.rep-later-h { font-size: 12px; font-weight: 900; color: #9fe7ff; margin-bottom: 6px; }
.rep-row { display: flex; align-items: center; gap: 8px; padding: 7px 2px; font-size: 13.5px; color: var(--muted); cursor: pointer; border-top: 1px solid var(--border); }
.rep-row:first-of-type { border-top: 0; }
.rep-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-when { flex: none; font-size: 11px; color: var(--dim); }
.rep-btn { flex: none; height: 46px; min-width: 46px; padding: 0 10px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: rgba(255, 255, 255, .06); border: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 900; transition: all .25s; }
.rep-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rep-btn span:empty { display: none; }
.rep-btn.on { color: #9fe7ff; border-color: rgba(24, 184, 255, .5); background: rgba(24, 184, 255, .14); }
.rep-btn[hidden] { display: none; }
.qa-form .rep-btn { height: 52px; }
.rep-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.chip-opt { padding: 12px 6px; border-radius: 14px; font-weight: 900; font-size: 13.5px; background: var(--surface); border: 1.5px solid var(--border); color: var(--muted); transition: all .2s; }
.chip-opt.on { color: var(--text); border-color: #18b8ff; background: rgba(24, 184, 255, .15); box-shadow: 0 0 16px -6px #18b8ff; }
.wd-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.wd { aspect-ratio: 1; border-radius: 50%; font-weight: 900; background: var(--surface); border: 1.5px solid var(--border); color: var(--muted); }
.wd.on { color: #fff; background: linear-gradient(135deg, #18b8ff, #7cf0ff); border-color: transparent; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; font-weight: 700; color: var(--muted); }
.stepper button { width: 44px; height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-2); font-size: 22px; font-weight: 700; color: var(--text); }
.stepper b { font-size: 30px; color: var(--text); min-width: 44px; text-align: center; }
.rep-preview { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; min-height: 1.4em; }
.rep-preview b { color: #9fe7ff; }
.rep-today { flex: none; display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; border-radius: 16px; color: #d6f6ff; background: linear-gradient(135deg, rgba(24, 184, 255, .2), rgba(124, 92, 255, .14)); border: 1px solid rgba(24, 184, 255, .35); font-weight: 900; font-size: 14px; }
.rep-today svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rep-today b { margin-left: auto; color: #7cf0ff; font-size: 14px; }
.rep-today i { font-style: normal; color: var(--muted); font-size: 18px; }
.rep-due { color: #7cf0ff; }
.rd-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.rd-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: all .45s var(--out); }
.rd-row.checked .check { border-color: transparent; background: linear-gradient(135deg, var(--c1), var(--c2)); animation: checkPop .5s var(--spring); }
.rd-row.checked .check svg { stroke-dashoffset: 0; }
.rd-row.collapse { opacity: 0; transform: translateX(40px); height: 0; padding: 0; margin: -4px 0; border-width: 0; overflow: hidden; }
.rd-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rd-body b { font-size: 14.5px; }
.rd-body small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-body .rep-chip { margin-left: 0; }
.float-text.ammo { font-size: 14px; color: #ffe2a6; text-shadow: 0 0 10px rgba(255, 166, 61, .8); }

/* ---------- badges page ---------- */
.badges-screen { gap: 10px; }
.bsum { flex: none; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; padding: 14px 16px; }
.bsum-num { font-size: 36px; font-weight: 800; line-height: 1.1; }
.bsum-num small { font-size: 16px; color: var(--muted); }
.bsum-tiers { display: flex; gap: 5px; }
.tdot { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font-family: 'Outfit'; font-weight: 800; font-size: 12px; color: #1b1530; }
.bsum .bar { grid-column: span 2; height: 8px; }
.gold-bar i { background: linear-gradient(90deg, #ffb547, #ffe58a); box-shadow: 0 0 12px rgba(255, 207, 92, .6); }
.badges-pane { flex: 1; min-height: 0; margin: 0 -14px; padding: 2px 14px 20px; overflow-y: auto; }
.near h2, .bcat h2 { margin: 14px 2px 8px; font-size: 14.5px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.near-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; margin-bottom: 6px; border-radius: 16px; text-align: left; background: var(--surface); border: 1px solid var(--border); }
.near-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: rgba(255, 255, 255, .06); flex: none; filter: grayscale(.4); }
.near-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.near-body b { font-size: 13.5px; }
.near-body small { font-size: 11px; color: var(--muted); }
.near-left { flex: none; font-size: 11px; color: var(--muted); text-align: right; }
.near-left b { display: block; font-size: 18px; color: var(--gold); }
.bprog { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 4px; width: 100%; }
.bprog i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7c5cff, #ff5fa2); }
.badge .bprog { margin: 5px auto 0; width: 80%; }
/* rarity colours */
.tier1 { --tc: #d39060; } .tier2 { --tc: #cfd8ea; } .tier3 { --tc: #ffcf5c; } .tier4 { --tc: #7cf0ff; } .tier5 { --tc: #ff7ad1; }
.tdot { background: var(--tc); }
.tdot.tier5 { background: linear-gradient(120deg, #ff5fa2, #ffb547, #7cf0ff, #c18cff); }
.badge.on .badge-icon::before { background: var(--tc); }
.badge.on.tier5 .badge-icon::before { background: conic-gradient(#ffcf5c, #ff5fa2, #7c5cff, #22c3ff, #2ed6a1, #ffcf5c); }
.badge.on { border-color: color-mix(in srgb, var(--tc) 45%, transparent); background: linear-gradient(170deg, color-mix(in srgb, var(--tc) 14%, transparent), rgba(255, 255, 255, .03)); }
.badge.on .badge-name { color: color-mix(in srgb, var(--tc) 55%, #fff); }
.badge-toast.tier4, .badge-toast.tier5 { border-color: var(--tc); box-shadow: 0 0 30px -6px var(--tc), 0 16px 40px -10px rgba(0, 0, 0, .7); }
.badge-toast .bt-eyebrow { color: var(--tc, var(--gold)); }
.toast.tier1 .t-icon, .toast.tier2 .t-icon, .toast.tier3 .t-icon, .toast.tier4 .t-icon, .toast.tier5 .t-icon { filter: drop-shadow(0 0 8px var(--tc)); }

/* ---------- play ---------- */
.play { gap: 10px; }
.play-head { flex: none; display: flex; align-items: center; gap: 8px; }
.pchip { display: flex; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; }
.pchip b { font-size: 18px; font-weight: 800; }
.pchip small { font-size: 10.5px; color: var(--muted); }
.pchip.pc-stars b { color: var(--gold); }
.pchip.pc-ammo b { color: #ffe2a6; }
.shop-btn { margin-left: auto; }
.board-wrap { position: relative; flex: 1; min-height: 200px; border-radius: 22px; overflow: hidden; border: 1px solid var(--border-2); box-shadow: inset 0 0 40px rgba(0, 0, 0, .5), 0 18px 50px -20px rgba(0, 0, 0, .8); touch-action: none; }
.board-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.sess { position: absolute; top: 40px; right: 10px; padding: 4px 10px; border-radius: 99px; background: rgba(0, 0, 0, .45); font-size: 12px; font-weight: 700; color: var(--muted); opacity: 0; transition: opacity .3s; pointer-events: none; }
.sess.on { opacity: 1; }
.sess b { color: var(--gold); font-size: 14px; }
.fever-banner { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-6deg); font-family: 'Outfit'; font-weight: 900; font-style: italic; font-size: 44px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(255, 95, 162, .8)); animation: feverPulse .5s ease-in-out infinite alternate; pointer-events: none; }
.fever-banner[hidden] { display: none; }
@keyframes feverPulse { to { transform: translate(-50%, -50%) rotate(-6deg) scale(1.12); } }
.board-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.8; background: rgba(10, 9, 24, .6); pointer-events: none; }
.play-ctrl { flex: none; display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-bottom: 2px; }
.pbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 11px 8px; border-radius: 18px; font-weight: 900; font-size: 15px; background: var(--surface-2); border: 1px solid var(--border-2); transition: transform .25s var(--spring), opacity .2s; }
.pbtn small { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.pbtn:active { transform: scale(.95); }
.pbtn:disabled { opacity: .45; }
.pbtn.big { color: #fff; background: linear-gradient(135deg, #18b8ff, #7c5cff 55%, #ff5fa2); border: 0; box-shadow: 0 10px 28px -8px rgba(24, 184, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.pbtn.big small { color: rgba(255, 255, 255, .85); }
.pbtn.big.done { background: var(--surface-2); box-shadow: none; color: var(--muted); }
.ov-tip { color: var(--dim); font-size: 12.5px; line-height: 1.6; margin: -10px 0 18px; }

/* ---------- shop ---------- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 10px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--border); text-align: center; transition: transform .25s var(--spring); }
.shop-item:active { transform: scale(.95); }
.shop-item b { font-size: 13px; }
.shop-item small { font-size: 11px; color: var(--gold); font-weight: 700; line-height: 1.4; }
.shop-item small em { font-style: normal; color: var(--dim); font-weight: 500; }
.shop-item.owned small { color: var(--muted); }
.shop-item.on { border-color: var(--gold); background: rgba(255, 207, 92, .1); box-shadow: 0 0 18px -6px var(--gold); }
.shop-item.on small { color: #7df0b8; }
.shop-item[data-short] { opacity: .7; }
.sw { width: 64px; height: 64px; border-radius: 16px; background: radial-gradient(circle at 70% 25%, var(--s2), transparent 55%), var(--s1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.sw-jar { border-radius: 10px 10px 22px 22px; background: linear-gradient(90deg, color-mix(in srgb, var(--s2) 35%, transparent), transparent 40%, color-mix(in srgb, var(--s2) 25%, transparent)), var(--s1); box-shadow: inset 0 0 0 2px var(--s2); }
.sw-board { background: radial-gradient(circle, var(--s2) 2px, transparent 2.6px) 0 0 / 14px 14px, var(--s1); }

/* ---------- app background themes ---------- */
[data-theme=sakura] .bg { background: radial-gradient(120% 80% at 50% -10%, #3a1432 0%, #0d0812 60%); }
[data-theme=sakura] .a1 { background: radial-gradient(circle, rgba(255, 140, 200, .4), transparent 62%); }
[data-theme=sakura] .a2 { background: radial-gradient(circle, rgba(255, 200, 225, .25), transparent 62%); }
[data-theme=sakura] .a3 { background: radial-gradient(circle, rgba(255, 120, 170, .18), transparent 62%); }
[data-theme=ocean] .bg { background: radial-gradient(120% 80% at 50% -10%, #08304f 0%, #030b16 60%); }
[data-theme=ocean] .a1 { background: radial-gradient(circle, rgba(24, 184, 255, .4), transparent 62%); }
[data-theme=ocean] .a2 { background: radial-gradient(circle, rgba(46, 214, 161, .22), transparent 62%); }
[data-theme=ocean] .a3 { background: radial-gradient(circle, rgba(74, 107, 255, .25), transparent 62%); }
[data-theme=sunset] .bg { background: radial-gradient(120% 80% at 50% -10%, #4a1d12 0%, #120807 60%); }
[data-theme=sunset] .a1 { background: radial-gradient(circle, rgba(255, 122, 47, .42), transparent 62%); }
[data-theme=sunset] .a2 { background: radial-gradient(circle, rgba(255, 61, 99, .3), transparent 62%); }
[data-theme=sunset] .a3 { background: radial-gradient(circle, rgba(255, 207, 92, .25), transparent 62%); }
[data-theme=cosmos] .bg { background: radial-gradient(120% 80% at 50% -10%, #120a2a 0%, #020206 60%); }
[data-theme=cosmos] .a1 { background: radial-gradient(circle, rgba(193, 140, 255, .32), transparent 62%); }
[data-theme=cosmos] .a2 { background: radial-gradient(circle, rgba(24, 184, 255, .2), transparent 62%); }
[data-theme=cosmos] .a3 { background: radial-gradient(circle, rgba(255, 95, 162, .15), transparent 62%); }
[data-theme=cosmos] .s1, [data-theme=cosmos] .s2 { opacity: .7; }

/* ---------- desktop: the goal sidebar is always visible ---------- */
@media (min-width: 1000px) {
  :root { --side: 320px; }
  .drawer { visibility: visible; inset: 0 auto 0 0; width: var(--side); z-index: 20; }
  .drawer-scrim { display: none; }
  .drawer-panel { width: var(--side); transform: none !important; transition: none; box-shadow: none; background: linear-gradient(180deg, rgba(29, 25, 66, .92), rgba(16, 14, 38, .95)); }
  [data-dr-close], .top-left > .icon-btn[data-act=drawer], .goals-sec .btn-chip[data-act=drawer] { display: none; }
  #app { left: var(--side); }
  #toasts { left: calc(50% + var(--side) / 2); }
  .sheet { left: calc(50% + var(--side) / 2); }
  .grow:hover { transform: translateX(3px); }
}

/* ---------- arcade hub ---------- */
.wallet { display: flex; gap: 6px; flex: none; }
.wallet .pchip { padding: 6px 10px; }
.wallet .pchip b { font-size: 16px; }
.arcade { gap: 10px; }
.arc-head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.arc-title { margin: 2px 0 0; font-size: 24px; font-weight: 900; }
.arc-list { margin: 0 -14px; padding: 2px 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.arc-card, .arc-shop { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 22px; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--g1) 30%, transparent), color-mix(in srgb, var(--g2) 12%, transparent) 70%), var(--surface); border: 1px solid color-mix(in srgb, var(--g1) 45%, transparent); transition: transform .3s var(--spring); flex: none; }
.arc-card:active, .arc-shop:active { transform: scale(.97); }
.arc-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .12) 50%, transparent 65%); transform: translateX(-120%); transition: transform .9s var(--out); pointer-events: none; }
@media (hover: hover) { .arc-card:hover::after { transform: translateX(120%); } }
.arc-icon { flex: none; width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; font-size: 30px; background: linear-gradient(135deg, var(--g1, #7c5cff), var(--g2, #ff5fa2)); box-shadow: 0 8px 22px -6px var(--g1, #7c5cff), inset 0 1px 0 rgba(255, 255, 255, .45); }
.arc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.arc-body b { font-size: 16px; font-weight: 900; }
.arc-body small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.arc-body em { font-style: normal; font-size: 11px; font-weight: 700; }
.arc-badge { color: #7cf0ff; }
.arc-played { color: var(--dim); }
.arc-cost { flex: none; font-size: 11.5px; font-weight: 900; color: var(--gold); padding: 4px 9px; border-radius: 99px; background: rgba(0, 0, 0, .25); }
.arc-shop { --g1: #ffcf5c; --g2: #ff7a2f; }
.arc-shop > i { font-style: normal; font-size: 22px; color: var(--muted); }
.arc-tip { text-align: center; font-size: 12px; color: var(--dim); line-height: 1.7; margin: 6px 0 0; }

/* ---------- game screen frame ---------- */
.game-screen { gap: 10px; }
.gm-head { flex: none; display: flex; align-items: center; gap: 10px; }
.gm-head h1 { flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-root { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.gm-root > * { flex: 1; min-height: 0; }
.board-empty.static { position: relative; display: grid; place-content: center; text-align: center; border-radius: 22px; background: var(--surface); }
.play { display: flex; flex-direction: column; gap: 8px; }
.drop-items { flex: none; display: flex; gap: 8px; justify-content: center; min-height: 0; }
.drop-items:empty { display: none; }
.ditem { padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 900; background: rgba(255, 207, 92, .14); border: 1px solid rgba(255, 207, 92, .35); color: #ffe2a6; }
.ditem.btn { background: linear-gradient(135deg, #ff7a2f, #ff3d63); color: #fff; border: 0; box-shadow: 0 6px 18px -4px rgba(255, 61, 99, .7); }

/* shared bet / message / spin controls */
.slot-bets { display: flex; justify-content: center; gap: 8px; }
.bet { padding: 9px 16px; border-radius: 14px; font-weight: 900; font-size: 14px; background: var(--surface); border: 1.5px solid var(--border-2); color: var(--muted); transition: all .2s; }
.bet.on { color: #fff; border-color: var(--gold); background: rgba(255, 207, 92, .16); box-shadow: 0 0 16px -4px var(--gold); }
.slot-msg { text-align: center; font-weight: 900; font-size: 16px; min-height: 1.5em; color: var(--muted); }
.slot-msg.win { color: #7df0b8; }
.slot-msg.jp { font-size: 20px; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pulse .6s var(--spring); }
.slot-msg.lose { color: #ff8fa3; }
.spin-btn { width: 100%; padding: 15px; border-radius: 18px; font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 20px; letter-spacing: .1em; color: #3b2400; background: var(--grad-gold); box-shadow: 0 10px 26px -6px rgba(255, 166, 61, .8), inset 0 1px 0 rgba(255, 255, 255, .6); transition: transform .2s var(--spring), opacity .2s; }
.spin-btn small { font-family: 'Zen Maru Gothic'; font-size: 12px; letter-spacing: 0; margin-left: 6px; }
.spin-btn:active { transform: scale(.95); }
.spin-btn:disabled { opacity: .5; }

/* ---------- slot ---------- */
.slot { display: flex; flex-direction: column; gap: 12px; justify-content: center; padding: 16px; border-radius: 26px; background: linear-gradient(180deg, #4a1530, #2a0d22); border: 2px solid rgba(255, 140, 170, .35); box-shadow: inset 0 0 40px rgba(0, 0, 0, .5), 0 0 40px -10px rgba(255, 61, 99, .5); overflow-y: auto; }
.slot-top { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: 'Outfit'; font-weight: 900; letter-spacing: .2em; color: #ffd1dc; }
.slot-lamp { width: 10px; height: 10px; border-radius: 50%; background: #ffd166; box-shadow: 0 0 10px #ffd166; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.slot-window { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: 18px; background: #15060f; box-shadow: inset 0 6px 20px rgba(0, 0, 0, .8); }
.reel { position: relative; height: min(30vh, 210px); overflow: hidden; border-radius: 12px; background: linear-gradient(180deg, #d9d2e8, #fff 30%, #fff 70%, #d9d2e8); }
.reel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent 30%, transparent 70%, rgba(0, 0, 0, .45)); pointer-events: none; }
.strip { will-change: transform; }
.cell { height: calc(min(30vh, 210px) / 3); display: grid; place-items: center; font-size: clamp(30px, 9vw, 44px); }
.sym-7 { font-family: 'Outfit'; font-weight: 900; font-style: italic; font-size: 1.2em; background: linear-gradient(180deg, #ff5f7a, #c4002a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #7a001a); }
.sym-wild { position: relative; display: grid; place-items: center; }
.sym-wild i { position: absolute; bottom: -8px; font-style: normal; font-family: 'Outfit'; font-weight: 900; font-size: 9px; letter-spacing: .1em; color: #fff; background: linear-gradient(90deg, #7c5cff, #ff5fa2); padding: 0 5px; border-radius: 99px; }
.payline { position: absolute; left: 4px; right: 4px; top: 50%; height: 3px; margin-top: -1.5px; background: rgba(255, 61, 99, .7); box-shadow: 0 0 10px #ff3d63; pointer-events: none; }
.reach { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); font-weight: 900; font-size: 34px; color: #fff; text-shadow: 0 0 12px #ff3d63, 0 0 24px #ff3d63; animation: pulse .5s ease-in-out infinite; pointer-events: none; }
.reach[hidden] { display: none; }
.slot.win .slot-window { box-shadow: inset 0 6px 20px rgba(0, 0, 0, .8), 0 0 0 3px #7df0b8, 0 0 30px #7df0b8; }
.slot.jackpot .slot-window { animation: jpFlash .25s steps(2) 8; }
@keyframes jpFlash { 50% { box-shadow: inset 0 6px 20px rgba(0, 0, 0, .8), 0 0 0 4px #ffd166, 0 0 50px #ffd166; } }
.paytable summary { cursor: pointer; text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.paytable div { margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .3); }
.paytable p { display: flex; justify-content: space-between; align-items: center; margin: 4px 0; font-size: 13px; }
.paytable p span { font-size: 18px; letter-spacing: 2px; }
.paytable p span .sym-wild i { display: none; }
.paytable small { display: block; text-align: center; color: var(--dim); margin-top: 6px; }

/* ---------- roulette ---------- */
.roul { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.roul-wheel { position: relative; width: min(100%, 44vh, 360px); aspect-ratio: 1; margin: 0 auto; flex: none; }
.roul-wheel canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .6)); }
.roul-pointer { position: absolute; left: 50%; top: -4px; width: 0; height: 0; transform: translateX(-50%); border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 26px solid #ffd166; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.roul-hub { position: absolute; left: 50%; top: 50%; width: 26%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; font-family: 'Outfit'; font-weight: 900; font-size: clamp(13px, 4vw, 17px); color: #3b2400; background: radial-gradient(circle at 35% 30%, #fff8d6, #ffcf5c 45%, #e08a12); box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 -4px 8px rgba(0, 0, 0, .2); transition: transform .2s var(--spring); }
.roul-hub:active { transform: translate(-50%, -50%) scale(.92); }
.roul-legend { text-align: center; font-size: 11.5px; color: var(--dim); margin: 0; }

/* ---------- high & low ---------- */
.hl { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.hl-info { display: flex; justify-content: center; gap: 20px; font-size: 13px; color: var(--muted); font-weight: 700; }
.hl-info b { font-size: 22px; color: var(--gold); margin: 0 3px; }
.hl-table { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; border-radius: 22px; background: radial-gradient(ellipse at center, #1e6b45, #0f3a26); border: 2px solid rgba(255, 207, 92, .3); box-shadow: inset 0 0 40px rgba(0, 0, 0, .5); }
.card-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.card-slot small { font-size: 11px; color: rgba(255, 255, 255, .7); }
.hl-vs { font-size: 26px; color: rgba(255, 255, 255, .6); }
.pcard { position: relative; width: min(30vw, 120px); aspect-ratio: 5 / 7; border-radius: 12px; background: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .5); display: grid; place-items: center; font-family: 'Outfit'; font-weight: 800; }
.pcard .s { font-size: clamp(40px, 12vw, 56px); }
.pcard .r { position: absolute; top: 6px; left: 9px; font-size: 20px; }
.pcard .r2 { position: absolute; bottom: 6px; right: 9px; font-size: 20px; transform: rotate(180deg); }
.pcard.red { color: #e0193a; }
.pcard.black { color: #1b1530; }
.pcard.back { background: repeating-linear-gradient(45deg, #7c5cff 0 8px, #6a4ce8 8px 16px); border: 4px solid #fff; }
.pcard.back > * { display: none; }
.pcard.flip { animation: flipIn .45s var(--out); }
@keyframes flipIn { from { transform: rotateY(90deg) scale(.9); } }
.pcard.shake { animation: shakeCard .45s ease-in-out; }
@keyframes shakeCard { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.hl-start, .hl-play { display: flex; flex-direction: column; gap: 10px; }
.hl-start[hidden], .hl-play[hidden] { display: none; }
.hl-guess { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hl-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 8px; border-radius: 18px; font-family: 'Outfit'; font-weight: 900; font-size: 20px; color: #fff; transition: transform .2s var(--spring), opacity .2s; }
.hl-btn small { font-size: 15px; opacity: .9; }
.hl-btn.high { background: linear-gradient(135deg, #ff5fa2, #ff3d63); box-shadow: 0 10px 24px -8px rgba(255, 61, 99, .8); }
.hl-btn.low { background: linear-gradient(135deg, #18b8ff, #4a6bff); box-shadow: 0 10px 24px -8px rgba(24, 184, 255, .8); }
.hl-btn:active { transform: scale(.95); }
.hl-btn:disabled { opacity: .3; }

/* ---------- pusher ---------- */
.pusher { display: flex; flex-direction: column; gap: 8px; }
.push-info { flex: none; display: flex; justify-content: center; gap: 14px; font-size: 12.5px; color: var(--muted); font-weight: 700; flex-wrap: wrap; }
.push-info b { color: var(--gold); font-size: 15px; margin: 0 2px; }
.push-wrap { position: relative; flex: 1; min-height: 220px; border-radius: 22px; overflow: hidden; border: 2px solid rgba(255, 207, 92, .35); box-shadow: inset 0 0 40px rgba(0, 0, 0, .5); touch-action: none; }
.push-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.push-hint { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 900; background: rgba(0, 0, 0, .55); pointer-events: none; animation: floaty 2s ease-in-out infinite; white-space: nowrap; }
.push-hint[hidden] { display: none; }
.push-ctrl { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- shop: gacha / items / book ---------- */
.shop { display: flex; flex-direction: column; gap: 10px; }
.shop .tabs button { font-size: 12px; padding: 8px 2px; }
.gacha { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; }
.gacha-machine { position: relative; width: 170px; }
.gm-dome { position: relative; width: 170px; height: 150px; border-radius: 85px 85px 20px 20px; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, .06) 60%); border: 3px solid rgba(255, 255, 255, .4); overflow: hidden; }
.gm-dome i { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(180deg, var(--col) 50%, #fff 50%); box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .25); }
.gm-body { position: relative; height: 70px; margin-top: -4px; border-radius: 0 0 20px 20px; background: linear-gradient(135deg, #ff5fa2, #7c5cff); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4); }
.gm-handle { position: absolute; left: 22px; top: 16px; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle, #fff 30%, #ffd166 32%); box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
.gm-handle::after { content: ''; position: absolute; left: 50%; top: 4px; width: 6px; height: 30px; margin-left: -3px; border-radius: 3px; background: #c46a10; }
.gm-handle.turn { animation: turn .7s var(--out); }
@keyframes turn { to { transform: rotate(360deg); } }
.gm-slot { position: absolute; right: 22px; top: 18px; width: 44px; height: 34px; border-radius: 10px; background: #1b1530; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .6); }
.gacha-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.spin-btn.eleven { background: linear-gradient(135deg, #ff5fa2, #ffb547); color: #fff; }
.gacha-rate { font-size: 11px; color: var(--dim); text-align: center; line-height: 1.7; margin: 0; }
.gacha-result { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; width: 100%; }
.capsule { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--col) 22%, transparent), rgba(255, 255, 255, .03)); border: 1.5px solid color-mix(in srgb, var(--col) 60%, transparent); animation: capIn .6s var(--spring) both; }
@keyframes capIn { 0% { transform: scale(0) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.15); } }
.capsule .cap-e { font-size: 34px; }
.capsule b { font-family: 'Outfit'; font-size: 12px; color: var(--col); letter-spacing: .08em; }
.capsule small { font-size: 10.5px; color: var(--muted); }
.capsule em { position: absolute; top: 4px; right: 4px; font-style: normal; font-family: 'Outfit'; font-size: 9px; font-weight: 900; padding: 1px 5px; border-radius: 99px; background: #ff3d63; color: #fff; }
.capsule em.dup { background: rgba(255, 207, 92, .2); color: var(--gold); }
.capsule.r-SSR, .capsule.r-UR { box-shadow: 0 0 24px -4px var(--col); }
.capsule.r-UR { background: linear-gradient(135deg, rgba(255, 95, 162, .3), rgba(255, 181, 71, .25), rgba(124, 240, 255, .25), rgba(193, 140, 255, .3)); }
.items { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.item-ic { flex: none; font-size: 26px; min-width: 40px; text-align: center; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-body b { font-size: 14px; }
.item-body small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.item-body .have { color: #7df0b8; font-weight: 700; }
.buy { flex: none; padding: 9px 12px; border-radius: 12px; font-weight: 900; font-size: 13px; color: #3b2400; background: var(--grad-gold); box-shadow: 0 6px 16px -6px rgba(255, 166, 61, .8); transition: transform .2s var(--spring); }
.buy:active { transform: scale(.92); }
.ex-btns { display: flex; gap: 6px; }
.ex-h, .looks-h { margin: 14px 2px 4px; font-size: 14px; font-weight: 900; }
.looks-note { font-size: 12px; color: var(--muted); margin: 4px 2px; }
.book-head { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.book-head b { font-size: 26px; color: var(--gold); }
.book h3 { margin: 12px 2px 6px; font-family: 'Outfit'; font-size: 14px; letter-spacing: .1em; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.book-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px dashed var(--border-2); }
.book-cell span { font-size: 26px; filter: grayscale(1) brightness(.4); }
.book-cell small { font-size: 9.5px; color: var(--dim); }
.book-cell.on { border: 1.5px solid color-mix(in srgb, var(--col) 60%, transparent); background: color-mix(in srgb, var(--col) 12%, transparent); }
.book-cell.on span { filter: none; }
.book-cell.on small { color: var(--text); }
.book-cell em { position: absolute; top: 2px; right: 4px; font-style: normal; font-size: 9px; color: var(--gold); font-family: 'Outfit'; font-weight: 800; }

/* ---------- quick add: AI organize ---------- */
.qa-form.ai-mode .send { background: linear-gradient(135deg, #7c5cff, #ff5fa2); font-size: 22px; }
.qa-form.ai-mode textarea { min-height: 96px; }
.ai-items { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.ai-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--border); opacity: .55; transition: all .2s; animation: enter .45s var(--spring) both; }
.ai-item.on { opacity: 1; border-color: color-mix(in srgb, var(--c1) 55%, transparent); background: color-mix(in srgb, var(--c1) 10%, var(--surface)); }
.ai-check { flex: none; width: 26px; height: 26px; margin-top: 2px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); display: grid; place-items: center; }
.ai-check svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.ai-item.on .ai-check { background: linear-gradient(135deg, #7c5cff, #ff5fa2); border-color: transparent; }
.ai-item.on .ai-check svg { opacity: 1; }
.ai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ai-text { font-size: 14.5px; font-weight: 700; line-height: 1.45; }
.ai-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-kind { padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 900; background: rgba(124, 92, 255, .2); color: #d6ccff; border: 1px solid rgba(124, 92, 255, .4); }
.ai-kind.done { background: rgba(255, 207, 92, .18); color: #ffe2a6; border-color: rgba(255, 207, 92, .45); }
.ai-goal { max-width: 160px; padding: 3px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: var(--text); background: rgba(0, 0, 0, .3); border: 1px solid var(--border-2); }
.ai-loading { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 22px; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.ai-loading i { width: 8px; height: 8px; border-radius: 50%; background: #b9a8ff; animation: dots 1s ease-in-out infinite; }
.ai-loading i:nth-child(2) { animation-delay: .15s; }
.ai-loading i:nth-child(3) { animation-delay: .3s; }
.ai-loading span { margin-left: 6px; }
.qa-sheet .tabs button { font-size: 12px; }

/* ---------- slot: stop buttons, spinning reels, bonus ---------- */
.reel.spinning .strip { animation: reelLoop .32s linear infinite; filter: blur(1.4px); }
@keyframes reelLoop { from { transform: translateY(0); } to { transform: translateY(var(--loop)); } }
.stop-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 10px; }
.stop-btn { padding: 10px 0; border-radius: 12px; font-family: 'Outfit'; font-weight: 900; letter-spacing: .1em; color: #fff; background: linear-gradient(180deg, #ff5f7a, #c4002a); box-shadow: 0 4px 0 #7a001a, 0 8px 16px -6px rgba(255, 61, 99, .7); transition: transform .1s, box-shadow .1s, opacity .2s; }
.stop-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a001a; }
.stop-btn:disabled { opacity: .35; filter: grayscale(.6); transform: translateY(3px); box-shadow: 0 1px 0 #3a1020; }
.gekiatsu { position: absolute; left: 50%; top: 18%; transform: translateX(-50%) rotate(-6deg); padding: 4px 14px; border-radius: 10px; font-weight: 900; font-size: 22px; color: #fff; background: linear-gradient(90deg, #ff3d63, #ffb547, #ff3d63); background-size: 200% 100%; animation: gekiatsu .4s linear infinite; box-shadow: 0 0 24px #ff3d63; pointer-events: none; white-space: nowrap; }
.gekiatsu[hidden] { display: none; }
@keyframes gekiatsu { to { background-position: 200% 0; } }
.slot-bonus { text-align: center; font-family: 'Outfit', 'Zen Maru Gothic'; font-weight: 900; font-size: 14px; color: #3b2400; padding: 6px; border-radius: 12px; background: var(--grad-gold); animation: pulse 1s ease-in-out infinite; }
.slot-bonus[hidden] { display: none; }
.slot.bonus { border-color: transparent; box-shadow: inset 0 0 40px rgba(0, 0, 0, .5), 0 0 0 3px #ffd166, 0 0 40px #ffb547; }
.slot-items { display: flex; justify-content: center; }
.slot-items:empty { display: none; }

/* ---------- roulette double-up ---------- */
.dup { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: rgba(255, 207, 92, .08); border: 1px solid rgba(255, 207, 92, .35); animation: enter .4s var(--spring); }
.dup[hidden], .dup-cards[hidden], .dup-btns[hidden] { display: none; }
.dup-pot { text-align: center; font-weight: 700; color: var(--muted); }
.dup-pot b { font-size: 26px; color: var(--gold); margin: 0 4px; }
.dup-pot small { color: #7df0b8; }
.dup-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.dup-btns .spin-btn { font-size: 15px; padding: 12px; }
.dup-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dup-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border-radius: 16px; font-size: 32px; font-weight: 900; transition: transform .2s var(--spring), box-shadow .3s; }
.dup-card small { font-size: 13px; }
.dup-card.red { background: linear-gradient(135deg, #ff5f7a, #c4002a); }
.dup-card.black { background: linear-gradient(135deg, #3a3550, #0d0b18); border: 1px solid var(--border-2); }
.dup-card:active { transform: scale(.94); }
.dup-card.hit { box-shadow: 0 0 0 4px #ffd166, 0 0 30px #ffd166; transform: scale(1.06); }

/* ---------- pusher item buttons ---------- */
.ditem.btn.blue { background: linear-gradient(135deg, #18b8ff, #4a6bff); box-shadow: 0 6px 18px -4px rgba(24, 184, 255, .7); }
#puItems { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- shop: omikuji, premium, glow ---------- */
.omikuji { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 18px; text-align: left; background: linear-gradient(135deg, rgba(255, 61, 99, .22), rgba(255, 181, 71, .14)); border: 1.5px solid rgba(255, 140, 120, .5); transition: transform .25s var(--spring); }
.omikuji:active { transform: scale(.97); }
.omikuji.done { opacity: .6; filter: grayscale(.4); }
.omi-box { font-size: 30px; }
.omi-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.omi-body b { font-size: 15px; }
.omi-body small { font-size: 11.5px; color: var(--muted); }
.omi-go { flex: none; padding: 8px 14px; border-radius: 12px; font-weight: 900; color: #fff; background: linear-gradient(135deg, #ff3d63, #ff7a2f); }
.omikuji.done .omi-go { background: var(--surface-2); }
.spin-btn.premium { background: linear-gradient(135deg, #c18cff, #7c5cff 50%, #18b8ff); color: #fff; font-size: 16px; }
.gacha-machine.glow .gm-dome { box-shadow: 0 0 40px 6px var(--glow), inset 0 0 30px var(--glow); animation: pulse .5s ease-in-out infinite; }
.omikuji-ov .ov-card { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.omi-stick { font-size: 64px; animation: omiShake .8s ease-in-out; }
@keyframes omiShake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-25deg); } 40% { transform: rotate(20deg); } 60% { transform: rotate(-15deg); } 80% { transform: rotate(10deg); } }
.omi-paper { width: 200px; padding: 18px 14px; border-radius: 6px; background: #fffdf5; color: #2a1a10; text-align: center; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: paperIn .7s var(--spring) both .6s; border-top: 8px solid var(--oc); }
@keyframes paperIn { from { opacity: 0; transform: translateY(-40px) scaleY(.2); } }
.omi-paper b { display: block; font-size: 44px; font-weight: 900; color: var(--oc); writing-mode: horizontal-tb; }
.omi-paper p { font-size: 13px; line-height: 1.6; margin: 8px 0; }
.omi-gifts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.omi-gifts span { padding: 4px 10px; border-radius: 99px; background: #2a1a10; color: #ffe2a6; font-weight: 900; font-size: 13px; }
.book h3 small { font-family: 'Zen Maru Gothic'; font-size: 11px; color: var(--muted); letter-spacing: 0; }

/* ---------- looks: accessories, titles ---------- */
.sw-acc { display: grid; place-items: center; font-size: 34px; background: radial-gradient(circle, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02)); }
.sw-title { width: auto; height: auto; min-height: 40px; padding: 8px 10px; display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #ffe2a6; background: linear-gradient(135deg, rgba(255, 207, 92, .2), rgba(255, 95, 162, .15)); border-radius: 12px; }
.shop-grid.titles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.title-chip { display: inline-block; margin-bottom: 4px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 900; color: #ffe2a6; background: linear-gradient(135deg, rgba(255, 207, 92, .22), rgba(255, 95, 162, .18)); border: 1px solid rgba(255, 207, 92, .4); }

/* ---------- more background themes ---------- */
[data-theme=forest] .bg { background: radial-gradient(120% 80% at 50% -10%, #0f3a26 0%, #040c08 60%); }
[data-theme=forest] .a1 { background: radial-gradient(circle, rgba(46, 214, 161, .35), transparent 62%); }
[data-theme=forest] .a2 { background: radial-gradient(circle, rgba(166, 242, 139, .2), transparent 62%); }
[data-theme=forest] .a3 { background: radial-gradient(circle, rgba(255, 207, 92, .15), transparent 62%); }
[data-theme=snow] .bg { background: radial-gradient(120% 80% at 50% -10%, #23345a 0%, #070b16 60%); }
[data-theme=snow] .a1 { background: radial-gradient(circle, rgba(200, 225, 255, .3), transparent 62%); }
[data-theme=snow] .a2 { background: radial-gradient(circle, rgba(124, 240, 255, .18), transparent 62%); }
[data-theme=snow] .a3 { background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 62%); }
[data-theme=snow] .s1, [data-theme=snow] .s2 { opacity: .8; }
[data-theme=neon] .bg { background: radial-gradient(120% 80% at 50% -10%, #2a0838 0%, #05020b 60%); }
[data-theme=neon] .a1 { background: radial-gradient(circle, rgba(255, 43, 214, .38), transparent 62%); }
[data-theme=neon] .a2 { background: radial-gradient(circle, rgba(0, 240, 255, .3), transparent 62%); }
[data-theme=neon] .a3 { background: radial-gradient(circle, rgba(255, 230, 0, .16), transparent 62%); }

/* ---------- view transitions ---------- */
::view-transition-old(root) { animation: vtOut .25s ease both; }
::view-transition-new(root) { animation: vtIn .45s var(--out) both; }
html[data-dir=forward]::view-transition-old(root) { animation-name: vtOutLeft; }
html[data-dir=forward]::view-transition-new(root) { animation-name: vtInRight; }
html[data-dir=back]::view-transition-old(root) { animation-name: vtOutRight; }
html[data-dir=back]::view-transition-new(root) { animation-name: vtInLeft; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes vtOutLeft { to { opacity: 0; transform: translateX(-40px) scale(.98); } }
@keyframes vtInRight { from { opacity: 0; transform: translateX(60px); } }
@keyframes vtOutRight { to { opacity: 0; transform: translateX(40px) scale(.98); } }
@keyframes vtInLeft { from { opacity: 0; transform: translateX(-60px); } }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
