:root {
  --bg: #fff8e7;
  --ink: #3d3429;
  --muted: #7a6e5f;
  --accent: #ff8fab;
  --accent-deep: #ff6b8a;
  --sky: #a8e6ff;
  --card: #ffffffee;
  --done: #2a9d8f;
  --todo: #c9bfb2;
  --next: #e85d04;
  --shadow: 0 12px 32px rgba(61, 52, 41, 0.12);
  --radius: 24px;
  --font: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100dvh;
  background-color: #fff4e4;
  color: var(--ink);
  font-family: var(--font);
}
body {
  background-image:
    radial-gradient(1200px 640px at 50% -8%, #ffe0ea 0%, rgba(255, 224, 234, 0) 72%),
    radial-gradient(900px 560px at 100% 110%, #d7f3ff 0%, rgba(215, 243, 255, 0) 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 32px; }

.topbar { text-align: center; margin-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-icon { font-size: 1.5rem; }
.topbar h1 { margin: 0; font-size: 1.35rem; letter-spacing: 0.03em; }
.tagline { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }

.hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.hud.hidden { visibility: hidden; }
.hud-item {
  background: var(--card);
  border-radius: 14px;
  padding: 8px 6px;
  text-align: center;
  box-shadow: var(--shadow);
}
.hud-label { display: block; font-size: 0.68rem; color: var(--muted); }
.hud-item span:last-child { font-weight: 700; font-size: 1.02rem; }
.hud-mode {
  grid-column: 1 / -1;
  background: var(--card);
  border-radius: 14px;
  padding: 8px 10px;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
}
.hud-mode.is-ranked { background: #fff0f4; color: #9a3b18; }
.result-mode-note { margin: 0 0 8px; font-weight: 700; color: var(--muted); }
.enroll-notice { min-height: 1.2em; font-weight: 800; color: #2a9d8f; font-size: 0.9rem; line-height: 1.45; }
#chk-guardian { width: 20px; height: 20px; flex-shrink: 0; }

.stage-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, #8ed8ff 0%, #d9f3ff 45%, #c8f0a8 78%, #9dd96a 100%);
  min-height: 520px;
}

#game {
  display: block;
  width: 100%;
  height: auto;
  max-height: 38vh;
  pointer-events: none;
}

.typing-panel {
  padding: 8px 16px 10px;
  text-align: center;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(4px);
}
.typing-panel.hidden { display: none; }

.prompt-kana {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.prompt-mean {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}
.prompt-roma {
  margin: 0;
  font-family: "SF Mono", "Menlo", "Consolas", "Courier New", monospace;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  min-height: 1.6em;
  word-break: break-all;
}
.prompt-roma .done { color: var(--done); }
.prompt-roma .next {
  color: var(--next);
  background: #ffe8d6;
  border-radius: 6px;
  padding: 0 3px;
  box-shadow: 0 2px 0 #f4a261;
}
.prompt-roma .todo { color: var(--todo); }
.hint-line {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.osk-wrap {
  padding: 8px 10px 14px;
  background: rgba(255,255,255,0.72);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}
.osk-wrap.hidden { display: none; }
.osk {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  min-width: 0;
}
.osk-row {
  display: flex;
  justify-content: stretch;
  align-items: stretch;
  gap: 3px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.osk-key {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: 34px;
  padding: 0 2px;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid #e8dfd2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 2px 0 #e8dfd2;
  text-transform: uppercase;
  box-sizing: border-box;
}
.osk-key.wide { flex: 1.4 1 0; min-width: 0; font-size: 0.65rem; }
.osk-key.space { flex: 3 1 0; min-width: 0; }
.osk-key.backspace { flex: 1.6 1 0; min-width: 0; }
.osk-key.hl {
  background: linear-gradient(180deg, #ffd166, #ffb703);
  border-color: #f4a261;
  box-shadow: 0 2px 0 #e09f3e;
  color: #3d3429;
  transform: translateY(-1px);
}
.osk-key.hint {
  outline: 4px solid #e85d04;
  background: #ff8fab;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(255, 248, 231, 0.62);
  backdrop-filter: blur(2px);
  z-index: 5;
  overflow: auto;
}
.overlay.hidden { display: none; }

.card {
  width: min(100%, 380px);
  background: var(--card);
  border-radius: 22px;
  padding: 20px 18px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.card.scroll { max-height: min(90vh, 640px); overflow: auto; }
.card.compact { padding: 28px 24px; }
.mascot { font-size: 1.8rem; margin-bottom: 2px; }
.card h2 { margin: 0 0 8px; font-size: 1.3rem; }
.lead { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.level-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.level-label {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: left;
}
.level-btn {
  border: 2px solid #f0e6d8;
  background: #fff;
  border-radius: 14px;
  padding: 10px 4px;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 1.25;
}
.level-btn small { font-weight: 500; color: var(--muted); font-size: 0.68rem; }
.level-btn.active {
  border-color: var(--accent-deep);
  background: #fff0f4;
  box-shadow: 0 0 0 2px rgba(255, 107, 138, 0.25);
}

.check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 10px;
  cursor: pointer;
}
.check input { width: 16px; height: 16px; }

.best { margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); }

.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  margin: 5px 3px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:active { transform: scale(0.96); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 107, 138, 0.35);
  min-width: 150px;
}
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 2px solid #f0e6d8;
}

.countdown {
  margin: 0;
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent-deep);
  line-height: 1;
}

.result-score { font-size: 1.3rem; margin: 6px 0; }
.stats {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  text-align: left;
  font-size: 0.92rem;
}
.stats li {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 10px;
}
.stats li:nth-child(odd) { background: #fff3f7; }
.new-record { color: #e85d04; font-weight: 800; margin: 0 0 8px; }
.new-record.hidden { display: none; }
.result-msg { margin: 0 0 10px; color: var(--muted); min-height: 1.3em; }

.footer {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.76rem;
}
.footer p { margin: 0; }

@media (max-width: 420px) {
  .hud { grid-template-columns: repeat(2, 1fr); }
  .prompt-kana { font-size: 2rem; }
  .prompt-roma { font-size: 1.25rem; }
  .osk-wrap { padding: 8px 6px 12px; }
  .osk-row { gap: 2px; }
  .osk-key { min-width: 0; min-height: 40px; height: 40px; font-size: 0.68rem; padding: 0 1px; }
  .osk-key.wide, .osk-key.backspace { min-width: 0; font-size: 0.58rem; }
  .osk-key.space { min-width: 0; }
}

.ime-hint {
  margin: 8px 0 0;
  color: #9a3b18;
  background: #fff3d6;
  border: 1px solid #f4d48b;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
  line-height: 1.45;
}
.ime-hint.compact {
  margin: 8px auto 0;
  max-width: 92%;
  font-size: 0.74rem;
  padding: 6px 8px;
}
.board-status, .board-me, .rank-result {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.board-status.warn { color: #9a3b18; font-weight: 700; }
.btn.secondary {
  background: linear-gradient(180deg, #7bdff2, #48cae4);
  color: #123;
  box-shadow: 0 8px 18px rgba(72, 202, 228, 0.35);
  min-width: 150px;
}
.btn.danger { color: #9b2226; border-color: #f1c0c2; }
.card.wide { width: min(100%, 460px); }
.subhead { margin: 14px 0 6px; font-size: 1rem; }
.table-wrap { overflow: auto; margin: 8px 0 10px; }
.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.board-table th, .board-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #f0e6d8;
  text-align: left;
}
.board-table th { color: var(--muted); font-weight: 600; }
.guardian-copy { text-align: left; font-size: 0.88rem; color: var(--ink); line-height: 1.55; }
.guardian-copy p { margin: 0 0 8px; }
.fineprint { font-size: 0.72rem; color: var(--muted); text-align: left; line-height: 1.45; }
.pager { margin: 4px 0 10px; }
.osk-key {
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}
.osk-key:active { transform: translateY(1px); }

/* Original star-cat learning layout: natural document flow, no prompt-covering overlays. */
.hidden { display: none !important; }
.stage-wrap { min-height: 0; overflow: visible; background: linear-gradient(155deg,#d9f3ff,#fff8e7); }
#game { max-height: 130px; border-radius:24px 24px 0 0; object-fit:contain; }
.overlay { position: relative; inset:auto; padding:14px; background:transparent; backdrop-filter:none; overflow:visible; }
.card, .card.wide { width:100%; max-width:100%; box-sizing:border-box; }
.card.scroll { max-height:none; overflow:visible; }
.home-entries { display:grid; gap:10px; margin:18px 0; }
.home-entries .btn { width:100%; margin:0; border-radius:18px; padding:16px 12px; font-size:1rem; }
.home-entries small { display:block; font-size:.76rem; font-weight:500; margin-top:5px; }
.route-card { display:block; width:100%; margin:10px 0; background:#fff3d6; border:2px solid #f4d48b; border-radius:16px; padding:16px 8px; }
.star-total { color:#8a5511; font-weight:800; }
#storage-notice { color:#9a3b18; font-size:.85rem; }
#local-controls { font-size:.9rem; }
#local-progress { font-weight:800; color:#365e63; }
#local-next-word { color:#7a6e5f; font-size:.85rem; }
#gentle-feedback { min-height:1.6em; margin:5px 0; color:#365e63; }
#gentle-feedback.brief-cue { color:#9b2226; background:#fff0f1; border-radius:10px; }
#star-spark { display:inline-block; color:#cd8500; opacity:0; pointer-events:none; }
#star-spark.spark { animation:star-wink .65s ease-out; }
@keyframes star-wink { 0%{opacity:1;transform:scale(.7)} 45%{opacity:1;transform:translateY(-5px) scale(1.2)} 100%{opacity:0;transform:translateY(-10px)} }
button:focus-visible, input:focus-visible, summary:focus-visible { outline:3px solid #24697e; outline-offset:3px; }
summary { cursor:pointer; padding:12px; }
#typing-panel:focus { outline:none; }
.osk-key { font-family:inherit; }
@media (max-width:420px) {
  #app { padding:12px 10px 24px; }
  .brand { gap:4px; } .topbar h1 { font-size:1.15rem; }
  .overlay { padding:8px; } .card { padding:16px 10px; }
  .typing-panel { padding:8px; } .btn { max-width:100%; padding:12px 16px; }
  .hud { gap:5px; } #game { max-height:100px; }
  .osk-wrap { overflow-x:visible; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; }
}

#app { width: min(1440px, 100%); max-width: 1440px; }
@media (min-width: 1100px) {
  #app { width: min(1440px, max(1000px, calc(100% - 32px))); }
  .home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
  .prompt-kana { font-size: 64px; }
  .prompt-roma { font-size: 40px; }
  #game { height: 240px; max-height: 240px; }
  .card.wide { width: min(100%, 1200px); }
}
@media (min-width: 1600px) {
  #app { width: min(1440px, max(1200px, calc(100% - 48px))); }
  .prompt-kana { font-size: 80px; }
}
.home-grid { display: grid; gap: 12px; }
.play-card {
  background: #fff;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}
.play-card > .btn:last-child { margin-top: auto; max-width: 100%; align-self: center; }
.play-card h3 { margin: 6px 0; }
.card-art { width: 100%; height: 112px; display: block; overflow: visible; }
.settings-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 12px; }
.hud-row { display: flex; flex-wrap: nowrap; gap: 8px; align-items: stretch; }
.hud-row .hud-item { flex: 1 1 0; min-width: 0; }
.time-bar { display: block; height: 8px; margin-top: 4px; background: #f0e6d8; border-radius: 99px; overflow: hidden; }
#time-bar-fill { display: block; height: 100%; width: 100%; background: #ff8fab; }
.next-word { margin: 4px 0; min-height: 1.2em; color: #7a6e5f; font-size: 1.05rem; }
.score-pop { min-height: 1.2em; margin: 0; font-weight: 800; color: #e85d04; }
.score-pop.show { animation: score-pop .6s ease-out; }
@keyframes score-pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.prompt-kana.miss-flash, .prompt-kana.miss-static {
  color: var(--ink);
  background: #fff3d6;
  outline: 3px solid #e85d04;
  border-radius: 12px;
}
.prompt-kana.miss-flash { animation: miss-wobble .28s linear; }
@keyframes miss-wobble {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-1.2deg); }
  70% { transform: rotate(1.2deg); }
}
@keyframes miss-shake { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
.combo-milestone { margin: 8px auto 0; font-weight: 800; color: #9a3b18; text-align: center; font-size: 22px; }
.combo-milestone:not(.hidden) { display: block; background: #fff3d6; border-radius: 999px; padding: 4px 14px; width: fit-content; }
.play-tools { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
#ime-hint-top { display: none; }
body.fine-pointer .touch-only { display: none; }
body:not(.fine-pointer) .fine-only { display: none; }
body.is-playing .tagline, body.is-playing .footer, body.is-playing .topbar, body.is-playing .hint-line, body.is-playing .prompt-mean { display: none; }
body.is-playing #app { padding-top: 4px; padding-bottom: 4px; }
body.is-playing .typing-panel { padding: 2px 12px 4px; }
body.is-playing .prompt-kana { line-height: 1; }
body.is-playing .next-word, body.is-playing .score-pop, body.is-playing #gentle-feedback { margin: 0; line-height: 1.15; }
body.is-playing .hud { margin-bottom: 4px; }
body.is-playing .hud-item { padding: 4px 4px; }
body:not(.is-playing) #game { height: 0; max-height: 0; }
@media (min-width: 1100px) {
  .topbar { margin-bottom: 4px; }
  .mascot, .lead { margin-bottom: 4px; }
  .card-art { height: 112px; }
  .play-card { padding: 8px; }
  .play-card p, .play-card h3 { margin: 4px 0; }
  #screen-title .card { padding: 10px 12px; }
  .settings-bar { margin-top: 6px; }
}
#screen-title .card { width: min(100%, 1400px); }
.new-record.celebrate { animation: score-pop .8s ease-out; }
.best-gap { min-height: 1.2em; font-weight: 800; color: #365e63; }
.stage-wrap { position: relative; }
.combo-milestone {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  pointer-events: none;
}
#final-score { display: block; font-size: clamp(64px, 7vw, 96px); line-height: 0.95; }
#screen-result .result-score { font-size: 1.05rem; }
.new-record { font-size: 1.45rem; }
.home-levels { grid-template-columns: 1fr; }
.home-levels .level-btn { font-size: 0.82rem; padding: 8px 6px; }

.hud {
  display: block;
  width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 8px 14px 10px;
  box-shadow: var(--shadow);
}
.hud-row { width: 100%; }
.hud-item { background: transparent; box-shadow: none; padding: 2px 4px; }
.time-bar { width: 100%; height: 12px; margin-top: 6px; }
#time-bar-fill { width: 100%; }
#screen-result .stats-main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
#screen-result .stats-main li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  background: #fff3f7;
  border-radius: 16px;
  padding: 14px 8px;
  min-height: 92px;
}
#screen-result .stats-main strong { font-size: clamp(28px, 3vw, 42px); line-height: 1; }
body.is-playing #app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.is-playing main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.is-playing .stage-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}
body.is-playing #game {
  width: 100%;
  flex: 1 1 auto;
  height: clamp(240px, 34vh, 520px);
  min-height: clamp(240px, 34vh, 520px);
  max-height: none;
}
@media (min-width: 1100px) {
  .hud-item #score,
  .hud-item #timer,
  .hud-item #combo,
  .hud-item #accuracy,
  .hud-item #hud-best { font-size: 28px; line-height: 1; font-weight: 800; }
  .score-pop.show { font-size: 32px; }
  #screen-result .card { width: min(100%, 920px); }
}
@media (min-width: 1600px) {
  body.is-playing #game { height: clamp(360px, 48vh, 640px); min-height: clamp(360px, 48vh, 640px); }
  .prompt-kana { font-size: clamp(80px, 8vh, 96px); }
}
#screen-result .stats-main strong { font-size: clamp(18px, 2vw, 28px); }
#screen-result .stats-main li { min-height: 64px; padding: 8px 6px; }
#screen-result .card { padding-top: 10px; padding-bottom: 8px; }
@media (max-height: 800px) {
  .mascot, #screen-title .lead { display: none; }
  .topbar { margin-bottom: 2px; }
  #screen-title .card { padding: 4px 8px; }
  #screen-title .home-title, #screen-title .star-shelf, #screen-title .title-track { margin: 0; }
  .card-art { height: 96px; }
  .play-card { padding: 6px; }
  .play-card h3, .play-card p { margin: 2px 0; }
  .settings-bar { margin-top: 4px; }
  .footer { margin-top: 2px; }
  #app { padding-top: 6px; padding-bottom: 6px; }
  #route-total { margin: 2px 0; }
}
@media (min-height: 801px) {
  #screen-title .lead { margin-bottom: 2px; }
  #screen-title .mascot { margin-bottom: 0; }
  #screen-title .title-track { margin: 0; }
  #screen-title .card { padding-top: 4px; padding-bottom: 4px; }
}
@media (min-width: 1600px) and (min-height: 900px) {
  body:not(.is-playing) #app { min-height: 100dvh; display: flex; flex-direction: column; }
  body:not(.is-playing) main,
  body:not(.is-playing) .stage-wrap,
  #screen-title { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  #screen-title .card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  .home-grid { flex: 1 1 auto; align-items: stretch; }
  .card-art { height: clamp(140px, 22vh, 240px); }
  .play-card { padding: 18px 16px; display: flex; flex-direction: column; }
  .play-card h3 { font-size: 1.6rem; }
  .home-levels .level-btn { font-size: 1rem; padding: 12px 8px; }
}
.home-title, .star-shelf { margin: 0; font-size: 1rem; line-height: 1.2; font-weight: 800; color: #365e63; }
.home-title .en, .star-shelf .en { display: inline; margin-left: 0.35em; font-size: 1rem; font-weight: 700; }
.shelf-jar { display: inline-block; width: 16px; height: 20px; margin: 0 3px; vertical-align: middle; border: 2px solid #3d9ad6; border-radius: 3px 3px 5px 5px; background: linear-gradient(#fff, #ffd166); }
.title-track { height: 8px; background: #efe6d6; border-radius: 99px; overflow: hidden; margin: 2px 0; }
#title-progress, #result-title-bar { display: block; height: 100%; width: 0; background: #ffd166; }
.result-phase1 { display: flex; flex-direction: row; gap: 16px; align-items: stretch; text-align: left; margin: 0 0 8px; }
#result-stage { flex: 0 0 46%; width: 46%; height: 160px; min-height: 150px; display: block; background: #d9f3ff; border-radius: 12px; }
.result-reward { flex: 1 1 auto; min-width: 0; }
#result-jars, #result-moon, #result-title-progress, #result-title-up, #star-best {
  margin: 0 0 4px;
  font-size: 1.25rem;
  line-height: 1.35;
  font-weight: 800;
  color: #3d3429;
}
#result-title { font-size: 1.25rem; line-height: 1.35; }
#result-title-up { display: inline-block; background: #fff3d6; color: #e85d04; border-radius: 999px; padding: 4px 12px; }
#result-title-up.hidden { display: none !important; }
#result-jars .en, #result-moon .en, #result-title-progress .en, #result-title-up .en, #star-best .en {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
}
.moon-mark { display: inline-block; width: 1.15em; height: 1.15em; margin-right: 0.25em; border-radius: 50%; vertical-align: -0.15em; }
.moon-0 { background: #243044; }
.moon-1 { background: #243044; box-shadow: inset -0.42em 0 0 #f4e3b2; }
.moon-2 { background: linear-gradient(90deg, #243044 50%, #f4e3b2 50%); }
.moon-3 { background: #f4e3b2; }
.moon-4 { background: conic-gradient(#ff8fab, #ffd166, #90dbf4, #c77dff, #ff8fab); }
#result-mode-note { word-break: keep-all; line-break: strict; overflow-wrap: normal; }
body.is-playing .play-tools .btn { padding: 4px 8px; font-size: 0.75rem; }
@media (max-width: 700px) {
  .result-phase1 { flex-direction: column; }
  #result-stage { flex-basis: auto; width: 100%; height: 150px; }
}
@media (min-width: 1100px) and (max-height: 800px) {
  body.is-result .tagline,
  body.is-result .ime-hint { display: none; }
  body.is-result .topbar { position: relative; z-index: 6; display: block; margin-bottom: 0; }
  body.is-result .footer { display: none; }
  body.is-result .stage-wrap,
  body.is-result #screen-result { max-height: none; overflow: visible; position: relative; }
  body.is-result #app { padding-top: 0; padding-bottom: 0; }
  body.is-result #screen-result { margin-top: 0; padding: 0; }
  body.is-result #result-stage { height: 140px; min-height: 140px; }
  body.is-result .result-phase1 { margin-bottom: 2px; }
  body.is-result #result-jars,
  body.is-result #result-moon,
  body.is-result #result-title-progress,
  body.is-result #star-best { margin: 0 0 1px; line-height: 1.15; }
  body.is-result #result-jars .en,
  body.is-result #result-moon .en,
  body.is-result #result-title-progress .en,
  body.is-result #star-best .en { line-height: 1.1; margin: 0; }
  body.is-result #screen-result .card { padding: 4px 10px 2px; max-height: none; overflow: visible; margin: 0; }
  body.is-result #screen-result h2,
  body.is-result #screen-result p { margin-top: 0; margin-bottom: 2px; }
  body.is-result #screen-result .stats-main { gap: 8px; margin: 0; }
  body.is-result #screen-result .stats-main li { min-height: 0; padding: 2px 4px; }
  body.is-result #screen-result .stats-main strong { font-size: 18px; }
  body.is-result #final-score { font-size: 56px; line-height: 0.9; }
  body.is-result #screen-result .new-record { font-size: 1rem; margin: 0; }
  body.is-result #screen-result .btn { padding: 6px 14px; margin: 2px; }
}
#storage-notice:empty { display: none; }

/* WP-AF operator / label typography. No new colors. */
.operator-info p { margin: 0.4em 0; }
.amazon-associate-disclosure { font-weight: 700; }
.affiliate-label {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  color: inherit;
  border: 1px solid currentColor;
  padding: 10px 12px;
  margin: 0 0 16px;
}
.affiliate-label--inline {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  color: inherit;
  border: 1px solid currentColor;
  padding: 2px 8px;
  margin: 0 8px 0 0;
}
