/* Little Spaces: portrait-first, 9:16, designed at 390 x 844 CSS px. */
:root {
  --paper: #f6ead3; --paper-2: #efdec0; --paper-edge: #dcc59c; --card: #fffaf0;
  --ink: #4a3a3f; --ink-soft: #7d6a6b; --ink-faint: #b4a39a;
  --purple: #7a62b8; --purple-d: #5a4592; --purple-l: #d9cff0;
  --star: #f2c14e; --star-d: #c9962b; --red: #c4513f; --red-l: #f4d3cb; --green: #5e8f52;
  --night: #2f2530; --night-2: #3a2d3c;
  --tape: rgba(234, 214, 168, .88);
  --hand: "Segoe Print", "Bradley Hand", "Noteworthy", "Chalkboard SE", "Marker Felt", cursive;
  --ui: "Nunito", "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --col: min(100vw, calc(100dvh * 0.5625));
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink);
  font-family: var(--ui); font-size: 16px; -webkit-text-size-adjust: 100%;
  overscroll-behavior: none; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
body {
  background:
    radial-gradient(circle at 20% 10%, rgba(122, 98, 184, .18), transparent 40%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 12px, transparent 12px 24px),
    var(--night);
}
img, canvas { -webkit-user-drag: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
[hidden] { display: none !important; }
.hand { font-family: var(--hand); font-weight: 600; letter-spacing: .01em; }
.small { font-size: 13px; } .muted { color: var(--ink-soft); } .center { text-align: center; }

#app {
  position: fixed; top: 0; bottom: 0; left: 50%; width: var(--col); transform: translateX(-50%);
  overflow: hidden; background: var(--night);
}
@media (min-aspect-ratio: 10/16) { #app { box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 30px 80px rgba(0,0,0,.5); } }
.screen { position: absolute; inset: 0; }

/* ---------- loading ---------- */
#loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--paper); z-index: 5; }
#loading p { font-size: 22px; margin: 0; }
.load-rabbit { image-rendering: pixelated; animation: hop 900ms var(--ease-in-out) infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px); } }

