:root {
  --cream: #F7EBD6; --cream-deep: #E9D8BB; --card: #FFF9EE; --ink: #211D1B; --ink-soft: #7A6F65;
  --orange: #FD5E1C; --orange-deep: #CC4510; --moon: #F6C744; --film: #1C1A17;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--cream); color: var(--ink); font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif; }
body { overscroll-behavior: none; }
.screen { min-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.screen.dark { background: var(--film); color: #fff; }
.center { margin: auto; text-align: center; }
.muted { color: var(--ink-soft); font-size: 14px; }
.dark .muted { color: rgba(255,255,255,.6); }
h1 { font-weight: 900; font-size: 26px; margin: 0 0 6px; line-height: 1.4; }
h2 { font-weight: 700; font-size: 17px; margin: 0; }
p { margin: 6px 0; line-height: 1.7; }
.logo { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 22px; }
.logo img { height: 24px; }
.hero { display: block; margin: 8px auto; height: 150px; }
.hero.small { height: 110px; }
.btn { display: block; width: 100%; border: 0; border-radius: 22px; padding: 18px; font: inherit; font-weight: 700; font-size: 18px; color: #fff;
  background: linear-gradient(180deg, #FF7A45, var(--orange)); box-shadow: 0 5px 0 var(--orange-deep), 0 12px 24px rgba(204,69,16,.25); cursor: pointer; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--orange-deep); }
.btn:disabled { background: var(--cream-deep); color: rgba(122,111,101,.7); box-shadow: 0 5px 0 rgba(233,216,187,.6); }
.btn.secondary { background: var(--card); color: var(--ink); box-shadow: 0 4px 0 var(--cream-deep); }
.field { width: 100%; font: inherit; font-size: 22px; font-weight: 700; padding: 14px 4px; border: 0; border-bottom: 2px solid var(--cream-deep); background: transparent; color: var(--ink); outline: none; }
.sticker { display: inline-block; background: var(--card); border-radius: 10px; padding: 6px 12px; font-weight: 700; box-shadow: 0 2px 0 var(--cream-deep); transform: rotate(-2deg); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.bottom { margin-top: auto; padding-top: 16px; }
/* 撮影 */
.finder { position: relative; width: 82%; margin: 8px auto; aspect-ratio: 5 / 6; border-radius: 26px; background: #000; overflow: hidden; box-shadow: 0 0 0 10px #050505, 0 18px 40px rgba(0,0,0,.6); }
.finder video { width: 100%; height: 100%; object-fit: cover; }
.finder .corner { position: absolute; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.9); border-radius: 2px; }
.finder .tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; } .finder .tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.finder .bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; } .finder .br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 18px; }
.counter { justify-self: start; text-align: center; }
.counter b { display: block; width: 64px; height: 44px; line-height: 44px; border-radius: 10px; background: #0a0a0a; border: 1.5px solid rgba(255,255,255,.12); font-size: 28px; font-weight: 900; color: #F7EBD6; }
.counter b.low { color: var(--orange); }
.counter small { display: block; margin-top: 4px; color: rgba(255,255,255,.55); font-size: 11px; }
.shutter { width: 96px; height: 96px; border-radius: 50%; border: 0; background: radial-gradient(circle at 50% 35%, #4a4a4a, #1e1e1e); box-shadow: 0 6px 12px rgba(0,0,0,.6); position: relative; }
.shutter::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #737373; transition: background .2s, box-shadow .2s; }
.shutter.ready::after { background: linear-gradient(180deg, #FF8A55, var(--orange)); box-shadow: 0 0 22px rgba(253,94,28,.55); }
.shutter:active::after { transform: scale(.9); }
.flip { justify-self: end; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 18px; }
.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .16s; }
.flash.on { opacity: .92; }
.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.6); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 700; opacity: 0; transition: opacity .2s; }
.toast.on { opacity: 1; }
/* できあがり */
.prints { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 14px; margin-top: 18px; }
.print { background: #fff; border-radius: 8px; padding: 8px 8px 12px; box-shadow: 0 5px 12px rgba(0,0,0,.12), 0 2px 0 var(--cream-deep); }
.print img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; display: block; }
.print small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 11px; }
.viewer { position: fixed; inset: 0; background: #000; display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 10; }
.viewer.on { display: flex; }
.viewer img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.viewer .close { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 18px; }
.viewer .hint { color: rgba(255,255,255,.75); margin-top: 12px; font-size: 13px; }
.zzz { position: absolute; font-weight: 900; color: var(--ink-soft); animation: floatz 2.4s ease-out infinite; }
@keyframes floatz { from { transform: translateY(0); opacity: .9 } to { transform: translateY(-26px); opacity: 0 } }
.progress { display: flex; align-items: center; gap: 10px; margin: 18px 22px; }
.progress .bar { flex: 1; height: 8px; border-radius: 999px; background: var(--cream-deep); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, rgba(122,111,101,.5), var(--moon)); }
.progress img { height: 26px; }
