/* ==========================================================
   app.css — レベルアップクエスト
   ・太いふち＋ずらし影の「ポップなステッカー風」
   ・テーマは html[data-theme]、もじモードは html[data-mode]
   ========================================================== */

/* ---------- トークン ---------- */
:root {
  --font: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  --font-num: 'Dela Gothic One', 'M PLUS Rounded 1c', 'Hiragino Sans', sans-serif;
  --radius: 22px;
  --ink: #1C2045;
  --muted: #5F6690;
  --edge: #1C2045;
  --card: #FFFFFF;
  --soft: #F1F3FC;
  --on-p: #FFFFFF;
  --good: #16BF79;
  --bad: #FF4D6A;
  --gold: #FFC531;
  --hero-ink: #FFFFFF;
}
[data-theme="soda"]   { --p: #1FB6FF; --p-ink: #0070AD; --p-soft: #DCF2FF; --s: #7B61FF; --bg: #E6F5FF; --bg2: #EFE9FF; --bar: #1FB6FF; }
[data-theme="berry"]  { --p: #FF4F8B; --p-ink: #C0155A; --p-soft: #FFE0EB; --s: #FF9F1C; --bg: #FFF0F5; --bg2: #FFF4E2; --bar: #FF4F8B; }
[data-theme="melon"]  { --p: #12B872; --p-ink: #067A4E; --p-soft: #D6F7E8; --s: #00A8E8; --bg: #E8FAF1; --bg2: #E2F5FC; --bar: #12B872; }
[data-theme="grape"]  { --p: #8B5CF6; --p-ink: #5A2FC0; --p-soft: #ECE4FF; --s: #F45DB4; --bg: #F2EDFF; --bg2: #FFEDF7; --bar: #8B5CF6; }
[data-theme="sunset"] { --p: #FF7A00; --p-ink: #B84E00; --p-soft: #FFE8D2; --s: #FF3D6E; --bg: #FFF3E6; --bg2: #FFE9EF; --bar: #FF7A00; }
[data-theme="night"]  {
  --p: #00E0FF; --p-ink: #5CEBFF; --p-soft: #12304A; --s: #FF3DF2; --bg: #0B0D21; --bg2: #1B0E34; --bar: #0B0D21;
  --ink: #F1F3FF; --muted: #A6ADDA; --edge: #3B4290; --card: #161A3A; --soft: #232856; --on-p: #04131F;
  color-scheme: dark;
}

/* ランクの わくの色 */
[data-rank="rookie"]   { --ring: linear-gradient(135deg, #FFFFFF, #CDD5E3); }
[data-rank="bronze"]   { --ring: linear-gradient(135deg, #F2B37A, #A65F2A); }
[data-rank="silver"]   { --ring: linear-gradient(135deg, #FFFFFF, #93A3B8); }
[data-rank="gold"]     { --ring: linear-gradient(135deg, #FFF0A0, #E3A200); }
[data-rank="platinum"] { --ring: linear-gradient(135deg, #C6FFF6, #2EC4AE); }
[data-rank="diamond"]  { --ring: linear-gradient(135deg, #D6EEFF, #4B8DFF 55%, #B79CFF); }
[data-rank="master"]   { --ring: linear-gradient(135deg, #F7C2FF, #9B30FF); }
[data-rank="legend"]   { --ring: conic-gradient(#FF4D6A, #FF9F1C, #FFD23F, #3DDC97, #1FB6FF, #8B5CF6, #FF4D6A); }

/* ---------- ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--p) 22%, transparent) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
html[data-mode="kana"] body { font-size: 17px; letter-spacing: .02em; }
html[data-mode="ruby"] body { line-height: 1.85; }
ruby { ruby-position: over; ruby-align: center; }
rt { font-size: .5em; font-weight: 700; letter-spacing: 0; opacity: .85; }
button { font-family: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.num { font-family: var(--font-num); font-weight: 400; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
:focus-visible { outline: 3px solid var(--p); outline-offset: 2px; }
[hidden] { display: none !important; }

.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.bg-deco i { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; }
.bg-deco i:nth-child(1) { width: 320px; height: 320px; background: var(--bg2); top: -90px; right: -110px; }
.bg-deco i:nth-child(2) { width: 240px; height: 240px; background: color-mix(in srgb, var(--s) 18%, transparent); bottom: 120px; left: -120px; }
.bg-deco i:nth-child(3) { width: 140px; height: 140px; background: color-mix(in srgb, var(--p) 16%, transparent); top: 40%; right: -50px; }

/* 金のコイン（絵文字の🪙は 機種で銀色に見えるので CSS で描く） */
.coin {
  position: relative; display: inline-block; width: 1em; height: 1em; margin: 0 .08em; vertical-align: -.14em;
  font-style: normal; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #FFF7B8, #FFC531 46%, #DE9500);
  border: .085em solid #7A4E00; box-shadow: inset -.06em -.06em 0 rgba(0,0,0,.15);
}
.coin::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; font-size: .56em; line-height: 1; color: #A36A00; }
.bank-coin .coin { font-size: 58px; }
.ob-logo .coin { font-size: 48px; vertical-align: -6px; }

/* ---------- ヘッダー / タブ ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.me {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 3px 10px 3px 3px; border: 2.5px solid var(--edge); border-radius: 999px;
  background: var(--card); box-shadow: 0 2px 0 var(--edge); cursor: pointer;
}
.me-name { font-weight: 900; font-size: 14px; max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-caret { font-size: 10px; color: var(--muted); }
.top-pills { display: flex; align-items: center; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; border: 2.5px solid var(--edge); border-radius: 999px;
  background: var(--card); box-shadow: 0 2px 0 var(--edge); font-weight: 900; font-size: 15px;
}
.pill .num { font-size: 15px; }
.pill.streak:not(.lit) { filter: grayscale(.9); opacity: .75; }
.pill.streak.lit { background: #FFF0DD; color: #7A3A00; }
.pill.coins { background: #FFF6CF; color: #6B4600; }
.pill.coins.bump { animation: bump .28s; }
.hdr-btn { width: 36px; height: 36px; font-size: 16px; font-weight: 900; border: 2.5px solid var(--edge) !important; background: var(--card) !important; box-shadow: 0 2px 0 var(--edge); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: none; border-radius: 999px; background: transparent; font-size: 18px; cursor: pointer; color: var(--ink);
}
.icon-btn:disabled { opacity: .3; cursor: default; }

.screen { max-width: 560px; margin: 0 auto; padding: 6px 14px calc(env(safe-area-inset-bottom) + 108px); outline: none; }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 30;
  width: min(560px, 100%);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--card); border: 2.5px solid var(--edge); border-bottom: none; border-radius: 22px 22px 0 0;
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 0; color: var(--muted); text-decoration: none; font-weight: 800; font-size: 11px; line-height: 1.3;
}
.tab-ico { font-size: 22px; line-height: 1.35; padding: 0 12px; border-radius: 999px; transition: background .2s, transform .2s; }
.tab[aria-current="page"] { color: var(--p-ink); }
.tab[aria-current="page"] .tab-ico { background: var(--p-soft); transform: translateY(-2px) scale(1.08); }
.tab-label { white-space: nowrap; }
.tab-label rt { font-size: .62em; }
.tab-dot { position: absolute; top: 2px; right: calc(50% - 22px); width: 11px; height: 11px; border-radius: 50%; background: var(--bad); border: 2px solid var(--card); animation: bounce 1.2s infinite; }

/* ---------- カード / ボタン ---------- */
.card {
  position: relative;
  display: block;
  margin: 0 0 14px;
  padding: 16px;
  background: var(--card);
  border: 2.5px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--edge);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 4px; }
.count { font-size: 14px; color: var(--muted); margin-left: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px;
  font: inherit; font-weight: 900; font-size: 15px; line-height: 1.3;
  color: var(--ink); background: var(--card);
  border: 2.5px solid var(--edge); border-radius: 999px; box-shadow: 0 3px 0 var(--edge);
  cursor: pointer; transition: transform .08s, box-shadow .08s, filter .15s; touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--edge); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.btn-primary { background: var(--p); color: var(--on-p); }
.btn-ghost { background: var(--soft); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-gold { background: linear-gradient(180deg, #FFE36E, #FFB800); color: #4A2F00; animation: glow 1.6s ease-in-out infinite; }
.btn-attack { background: linear-gradient(180deg, #FF7A8E, #FF4D6A); color: #fff; padding: 6px 12px; min-height: 40px; font-size: 14px; border-color: #000; box-shadow: 0 3px 0 #000; }
.btn-sm { min-height: 36px; padding: 4px 12px; font-size: 13px; }
.btn-big { min-height: 54px; padding: 12px 22px; font-size: 18px; }
.btn.wide { width: 100%; margin-top: 12px; }
.danger-text { color: var(--bad); }
.link-btn { display: block; margin: 8px auto 0; padding: 8px; background: none; border: none; color: var(--p-ink); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }

.bar { display: block; height: 12px; background: var(--soft); border: 2px solid var(--edge); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--p), var(--s)); transition: width .7s cubic-bezier(.2, .9, .3, 1); }

.tag { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--p-soft); color: var(--p-ink); }
.tag.todo { background: #FFF0D2; color: #8A5200; }
.empty { padding: 10px; color: var(--muted); font-size: 14px; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.center { justify-content: center; }
.chip {
  padding: 6px 12px; border: 2px solid var(--edge); border-radius: 999px; background: var(--card);
  font: inherit; font-size: 14px; font-weight: 800; color: var(--ink); cursor: pointer;
}
.chip.on { background: var(--p); color: var(--on-p); }
.chip.big { padding: 9px 16px; font-size: 16px; }
.chip.static { cursor: default; background: var(--soft); border-width: 0; }
.ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip.idea { padding: 4px 10px; font-size: 13px; background: var(--soft); border-style: dashed; }

/* ---------- ヒーロー（アバターとレベル） ---------- */
.hero {
  overflow: hidden;
  color: var(--hero-ink);
  background: linear-gradient(135deg, var(--p), var(--s));
}
.hero::before, .hero::after { content: '✦'; position: absolute; color: rgba(255,255,255,.35); pointer-events: none; animation: twinkle 2.6s ease-in-out infinite; }
.hero::before { top: 8px; right: 18px; font-size: 26px; }
.hero::after { bottom: 52px; right: 54px; font-size: 14px; animation-delay: 1.1s; }
[data-theme="night"] .hero { text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.hero-top { display: flex; align-items: center; gap: 14px; }
.hero-ava { position: relative; padding: 0 0 10px; background: none; border: none; cursor: pointer; flex: none; }
.hero-ava .avatar { animation: float 3.2s ease-in-out infinite; }
.hero-ava .rank-chip { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); white-space: nowrap; }
.hero-name { font-size: 20px; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
.title-chip { display: inline-block; margin-top: 2px; padding: 0 8px; border-radius: 999px; background: rgba(255,255,255,.25); font-size: 12px; font-weight: 800; }
.lv-row { display: flex; align-items: baseline; gap: 2px; line-height: 1; margin: 2px 0 6px; }
.lv-tag { font-family: var(--font-num); font-size: 18px; }
.lv-num { font-size: 46px; text-shadow: 3px 3px 0 rgba(0,0,0,.22); }
.xp-bar { position: relative; height: 18px; border-radius: 999px; background: rgba(0,0,0,.22); border: 2.5px solid var(--edge); overflow: hidden; }
.xp-bar i {
  position: relative; display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(180deg, #FFF09A, #FFC531 60%, #FFAA00);
  transition: width 1s cubic-bezier(.2, .9, .3, 1.15);
  overflow: hidden;
}
.xp-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.75) 50%, transparent 80%); transform: translateX(-100%); animation: shine 2.4s ease-in-out infinite; }
.xp-text { margin-top: 4px; font-size: 12.5px; font-weight: 800; opacity: .95; }
.xp-text b { font-size: 15px; }
.bubble {
  position: relative; margin-top: 14px; padding: 10px 14px;
  background: var(--card); color: var(--ink); text-shadow: none;
  border: 2.5px solid var(--edge); border-radius: 18px; font-weight: 800; font-size: 15px;
}
.bubble::before { content: ''; position: absolute; top: -11px; left: 34px; width: 16px; height: 16px; background: var(--card); border-left: 2.5px solid var(--edge); border-top: 2.5px solid var(--edge); transform: rotate(45deg); border-radius: 3px 0 0 0; }
.next-rank { margin-top: 8px; font-size: 12.5px; font-weight: 800; opacity: .95; }

/* ---------- アバター ---------- */
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--av); height: var(--av); border-radius: 50%; isolation: isolate; }
.avatar img, .avatar .emo { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; font-size: calc(var(--av) * .56); line-height: 1; user-select: none; }
.avatar.ring { padding: calc(var(--av) * .065); border: 2.5px solid var(--edge); box-shadow: 0 3px 0 var(--edge); }
.avatar.ring::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 50%; background: var(--ring); }
.avatar.ring img, .avatar.ring .emo { border: 2px solid var(--edge); }
.avatar.ring[data-rank="legend"]::before { animation: spin 3s linear infinite; }
.avatar.ring:is([data-rank="gold"], [data-rank="platinum"], [data-rank="diamond"], [data-rank="master"], [data-rank="legend"])::after {
  content: '✦'; position: absolute; top: -4%; right: 2%; font-size: calc(var(--av) * .2); color: #FFF7B0; text-shadow: 0 0 6px #FFD23F; animation: twinkle 1.8s infinite;
}
.rank-chip { display: inline-block; padding: 1px 10px; border: 2px solid var(--edge); border-radius: 999px; background: var(--ring); color: #1C2045; font-size: 11px; font-weight: 900; text-shadow: none; }
.rank-chip.inline { vertical-align: middle; }

/* ---------- きょうの すすみぐあい ---------- */
.today-card { display: flex; align-items: center; gap: 14px; }
.ring-wrap { position: relative; width: 72px; height: 72px; flex: none; }
.pring { width: 72px; height: 72px; transform: rotate(-90deg); }
.pring circle { fill: none; stroke-width: 9; }
.pring-bg { stroke: var(--soft); }
.pring-fg { stroke: var(--p); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .9, .3, 1.1); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; }
.today-title { font-size: 17px; font-weight: 900; }
.today-msg { font-size: 14px; font-weight: 800; color: var(--muted); }
.today-msg b { color: var(--p-ink); font-size: 18px; }
.today-card.perfect { background: linear-gradient(135deg, #FFF8CC, #FFDD7A); color: #3A2A00; }
.today-card.perfect .today-msg { color: #6B4800; }
.today-card.perfect .pring-fg { stroke: #FFAA00; }
.today-card.perfect .pring-bg { stroke: rgba(255,255,255,.7); }
.chest-btn { animation: glow 1.6s ease-in-out infinite, wiggle 1.4s ease-in-out infinite; }
.today-sticker { position: absolute; top: -12px; right: -6px; font-size: 34px; transform: rotate(10deg); }
.today-sticker, .cal-st, .stk.got {
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 3px 2px rgba(0,0,0,.25));
}
.today-sticker.rare { animation: rareGlow 2s ease-in-out infinite; }

/* ---------- めざす ごほうび ---------- */
.goal-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.goal-card.empty { justify-content: center; font-weight: 900; color: var(--p-ink); }
.goal-emoji { font-size: 42px; animation: float 2.6s ease-in-out infinite; }
.goal-card .grow { display: flex; flex-direction: column; gap: 6px; }
.goal-title { font-size: 15px; font-weight: 800; }
.goal-title b { font-size: 17px; }
.goal-msg { font-size: 13px; font-weight: 800; color: var(--muted); }
.goal-msg b { color: var(--p-ink); font-size: 16px; }
.goal-card.ready { background: linear-gradient(135deg, #FFFBE0, #FFE58A); color: #3A2A00; animation: glowBox 1.6s ease-in-out infinite; }
.goal-card.ready .goal-msg { color: #8A5A00; }
.goal-card.ready .bar i { background: linear-gradient(90deg, #FFC531, #FF9F1C); }

/* ---------- クエスト ---------- */
.quests { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.quest {
  display: flex; align-items: stretch; overflow: hidden;
  background: var(--card); border: 2.5px solid var(--edge); border-radius: 18px; box-shadow: 0 3px 0 var(--edge);
  transition: background .3s;
}
.q-main {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 62px; padding: 10px 12px;
  background: none; border: none; text-align: left; font: inherit; cursor: pointer; touch-action: manipulation;
}
.check {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px;
  border: 3px solid var(--edge); border-radius: 50%; background: var(--card);
  transition: transform .15s, background .2s;
}
.q-main:active .check { transform: scale(.86); }
.check svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s .05s; }
.quest.done { background: color-mix(in srgb, var(--good) 13%, var(--card)); }
.quest.done .check { background: var(--good); }
.quest.done .check svg { stroke-dashoffset: 0; }
.quest.done .q-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2.5px; text-decoration-color: var(--good); }
.quest.just-done { animation: rowFlash .8s; }
.quest.just-done .check { animation: checkPop .55s cubic-bezier(.2, 1.7, .4, 1); }
.quest.just-undo { animation: shake .35s; }
.q-emoji { font-size: 25px; flex: none; }
.q-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.q-name { font-size: 16.5px; font-weight: 900; line-height: 1.45; overflow-wrap: anywhere; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.q-reward { white-space: nowrap; }
.q-more { width: 44px; height: auto; border-radius: 0; border-left: 2px dashed color-mix(in srgb, var(--edge) 22%, transparent); color: var(--muted); }
.rest { margin-top: 12px; }
.rest summary { font-size: 13px; color: var(--muted); }
.rest-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.rest-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.rest-list li span:first-child { flex: 1; }
details summary { cursor: pointer; font-weight: 800; }
.summary-h { font-size: 16px; font-weight: 900; }

/* ---------- ボス ---------- */
.boss {
  display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 10px;
  margin-top: 10px; padding: 10px 10px 10px 8px;
  color: #fff; background: linear-gradient(135deg, #2A2E5E, #50308A);
  border: 2.5px solid #0E1030; border-radius: 18px; box-shadow: 0 3px 0 #0E1030;
}
.boss-emoji { position: relative; font-size: 46px; text-align: center; animation: bossIdle 2.4s ease-in-out infinite; }
.boss.just-hit .boss-emoji { animation: bossHit .45s; }
.dmg { position: absolute; top: -8px; right: -4px; font-size: 22px; color: #FF4D6A; text-shadow: 2px 2px 0 #fff, -1px -1px 0 #fff; animation: dmgPop .9s forwards; }
.boss-name { font-weight: 900; line-height: 1.4; overflow-wrap: anywhere; }
.hp { height: 13px; margin: 4px 0 2px; overflow: hidden; background: rgba(255,255,255,.18); border: 2px solid #000; border-radius: 999px; }
.hp i { display: block; height: 100%; background: linear-gradient(90deg, #3DDC97, #12B872); transition: width .5s cubic-bezier(.2, .9, .3, 1.1); }
.hp i.low { background: linear-gradient(90deg, #FF9A6B, #FF4D6A); }
.hp-text { font-size: 12px; opacity: .9; }
.hp-text .num { font-size: 12px; }
.boss-btns { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.boss-btns .icon-btn { color: #fff; height: 30px; }
.boss.defeated { background: linear-gradient(135deg, #4A4E6E, #5E5878); }
.boss.defeated .boss-emoji { filter: grayscale(1); animation: none; transform: rotate(-90deg); opacity: .6; }
.beaten { display: inline-block; padding: 2px 8px; color: #FFD23F; border: 2.5px solid #FFD23F; border-radius: 8px; font-weight: 900; transform: rotate(-8deg); }

/* ---------- しゅうちゅう / ことば ---------- */
.focus-card { display: flex; align-items: center; gap: 12px; }
.focus-ico { font-size: 36px; }
.quote-card { background: color-mix(in srgb, var(--p-soft) 60%, var(--card)); }
.quote-card.flip { animation: flipIn .45s; }
.quote-head { font-size: 13px; font-weight: 900; color: var(--p-ink); margin-bottom: 4px; }
.quote-text { font-size: 16.5px; font-weight: 800; line-height: 1.95; overflow-wrap: anywhere; }
html[data-mode="kanji"] .quote-text { line-height: 1.75; }
.quote-src { margin-top: 6px; text-align: right; font-size: 12.5px; color: var(--muted); font-weight: 700; line-height: 1.9; }

/* ---------- スタンプ（おうちの人から） ---------- */
.stamp-card { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #FFEFF6, #FFF7D6); color: #3A1E2A; animation: wiggle 2.4s ease-in-out infinite; }
.stamp-card .muted { color: #7A5566; }
.stamp-card .grow { display: flex; flex-direction: column; }
.stamp-bounce { font-size: 38px; animation: bounce 1s infinite; }

/* ---------- シート ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 75; /* はじめての設定(60)・しゅうちゅう(70)より上、お祝い(80)より下 */
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(8, 10, 30, .5); opacity: 0; transition: opacity .2s;
}
.sheet-back.in { opacity: 1; }
.sheet-back.out { opacity: 0; }
.sheet {
  width: min(560px, 100%); max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 16px calc(env(safe-area-inset-bottom) + 22px);
  background: var(--card); border: 2.5px solid var(--edge); border-bottom: none; border-radius: 26px 26px 0 0;
  transform: translateY(48px); transition: transform .28s cubic-bezier(.2, .9, .3, 1.1); outline: none;
}
.sheet-back.in .sheet { transform: none; }
.sheet-grip { width: 46px; height: 5px; margin: 4px auto 6px; border-radius: 99px; background: var(--soft); }
.sheet-head { position: sticky; top: -6px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0 6px; background: var(--card); }
.sheet-title { font-size: 19px; font-weight: 900; line-height: 1.5; }
.sheet-text { margin: 6px 0; font-weight: 700; }
@media (min-width: 720px) {
  .sheet-back { align-items: center; }
  .sheet { border-bottom: 2.5px solid var(--edge); border-radius: 26px; max-height: 86dvh; }
}
.field-label { margin: 16px 0 8px; font-size: 14px; font-weight: 900; }
.input {
  width: 100%; padding: 11px 14px;
  font: inherit; font-size: 17px; font-weight: 700; color: var(--ink);
  background: var(--card); border: 2.5px solid var(--edge); border-radius: 14px;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input:focus { outline: 3px solid var(--p); outline-offset: 1px; }
.input.big { padding: 14px; font-size: 22px; text-align: center; }
.input.shake { animation: shake .35s; }
.row-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.row-btns.center { justify-content: center; margin-top: 10px; }
.row-btns .btn-big { flex: 1; }
.reward-note { margin: 14px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.reward-note b { color: var(--p-ink); }

.seg { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 2.5px solid var(--edge); border-radius: 16px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg-opt { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 9px 4px; font: inherit; font-weight: 900; background: var(--card); border: none; cursor: pointer; line-height: 1.4; }
.seg-opt + .seg-opt { border-left: 2.5px solid var(--edge); }
.seg-opt.on { background: var(--p); color: var(--on-p); }
.seg-opt b { font-size: 20px; }
.seg-opt span { font-size: 12.5px; }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-opt { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 7px 2px; font: inherit; font-size: 12px; font-weight: 800; line-height: 1.4; background: var(--card); border: 2px solid var(--edge); border-radius: 14px; cursor: pointer; }
.cat-opt.on { background: var(--p-soft); box-shadow: inset 0 0 0 2.5px var(--p); }
.cat-emoji { font-size: 24px; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.emoji-opt { aspect-ratio: 1; font-size: 26px; background: var(--soft); border: 2.5px solid transparent; border-radius: 14px; cursor: pointer; transition: transform .12s; }
.emoji-opt.on { background: var(--p-soft); border-color: var(--edge); transform: scale(1.06); }
.color-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.color-opt { width: 34px; height: 34px; background: var(--c); border: 2.5px solid var(--edge); border-radius: 50%; cursor: pointer; }
.color-opt.on { outline: 3px solid var(--p); outline-offset: 2px; }
.theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; font: inherit; font-size: 12px; font-weight: 900; background: var(--card); border: 2.5px solid var(--edge); border-radius: 16px; cursor: pointer; }
.theme-opt i { display: block; width: 100%; height: 30px; border-radius: 10px; background: linear-gradient(135deg, var(--a), var(--b)); border: 2px solid var(--edge); }
.theme-opt.on { box-shadow: 0 0 0 3px var(--p); transform: translateY(-2px); }
.theme-row.big .theme-opt i { height: 54px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-opt { aspect-ratio: 1; font: inherit; font-weight: 900; background: var(--card); border: 2px solid var(--edge); border-radius: 50%; cursor: pointer; line-height: 1.2; }
.day-opt.on { background: var(--p); color: var(--on-p); }
.stepper { display: inline-flex; align-items: center; overflow: hidden; border: 2.5px solid var(--edge); border-radius: 999px; }
.step { width: 52px; height: 48px; font-size: 24px; font-weight: 900; background: var(--soft); border: none; cursor: pointer; touch-action: manipulation; }
.stepper output { min-width: 70px; font-size: 22px; text-align: center; }

.prof-ava { display: grid; place-items: center; margin: 6px 0 10px; }
.sib-list { display: grid; gap: 6px; }
.sib { padding: 10px 14px; font: inherit; font-weight: 800; text-align: left; background: var(--soft); border: 2px solid var(--edge); border-radius: 14px; cursor: pointer; }
.sib.add { background: var(--card); border-style: dashed; }

/* PIN */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 10px 0 18px; }
.pin-dots i { width: 16px; height: 16px; border: 2.5px solid var(--edge); border-radius: 50%; }
.pin-dots i.on { background: var(--p); }
.pin-dots.shake { animation: shake .4s; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 74px); justify-content: center; gap: 10px; }
.pin-key { height: 60px; font-family: var(--font-num); font-size: 24px; background: var(--card); border: 2.5px solid var(--edge); border-radius: 18px; box-shadow: 0 3px 0 var(--edge); cursor: pointer; touch-action: manipulation; }
.pin-key:active { transform: translateY(3px); box-shadow: none; }
.pin-math { margin: 10px 0; font-family: var(--font-num); font-size: 26px; text-align: center; }

/* 画像の切りぬき */
.crop-view { position: relative; width: min(280px, 78vw); aspect-ratio: 1; margin: 8px auto; overflow: hidden; background: #222; border: 2.5px solid var(--edge); border-radius: 18px; touch-action: none; cursor: grab; }
.crop-img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; pointer-events: none; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 69.5%, rgba(0,0,0,.55) 70%); }
.crop-zoom { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0; }
.crop-zoom input { width: 200px; accent-color: var(--p); }

/* ---------- お祝い画面 ---------- */
.celebrate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; overflow: hidden; background: rgba(8, 10, 30, .74); opacity: 0; transition: opacity .25s; }
.celebrate.in { opacity: 1; }
.celebrate.out { opacity: 0; }
.cel-rays { position: absolute; inset: -60%; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.09) 0 9deg, transparent 9deg 18deg); animation: spin 22s linear infinite; }
.cel-card {
  position: relative; width: min(380px, 100%); padding: 26px 20px 20px; text-align: center;
  background: var(--card); border: 3px solid var(--edge); border-radius: 30px; box-shadow: 0 6px 0 var(--edge);
  transform: scale(.55); transition: transform .45s cubic-bezier(.2, 1.6, .4, 1);
}
.celebrate.in .cel-card { transform: scale(1); }
.cel-card > * + * { margin-top: 10px; }
.cel-card .cel-ok { width: 100%; margin-top: 18px; }
.cel-big { font-family: var(--font-num); font-weight: 400; font-size: 40px; line-height: 1.15; letter-spacing: .02em; }
.cel-big span { display: inline-block; animation: letterJump .7s calc(var(--i) * 55ms) both; }
.cel-big.rainbow span, .cel-big.gold span { -webkit-text-stroke: 1.5px var(--edge); text-shadow: 3px 3px 0 var(--edge); }
.cel-big.rainbow span:nth-child(6n+1) { color: #FF4D6A; }
.cel-big.rainbow span:nth-child(6n+2) { color: #FF9F1C; }
.cel-big.rainbow span:nth-child(6n+3) { color: #FFD23F; }
.cel-big.rainbow span:nth-child(6n+4) { color: #3DDC97; }
.cel-big.rainbow span:nth-child(6n+5) { color: #1FB6FF; }
.cel-big.rainbow span:nth-child(6n+6) { color: #8B5CF6; }
.cel-big.gold span { color: #FFC531; }
.cel-ava { margin-top: -86px !important; display: grid; place-items: center; animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1); }
.cel-ava .avatar { box-shadow: 0 0 0 8px rgba(255,255,255,.25), 0 0 40px 10px color-mix(in srgb, var(--p) 70%, transparent); }
.cel-lv { font-size: 20px; font-weight: 900; }
.cel-lv b { font-size: 30px; color: var(--p-ink); }
.cel-lv .arrow { display: inline-block; animation: nudge 1s infinite; }
.cel-rank { display: inline-block; padding: 4px 16px; background: var(--ring); color: #1C2045; border: 2.5px solid var(--edge); border-radius: 999px; font-weight: 900; animation: popIn .6s .4s both cubic-bezier(.2, 1.6, .4, 1); }
.cel-text { font-size: 17px; font-weight: 900; }
.cel-sub { font-size: 14px; font-weight: 800; color: var(--muted); }
.cel-coins { font-size: 19px; font-weight: 900; }
.cel-coins b { font-size: 26px; color: #E09A00; }
.cel-coins.big b { font-size: 48px; }
.cel-emoji { font-size: 84px; line-height: 1.1; }
.cel-emoji.fire { animation: flicker 1s infinite; }
.spin-in { animation: spinIn .8s cubic-bezier(.2, 1.6, .4, 1); }
.cel-chest { position: relative; height: 112px; }
.chest-box { display: inline-block; font-size: 96px; line-height: 1.15; animation: chestShake .8s, chestOpen .35s .8s both cubic-bezier(.2, 1.6, .4, 1); }
.chest-flash { position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; border-radius: 50%; background: #FFF6B0; opacity: 0; animation: flash .7s .8s; }
.cel-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.cel-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 220px; text-wrap: balance; }
.badge-medal {
  display: grid; place-items: center; width: 86px; height: 86px; font-size: 44px;
  background: radial-gradient(circle at 32% 28%, #FFF8D0, #FFC531 55%, #E39B00); color: #1C2045;
  border: 3px solid var(--edge); border-radius: 50%; box-shadow: 0 4px 0 var(--edge);
}
.cel-badge .badge-medal { animation: medal 1s cubic-bezier(.2, 1.6, .4, 1); }
.cel-boss { position: relative; height: 112px; }
.boss-boom { display: inline-block; font-size: 90px; animation: bossDie 1s forwards; }
.boom { position: absolute; inset: 0; display: grid; place-items: center; font-size: 110px; opacity: 0; animation: boom .7s .45s; }
.cel-stamp { font-size: 112px; line-height: 1.1; animation: stampIn .55s cubic-bezier(.2, 1.6, .4, 1); }
.cel-msg { padding: 10px 14px; background: var(--soft); border-radius: 16px; font-weight: 800; overflow-wrap: anywhere; }

/* チケット */
.tickets { display: grid; gap: 10px; margin-top: 10px; }
.ticket {
  position: relative; display: grid; grid-template-columns: 58px 1fr; grid-auto-rows: auto; column-gap: 12px; align-items: center;
  padding: 12px 14px 12px 10px; color: #3A2A00;
  background: linear-gradient(135deg, #FFF4C6, #FFDB75); border: 2.5px solid var(--edge); border-radius: 16px;
  -webkit-mask: radial-gradient(circle 9px at 70px 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 9px at 70px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 9px at 70px 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 9px at 70px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket-emoji { grid-row: 1 / span 3; display: grid; place-items: center; height: 100%; padding-right: 8px; font-size: 36px; border-right: 2.5px dashed rgba(58,42,0,.4); }
.ticket-name { font-size: 17px; font-weight: 900; }
.ticket-sub { font-size: 12px; font-weight: 700; opacity: .8; }
.ticket-btns { display: flex; gap: 6px; margin-top: 6px; }
.ticket.big { width: 270px; margin: 6px auto 0 !important; transform: rotate(-3deg); animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1); text-align: left; }

/* ---------- 演出の部品 ---------- */
.confetti { position: fixed; inset: 0; z-index: 100; width: 100%; height: 100%; pointer-events: none; }
.fly-coin {
  position: fixed; top: 0; left: 0; z-index: 95; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #FFF6B0, #FFC531 45%, #DE9500); border: 2px solid #7A4E00; border-radius: 50%;
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.15);
}
.fly-coin::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: #A36A00; }
.pop-text {
  position: fixed; z-index: 96; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none;
  font-family: var(--font-num); font-size: 20px; color: var(--p-ink);
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 0 4px 6px rgba(0,0,0,.2);
  animation: popUp 1.25s ease-out forwards;
}
.pop-text small { font-size: .55em; }
.pop-text.combo { font-size: 32px; line-height: 1.05; text-align: center; color: #FF4D6A; animation: comboIn 1.15s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.pop-text.combo small { display: block; font-size: 15px; color: var(--p-ink); }
.pop-text.lucky { font-family: var(--font); font-weight: 900; font-size: 18px; color: #0E9F5A; }
.pop-text.dmg { font-size: 30px; color: #FF4D6A; }
[data-theme="night"] .pop-text { text-shadow: 0 0 8px rgba(0,0,0,.9), 2px 2px 0 #000; }

.toast-wrap { position: fixed; top: calc(env(safe-area-inset-top) + 62px); left: 50%; z-index: 90; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-weight: 800; background: var(--card); border: 2.5px solid var(--edge); border-radius: 16px; box-shadow: 0 3px 0 var(--edge); animation: toastIn .4s cubic-bezier(.2, 1.5, .4, 1); transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast-big { font-size: 30px; line-height: 1; }
.toast.rare { background: linear-gradient(135deg, #FFF6C8, #FFD9F5, #D9F1FF); color: #2A1E45; }
.toast.fire { background: #FFF0DE; color: #6B3300; }
.toast.warn { background: #FFE2E6; color: #6B0016; }
.toast.lap { background: linear-gradient(135deg, #FFFBE6, #F1E9FF); color: #1C2045; }
.toast .lap-chip { margin: 0 2px; }

/* ---------- しゅうちゅうタイム ---------- */
.focus-ov { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; color: #fff; text-align: center; background: linear-gradient(160deg, var(--p), var(--s)); opacity: 0; transition: opacity .3s; }
.focus-ov.in { opacity: 1; }
.focus-ov.out { opacity: 0; }
.focus-cat { font-size: 18px; font-weight: 900; }
.focus-ring { position: relative; width: min(280px, 72vw); aspect-ratio: 1; margin: 14px auto; }
.focus-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fr-bg { fill: none; stroke: rgba(255,255,255,.25); stroke-width: 16; }
.fr-fg { fill: none; stroke: #fff; stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.focus-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 58px; text-shadow: 3px 3px 0 rgba(0,0,0,.2); }
.focus-cheer { min-height: 2em; font-size: 22px; font-weight: 900; }
.focus-hint { margin: 6px 0 18px; opacity: .9; }
.btn.light { background: rgba(255,255,255,.2); color: #fff; border-color: #fff; box-shadow: none; }

/* ---------- はじめての せってい ---------- */
.onboard { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background-color: var(--bg); background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--p) 22%, transparent) 1.4px, transparent 1.6px); background-size: 22px 22px; transition: opacity .25s; }
.onboard.out { opacity: 0; }
.ob-inner { display: flex; flex-direction: column; max-width: 520px; min-height: 100%; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 26px); }
.ob-hero { margin: 24px 0 18px; text-align: center; }
.ob-logo span { display: inline-block; font-size: 52px; animation: float 2.4s ease-in-out infinite; }
.ob-logo span:nth-child(2) { animation-delay: .3s; }
.ob-logo span:nth-child(3) { animation-delay: .6s; }
.ob-title { margin: 12px 0 6px; font-family: var(--font-num); font-weight: 400; font-size: clamp(44px, 13vw, 60px); line-height: 1.02; color: var(--p); -webkit-text-stroke: 2px var(--edge); text-shadow: 5px 5px 0 var(--s), 5px 5px 0 var(--edge); }
.ob-sub { font-size: 18px; font-weight: 900; }
.ob-feats { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ob-feats li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 700; background: var(--card); border: 2.5px solid var(--edge); border-radius: 16px; box-shadow: 0 3px 0 var(--edge); }
.ob-feats .ob-ico { flex: none; font-size: 26px; }
.ob-feats .ob-txt { flex: 1; min-width: 0; }
.ob-restore { margin-top: 14px; font-size: 15px; }
.ob-feats b { color: var(--p-ink); }
.ob-note { margin-top: 14px; text-align: center; font-size: 14px; font-weight: 800; color: var(--muted); }
.ob-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.ob-dots i { width: 30px; height: 7px; background: var(--card); border: 2px solid var(--edge); border-radius: 99px; }
.ob-dots i.on { background: var(--p); }
.ob-h { margin: 18px 0 10px; font-size: 23px; font-weight: 900; }
.ob-mode { margin-top: 18px; }
.ob-mode .seg { margin-top: 6px; }
.ob-preview { margin-top: 10px; padding: 10px 14px; font-weight: 800; background: var(--card); border: 2px dashed var(--edge); border-radius: 14px; }
.ob-ava { display: grid; place-items: center; margin: 4px 0 6px; }
.ob-ava + .row-btns + p { margin-bottom: 12px; }
.ob-sample { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.ob-sample .xp-bar { margin-top: 6px; }
.ob-sample .lv-num { font-size: 26px; }
.pick-list { display: grid; gap: 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font: inherit; font-weight: 800; text-align: left; background: var(--card); border: 2.5px solid var(--edge); border-radius: 16px; box-shadow: 0 3px 0 var(--edge); cursor: pointer; }
.pick > span:first-child { font-size: 22px; }
.pick-cost { font-size: 14px; color: #8A5A00; }
.pick-check { display: grid; place-items: center; flex: none; width: 28px; height: 28px; color: transparent; border: 2.5px solid var(--edge); border-radius: 50%; }
.pick.on { background: var(--p-soft); }
.pick.on .pick-check { color: #fff; background: var(--good); }
.add-inline { display: flex; gap: 8px; margin-top: 10px; }
.ob-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 22px; }
.ob-nav .btn-big { flex: 1; }

/* ---------- ごほうび画面 ---------- */
.bank { display: flex; align-items: center; gap: 14px; color: #3A2A00; background: linear-gradient(135deg, #FFF5CC, #FFD45E); }
.bank .muted { color: #7A5A12; }
.bank-coin { font-size: 58px; line-height: 1; animation: coinSpin 3.2s ease-in-out infinite; }
.bank-label { font-size: 14px; font-weight: 900; }
.bank-num { font-size: 50px; line-height: 1.05; }
.rewards { display: grid; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
.reward { display: grid; grid-template-columns: 30px 42px 1fr auto; align-items: center; gap: 8px; padding: 10px 8px 10px 6px; background: var(--card); border: 2.5px solid var(--edge); border-radius: 18px; box-shadow: 0 3px 0 var(--edge); }
.reward.ready { color: #3A2A00; background: linear-gradient(135deg, #FFFBE3, #FFEDA6); }
.reward.ready .rw-meta { color: #7A5A12; }
.reward.goal { box-shadow: 0 3px 0 var(--edge), inset 0 0 0 2.5px var(--p); }
.star { padding: 0; font-size: 24px; color: #FFB800; background: none; border: none; cursor: pointer; }
.rw-emoji { font-size: 32px; text-align: center; }
.rw-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rw-name { font-weight: 900; overflow-wrap: anywhere; }
.rw-meta { font-size: 12px; font-weight: 700; color: var(--muted); }
.rw-meta .num { font-size: 13px; }
.rw-btns { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.history { margin: 8px 0 0; padding: 0; list-style: none; }
.history li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed color-mix(in srgb, var(--edge) 30%, transparent); }

/* ---------- せいちょう画面 ---------- */
.growth-hero { display: flex; align-items: center; gap: 14px; }
.radar { display: block; width: 100%; max-width: 340px; margin: 0 auto; }
.radar-grid { fill: none; stroke: color-mix(in srgb, var(--ink) 16%, transparent); stroke-width: 1.5; }
.radar-axis { stroke: color-mix(in srgb, var(--ink) 12%, transparent); stroke-width: 1.5; }
.radar-val { fill: color-mix(in srgb, var(--p) 42%, transparent); stroke: var(--p-ink); stroke-width: 3; stroke-linejoin: round; transform-origin: 150px 140px; animation: radarIn .8s cubic-bezier(.2, 1.4, .4, 1); }
.radar-emoji { font-size: 20px; }
.radar-num { font-family: var(--font-num); font-size: 13px; fill: var(--ink); }
.stat-list { display: grid; gap: 12px; margin: 6px 0 10px; padding: 0; list-style: none; }
.stat-row { display: grid; gap: 4px; }
.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-name { flex: 1; font-size: 14px; font-weight: 900; white-space: nowrap; }
.stat-val { font-size: 18px; min-width: 3.2em; text-align: right; }
.stat-bar { height: 16px; background: var(--under, var(--soft)); }
.stat-bar i { position: relative; overflow: hidden; background: var(--c); border-radius: 999px 0 0 999px; animation: barIn .9s cubic-bezier(.2, .9, .3, 1) both; }
.stat-bar i[style*="width:100%"] { border-radius: 999px; }
.stat-bar.shiny i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.7) 50%, transparent 80%); transform: translateX(-100%); animation: shine 2.2s ease-in-out infinite; }
.stat-bar.max i { background: linear-gradient(90deg, #FF4D6A, #FF9F1C, #FFD23F, #3DDC97, #1FB6FF, #8B5CF6); }
.stat-next { font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; }
.lap-chip { padding: 0 9px; font-size: 11.5px; font-weight: 900; line-height: 1.7; color: #1C2045; background: var(--c); border: 2px solid var(--edge); border-radius: 999px; }
.lap-chip.max { color: #fff; background: linear-gradient(90deg, #FF4D6A, #FF9F1C, #FFD23F, #3DDC97, #1FB6FF, #8B5CF6); text-shadow: 0 1px 0 rgba(0,0,0,.4); }
@keyframes barIn { 0% { width: 0; } }
.stat-grid, .report-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.report-nums { grid-template-columns: repeat(4, 1fr); }
.stat-grid > div, .report-nums > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 4px; text-align: center; background: var(--soft); border-radius: 16px; }
.stat-grid b, .report-nums b { font-size: 24px; line-height: 1.2; }
.report-nums small { font-size: 13px; }
.stat-grid span, .report-nums span { font-size: 11px; font-weight: 800; line-height: 1.5; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; font: inherit; background: none; border: none; cursor: pointer; }
.badge .badge-medal { width: 58px; height: 58px; font-size: 30px; box-shadow: 0 3px 0 var(--edge); }
.badge:not(.got) .badge-medal { color: var(--muted); background: var(--soft); font-family: var(--font-num); font-size: 22px; }
.badge-name { font-size: 10.5px; font-weight: 800; line-height: 1.35; text-align: center; }
.badge-big { display: grid; place-items: center; width: 120px; height: 120px; margin: 4px auto 10px; font-size: 64px; background: var(--soft); border: 3px solid var(--edge); border-radius: 50%; }
.badge-big.got { background: radial-gradient(circle at 32% 28%, #FFF8D0, #FFC531 55%, #E39B00); animation: medal 1s cubic-bezier(.2, 1.6, .4, 1); }
.rank-road { margin: 0; padding: 0; list-style: none; }
.rank-road li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; font-weight: 800; opacity: .5; }
.rank-road li.past { opacity: .85; }
.rank-road li.now { opacity: 1; background: var(--p-soft); border-radius: 12px; }
.rank-dot { width: 24px; height: 24px; background: var(--ring); border: 2px solid var(--edge); border-radius: 50%; }

/* ---------- カレンダー ---------- */
.streak-card { display: flex; align-items: center; gap: 12px; }
.flame { font-size: 50px; filter: grayscale(1); opacity: .45; }
.flame.lit { filter: none; opacity: 1; animation: flicker 1.2s ease-in-out infinite; }
.streak-num { font-weight: 900; }
.streak-num b { font-size: 42px; line-height: 1.1; margin-right: 4px; }
.freeze { display: flex; flex-direction: column; align-items: center; padding: 4px 10px; font-size: 26px; color: #10324A; background: #E0F4FF; border: 2px solid var(--edge); border-radius: 14px; }
.freeze b { font-size: 15px; }
.freeze-note { margin: -6px 4px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h2 { font-size: 22px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week span { font-size: 12px; font-weight: 800; text-align: center; color: var(--muted); }
.cal-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; font: inherit; background: var(--soft); border: 2px solid transparent; border-radius: 12px; cursor: pointer; }
.cal-cell.blank { background: none; cursor: default; }
.cal-d { position: absolute; top: 1px; left: 5px; font-size: 10px; opacity: .6; }
.cal-st { font-size: clamp(18px, 6vw, 28px); line-height: 1; animation: stickIn .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.cal-n { position: absolute; right: 4px; bottom: 1px; font-size: 10px; }
.cal-cell.today { border-color: var(--p); }
.cal-cell.perfect { color: #3A2A00; background: linear-gradient(135deg, #FFF4B5, #FFD24A); border-color: #D69A00; }
.cal-cell.rare .cal-st { animation: rareGlow 2s ease-in-out infinite; }
.cal-cell.picked { outline: 3px solid var(--edge); outline-offset: 1px; }
.cal-legend { margin-top: 8px; }
.day-detail { margin-top: 12px; padding-top: 10px; border-top: 2px dashed color-mix(in srgb, var(--edge) 25%, transparent); }
.day-title { font-weight: 900; }
.rec-list { margin: 6px 0 0; padding: 0; list-style: none; }
.rec-list li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed color-mix(in srgb, var(--edge) 22%, transparent); }
.rec-list .num { font-size: 13px; }
.minus { color: var(--bad); }
.sticker-book { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-top: 8px; }
.stk { position: relative; display: grid; place-items: center; aspect-ratio: 1; font-size: 26px; font-weight: 900; color: var(--muted); background: var(--soft); border-radius: 12px; }
.stk.got { background: var(--card); }
.stk.rare.got { background: linear-gradient(135deg, #FFF6C8, #FFD9F5, #D9F1FF); }
.stk i { position: absolute; right: 3px; bottom: 0; font-size: 10px; font-style: normal; color: var(--ink); filter: none; }

/* ---------- おうちの人 ---------- */
.fam-intro { display: flex; align-items: center; gap: 12px; }
.fam-intro h2 { font-size: 19px; font-weight: 900; }
.compare { margin-top: 8px; font-weight: 900; }
.compare.up { color: var(--good); }
.compare.down { color: var(--muted); }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 6px; height: 140px; margin: 14px 0 8px; }
.wb { display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; }
.wb-n { height: 16px; font-size: 12px; }
.wb-bar { display: flex; flex: 1; align-items: flex-end; width: 72%; overflow: hidden; background: var(--soft); border-radius: 10px; }
.wb-bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--p), var(--s)); border-radius: 10px; animation: growUp .7s cubic-bezier(.2, 1.3, .4, 1) both; transform-origin: bottom; }
.wb-d { font-size: 12px; font-weight: 800; }
.wb.today .wb-d { color: var(--p-ink); font-weight: 900; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tips { margin-top: 12px; padding: 12px 14px; background: var(--soft); border-radius: 16px; }
.tips-h { margin-bottom: 6px; font-weight: 900; }
.tips ul { display: grid; gap: 6px; margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 1.7; }
.stamp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.stamp-opt { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; font: inherit; background: var(--card); border: 2px solid var(--edge); border-radius: 16px; cursor: pointer; }
.stamp-opt span { font-size: 34px; line-height: 1.2; }
.stamp-opt small { font-size: 12px; font-weight: 800; }
.stamp-opt.on { background: var(--p-soft); box-shadow: inset 0 0 0 2.5px var(--p); }
.lock-state { font-size: 13px; font-weight: 800; color: var(--muted); }
.menu { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.menu button { display: block; width: 100%; padding: 11px 14px; font: inherit; font-weight: 800; text-align: left; background: var(--card); border: 2px solid var(--edge); border-radius: 14px; cursor: pointer; }
.menu button span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.about-body { margin-top: 8px; font-size: 14px; line-height: 1.8; }
.about-body ul { padding-left: 1.2em; }
.about-body li + li { margin-top: 6px; }
.privacy { padding: 10px 12px; background: var(--soft); border-radius: 12px; }

/* ---------- ふっかつのじゅもん（サーバー保存） ---------- */
.spell { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0; }
.spell-g { display: flex; gap: 3px; }
.spell b {
  display: grid; place-items: center; width: 23px; height: 34px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 19px; font-weight: 800;
  background: var(--soft); border: 2px solid var(--edge); border-radius: 7px;
}
.spell-warn { margin: 6px 0 12px; padding: 10px 12px; font-size: 14px; font-weight: 800; color: #6B4000; background: #FFF1CF; border-radius: 12px; }
.spell-notes { margin: 12px 0 0; padding-left: 1.2em; line-height: 1.7; }
.spell-input { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 22px; letter-spacing: .1em; text-align: center; text-transform: uppercase; }
.spell-err { min-height: 1.6em; margin: 6px 0 0; font-size: 13px; font-weight: 800; color: var(--bad); }
.cloud-status { font-weight: 800; }
.cloud-points { margin: 8px 0; padding-left: 1.2em; }
.cloud-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cloud-more summary { margin-top: 12px; color: var(--muted); }
.nudge-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 12px; background: color-mix(in srgb, var(--p-soft) 70%, var(--card)); }
.nudge-ico { font-size: 34px; }
.nudge-btns { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- アニメーション ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(120%); } }
@keyframes glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); box-shadow: 0 3px 0 var(--edge), 0 0 18px 4px rgba(255, 200, 40, .65); } }
@keyframes glowBox { 0%, 100% { box-shadow: 0 4px 0 var(--edge); } 50% { box-shadow: 0 4px 0 var(--edge), 0 0 22px 4px rgba(255, 200, 40, .6); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes checkPop { 0% { transform: scale(.5); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes rowFlash { 0% { background: color-mix(in srgb, var(--good) 45%, var(--card)); transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes wiggle { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-2deg); } 96% { transform: rotate(2deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes bossIdle { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
@keyframes bossHit { 0% { transform: translateX(0); filter: brightness(3); } 25% { transform: translateX(-8px) rotate(-10deg); } 50% { transform: translateX(8px) rotate(8deg); } 100% { transform: translateX(0); filter: none; } }
@keyframes dmgPop { 0% { opacity: 0; transform: translateY(6px) scale(.5); } 30% { opacity: 1; transform: translateY(-6px) scale(1.3); } 100% { opacity: 0; transform: translateY(-22px) scale(1); } }
@keyframes letterJump { 0% { opacity: 0; transform: translateY(30px) scale(.3); } 60% { opacity: 1; transform: translateY(-10px) scale(1.15); } 100% { transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.3); } 100% { opacity: 1; transform: scale(1); } }
@keyframes spinIn { 0% { opacity: 0; transform: scale(.2) rotate(-200deg); } 100% { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
@keyframes chestShake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-12deg) scale(1.05); } 30% { transform: rotate(12deg); } 45% { transform: rotate(-10deg) scale(1.1); } 60% { transform: rotate(10deg); } 75% { transform: rotate(-6deg) scale(1.12); } }
@keyframes chestOpen { 0% { transform: scale(1.12); } 50% { transform: scale(1.45) translateY(-8px); } 100% { transform: scale(1.15); } }
@keyframes flash { 0% { opacity: 0; transform: scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(7); } }
@keyframes medal { 0% { opacity: 0; transform: scale(.2) rotateY(180deg); } 100% { opacity: 1; transform: none; } }
@keyframes bossDie { 0% { transform: scale(1); } 30% { transform: scale(1.2) rotate(-10deg); filter: brightness(2.5); } 60% { transform: scale(.9) rotate(10deg); } 100% { transform: scale(.8) rotate(-90deg) translateX(-14px); filter: grayscale(1); opacity: .55; } }
@keyframes boom { 0% { opacity: 0; transform: scale(.3); } 40% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes stampIn { 0% { opacity: 0; transform: scale(2.6) rotate(-30deg); } 100% { opacity: 1; transform: rotate(-8deg); } }
@keyframes toastIn { 0% { opacity: 0; transform: translateY(-16px) scale(.9); } 100% { opacity: 1; transform: none; } }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
@keyframes comboIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-12deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(4deg); } 70% { opacity: 1; transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -120%) scale(.9); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(3deg); } }
@keyframes coinSpin { 0%, 70%, 100% { transform: rotateY(0); } 85% { transform: rotateY(180deg); } }
@keyframes rareGlow { 0%, 100% { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 6px #FFE066); } 50% { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 14px #FF9DF0); } }
@keyframes stickIn { 0% { opacity: 0; transform: scale(1.8) rotate(-20deg); } 100% { opacity: 1; transform: rotate(-6deg); } }
@keyframes radarIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes growUp { 0% { transform: scaleY(0); } 100% { transform: scaleY(1); } }
@keyframes flipIn { 0% { opacity: 0; transform: translateY(10px) rotateX(40deg); } 100% { opacity: 1; transform: none; } }

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

@media (max-width: 380px) {
  .me-name { max-width: 5em; }
  .hdr-btn { width: 32px; height: 32px; }
  .lv-num { font-size: 40px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .badges { grid-template-columns: repeat(3, 1fr); }
}