/* ---------- paper & polaroids ---------- */
.paper {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.55), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(220,197,156,.35), transparent 40%),
    repeating-radial-gradient(circle at 30% 40%, rgba(160,128,90,.035) 0 1px, transparent 1px 3px);
}
.polaroid { margin: 0; background: var(--card); padding: 9px 9px 0; border-radius: 3px; position: relative; box-shadow: 0 2px 0 rgba(74,58,63,.08), 0 10px 22px rgba(60,40,40,.22); }
.polaroid img, .polaroid canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; background: var(--night-2); }
.polaroid figcaption { text-align: center; padding: 8px 4px 10px; font-size: 18px; color: var(--ink); }
.tape { position: absolute; top: -10px; left: 50%; width: 84px; height: 22px; transform: translateX(-50%) rotate(-3deg); background: var(--tape); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tilt { transform: rotate(-1.5deg); } .tilt-r { transform: rotate(1.6deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px;
  border: 2px solid rgba(74,58,63,.22); border-radius: 14px; background: var(--card); color: var(--ink);
  font-weight: 700; font-size: 16px; box-shadow: 0 3px 0 rgba(74,58,63,.18);
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out), background-color 160ms var(--ease-out);
}
.btn:active:not(:disabled) { transform: translateY(2px) scale(.97); box-shadow: 0 1px 0 rgba(74,58,63,.18); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--purple); border-color: var(--purple-d); color: #fff; box-shadow: 0 3px 0 var(--purple-d); }
.btn-primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--purple-d); }
.btn-danger { color: var(--red); border-color: rgba(196,81,63,.4); }
.btn-ghost { background: transparent; box-shadow: none; border-style: dashed; }
.btn-big { width: 100%; min-height: 60px; font-size: 22px; font-family: var(--hand); border-radius: 18px; flex-wrap: wrap; row-gap: 0; }
.btn-big small { flex-basis: 100%; font-family: var(--ui); font-size: 12px; font-weight: 600; opacity: .85; margin-top: -4px; }
.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center; flex: none; border-radius: 14px;
  border: 2px solid rgba(74,58,63,.22); background: var(--card); color: var(--ink); box-shadow: 0 3px 0 rgba(74,58,63,.2);
  transition: transform 140ms var(--ease-out);
}
.icon-btn:active { transform: translateY(2px) scale(.96); }
.ic { width: 24px; height: 24px; flex: none; }
.ic.tiny { width: 12px; height: 12px; }
.ic.on { fill: var(--star); stroke: var(--star-d); }
.ic.heart { fill: none; stroke: var(--red); width: 18px; height: 18px; vertical-align: -3px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background-color: #fff; }
  .btn-primary:hover:not(:disabled) { background-color: #8670c4; }
  .icon-btn:hover { background: #fff; }
}

/* ---------- scrapbook menu ---------- */
#menu-screen { padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 10px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 10px); perspective: 1400px; }
.book { position: relative; height: 100%; }
.book::before { content: ""; position: absolute; inset: 6px -4px -6px 6px; border-radius: 18px; background: #e3cfa9; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.page {
  position: relative; height: 100%; border-radius: 16px; overflow-y: auto; overflow-x: hidden;
  touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  box-shadow: inset 10px 0 18px -12px rgba(90,60,40,.35), 0 2px 0 var(--paper-edge);
  transform-origin: left center; backface-visibility: hidden;
}
.page-inner { padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sticker-deco .ic { width: 40px; height: 40px; transform: rotate(14deg); filter: drop-shadow(0 2px 0 rgba(0,0,0,.12)); }
.hero { width: min(78%, 300px); align-self: center; transform: rotate(-2deg); margin-top: 4px; }
.hero-photo { background: var(--night-2); overflow: hidden; }
.hero figcaption { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.game-title { font-size: 30px; }
.hero .sub { font-size: 16px; color: var(--ink-soft); }
.years { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; touch-action: pan-x; }
.years::-webkit-scrollbar { display: none; }
.year-chip { flex: none; display: inline-flex; gap: 4px; align-items: center; padding: 8px 14px; border-radius: 12px; font-family: var(--hand); font-size: 18px; background: rgba(255,255,255,.5); border: 2px solid rgba(74,58,63,.12); color: var(--ink-faint); }
.year-chip.is-open { background: #fbe6b6; color: var(--ink); border-color: var(--star-d); box-shadow: 0 2px 0 rgba(201,150,43,.4); }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.slot-card { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 10px; border-radius: 12px; background: var(--card); border: 2px solid rgba(74,58,63,.14); box-shadow: 0 3px 0 rgba(74,58,63,.14); min-height: 132px; transition: transform 140ms var(--ease-out); }
.slot-card:active { transform: scale(.97); }
.slot-card.is-last { border-color: var(--star-d); }
.slot-card b { font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-card small { font-size: 12px; color: var(--ink-soft); }
.slot-thumb { width: 100%; aspect-ratio: 176/150; border-radius: 6px; background: var(--night-2); overflow: hidden; display: grid; place-items: center; }
.slot-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; image-rendering: pixelated; }
.slot-thumb.empty { background: repeating-linear-gradient(-45deg, var(--paper-2) 0 6px, var(--paper) 6px 12px); color: var(--ink-soft); }
.slot-card.is-broken .slot-thumb { color: var(--red); }
.slot-star { position: absolute; top: -10px; right: -8px; }
.slot-star .ic { width: 30px; height: 30px; transform: rotate(12deg); }
.page-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }

.album .page-top { gap: 8px; }
.album-name { flex: 1; margin: 0; font-size: 26px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover { width: min(70%, 260px); align-self: center; padding-bottom: 9px; }
.cover .placeholder { display: grid; place-items: center; aspect-ratio: 176/182; color: var(--paper); font-size: 18px; padding: 20px; text-align: center; }
.section { margin: 8px 0 -4px; font-size: 22px; display: flex; align-items: baseline; gap: 8px; }
.section small { font-family: var(--ui); font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chapter { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.55); }
.chapter.is-locked { opacity: .6; }
.ch-year { font-size: 20px; }
.ch-title { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; }
.ch-title small { font-weight: 600; font-size: 12px; color: var(--ink-soft); }
.ch-stars { display: flex; gap: 2px; color: var(--ink-faint); }
.ch-stars .ic { width: 20px; height: 20px; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.sticker { aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.4); }
.sticker img { width: 72%; height: 72%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 1px rgba(60,40,40,.25)); transform: rotate(-4deg); }
.sticker:nth-child(even) img { transform: rotate(5deg); }
.sticker.is-missing { border: 2px dashed rgba(74,58,63,.2); color: var(--ink-faint); font-family: var(--hand); font-size: 20px; }
.photo-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; touch-action: pan-x; }
.photo-thumb { flex: none; width: 96px; padding: 5px 5px 14px; border: 0; background: var(--card); box-shadow: 0 4px 10px rgba(60,40,40,.2); border-radius: 2px; }
.photo-thumb:nth-child(odd) { transform: rotate(-2deg); } .photo-thumb:nth-child(even) { transform: rotate(2deg); }
.photo-thumb img { width: 100%; display: block; image-rendering: pixelated; aspect-ratio: 176/182; object-fit: cover; background: var(--night-2); }
.achievements { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.achievements li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.4); color: var(--ink-faint); }
.achievements li.is-on { color: var(--ink); background: rgba(255,255,255,.7); }
.achievements span { display: flex; flex-direction: column; }
.achievements small { font-size: 12px; }

/* page turns (scene motion, kept under 300ms each way) */
.turn-out-next { animation: turnOutNext 260ms var(--ease-in-out) forwards; }
.turn-in-next { animation: turnIn 300ms var(--ease-out); }
.turn-out-prev { animation: turnOutPrev 260ms var(--ease-in-out) forwards; transform-origin: right center; }
.turn-in-prev { animation: turnIn 300ms var(--ease-out); }
.fade-out { animation: fadeOut 140ms ease forwards; } .fade-in { animation: fadeIn 160ms ease; }
@keyframes turnOutNext { to { transform: rotateY(-88deg); opacity: .6; } }
@keyframes turnOutPrev { to { transform: rotateY(88deg); opacity: .6; } }
@keyframes turnIn { from { transform: rotateY(10deg) scale(.985); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } } @keyframes fadeIn { from { opacity: 0; } }

/* ---------- game screen ---------- */
#game-screen { touch-action: none; }
#game-canvas { position: absolute; inset: 0; display: block; touch-action: none; image-rendering: pixelated; }
.hud-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 12px) 6px calc(var(--safe-l) + 12px); pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.title-pill {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px;
  padding: 4px 12px; border-radius: 14px; background: var(--card); border: 2px solid rgba(74,58,63,.18); box-shadow: 0 3px 0 rgba(74,58,63,.2);
}
#room-title { font-family: var(--hand); font-weight: 600; font-size: 18px; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#room-sub { font-size: 12px; font-weight: 700; color: var(--ink-soft); line-height: 1.1; }
#room-sub[data-state="odd"] { color: var(--red); } #room-sub[data-state="none"] { color: var(--red); } #room-sub[data-state="ok"] { color: var(--green); }
.zoom-stack { position: absolute; z-index: 2; right: calc(var(--safe-r) + 12px); top: calc(var(--safe-t) + 70px); display: flex; flex-direction: column; gap: 8px; }
.zoom-stack .icon-btn { width: 44px; height: 44px; opacity: .92; }
.hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  padding: 6px calc(var(--safe-r) + 12px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 12px); pointer-events: none;
}
.hud-bottom > * { pointer-events: auto; }
.room-strip { align-self: center; display: flex; gap: 8px; padding: 6px; border-radius: 16px; background: rgba(255,250,240,.9); border: 2px solid rgba(74,58,63,.14); box-shadow: 0 3px 0 rgba(74,58,63,.18); max-width: 100%; overflow-x: auto; }
.room-chip { position: relative; padding: 2px; border-radius: 10px; border: 2px solid transparent; background: var(--night-2); line-height: 0; }
.room-chip canvas, .room-chip img { width: 52px; height: 54px; image-rendering: pixelated; border-radius: 6px; display: block; }
.room-strip { scroll-snap-type: x proximity; scrollbar-width: none; }
.room-strip[hidden] { display: none; }
.room-chip { flex: 0 0 auto; scroll-snap-align: center; min-width: 56px; }
.chip-empty { width: 52px; height: 54px; display: grid; place-items: center; color: rgba(255,250,240,.5); }
.chip-empty .ic { width: 22px; height: 22px; }
.chip-name { position: absolute; left: 2px; right: 2px; bottom: 2px; font: 600 9px/1.2 var(--ui); color: #fffaf0; background: rgba(47,37,48,.72); border-radius: 0 0 6px 6px; padding: 1px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-chip.is-current { border-color: var(--star); box-shadow: 0 0 0 2px rgba(242,193,78,.4); }
.chip-badge { position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.chip-badge .ic { width: 14px; height: 14px; stroke-width: 3; }
.controls { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 10px; align-items: end; }
.ctl {
  min-height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 18px; background: var(--card); border: 2px solid rgba(74,58,63,.2); box-shadow: 0 4px 0 rgba(74,58,63,.22);
  font-weight: 800; font-size: 14px; color: var(--ink);
  transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out), background-color 160ms var(--ease-out), opacity 160ms;
}
.ctl .ic { width: 26px; height: 26px; }
.ctl:active:not(:disabled) { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 rgba(74,58,63,.22); }
.ctl:disabled { opacity: .45; }
.ctl-main { min-height: 80px; font-size: 16px; }
.ctl-main .ic { width: 32px; height: 32px; }
.ctl.is-primary { background: var(--purple); border-color: var(--purple-d); color: #fff; box-shadow: 0 4px 0 var(--purple-d); }
.ctl.is-primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--purple-d); }

