/* ピカピカ大掃除 */
:root {
  --accent: #1583b8; --accent-ink: #ffffff; --accent-soft: #dff1fa;
  --pika: #ffcf2e; --pika-ink: #3a2a00;
  --os-scene-bg: #e9e4da;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --accent: #5cc3f0; --accent-ink: #062233; --accent-soft: #123447; --os-scene-bg: #1d2333; }
}
:root[data-theme="dark"] { --accent: #5cc3f0; --accent-ink: #062233; --accent-soft: #123447; --os-scene-bg: #1d2333; }
body { background: var(--bg); }

/* タイトル */
.os-title { display: grid; gap: 14px; }
.os-hero { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: linear-gradient(160deg, #bfe7f7, #e8f6fb 55%, #f6efe0); box-shadow: var(--shadow); }
.os-hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.os-hero-fallback { position: absolute; inset: 0; display: grid; place-items: center start; padding-left: 8%; }
.os-hero-em { font-size: clamp(64px, 18vw, 120px); filter: drop-shadow(0 6px 12px rgba(0,0,0,.15)); }
.os-hero-bubbles { position: absolute; inset: 0; background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.9) 0 8px, transparent 9px), radial-gradient(circle at 34% 64%, rgba(255,255,255,.8) 0 5px, transparent 6px), radial-gradient(circle at 12% 74%, rgba(255,255,255,.7) 0 11px, transparent 12px); }
.os-hero-title { position: absolute; right: 0; top: 0; bottom: 0; width: 52%; display: flex; flex-direction: column; justify-content: center; padding: 0 5% 0 0; text-align: right; }
.os-logo { margin: 0; font-size: clamp(30px, 9.5vw, 60px); line-height: 1.02; font-weight: 900; color: #fff; letter-spacing: .02em;
  text-shadow: 0 2px 0 #0d5f86, 0 4px 0 #0d5f86, 0 6px 14px rgba(0,0,0,.35); }
.os-hero-kicker { margin: 0 0 6px; font-size: clamp(11px, 3vw, 15px); font-weight: 800; color: #0d4f70; background: rgba(255,255,255,.85); padding: 3px 8px; border-radius: 999px; align-self: flex-end; }
.os-daily .mn-btn { flex: none; min-height: 44px; }
.os-cd { font-variant-numeric: tabular-nums; }
.os-title-row { gap: 8px; flex-wrap: wrap; }
.os-friend p { margin: .3em 0 .7em; }

/* 家 */
.os-house { display: grid; gap: 12px; }
.os-house-head { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 120px; background: linear-gradient(160deg, #cfe8f5, #f4ead8); }
.os-house-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.os-house-cap { position: relative; margin: 12px; padding: 10px 14px; background: color-mix(in srgb, var(--surface) 88%, transparent); border-radius: var(--radius-sm); display: inline-block; max-width: calc(100% - 24px); }
.os-house-cap h2 { margin: 0 0 2px; }
.os-house-cap p { margin: 0; }
.os-places { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .os-places { grid-template-columns: 1fr 1fr; } }
.os-place { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.os-place:hover:not(:disabled) { border-color: var(--accent); }
.os-place.is-next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.os-place.is-locked { opacity: .6; cursor: default; }
.os-place.is-locked .os-place-thumb { filter: grayscale(1) blur(1.5px); }
.os-place-thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; font-size: 30px; background: var(--surface-2); }
.os-place-body { display: grid; gap: 2px; min-width: 0; }
.os-place-meta { font-size: 13px; color: var(--text-sub); }

/* 章 */
.os-chapter h2 { margin: .1em 0 .6em; font-family: var(--font-serif); }
.os-lines { display: grid; gap: 10px; margin-bottom: 16px; }
.os-line { margin: 0; display: flex; gap: 10px; align-items: flex-start; line-height: 1.85; font-family: var(--font-serif); font-size: 16px; animation: os-in .5s both; }
.os-line.os-say span:last-child { background: var(--surface-2); padding: 6px 12px; border-radius: 14px; }
.os-face { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); }
.os-face-em { display: grid; place-items: center; font-size: 28px; }
@keyframes os-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.os-item-found { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; padding: 10px; border-radius: var(--radius-sm); background: linear-gradient(120deg, #fff6d1, #fff); color: #3a2a00; border: 1px solid #f1d77a; }
.os-item-found .mn-kicker { margin: 0; color: #9a6b00; }
.os-item-img, .os-item-em { width: 72px; height: 72px; flex: none; object-fit: contain; display: grid; place-items: center; font-size: 46px; }

/* 掃除画面 */
.os-play { display: grid; gap: 6px; justify-items: center; }
.os-play > * { width: 100%; max-width: 600px; }
.os-hud { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.os-hud-l { display: grid; gap: 2px; min-width: 0; }
.os-hud-sub { display: flex; align-items: center; gap: 10px; }
.os-quit { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-sub); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.os-hud-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-time { font-variant-numeric: tabular-nums; color: var(--text-sub); font-weight: 700; }
.os-hud-r { display: flex; align-items: baseline; gap: 2px; }
.os-pct { font-size: 40px; line-height: 1; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.os-pct-u { font-weight: 900; color: var(--accent); }
.os-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.os-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #6fd6ff); transition: width .2s; }
.os-play.is-clear .os-bar i { background: linear-gradient(90deg, var(--pika), #fff2a8); }
.os-scene { position: relative; width: 100%; min-width: min(100%, 300px); aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: var(--os-scene-bg); box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.os-scene-wrap { width: min(100%, 600px, calc(100vh - 360px)); min-width: min(100%, 300px); justify-self: center; touch-action: none; user-select: none; -webkit-user-select: none; }
@supports (height: 100dvh) { .os-scene-wrap { width: min(100%, 600px, calc(100dvh - 360px)); } }
.os-pad { height: 34px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-sub); border-radius: 0 0 8px 8px; background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--accent) 10%, transparent) 8px 16px); cursor: crosshair; }
.os-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.os-fx { cursor: crosshair; touch-action: none; }
.os-pops { position: absolute; inset: 0; pointer-events: none; }
.os-pop { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 26px; color: #fff; white-space: nowrap; text-shadow: 0 0 8px rgba(255,200,0,.9), 0 2px 0 #b07a00; animation: os-pop 1.3s ease-out both; }
.os-pop.is-item { font-size: 16px; background: rgba(255,248,214,.95); color: #6a4a00; text-shadow: none; padding: 4px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.os-pop.is-big { font-size: 40px; animation-duration: 1.9s; }
@keyframes os-pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 30% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -120%) scale(1); } }
.os-tut { position: absolute; transform: translateY(-2px); display: grid; gap: 2px; padding: 6px 9px; border-radius: 10px; background: rgba(10,40,60,.86); color: #fff; pointer-events: none; max-width: 62%; font-size: 13px; line-height: 1.35; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.os-tut-row { display: flex; align-items: center; gap: 4px; color: var(--pika); }
.os-tut-row b { color: #fff; }
.os-tut > span:last-child { font-size: 11.5px; opacity: .9; }
.os-tut.is-gone { opacity: 0; }
.os-tut-row .os-svg { animation: os-nudge 1s ease-in-out infinite; display: inline-flex; }
@keyframes os-nudge { 50% { transform: translateX(-4px); } }
@keyframes os-swipe { 0%, 100% { transform: translateX(-30px); } 50% { transform: translateX(30px); } }
.os-parts { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.os-chip { display: inline-flex; gap: 5px; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; transition: background .2s; }
.os-chip b { font-variant-numeric: tabular-nums; color: var(--accent); }
.os-chip.is-done { background: var(--pika); border-color: var(--pika); color: var(--pika-ink); }
.os-chip.is-done b { color: var(--pika-ink); }
.os-chip.is-done b::before { content: '✓ '; }
.os-hint { margin: 0; min-height: 0; font-size: 14px; font-weight: 700; text-align: center; color: var(--warn); opacity: 0; transition: opacity .3s; }
.os-hint.is-on { opacity: 1; min-height: 1.4em; }
.os-newtool { margin: 0; padding: 6px 10px; text-align: center; font-size: 13px; background: var(--accent-soft); color: var(--text); border-radius: 10px; transition: opacity .5s, max-height .5s, padding .5s; max-height: 80px; overflow: hidden; }
.os-newtool.is-gone { opacity: 0; max-height: 0; padding: 0 10px; }
.os-newtool b { background: var(--pika); color: var(--pika-ink); padding: 1px 6px; border-radius: 6px; }
.os-tools { display: grid; gap: 6px; }
.os-tool-g { display: flex; gap: 5px; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.os-tool-g::-webkit-scrollbar { display: none; }
.os-tool-h { flex: none; writing-mode: vertical-rl; font-size: 11px; color: var(--text-sub); font-weight: 700; display: grid; place-items: center; }
.os-tool { position: relative; flex: 1 1 54px; min-width: 52px; max-width: 120px; min-height: 46px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 4px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.os-tool[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.os-tool-em { width: 24px; height: 24px; display: grid; place-items: center; font-size: 20px; border-radius: 50%; }
.os-tool-img { width: 26px; height: 26px; object-fit: contain; }
.os-tool.is-new::after { content: 'NEW'; position: absolute; top: -6px; right: -4px; font-size: 10px; background: var(--pika); color: var(--pika-ink); padding: 1px 5px; border-radius: 6px; }
.os-tool.is-hint { animation: os-hintp .6s ease-in-out infinite alternate; }
@keyframes os-hintp { to { transform: scale(1.08); box-shadow: 0 0 0 4px var(--pika); } }
.os-find { min-height: 44px; min-width: 44px; padding: 0 10px; margin-right: 8px; align-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-sub); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.os-find.is-ready { background: var(--pika); color: var(--pika-ink); box-shadow: 0 2px 10px rgba(0,0,0,.25); }

/* 結果 */
.os-result { display: grid; gap: 14px; }
.os-res-line { margin: .2em 0; font-size: 22px; line-height: 1.4; }
.os-res-stars { margin: 0; font-size: 40px; color: #f2b400; letter-spacing: 4px; line-height: 1.1; }
.os-tags { flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.os-vs { font-weight: 800; color: var(--accent); margin: .4em 0; }
.os-card-img { width: 100%; height: auto; border-radius: 10px; margin: 8px 0 10px; display: block; aspect-ratio: 1200 / 630; background: var(--surface-2); }
.os-result .mn-btn-block + .mn-btn-block { margin-top: 8px; }
.os-share { border-color: var(--accent); color: var(--accent); }
.os-end-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; margin: 0 0 12px; display: block; }
.os-end-fb { display: grid; place-items: center; font-size: 56px; background: linear-gradient(160deg, #cfe8f5, #f4ead8); }
.os-ends { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.os-ends li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.os-ends li.is-cur { background: var(--pika); color: var(--pika-ink); }

/* 図鑑 */
.os-zukan h3 { margin: 1em 0 .4em; }
.os-zk-places, .os-zk-items { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.os-zk-places li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; }
.os-zk-items { grid-template-columns: 1fr 1fr; }
.os-zk-items li { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 8px; border-radius: 10px; background: var(--surface-2); }
.os-zk-items li.is-none { opacity: .55; }
.os-zk-items img, .os-zk-em { width: 56px; height: 56px; object-fit: contain; font-size: 36px; display: grid; place-items: center; }

@media (prefers-reduced-motion: reduce) {
  .os-line, .os-pop, .os-tut-row .os-svg, .os-tool.is-hint { animation: none !important; }
  .os-pop { opacity: 1; }
}

.os-scene.is-shake { animation: os-shake .28s ease-out; }
@keyframes os-shake { 25% { transform: translate(2px, -1px); } 50% { transform: translate(-2px, 1px); } 75% { transform: translate(1px, 1px); } }

.os-tool-l { white-space: nowrap; font-size: 11.5px; letter-spacing: -.02em; }
.os-find-t { display: none; }
.os-find.is-ready .os-find-t { display: inline; }

.os-svg { display: inline-flex; line-height: 0; }
.os-hud-name { display: flex; align-items: center; gap: 6px; }
.os-hud-thumb { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex: none; }
.os-hud-r { align-items: center; }
.os-chip.is-mile { animation: os-mile .6s ease-out; }
@keyframes os-mile { 30% { background: #fff6c8; border-color: var(--pika); transform: scale(1.08); } }
.os-pop.is-weak { font-size: 13px; color: #fff; background: rgba(150,40,30,.85); text-shadow: none; padding: 2px 8px; border-radius: 999px; }
.os-tool .os-svg.os-tool-img { width: 26px; height: 26px; align-items: center; justify-content: center; }
.os-zk-thumb { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
@media (prefers-reduced-motion: reduce) { .os-chip.is-mile { animation: none; } }
/* 375×740 で道具まで1画面に収める（レビュー1の対応） */
.os-play { gap: 5px; }
.os-hud { align-items: center; }
.os-hud-l { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: nowrap; }
.os-hud-name { min-width: 0; font-size: 15px; }
.os-hud-sub { gap: 6px; flex: none; }
.os-quit { min-height: 30px; padding: 0 10px; }
.os-pct { font-size: 34px; }
.os-find { min-height: 40px; min-width: 40px; }
.os-bar { height: 6px; }
.os-pad { height: 28px; font-size: 10.5px; }
.os-chip { padding: 2px 8px; font-size: 11.5px; }
.os-scene-wrap { width: min(100%, 600px, calc(100vh - 390px)); }
@supports (height: 100dvh) { .os-scene-wrap { width: min(100%, 600px, calc(100dvh - 390px)); } }
@media (max-width: 380px) { .os-hud-name { font-size: 14px; } .os-hud-thumb { display: none; } }
@media (max-width: 420px) { .os-find-t { display: none !important; } .os-hud-r { flex: none; } }
.os-pad { height: 24px; } .os-chip { font-size: 11px; padding: 1px 7px; } .os-parts { gap: 3px; }

/* レビュー2 */
.os-scene-wrap.is-mouse .os-pad { height: 0; overflow: hidden; background: none; font-size: 0; }
.os-zk-places li.is-none .os-zk-thumb { filter: grayscale(1) blur(1.5px); opacity: .6; }
.os-daily b { white-space: nowrap; }
@media (max-width: 380px) { .os-daily b { font-size: 14px; } }
