/* Chikara – ink on washi paper, a vermilion seal for wins, gold for kintsugi and pace,
   amber (kohaku) for "behind". Red never means "behind". */
:root {
  --paper: #f4ecdc;
  --surface: #fbf7ee;
  --surface-2: #ece2cf;
  --ink: #1c1814;
  --ink-soft: #6b6052;
  --line: #ddd1ba;
  --track: #e7dcc6;
  --shu: #c8372d;           /* vermilion: the seal, goal reached */
  --kin: #b8952f;           /* gold: pace marker, kintsugi */
  --kohaku: #b3651b;        /* amber: behind pace, flags */
  --matcha: #5f7d3a;        /* on pace, ahead */
  --w1: #ebe3d3; --w2: #cdbfa6; --w3: #9d8f78; --w4: #5e5447; --w5: #1c1814;   /* ink wash */
  --on-w4: #f4ecdc;
  --snow: #ffffff;
  --shadow: 0 1px 2px rgba(40, 25, 10, .08), 0 4px 14px rgba(40, 25, 10, .06);
  --radius: 16px;
  --font: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", sans-serif;
  --brush: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14110e; --surface: #1e1a16; --surface-2: #2a241e; --ink: #f1e8d6; --ink-soft: #b3a790;
    --line: #3a322a; --track: #2f2822; --shu: #e0503f; --kin: #d9b257; --kohaku: #e0913a; --matcha: #97b468;
    --w1: #3a332b; --w2: #5f574c; --w3: #8f8676; --w4: #c4baa6; --w5: #f1e8d6; --on-w4: #14110e; --snow: #e9e1d0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
body.big { font-size: 19px; }
a { color: var(--ink); text-decoration-color: var(--kin); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-family: var(--brush); font-weight: 800; }
h2 { font-size: 1.15rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .85em; }

/* Header with a faint seigaiha (wave) pattern in ink */
.top {
  position: sticky; top: 0; z-index: 5; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background:
    radial-gradient(circle at 50% 100%, transparent 38%, color-mix(in srgb, var(--ink) 7%, transparent) 39% 41%, transparent 42%) 0 0 / 28px 14px,
    var(--paper);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
}
.top .title { font-family: var(--brush); font-weight: 800; font-size: 1.15rem; flex: 1; display: flex; align-items: center; gap: 8px; }
.top .title .mark { border-radius: 7px; display: block; }
.rank-chip {
  font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
main { max-width: 640px; margin: 0 auto; padding: 12px 16px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px; }

/* Bottom tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: .72rem;
  text-decoration: none; color: var(--ink-soft);
}
.tabs a .ic { font-size: 1.25rem; line-height: 1; filter: grayscale(.6); }
.tabs a.on { color: var(--ink); font-weight: 700; }
.tabs a.on .ic { filter: none; }

/* Day header and swipe */
.dayhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dayhead a, .dayhead span.nav { text-decoration: none; font-size: 1.4rem; padding: 4px 10px; color: var(--ink); }
.dayhead span.nav { opacity: .2; }
.dayhead .label { text-align: center; }
.dayhead .label b { display: block; font-family: var(--brush); }

/* Progress */
.progress { display: grid; grid-template-columns: 1fr; gap: 8px; text-align: center; }
.ring-wrap { position: relative; width: 210px; height: 210px; margin: 0 auto; }
.ring { width: 100%; height: 100%; overflow: visible; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 16; }
.ring-fill { fill: none; stroke: var(--ink); stroke-width: 16; stroke-linecap: round; filter: url(#brush);
  transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring-pace { fill: var(--kin); stroke: var(--surface); stroke-width: 3; }
.ring-seal { transform-box: fill-box; transform-origin: center; }
.ring.hit .ring-seal { animation: stamp .55s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.8) rotate(-18deg); } 100% { opacity: 1; transform: scale(1) rotate(-8deg); } }
.progress { position: relative; }
.seal-inline { position: absolute; top: 14px; right: 14px; transform: rotate(-8deg); animation: stamp .55s cubic-bezier(.3,1.6,.5,1) both; }
.ring-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.big-num { font-family: var(--brush); font-size: 2.9rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.of { color: var(--ink-soft); }
.status { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .85rem; background: var(--surface-2); }
.status.behind { background: color-mix(in srgb, var(--kohaku) 16%, var(--surface)); color: var(--kohaku); }
.status.ahead, .status.on_pace { background: color-mix(in srgb, var(--matcha) 16%, var(--surface)); color: var(--matcha); }
.status.done { background: color-mix(in srgb, var(--shu) 14%, var(--surface)); color: var(--shu); }
.paceline { width: 100%; height: auto; }
.paceline .grid { stroke: var(--line); stroke-dasharray: 4 4; }
.paceline .pace { stroke: var(--kin); stroke-dasharray: 6 5; stroke-width: 2; }
.paceline .you { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.paceline .lbl, .bars .lbl { fill: var(--ink-soft); font-size: 10px; font-family: var(--font); }
.left-big { font-family: var(--brush); font-size: 2.2rem; font-weight: 800; }
.bar-simple { height: 18px; background: var(--track); border-radius: 9px; position: relative; overflow: hidden; }
.bar-simple i { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 9px; transition: width 1s; }
.bar-simple b { position: absolute; top: -3px; bottom: -3px; width: 4px; background: var(--kin); }

/* Chips, chat */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: 7px 12px; font: inherit; font-size: .9rem; cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.chip small { color: var(--ink-soft); }
.chip:active { transform: scale(.96); }
.chat { display: flex; gap: 8px; align-items: flex-end; }
.chat textarea {
  flex: 1; min-height: 46px; max-height: 140px; resize: none; padding: 12px 14px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit;
}
.chat textarea:focus, textarea.plain:focus, input:focus, select:focus { outline: 2px solid var(--kin); outline-offset: 1px; border-color: transparent; }
.iconbtn {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--ink);
  font-size: 1.2rem; cursor: pointer; display: grid; place-items: center;
}
.iconbtn.send { background: var(--ink); color: var(--paper); }
.iconbtn.rec { background: var(--shu); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.photo-preview { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .9rem; }
.photo-preview img { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); padding: 10px 2px; }
.thinking .fig { font-size: 1.6rem; animation: hop .9s ease-in-out infinite; }
@keyframes hop { 0%,100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-8px) rotate(-8deg); } 60% { transform: translateY(0) rotate(6deg); } }

/* Draft cards */
.draft {
  border-left: 4px solid var(--ink); background: var(--surface); border-radius: 12px; padding: 10px 12px; margin: 8px 0;
  box-shadow: var(--shadow); animation: slidein .35s ease-out;
}
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.draft .when { font-weight: 700; color: var(--kohaku); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.draft .row { display: flex; justify-content: space-between; gap: 10px; }
.draft .g { font-family: var(--brush); font-weight: 800; white-space: nowrap; }
.draft .q { margin-top: 6px; font-size: .92rem; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.opts button, .btn {
  border: 1px solid var(--ink); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.danger { border-color: var(--shu); color: var(--shu); }
.btn.block { display: block; width: 100%; padding: 12px; text-align: center; font-weight: 700; }
.note { font-size: .88rem; color: var(--ink-soft); margin-top: 4px; }
.notice { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--kohaku) 13%, var(--surface)); margin: 8px 0; }

/* Entry list with swipe */
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.entries li:last-child { border-bottom: none; }
.entries .swipe { display: flex; gap: 10px; align-items: baseline; padding: 10px 2px; background: var(--surface); transition: transform .2s; position: relative; z-index: 1; touch-action: pan-y; }
.entries .t { color: var(--ink-soft); font-variant-numeric: tabular-nums; width: 3.6em; flex: 0 0 auto; font-size: .9em; }
.entries .f { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entries .p { font-family: var(--brush); font-weight: 800; font-variant-numeric: tabular-nums; }
.entries .flag { color: var(--kohaku); }
.entries .actions { position: absolute; inset: 0 0 0 auto; display: flex; z-index: 0; }
.entries .actions a, .entries .actions button {
  border: none; width: 72px; display: grid; place-items: center; color: #fff; font: inherit; font-size: .85rem; text-decoration: none; cursor: pointer;
}
.entries .actions .edit { background: #5e5447; }
.entries .actions .del { background: var(--shu); }
.entries li.open .swipe { transform: translateX(-144px); }
.empty { text-align: center; padding: 18px 8px; color: var(--ink-soft); }
.empty .fig { font-size: 2.2rem; display: block; }

/* Forms */
label { display: block; margin: 10px 0 4px; font-weight: 700; font-size: .92rem; }
input[type=text], input[type=email], input[type=number], input[type=time], input[type=date], select, textarea.plain {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }

/* Calendar: ink wash, more ink = more protein */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .h { text-align: center; font-size: .72rem; color: var(--ink-soft); }
.cal a, .cal span.c {
  aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; font-size: .8rem; color: var(--ink); background: transparent; border: 1px dashed var(--line);
}
.cal a.l1 { background: var(--w1); border: none; } .cal a.l2 { background: var(--w2); border: none; }
.cal a.l3 { background: var(--w3); border: none; } .cal a.l4 { background: var(--w4); border: none; color: var(--on-w4); }
.cal a.l5 { background: var(--w5); border: none; color: var(--on-w4); }
.cal a small { font-size: .65rem; opacity: .9; }
.cal a.seam { position: relative; border: 1px solid color-mix(in srgb, var(--kin) 35%, var(--line)); background: var(--surface);
  align-items: flex-start; justify-content: flex-start; overflow: hidden; }
.cal a.seam .dn { position: absolute; top: 3px; left: 5px; font-size: .68rem; color: var(--ink-soft); z-index: 1; }
.cal a.seam .crack { position: absolute; inset: 0; width: 100%; height: 100%; }
.crack-gold { fill: none; stroke: var(--kin); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.crack-gold.thin { stroke-width: 1.4; }
.crack-shine { fill: none; stroke: #f6e3a0; stroke-width: .8; opacity: .8; vector-effect: non-scaling-stroke; }
.cal .future { opacity: .35; }
.legend { display: flex; gap: 4px; align-items: center; font-size: .75rem; color: var(--ink-soft); margin-top: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.bars { width: 100%; height: auto; margin-top: 8px; }
.bars .bar { fill: var(--w2); } .bars .bar.good { fill: var(--w4); } .bars .bar.hit { fill: var(--w5); }
.bars .goal { stroke: var(--kin); stroke-width: 1.5; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.stat b { display: block; font-family: var(--brush); font-size: 1.35rem; }
.meter { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--ink); }

/* The rocking doll (okiagari-koboshi) */
.status-row { display: flex; align-items: center; justify-content: center; gap: 8px 10px; flex-wrap: wrap; }
.doll { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-soft); }
.doll svg { overflow: visible; }
.doll .doll-shadow { fill: var(--ink); opacity: .12; }
.doll .doll-body { transform-box: view-box; transform-origin: 50px 112px; }
.doll.standing .doll-body { animation: sway 6s ease-in-out infinite; }
.doll.tipped svg { margin-right: 18px; }
.doll.tipped .doll-body { transform: rotate(72deg) translate(10px, 6px); }
.doll.tipped .doll-eyes { d: path("M38 58 h6 M56 58 h6"); }
.doll.risen .doll-body { animation: rockback 1.6s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes sway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg); } }
@keyframes rockback { 0% { transform: rotate(72deg) translate(10px, 6px); } 30% { transform: rotate(-22deg); }
  50% { transform: rotate(12deg); } 68% { transform: rotate(-6deg); } 84% { transform: rotate(3deg); } 100% { transform: rotate(0); } }
.doll-cap { font-size: .78rem; line-height: 1.25; text-align: left; max-width: 15em; }
.doll-cap small { display: block; font-family: var(--font); font-weight: 400; font-size: .72rem; color: var(--ink-soft); letter-spacing: 0; }
.doll.risen .doll-cap { font-family: var(--brush); font-weight: 800; color: var(--ink); font-size: .95rem; letter-spacing: .04em; }

/* Approve day: ごちそうさま, then 継続は力なり brushed in */
.btn.approve { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 12px; }
.approve-main { font-weight: 700; font-size: 1rem; }
.approve-sub { font-size: .8rem; opacity: .85; font-weight: 400; letter-spacing: .02em; }
.closing { text-align: center; padding: 22px 16px; }
.closing-thanks { font-family: var(--brush); font-weight: 600; color: var(--ink-soft); margin: 0 0 6px; letter-spacing: .1em; }
.closing-thanks small { display: block; font-family: var(--font); font-weight: 400; font-size: .78rem; letter-spacing: 0; margin-top: 2px; }
.motto-brush { font-family: var(--brush); font-weight: 800; font-size: 2.3rem; letter-spacing: .12em; margin: 0;
  animation: brushin 1.8s cubic-bezier(.4, 0, .2, 1) .2s both; }
@keyframes brushin { from { clip-path: inset(0 100% 0 0); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.closing-en { color: var(--ink-soft); margin: 4px 0 12px; animation: slidein .5s ease-out 1.8s both; }
.closing-day { font-family: var(--brush); font-weight: 600; font-size: 1.1rem; margin: 0; }
.closing-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 8px 0 12px; }

/* Suggestion box (目安箱) */
.feedback-foot { text-align: center; margin: 18px 0 4px; }
.feedback-foot a { font-size: .8rem; color: var(--ink-soft); text-decoration: none; border-bottom: 1px dashed var(--line); }
.meyasu-intro { text-align: center; }
.meyasubako { display: block; margin: 0 auto 4px; overflow: visible; }
.meyasubako .box-wood { fill: #8a5a33; } .meyasubako .box-lid { fill: #5e3b1f; } .meyasubako .box-slot { fill: #1c1814; }
.meyasubako .box-label { fill: var(--paper); stroke: #5e3b1f; } .meyasubako .box-kanji { font-family: var(--brush); font-weight: 800; font-size: 13px; fill: #1c1814; }
.meyasubako .box-paper { opacity: 0; } .meyasubako .box-paper rect { fill: #fffdf6; stroke: var(--line); } .meyasubako .box-paper path { stroke: var(--ink-soft); stroke-width: 1; }
.meyasubako.drop .box-paper { animation: drop 1.1s ease-in both; }
@keyframes drop { 0% { opacity: 1; transform: translateY(-30px) rotate(-6deg); } 70% { opacity: 1; transform: translateY(14px) rotate(0); } 100% { opacity: 0; transform: translateY(30px); } }
.fb-features { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-chip input { position: absolute; opacity: 0; pointer-events: none; }
.fb-chip span { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; font-size: .85rem; font-weight: 400; cursor: pointer; background: var(--surface); }
.fb-chip input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fb-chip input:focus-visible + span { outline: 2px solid var(--kin); }
.fb-bubble { background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: 10px 12px; margin: 10px 0 6px; }
.fb-bubble .who { font-weight: 700; display: block; font-size: .8rem; color: var(--ink-soft); }
.fb-item { border-bottom: 1px solid var(--line); padding: 10px 0; } .fb-item:last-child { border-bottom: 0; }
.fb-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-title { font-weight: 700; margin: 6px 0 2px; } h2.fb-title { font-size: 1.1rem; }
.fb-reply { background: color-mix(in srgb, var(--matcha) 10%, var(--surface)); border-left: 3px solid var(--matcha); padding: 6px 10px; border-radius: 6px; margin: 6px 0 0; }
.fb-text { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--ink); white-space: pre-wrap; }
.fb-line { white-space: normal; word-break: break-word; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.fb-owner { margin-top: 8px; display: grid; gap: 8px; }
.fb-filter { display: flex; gap: 6px; flex-wrap: wrap; } .fb-chip-link { font-size: .82rem; text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }
.fb-chip-link.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill-status { font-size: .75rem; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); }
.pill-status.new { background: color-mix(in srgb, var(--kin) 22%, var(--surface)); }
.pill-status.planned { background: color-mix(in srgb, var(--matcha) 18%, var(--surface)); color: var(--matcha); }
.pill-status.built { background: color-mix(in srgb, var(--shu) 14%, var(--surface)); color: var(--shu); }

/* Story links and the Stories page */
.story-link { display: inline-block; font-size: .78rem; color: var(--ink-soft); text-decoration: none; margin-top: 6px;
  border-bottom: 1px solid var(--kin); line-height: 1.3; }
.story-link:hover { color: var(--ink); }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.toc a { font-size: .82rem; text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; background: var(--paper); }
.story { scroll-margin-top: 72px; }
.story .motto { font-family: var(--brush); font-weight: 800; font-size: 1.6rem; letter-spacing: .08em; margin: 4px 0 8px; }
.story .where { font-size: .85rem; color: var(--ink-soft); border-left: 3px solid var(--kin); padding-left: 8px; }
.story .more { font-size: .85rem; }
.story:target { outline: 2px solid var(--kin); outline-offset: 2px; }
.figures { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 8px 0; }
.figures dt { font-weight: 700; white-space: nowrap; } .figures dd { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.swatches { list-style: none; padding: 0; margin: 0; } .swatches li { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.swatches i { width: 22px; height: 22px; border-radius: 6px; flex: 0 0 22px; }

/* The protein mountain */
.mountain { width: 100%; height: auto; display: block; margin: 4px 0 10px; }
.mountain .mt-body { fill: var(--surface-2); }
.mountain .mt-wash { fill: var(--w3); opacity: .85; transition: y 1.2s; }
.mountain .mt-snow { fill: var(--snow); }
.mountain .mt-line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; filter: url(#brush); }
.mountain .mt-st { stroke: var(--ink-soft); stroke-width: 2; }
.mountain .mt-st.passed { stroke: var(--kin); stroke-width: 3; }
.mountain .mt-lbl { fill: var(--ink-soft); font-size: 10px; font-family: var(--font); }
.mountain .mt-you { fill: var(--shu); stroke: var(--surface); stroke-width: 2.5; }
.mountain .mt-sun { fill: var(--shu); opacity: .85; }
.lifetime { display: block; font-size: .82rem; color: var(--ink-soft); text-decoration: none; margin-top: 2px; }

/* Game */
.rank { text-align: center; }
.rank .kanji { font-family: var(--brush); font-weight: 800; font-size: 2.8rem; letter-spacing: .1em; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { text-align: center; background: var(--surface-2); border-radius: 14px; padding: 12px 6px; }
.badge .fig { font-size: 2rem; display: block; }
.badge.locked { opacity: .45; filter: grayscale(1); }
.badge b { display: block; font-size: .85rem; margin-top: 4px; }
.badge small { color: var(--ink-soft); font-size: .7rem; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 20; max-width: 600px; margin: 0 auto;
  background: var(--ink); color: var(--paper); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); animation: slidein .3s;
}

/* Login */
.login { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.login .logo { border-radius: 26px; box-shadow: var(--shadow); display: block; margin: 0 auto 10px; }
.login h1 { font-size: 2.2rem; margin-bottom: .2rem; }
.login .motto { font-family: var(--brush); font-weight: 800; letter-spacing: .08em; margin: 0; }
.login .motto-en { color: var(--ink-soft); font-size: .9rem; margin: 2px 0 8px; }
.login form { text-align: left; }
.code-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; }

/* Simple view: hide extras */
body.simple .extra { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
