:root {
  --app-width: 430px;
  --ink: #26233b;
  --muted: #77728b;
  --paper: #fffdf8;
  --soft: #f5f2ff;
  --line: #e7e2f0;
  --primary: #6558d3;
  --primary-dark: #4f43bb;
  --primary-soft: #ebe8ff;
  --coral: #ff9872;
  --green: #16845f;
  --green-soft: #dff5eb;
  --red: #c65353;
  --red-soft: #ffefec;
  --gold: #a96b12;
  --gold-soft: #fff0d5;
  --shadow: 0 18px 50px rgba(54, 43, 102, 0.12);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #ebe8f4; }
body.app-body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: #ebe8f4;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(101, 88, 211, .3); outline-offset: 2px; }

.game-app {
  width: 100%;
  max-width: var(--app-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(40, 31, 78, .08);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(231, 226, 240, .85);
  background: rgba(255, 253, 248, .94);
  backdrop-filter: blur(14px);
}
.brand { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; }
.brand-seal { display: grid; width: 40px; height: 40px; color: #fff; border-radius: 13px; background: var(--primary); box-shadow: 0 8px 20px rgba(101,88,211,.25); font-size: 23px; font-weight: 800; place-items: center; }
.brand div { display: flex; min-width: 0; flex-direction: column; }
.brand strong { font-size: 14px; line-height: 1.2; }
.brand small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { display: grid; width: 40px; height: 40px; flex: 0 0 40px; margin-right: 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; background: #fff; font-size: 18px; place-items: center; }
#settings-button { margin: 0 0 0 8px; }

.screen { display: none; min-height: calc(100vh - 68px); min-height: calc(100dvh - 68px); padding: 22px 18px max(28px, env(safe-area-inset-bottom)); }
.screen.is-active { display: flex; flex-direction: column; animation: screen-in .22s ease-out both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 12px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.hero h1, .region-hero h1, .level-heading h1, .result-hero h1 { margin: 0; font-weight: 900; letter-spacing: -.045em; }
.hero h1 { font-size: clamp(34px, 10vw, 48px); line-height: 1.14; }
.hero p:last-child, .region-hero p, .level-heading p { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.compact-hero { padding: 8px 2px 20px; }

.japan-map { position: relative; display: grid; min-height: 590px; padding: 18px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 30px; background: linear-gradient(155deg, #f7f4ff, #eef5ff 58%, #fff7ef); grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(7, 1fr); gap: 8px; }
.japan-map::before { position: absolute; inset: 30px 24px; opacity: .45; background: radial-gradient(circle at 75% 12%, #b6acef 0 22px, transparent 23px), radial-gradient(circle at 65% 30%, #c7c0f3 0 28px, transparent 29px), radial-gradient(circle at 53% 45%, #d2ccf6 0 34px, transparent 35px), radial-gradient(circle at 40% 62%, #ddd8f7 0 38px, transparent 39px), radial-gradient(circle at 27% 80%, #e6e2fa 0 43px, transparent 44px); content: ""; }
.region-node { position: relative; z-index: 1; display: flex; min-width: 0; min-height: 70px; flex-direction: column; align-items: flex-start; justify-content: center; padding: 10px 12px; text-align: left; border: 1px solid rgba(216,210,233,.95); border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: 0 8px 18px rgba(53,44,91,.08); }
.region-node small { color: var(--muted); font-size: 9px; font-weight: 800; }
.region-node strong { margin-top: 2px; font-size: 15px; }
.region-node span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.region-node.is-open { color: #fff; border-color: var(--primary); background: linear-gradient(145deg, var(--primary), #897de9); box-shadow: 0 14px 28px rgba(101,88,211,.28); transform: scale(1.04); }
.region-node.is-open small, .region-node.is-open span { color: rgba(255,255,255,.82); }
.region-node.is-hidden { border-style: dashed; background: rgba(51,47,69,.84); color: #fff; }
.region-node.is-hidden small, .region-node.is-hidden span { color: #c8c3d5; }
.region-node:disabled { opacity: .78; }
.region-hokkaido { grid-area: 1 / 3 / 2 / 4; }
.region-tohoku { grid-area: 2 / 3 / 3 / 4; }
.region-kanto { grid-area: 3 / 3 / 4 / 4; }
.region-chubu { grid-area: 4 / 2 / 5 / 4; }
.region-kinki { grid-area: 5 / 2 / 6 / 3; }
.region-chugoku { grid-area: 5 / 1 / 6 / 2; }
.region-shikoku { grid-area: 6 / 2 / 7 / 3; }
.region-kyushu { grid-area: 7 / 1 / 8 / 2; }
.map-note { margin: 16px 8px 0; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.6; }

.region-hero { display: flex; align-items: center; padding: 10px 2px 22px; }
.region-hero > div:first-child { flex: 1; }
.region-hero h1 { font-size: 34px; }
.region-emblem { display: grid; width: 92px; height: 92px; margin-left: 10px; border: 1px solid #ded7fa; border-radius: 28px; background: var(--primary-soft); font-size: 46px; place-items: center; transform: rotate(3deg); }
.region-progress-card { margin-bottom: 18px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 10px 26px rgba(53,43,91,.07); }
.region-progress-card > div:first-child { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 12px; }
.region-progress-card span { color: var(--muted); }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e9e5ef; }
.progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #9a8ff2); transition: width .3s ease; }
.stage-list { display: grid; gap: 12px; }
.stage-card { display: flex; width: 100%; min-height: 104px; align-items: center; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 9px 24px rgba(53,43,91,.06); }
.stage-card.is-open { border-color: #cfc8fa; box-shadow: 0 13px 30px rgba(79,67,187,.12); }
.stage-card.is-locked { opacity: .62; background: #f8f6fa; }
.stage-card.final-trial { border-style: dashed; }
.stage-number { display: grid; width: 54px; height: 54px; flex: 0 0 54px; margin-right: 13px; color: var(--primary); border-radius: 17px; background: var(--primary-soft); font-size: 17px; font-weight: 900; place-items: center; }
.stage-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.stage-copy small, .stage-copy span { color: var(--muted); font-size: 10px; }
.stage-copy strong { margin: 3px 0 5px; font-size: 17px; }
.stage-status { color: var(--primary); font-size: 11px; font-weight: 800; }

.level-heading { display: flex; align-items: flex-start; padding: 8px 2px 18px; }
.level-heading > div:first-child { flex: 1; }
.level-heading h1 { font-size: 31px; }
.level-score { display: flex; min-width: 74px; height: 74px; align-items: baseline; justify-content: center; padding-top: 16px; border-radius: 24px; background: var(--primary-soft); }
.level-score strong { color: var(--primary); font-size: 28px; }
.level-score span { color: var(--muted); font-size: 12px; }
.pool-grid { display: grid; margin-bottom: 14px; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pool-card { display: flex; min-width: 0; min-height: 126px; flex-direction: column; align-items: center; justify-content: center; padding: 10px 5px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.pool-card:disabled { opacity: .48; }
.pool-icon { display: grid; width: 31px; height: 31px; margin-bottom: 6px; border-radius: 10px; font-weight: 900; place-items: center; }
.pool-new .pool-icon { color: var(--primary); background: var(--primary-soft); }
.pool-error .pool-icon { color: var(--red); background: var(--red-soft); }
.pool-review .pool-icon { color: var(--green); background: var(--green-soft); }
.pool-card small { color: var(--muted); font-size: 10px; }
.pool-card strong { margin: 2px 0; font-size: 26px; }
.pool-card > span:last-child { color: var(--muted); font-size: 9px; }
.battle-cta { display: flex; width: 100%; min-height: 72px; align-items: center; justify-content: space-between; padding: 13px 18px; color: #fff; border: 0; border-radius: 22px; background: linear-gradient(135deg, var(--primary-dark), #786be1); box-shadow: 0 14px 28px rgba(79,67,187,.24); text-align: left; }
.battle-cta span { display: flex; flex-direction: column; }
.battle-cta small { color: rgba(255,255,255,.72); font-size: 10px; }
.battle-cta strong { margin-top: 3px; font-size: 18px; }
.battle-cta b { font-size: 13px; }
.battle-hint { margin: 9px 4px 20px; color: var(--muted); text-align: center; font-size: 10px; }
.kana-board-card { padding: 16px 12px 14px; border: 1px solid var(--line); border-radius: 25px; background: #fff; box-shadow: 0 12px 28px rgba(53,43,91,.07); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 13px; }
.section-heading small { color: var(--primary); font-size: 9px; font-weight: 800; }
.section-heading h2 { margin: 2px 0 0; font-size: 18px; }
.legend-button { padding: 7px 9px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 9px; }
.kana-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.kana-cell, .kana-empty { min-width: 0; aspect-ratio: .86; }
.kana-cell { position: relative; display: flex; overflow: hidden; flex-direction: column; align-items: center; justify-content: center; padding: 4px 2px; border: 1px solid var(--line); border-radius: 13px; background: #faf9fc; }
.kana-character { font-size: 20px; font-weight: 900; }
.kana-icon { min-height: 15px; margin-top: 2px; font-size: 12px; }
.kana-cell small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.kana-cell.is-error { border-color: #ecb5ab; background: var(--red-soft); }
.kana-cell.is-sealed { border-color: #c9e5d9; background: #effaf6; }
.kana-cell.is-revived { border-color: #b7ddcf; background: var(--green-soft); }
.kana-cell.is-read { border-color: #d7c496; background: var(--gold-soft); }
.kana-cell.is-unread { border-style: dashed; border-color: #d8bf82; }
.boss-card { display: flex; width: 100%; min-height: 100px; align-items: center; margin-top: 16px; padding: 14px; text-align: left; border: 1px dashed #cfc8d8; border-radius: 23px; background: #f8f6fa; }
.boss-card.is-unlocked { border-style: solid; border-color: #dfb660; background: var(--gold-soft); }
.boss-avatar { display: grid; width: 60px; height: 60px; flex: 0 0 60px; margin-right: 12px; border-radius: 18px; background: #e9e5ee; font-size: 34px; place-items: center; filter: grayscale(1); }
.boss-card.is-unlocked .boss-avatar { background: #ffe0a0; filter: none; }
.boss-card > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.boss-card small { color: var(--muted); font-size: 9px; }
.boss-card strong { margin: 3px 0; font-size: 15px; }
.boss-card em { overflow: hidden; color: var(--muted); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }

.battle-screen { background: linear-gradient(180deg, #f4f0ff 0, var(--paper) 42%); }
.battle-topline { display: flex; align-items: center; gap: 10px; }
.exit-battle { padding: 7px 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 10px; }
.battle-progress-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; text-align: center; }
.battle-progress-copy span { color: var(--muted); font-size: 9px; }
.battle-progress-copy strong { margin-top: 2px; font-size: 12px; }
.streak { min-width: 57px; color: var(--primary); text-align: right; font-size: 10px; font-weight: 800; }
.battle-progress { margin: 9px 0 12px; }
.monster-queue { display: flex; min-height: 48px; overflow-x: auto; padding: 4px 1px 7px; gap: 6px; scrollbar-width: none; }
.monster-queue::-webkit-scrollbar { display: none; }
.queue-monster { position: relative; display: flex; width: 39px; height: 39px; flex: 0 0 39px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 19px; transition: .18s ease; }
.queue-monster.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(101,88,211,.12); transform: translateY(-2px); }
.queue-monster.is-defeated { background: var(--green-soft); }
.queue-monster small { position: absolute; right: 2px; bottom: 0; color: var(--muted); font-size: 7px; font-weight: 800; }
.queue-monster i { position: absolute; top: -4px; right: -3px; display: grid; width: 14px; height: 14px; color: #fff; border-radius: 50%; background: var(--red); font-size: 7px; font-style: normal; place-items: center; }
.battle-card { min-height: 560px; padding: 13px 14px 18px; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.monster-stage { position: relative; display: flex; min-height: 120px; align-items: center; justify-content: center; }
.monster-state { position: absolute; top: 3px; left: 0; padding: 5px 8px; color: var(--primary); border-radius: 99px; background: var(--primary-soft); font-size: 8px; font-weight: 900; }
.monster { font-size: 66px; filter: drop-shadow(0 10px 12px rgba(47,37,87,.12)); }
.seal-points { position: absolute; right: 2px; bottom: 12px; display: flex; gap: 4px; }
.seal-points i { width: 12px; height: 12px; border: 2px solid #cf5560; border-radius: 50%; background: #ff7a7f; }
.seal-points i.is-broken { border-color: #d8d3df; background: transparent; }
.step-kicker { margin: 0 0 9px; color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.learning-emoji { min-height: 74px; font-size: 64px; }
.learning-reading { margin-top: 6px; font-size: 48px; font-weight: 900; letter-spacing: .08em; }
ruby { display: inline-flex; flex-direction: column-reverse; align-items: center; margin: 0 .04em; ruby-position: under; }
rt { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .03em; }
ruby.is-target-kana span { color: #d84646; }
.learning-card-step > strong { display: block; margin-top: 9px; font-size: 18px; }
.audio-pill { min-height: 42px; margin-top: 15px; padding: 8px 14px; color: var(--primary); border: 1px solid #d8d2fb; border-radius: 13px; background: #fff; font-size: 11px; font-weight: 800; }
.question-title { margin: 0 0 15px; font-size: 19px; font-weight: 900; }
.question-word { display: grid; min-height: 110px; margin-bottom: 14px; padding: 14px; border-radius: 22px; background: var(--soft); font-size: 45px; font-weight: 900; letter-spacing: .08em; place-items: center; }
.audio-orb { display: grid; width: 92px; height: 92px; margin: 8px auto 18px; color: #fff; border: 0; border-radius: 50%; background: linear-gradient(145deg, var(--primary), #9487ef); box-shadow: 0 15px 30px rgba(101,88,211,.27); font-size: 30px; place-items: center; }
.prompt-visual { min-height: 62px; font-size: 56px; }
.prompt-visual.has-no-image { display: none; }
.prompt-kana { font-size: 36px; font-weight: 900; }
.prompt-meaning { margin: 8px 0 15px; font-size: 18px; font-weight: 900; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.choice-button { min-height: 64px; padding: 10px 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 17px; background: #fff; font-size: 15px; font-weight: 800; }
.choice-button:active { transform: translateY(1px); }
.choice-button.is-correct { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.choice-button.is-wrong { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.choice-grid.is-image-grid .choice-button { min-height: 90px; }
.choice-grid.is-image-grid .choice-button span { font-size: 42px; }
.typing-form { display: flex; margin-top: 16px; gap: 7px; }
.typing-form input { min-width: 0; min-height: 52px; flex: 1; padding: 11px 13px; border: 1px solid var(--line); border-radius: 15px; font-size: 17px; }
.typing-form button { min-width: 70px; color: #fff; border: 0; border-radius: 15px; background: var(--primary); font-weight: 800; }
.input-rule { display: block; margin-top: 8px; color: var(--muted); font-size: 8px; }
.compose-output { min-height: 52px; margin: 11px 0; padding: 11px; border: 1px dashed #cfc8e0; border-radius: 15px; background: var(--soft); font-size: 24px; font-weight: 900; letter-spacing: .15em; }
.compose-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.compose-bank button { display: grid; width: 49px; height: 49px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: 21px; font-weight: 800; place-items: center; }
.compose-bank button.is-selected { opacity: .36; }
.compose-actions { display: flex; margin-top: 10px; justify-content: center; gap: 8px; }
.compose-actions button { padding: 8px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 10px; }
.compose-actions button:last-child { color: #fff; border-color: var(--primary); background: var(--primary); }
.answer-feedback { margin-top: 15px; padding: 13px; text-align: left; border-radius: 17px; }
.answer-feedback.is-correct { color: #116d50; background: var(--green-soft); }
.answer-feedback.is-wrong { color: #a23f42; background: var(--red-soft); }
.answer-feedback > strong { font-size: 11px; }
.feedback-detail { display: flex; align-items: center; margin-top: 10px; color: var(--ink); }
.feedback-detail > span { width: 42px; text-align: center; font-size: 31px; }
.feedback-detail > div { display: flex; min-width: 0; flex: 1; flex-direction: column; margin-left: 7px; }
.feedback-detail > div > div { font-size: 20px; font-weight: 900; }
.feedback-detail rt { font-size: 7px; }
.feedback-detail small { color: var(--muted); font-size: 9px; }
.feedback-detail button { width: 35px; height: 35px; border: 0; border-radius: 11px; background: rgba(255,255,255,.75); }
.battle-actions { margin-top: 13px; }
.primary-button, .secondary-button, .danger-button { width: 100%; min-height: 52px; padding: 11px 16px; border-radius: 16px; font-size: 14px; font-weight: 900; }
.primary-button { color: #fff; border: 0; background: var(--primary); box-shadow: 0 10px 24px rgba(101,88,211,.22); }
.secondary-button { color: var(--ink); border: 1px solid var(--line); background: #fff; }
.danger-button { color: #fff; border: 0; background: var(--red); }

.special-card { margin: auto 0; padding: 28px 20px; text-align: center; border: 1px solid #d9cb9a; border-radius: 30px; background: linear-gradient(155deg, #fffdf4, #fff3d5); box-shadow: 0 18px 45px rgba(105,77,20,.1); }
.special-kana { font-size: 104px; font-weight: 900; line-height: 1.1; }
.special-reading { display: inline-block; margin-top: 4px; padding: 4px 12px; color: var(--gold); border-radius: 99px; background: #fff; font-size: 14px; font-weight: 900; }
.special-card h1 { margin: 18px 0 8px; font-size: 23px; }
.special-card p { margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.75; }
.screen-footer { margin-top: auto; padding-top: 22px; }

.result-hero { padding: 16px 0 18px; text-align: center; }
.result-burst { display: grid; width: 100px; height: 100px; margin: 0 auto 15px; color: #fff; border: 8px solid #fff; border-radius: 50%; outline: 2px solid var(--primary); background: var(--primary); box-shadow: 0 16px 34px rgba(101,88,211,.22); font-size: 42px; font-weight: 900; place-items: center; }
.result-burst.is-perfect { color: #633b00; outline-color: #e0aa3d; background: #ffd777; }
.result-hero h1 { font-size: 29px; }
.result-hero p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.result-stats { display: grid; margin-bottom: 15px; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-stats div { display: flex; min-height: 82px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.result-stats strong { color: var(--primary); font-size: 23px; }
.result-stats span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.result-words { display: grid; padding: 12px; border: 1px solid var(--line); border-radius: 22px; background: #fff; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.result-word { display: flex; min-width: 0; padding: 7px 2px; flex-direction: column; align-items: center; border-radius: 12px; }
.result-word.is-sealed { background: var(--green-soft); }
.result-word.is-escaped { background: var(--red-soft); }
.result-word span { font-size: 22px; }
.result-word strong { margin-top: 2px; font-size: 12px; }
.result-word small { color: var(--muted); font-size: 7px; }
.result-actions { display: grid; gap: 9px; }

.modal-layer[hidden] { display: none; }
.modal-layer { position: fixed; z-index: 100; top: 0; bottom: 0; left: 50%; display: flex; width: min(100%, var(--app-width)); align-items: flex-end; justify-content: center; padding: 18px; transform: translateX(-50%); }
.modal-backdrop { position: absolute; z-index: 0; inset: 0; background: rgba(31,27,47,.55); backdrop-filter: blur(4px); }
.modal-card { position: relative; z-index: 1; width: 100%; max-height: min(82vh, 700px); padding: 23px 18px max(20px, env(safe-area-inset-bottom)); overflow-y: auto; border-radius: 28px 28px 20px 20px; background: var(--paper); box-shadow: 0 25px 70px rgba(23,18,44,.28); animation: modal-in .2s ease-out both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; z-index: 2; top: 13px; right: 13px; display: grid; width: 35px; height: 35px; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 19px; place-items: center; }
.message-modal, .detail-card { padding-top: 13px; text-align: center; }
.message-modal > span { font-size: 48px; }
.message-modal h2, .detail-card h2, .legend-modal h2, .settings-modal h2 { margin: 10px 0 7px; font-size: 21px; }
.message-modal p, .detail-card p, .settings-modal p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.message-modal > button { margin-top: 11px; }
.modal-actions { display: grid; margin-top: 15px; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-status { display: inline-block; padding: 5px 9px; border-radius: 99px; background: var(--soft); color: var(--primary); font-size: 9px; font-weight: 900; }
.detail-emoji { min-height: 72px; margin-top: 8px; font-size: 64px; }
.detail-reading { font-size: 42px; font-weight: 900; }
.detail-card > strong { display: block; margin-top: 7px; font-size: 17px; }
.detail-card dl { margin: 18px 0 0; padding: 10px 13px; border-radius: 16px; background: var(--soft); }
.detail-card dl div { display: flex; justify-content: space-between; padding: 5px 0; }
.detail-card dt, .detail-card dd { margin: 0; font-size: 10px; }
.detail-card dt { color: var(--muted); }
.legend-modal ul { display: grid; margin: 17px 0 0; padding: 0; list-style: none; gap: 9px; }
.legend-modal li { display: grid; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; grid-template-columns: 18px 66px 1fr; gap: 7px; }
.legend-modal li i { width: 12px; height: 12px; border-radius: 50%; }
.legend-modal li strong { font-size: 11px; }
.legend-modal li span { color: var(--muted); font-size: 9px; }
.dot-new { background: #ddd9e7; }.dot-error { background: var(--red); }.dot-sealed { background: #77bea2; }.dot-revived { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.settings-modal a { display: block; margin-top: 8px; padding: 12px; color: var(--primary); text-decoration: none; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: 11px; font-weight: 800; }
.danger-outline { width: 100%; min-height: 45px; margin-top: 18px; color: var(--red); border: 1px solid #e8b6b2; border-radius: 14px; background: var(--red-soft); font-size: 11px; font-weight: 800; }

@media (min-width: 720px) {
  .modal-layer { align-items: center; }
  .modal-card { border-radius: 28px; }
}
