:root {
  --bg: #15213c; --bg2: #1d2c4f; --card: #24365e; --line: rgba(255,255,255,.14);
  --ink: #fff; --soft: #b9c6e4; --accent: #ffb703; --accent2: #ff5d73; --good: #5fd38d;
  --font: 'M PLUS Rounded 1c', system-ui, sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 500; line-height: 1.6; }
body { min-height: 100dvh; }
body.racing { overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
button { font: inherit; color: inherit; }

.g-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px; max-width: 560px; margin: 0 auto; font-size: 13px; font-weight: 800; }
.g-brand { color: var(--soft); text-decoration: none; }
.g-title { flex: 1; text-align: center; }
.g-head [data-mg-account] a { color: var(--accent); text-decoration: none; }
body.racing .g-head { display: none; }

.wrap { max-width: 560px; margin: 0 auto; padding: 4px 16px 28px; }
.scr { display: flex; flex-direction: column; gap: 12px; }
.note { margin: 0; font-size: 13px; color: var(--soft); }
.lead { margin: 0; text-align: center; font-size: 14px; }
.h3 { margin: 10px 0 0; font-size: 15px; }
.btn { display: block; width: 100%; min-height: 50px; border: 0; border-radius: 999px; background: var(--accent); color: #1d1d1d; font-weight: 800; font-size: 17px; cursor: pointer; box-shadow: 0 4px 0 #c98a00; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #c98a00; }
.btn:disabled { background: #4a5a7d; color: #b9c6e4; box-shadow: none; cursor: default; }
.btn.sub { background: transparent; color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.link { background: none; border: 0; color: var(--soft); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 8px 12px; min-height: 44px; display: inline-flex; align-items: center; align-self: center; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar h2 { margin: 0; font-size: 20px; }
.back { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card); display: grid; place-items: center; cursor: pointer; flex: none; }
.back svg { width: 22px; height: 22px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; }
.tab { flex: 1; min-height: 40px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--card); color: var(--soft); font-weight: 800; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.tab.on { background: var(--accent); color: #1d1d1d; }
.tab:disabled { opacity: .5; cursor: default; }

/* はじめて */
.logo { margin: 6px 0 0; text-align: center; font-size: 32px; font-weight: 800; line-height: 1.2; color: var(--accent); text-shadow: 0 3px 0 #a65d00; }
.logo span { display: block; font-size: 18px; color: #fff; text-shadow: none; }
.drv-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drv { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; }
.drv canvas { width: 72px; height: 72px; }
.drv b { font-size: 16px; }
.drv small { font-size: 11px; color: var(--soft); line-height: 1.4; text-align: center; }
.drv:hover, .drv:focus-visible { border-color: var(--accent); }

/* ホーム */
.show { position: relative; border-radius: 20px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #3c5ea6, #1c2b52 70%); }
.show.small { border-radius: 16px; }
.show-cv { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.show-top { position: absolute; left: 10px; right: 10px; top: 8px; display: flex; justify-content: space-between; }
.chip { padding: 2px 12px; border-radius: 999px; background: rgba(0,0,0,.35); font-weight: 800; font-size: 14px; }
.wallet { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wallet > div, .ta-box > div, .rec-sum > div { padding: 8px 12px; border-radius: 14px; background: var(--card); }
.lbl { display: block; font-size: 11px; color: var(--soft); }
.wallet b { font-size: 22px; font-variant-numeric: tabular-nums; }
.wallet small { display: block; font-size: 11px; color: var(--soft); }
.news { margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(255,183,3,.15); font-size: 13px; }
.menu { display: flex; flex-direction: column; gap: 10px; }
.mbtn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: 18px; background: var(--card); cursor: pointer; text-align: left; }
.mbtn svg { width: 28px; height: 28px; flex: none; color: var(--accent); }
.mbtn.big { min-height: 72px; background: linear-gradient(135deg, #ff7a3d, #ff4d6d); }
.mbtn.big svg { color: #fff; width: 36px; height: 36px; }
.mbtn.big.ta { background: linear-gradient(135deg, #3d7bff, #7a4dff); }
.mbtn span { display: flex; flex-direction: column; }
.mbtn b { font-size: 18px; }
.mbtn small { font-size: 12px; opacity: .9; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-row .mbtn { flex-direction: row; justify-content: center; gap: 8px; padding: 12px 6px; text-align: center; min-height: 56px; }
.menu-row .mbtn b { font-size: 14px; }
.opts { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.portal-link { color: var(--soft); font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; }

/* グランプリ */
.cup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cup { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 16px; background: var(--card); cursor: pointer; text-align: left; }
.cup:disabled { opacity: .75; filter: saturate(.3); cursor: default; }
.cup-ico { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.cup-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cup-t b { font-size: 16px; }
.cup-t small { font-size: 11px; color: var(--soft); line-height: 1.4; }
.cup-r { flex: none; display: grid; place-items: center; min-width: 28px; color: var(--soft); }
.courses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 374px) { .courses { grid-template-columns: 1fr; } }
.courses li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; background: var(--card); }
.courses li.now { outline: 2px solid var(--accent); }
.courses li.done { opacity: .75; }
.courses canvas { width: 52px; height: 52px; flex: none; }
.courses span { display: flex; flex-direction: column; min-width: 0; }
.courses b { font-size: 13px; line-height: 1.35; }
.courses small { font-size: 12px; color: var(--good); }
.talk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.07); }
.talk canvas { width: 56px; height: 56px; flex: none; }
.talk p { margin: 0; font-size: 14px; }
.talk b { display: block; font-size: 12px; color: var(--accent); }
.stand .res-list { margin-top: 6px; }

/* レース */
.race { gap: 8px; }
.stage { position: relative; width: 100%; aspect-ratio: 256 / 232; border-radius: 14px; overflow: hidden; background: #000; touch-action: none; }
.view { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.hud { position: absolute; inset: 0; pointer-events: none; font-weight: 800; text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.hud-pos { position: absolute; left: 8px; bottom: 6px; line-height: 1; padding: 2px 8px 4px; border-radius: 12px; background: rgba(10,20,40,.45); }
.hud-pos b { font-size: clamp(34px, 11vw, 54px); color: var(--accent); }
.hud-pos span { font-size: 18px; margin-left: 2px; }
.hud-r { position: absolute; right: 6px; top: 6px; text-align: right; padding: 2px 8px; border-radius: 10px; background: rgba(10,20,40,.45); }
.hud-lap { font-size: 13px; }
.hud-lap b { font-size: 18px; }
.hud-time { font-size: 15px; font-variant-numeric: tabular-nums; }
.map { position: absolute; left: 6px; top: 6px; width: 21%; height: auto; opacity: .9; }
.count { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(60px, 22vw, 104px); color: var(--accent); -webkit-text-stroke: 6px #1d2c4f; paint-order: stroke fill; }
.count.go { color: var(--good); }
.lapmsg { position: absolute; left: 0; right: 0; top: 34%; padding: 6px 0; text-align: center; font-size: clamp(22px, 7vw, 32px); color: #fff; background: linear-gradient(90deg, transparent, rgba(255,77,109,.85) 20%, rgba(255,77,109,.85) 80%, transparent); }
.charge { position: absolute; left: 50%; bottom: 8px; width: 60px; height: 6px; margin-left: -30px; border-radius: 3px; background: rgba(255,255,255,.18); opacity: 0; transition: opacity .1s; }
.charge.c0, .charge.c1, .charge.c2 { opacity: 1; }
.charge.c1 { background: #ffd23f; }
.charge.c2 { background: #ff5ad7; }
.cup-r .pl { font-size: 12px; color: var(--soft); }
.item-slot { position: absolute; left: 50%; top: 6px; width: 52px; height: 52px; margin-left: -26px; border-radius: 12px; border: 2px solid rgba(255,255,255,.7); background: rgba(10,20,40,.45); padding: 5px; pointer-events: auto; touch-action: none; cursor: pointer; }
.item-slot svg { width: 100%; height: 100%; display: block; }
/* アイテムを使うボタン（地図の下。アイテムを持っているときだけ出る。2026-10-18 代表の希望。地図は幅の21%の正方形なので、高さでは 21×256/232 ≒ 23.2%） */
.item-use { position: absolute; left: 6px; top: calc(23.2% + 12px); width: max(21%, 64px); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 5px; border-radius: 14px; border: 2px solid var(--accent); background: rgba(10,20,40,.62); box-shadow: 0 0 0 3px rgba(255,183,3,.35); color: #fff; font: 800 14px/1 var(--font, sans-serif); pointer-events: auto; touch-action: none; cursor: pointer; -webkit-user-select: none; user-select: none; animation: iu-pop .25s ease-out; }
.item-use[hidden] { display: none; }
.item-use .iu-ic { width: 40px; height: 40px; display: block; }
.item-use .iu-ic svg { width: 100%; height: 100%; display: block; }
.item-use.on { transform: scale(.94); background: rgba(255,183,3,.4); }
@keyframes iu-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.item-slot b { position: absolute; right: 2px; bottom: 0; font-size: 14px; color: #fff; }
.item-slot.ready { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,183,3,.35); }
.pause { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; cursor: pointer; }
.pause svg { width: 18px; height: 18px; }
/* レース中の操作の切りかえ（ハンドル ⇄ ボタン）。一時停止の左に置く。パソコン（下の操作がない画面）では出さない */
.ctrlsw { position: absolute; right: 56px; bottom: 8px; height: 40px; padding: 0 12px 0 9px; border-radius: 20px; border: 0; background: rgba(0,0,0,.35); color: #fff; display: flex; align-items: center; gap: 5px; font: 700 12px/1 var(--font, sans-serif); cursor: pointer; touch-action: manipulation; }
.ctrlsw svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .ctrlsw { display: none; } }
.panel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; background: rgba(10,18,40,.8); text-align: center; }
.panel p { margin: 0; }
.panel .btn { max-width: 260px; }
.stage.spin .view { animation: shake .18s linear infinite; }
@keyframes shake { 0%,100% { transform: translate(0,0); } 25% { transform: translate(2px,-1px); } 75% { transform: translate(-2px,1px); } }
@media (prefers-reduced-motion: reduce) { .stage.spin .view { animation: none; } }
.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; height: clamp(130px, calc(100dvh - 100vw * 232 / 256 - 40px), 280px); }
body.racing .wrap { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
body.racing .race { min-height: calc(100dvh - 14px); justify-content: space-between; }
@media (hover: hover) and (pointer: fine) { .pads { display: none; } body.racing .race { justify-content: flex-start; } }
.pad { border: 0; border-radius: 18px; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; touch-action: none; cursor: pointer; -webkit-user-select: none; user-select: none; }
.pad svg { width: 44px; height: 44px; }
.pad.on { background: rgba(255,183,3,.45); }
.keys { margin: 0; text-align: center; font-size: 12px; color: var(--soft); }
@media (hover: none) { .keys { display: none; } }

/* 結果 */
.res-h { margin: 8px 0 0; text-align: center; font-size: 14px; color: var(--soft); }
.res-pos { margin: 0; text-align: center; font-size: 52px; font-weight: 800; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; }
.res-time { margin: 0; text-align: center; font-size: 15px; }
.gain { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.gain li { padding: 6px 12px; border-radius: 12px; background: var(--card); text-align: center; }
.gain span { display: block; font-size: 11px; color: var(--soft); }
.gain b { font-size: 18px; color: var(--good); }
.levelup { padding: 10px 12px; border-radius: 14px; background: rgba(95,211,141,.15); font-size: 14px; }
.levelup p { margin: 0; }
.res-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.res-list li { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 8px; }
.res-list li:nth-child(odd) { background: rgba(255,255,255,.04); }
.res-list li.me { background: rgba(255,183,3,.22); }
.res-list .n { width: 1.6em; text-align: right; font-weight: 800; }
.res-list .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.res-list .nm { flex: 1; }
.res-list .t { font-variant-numeric: tabular-nums; }
.trophy { display: grid; place-items: center; min-height: 20px; }

/* ガレージ */
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.stats li { display: grid; grid-template-columns: 6.5em 1fr 2.5em; align-items: center; gap: 8px; font-size: 13px; }
.sbar { position: relative; height: 10px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; }
.sbar::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(255,255,255,.35); }
.sbar i { position: absolute; top: 0; bottom: 0; background: #5fd38d; }
.sbar i.neg { background: #ff6b6b; }
.stats b { text-align: right; font-variant-numeric: tabular-nums; }
.part-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.part { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 2px solid transparent; }
.part.eq { border-color: var(--accent); }
.part.lock { opacity: .6; }
.p-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.p-main b { font-size: 15px; }
.p-main small { font-size: 11px; color: var(--soft); line-height: 1.45; }
.lvs { display: flex; gap: 4px; margin: 3px 0; }
.lvs i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255,255,255,.15); transform: rotate(45deg); }
.lvs i.on { background: var(--accent); }
.p-act { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex: none; min-width: 92px; }
.sbtn { min-height: 44px; padding: 4px 10px; border: 0; border-radius: 10px; background: var(--accent); color: #1d1d1d; font-weight: 800; font-size: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.sbtn small { font-size: 10px; font-weight: 700; }
.sbtn.up { background: #5fd38d; }
.sbtn:disabled { background: #4a5a7d; color: #b9c6e4; cursor: default; }
.eqt { font-size: 12px; text-align: center; color: var(--accent); font-weight: 800; }
.lockt { font-size: 11px; color: var(--soft); text-align: right; display: block; max-width: 110px; }
.paint-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.paint { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 2px solid transparent; border-radius: 12px; background: var(--card); cursor: pointer; }
.paint.on { border-color: var(--accent); }
.paint.lock { opacity: .5; cursor: default; }
.paint .sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); }
.paint small { font-size: 10px; color: var(--soft); text-align: center; line-height: 1.3; }

/* ドライバー */
.drv-card { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; background: var(--card); }
.drv-card canvas { width: 80px; height: 80px; flex: none; }
.drv-card > div { flex: 1; display: flex; flex-direction: column; }
.drv-card b { font-size: 20px; }
.xpbar { height: 10px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; margin: 4px 0; }
.xpbar span { display: block; height: 100%; background: var(--good); }
.drv-card small { font-size: 12px; color: var(--soft); }
.skill-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.skill { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border: 2px solid transparent; border-radius: 14px; background: var(--card); cursor: pointer; text-align: left; }
.skill.on { border-color: var(--good); }
.skill:disabled { opacity: .7; filter: saturate(.3); cursor: default; }
.skill b { font-size: 14px; }
.skill small { font-size: 11px; color: var(--soft); line-height: 1.4; }
.skill .st { font-size: 11px; color: var(--good); font-weight: 800; }
.rival-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rival-list li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--card); }
.rival-list canvas { width: 48px; height: 48px; flex: none; }
.rival-list span { display: flex; flex-direction: column; }
.rival-list small { font-size: 12px; color: var(--soft); }

/* タイムアタック */
.ta-course { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--card); }
.ta-course canvas { width: 96px; height: 96px; flex: none; }
.ta-course > div { display: flex; flex-direction: column; }
.ta-course b { font-size: 20px; }
.ta-course small { font-size: 12px; color: var(--soft); }
.ta-box { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ta-box b { font-size: 20px; font-variant-numeric: tabular-nums; }
.check { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--soft); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.prize { padding: 10px 14px; border-radius: 16px; background: rgba(255,255,255,.05); }
.prize .h3 { margin: 0 0 6px; font-size: 14px; }
.prize-list { list-style: none; margin: 0 0 6px; padding: 0; font-size: 13px; display: grid; gap: 4px; }
.medal { display: inline-block; min-width: 5.5em; margin-right: 6px; padding: 0 8px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 800; text-align: center; }
.medal.m1 { background: #f2c94c; color: #3a2a00; }
.medal.m2 { background: #c9d0d8; color: #222; }
.medal.m3 { background: #c07a3e; color: #fff; }

/* 記録 */
.rec-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rec-sum b { font-size: 16px; display: flex; align-items: center; gap: 1px; flex-wrap: nowrap; white-space: nowrap; }
.rec-grid { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rec-grid li { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 10px; background: var(--card); }
.rec-grid small { font-size: 10px; color: var(--soft); text-align: center; line-height: 1.3; }

/* お知らせ */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5,10,25,.7); }
.modal-box { width: min(380px, 100%); padding: 18px; border-radius: 20px; background: var(--bg2); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.modal-box h3 { margin: 0; font-size: 18px; color: var(--accent); }
.modal-box p { margin: 0; font-size: 14px; }
.modal-box .big { font-size: 40px; font-weight: 800; color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: rgba(0,0,0,.85); font-size: 13px; text-align: center; }

/* 改行を意味のまとまりで（対応するブラウザだけ） */
.note, .lead, .drv small, .cup-t small, .skill small, .p-main small, .panel p, .levelup p, .talk p, .modal-box p, .mbtn small { word-break: auto-phrase; }
.nw { display: inline-block; }
.item-slot:empty { opacity: .45; border-style: dashed; }
.ta-laps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.ta-laps li { display: flex; justify-content: space-between; padding: 4px 12px; border-radius: 10px; background: var(--card); font-variant-numeric: tabular-nums; }
.ta-laps .d { color: var(--soft); }
.ta-laps .d.up { color: var(--good); }
.ta-laps .d.down { color: #ff8a8a; }
@keyframes pop { 0% { transform: scale(1.5); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
.count.pop { animation: pop .25s ease-out; }
@media (prefers-reduced-motion: reduce) { .count.pop { animation: none; } }

/* 挑戦状 */
.mbtn.duel { position: relative; min-height: 64px; background: linear-gradient(135deg, #2f5fd0, #183a8a); }
.mbtn.duel svg { color: #ffd23f; width: 32px; height: 32px; }
.mbtn .new { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #1d1d1d; font-style: normal; font-size: 12px; font-weight: 800; }
.letter { position: relative; padding: 16px 18px 14px; border-radius: 6px; background: #fbf5e6; color: #3a2f22; box-shadow: 0 6px 18px rgba(0,0,0,.35); transform: rotate(-.6deg); }
.letter::before { content: ''; position: absolute; inset: 6px; border: 1px dashed rgba(120,90,50,.35); border-radius: 4px; pointer-events: none; }
.letter-top { display: flex; align-items: center; gap: 12px; }
.letter-top canvas { width: 64px; height: 64px; flex: none; border-radius: 50%; background: #e9dcc0; }
.letter-top small { display: block; font-size: 11px; color: #8a7558; }
.letter-top b { font-size: 18px; }
.letter-text { margin: 12px 0 6px; font-size: 17px; font-weight: 700; line-height: 1.8; word-break: auto-phrase; }
.letter-sign { margin: 0; text-align: right; font-size: 13px; color: #8a7558; }
.res-list li.talkline { display: block; padding: 0; background: none; }

/* スライド操作 */
.slide { grid-column: 1 / -1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-radius: 18px; background: rgba(255,255,255,.08); touch-action: none; -webkit-user-select: none; user-select: none; }
.slide span { font-size: 12px; color: var(--soft); }
.slide-track { position: relative; width: 70%; height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgba(255,183,3,.5), rgba(255,255,255,.12) 45%, rgba(255,255,255,.12) 55%, rgba(255,183,3,.5)); }
.knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.4); transition: transform .05s linear; }
.slide.on .knob { background: var(--accent); }
.wheel { grid-column: 1 / -1; position: relative; display: grid; place-items: center; touch-action: none; -webkit-user-select: none; user-select: none; cursor: grab; }
.wheel[hidden] { display: none; }
.wheel-g { height: 100%; width: auto; max-width: 100%; max-height: 280px; aspect-ratio: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); transition: transform .18s ease-out; will-change: transform; }
.wheel.on .wheel-g { transition: none; }
.wheel-hint { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--soft); pointer-events: none; }
.wheel.on .wheel-hint { opacity: 0; }
.setting { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.sopt { min-height: 44px; padding: 6px 10px; border: 0; border-radius: 12px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.sopt b { color: var(--accent); }

/* 今日のお題 */
.missions { padding: 10px 12px; border-radius: 16px; background: var(--card); }
.missions h3 { margin: 0 0 6px; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.missions h3 small { font-size: 11px; color: var(--soft); font-weight: 500; }
.missions ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.missions li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.missions .ck { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--soft); display: grid; place-items: center; }
.missions li.done .ck { border-color: var(--good); background: var(--good); }
.missions li.done .ck svg { display: block; }
.missions .ck svg { display: none; width: 14px; height: 14px; }
.missions .mt { line-height: 1.4; }
.missions .bar2 { grid-column: 2 / 4; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: -2px; }
.missions .bar2 i { display: block; height: 100%; background: var(--accent); }
.missions li.done .mt { color: var(--soft); text-decoration: line-through; }
.missions .cnt { font-variant-numeric: tabular-nums; color: var(--soft); font-size: 12px; }
.missions .all { margin: 8px 0 0; font-size: 12px; color: var(--soft); }
.missions .all.ok { color: var(--good); font-weight: 700; }
/* タイムトライアル */
.tt-cup { margin: 12px 0 6px; font-size: 14px; }
.tt-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tt-row { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px; padding: 6px 10px; border: 0; border-radius: 14px; background: var(--card); text-align: left; cursor: pointer; }
.tt-row:disabled { opacity: .7; filter: saturate(.3); cursor: default; }
.tt-row canvas { width: 48px; height: 48px; }
.tt-row b { display: block; font-size: 14px; }
.tt-row small { display: block; font-size: 11px; color: var(--soft); font-variant-numeric: tabular-nums; }
.medals { display: flex; gap: 3px; }
.medal-ic { width: 18px; height: 18px; }
.res-medal { display: grid; place-items: center; }
.res-medal .medal-ic { width: 72px; height: 72px; display: block; margin: 0 auto 4px; }