#captions { position: absolute; z-index: 1; left: 0; right: 0; top: calc(var(--safe-t) + 110px); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; padding: 0 64px; }
.caption { margin: 0; color: #fff6e6; font-size: 24px; text-align: center; text-shadow: 0 2px 0 rgba(47,37,48,.85), 0 0 14px rgba(47,37,48,.8); opacity: 0; transform: translateY(6px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.caption-big { font-size: 34px; }
.caption.in { opacity: 1; transform: none; } .caption.out { opacity: 0; transform: translateY(-4px); }
#photo-flash { position: absolute; inset: 0; background: #fffaf0; opacity: 0; pointer-events: none; z-index: 3; }
#photo-flash.go { animation: flash 420ms var(--ease-out); }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* ---------- modals & toasts ---------- */
#modal-root, #toasts { position: fixed; top: 0; bottom: 0; left: 50%; width: var(--col); transform: translateX(-50%); pointer-events: none; z-index: 10; }
.modal-wrap { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: auto; padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px); }
.modal-scrim { position: absolute; inset: 0; background: rgba(30, 20, 28, .55); animation: fadeIn 200ms var(--ease-out); }
.modal {
  position: relative; width: 100%; max-width: 380px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  border-radius: 18px; padding: 18px 18px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.4); animation: pop 220ms var(--ease-out);
}
.modal-wrap.closing .modal { animation: popOut 160ms var(--ease-out) forwards; }
.modal-wrap.closing .modal-scrim { animation: fadeOut 160ms forwards; }
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(6px); } }
@keyframes popOut { to { opacity: 0; transform: scale(.97); } }
.modal-title { margin: 0 44px 10px 0; font-size: 26px; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; box-shadow: none; }
.modal-body p { line-height: 1.45; margin: 0 0 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
.menu-list { display: grid; gap: 10px; } .menu-list .btn { justify-content: flex-start; }
.modal-complete .polaroid { margin: 4px auto 10px; width: 88%; }
.modal-complete .stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0; color: var(--ink-faint); }
.modal-complete .stars .ic { width: 44px; height: 44px; }
.modal-photo .polaroid { margin: 0 auto; }
.field { display: grid; gap: 6px; font-weight: 700; margin-bottom: 8px; }
.field input { font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 2px solid rgba(74,58,63,.25); background: #fff; color: var(--ink); }
.file-btn { width: 100%; margin-top: 6px; position: relative; }
.settings section { margin-bottom: 14px; }
.settings h3 { font-family: var(--hand); font-size: 20px; margin: 0 0 6px; }
.slider { display: grid; gap: 4px; margin: 8px 0; font-weight: 700; font-size: 14px; }
.slider input { width: 100%; accent-color: var(--purple); height: 32px; }
.toggle { display: flex; gap: 12px; align-items: center; padding: 8px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex: none; width: 48px; height: 28px; border-radius: 14px; background: var(--ink-faint); position: relative; transition: background-color 160ms var(--ease-out); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform 180ms var(--ease-out); }
.toggle input:checked + .switch { background: var(--purple); }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.toggle input:focus-visible + .switch { outline: 3px solid var(--purple); outline-offset: 2px; }
.tl { display: flex; flex-direction: column; } .tl small { color: var(--ink-soft); font-size: 12px; }

#toasts { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; padding: 0 16px calc(var(--safe-b) + 176px); z-index: 11; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; max-width: 100%; padding: 10px 14px; border-radius: 14px; font-weight: 700; font-size: 14px; box-shadow: 0 8px 20px rgba(0,0,0,.3); animation: toastIn 240ms var(--ease-out); transition: opacity 260ms, transform 260ms var(--ease-out); }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast .btn { min-height: 40px; padding: 6px 12px; }
.toast-sticker { width: 40px; height: 40px; image-rendering: pixelated; object-fit: contain; }
.toast-star .ic { width: 32px; height: 32px; fill: var(--star); stroke: var(--star-d); }
.toast b { font-family: var(--hand); font-size: 16px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- orientation: portrait only on phones ---------- */
#rotate-hint { display: none; position: fixed; inset: 0; z-index: 20; background: var(--night); color: var(--paper); place-items: center; text-align: center; padding: 24px; font-size: 24px; }
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  #rotate-hint { display: grid; }
}

/* ---------- reduced motion ---------- */
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
.reduced-motion .caption { transition: opacity 300ms linear; transform: none !important; }
@media (prefers-reduced-motion: reduce) { .load-rabbit { animation: none; } }

/* short phones: tighten the menu so the first page fits */
@media (max-height: 700px) {
  .hero { width: min(62%, 240px); } .game-title { font-size: 26px; } .slot-card { min-height: 116px; }
  .ctl { min-height: 60px; } .ctl-main { min-height: 70px; }
}

.chapter-btn { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 8px; width: 100%; min-height: 44px; cursor: pointer; }
.chapter:has(.chapter-btn) { display: block; cursor: pointer; transition: transform 140ms var(--ease-out, ease-out); }
.chapter:has(.chapter-btn:focus-visible) { outline: 3px solid var(--star); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .chapter:has(.chapter-btn):hover { transform: translateY(-1px); } }
.chapter:has(.chapter-btn):active { transform: scale(.98); }
