:root{color-scheme:light;font-family:system-ui,-apple-system,'Hiragino Kaku Gothic ProN',sans-serif;color:#2a2328;background:#fff;font-size:14px}
*{box-sizing:border-box}
body{margin:0}
button,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button{position:relative;font:inherit;color:inherit;background:#f3f4f6;border:2px solid #e4e2e6;border-radius:8px;min-height:44px;padding:8px 12px}
button:active{transform:translateY(1px)}
button:disabled{opacity:.5}
button[aria-pressed=true]{border:2px solid #9a647b;background:#eef0f3}
button:focus-visible,a:focus-visible{outline:3px solid #9a647b;outline-offset:2px}
[hidden]{display:none!important}
.shell{max-width:450px;margin:auto;padding:3px 12px max(16px,env(safe-area-inset-bottom))}
.companion{display:flex;align-items:center;gap:8px;min-height:86px}
.portrait{position:relative;border:0;background:transparent;padding:0;flex:none;width:78px;height:82px}
.portrait img{width:78px;height:72px;object-fit:contain}
.portrait small{position:absolute;bottom:0;left:24px;font-size:10px;background:#f3f4f6;border-radius:4px;padding:1px 5px}
.companion>div{flex:1}
.companion span{font-size:11px;color:#6e626a}
.companion p{margin:4px 0;padding:9px;border:1px solid #e9dfda;background:#fffdf9;border-radius:5px 14px 14px;line-height:1.5;font-size:13px}
.toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.toolbar span{font-weight:600;font-size:12px}
.cast-options{display:flex;gap:8px;margin:6px 0}
.cast-options button{flex:1;padding:3px;font-size:11px}
.cast-options img{display:block;width:50px;height:50px;object-fit:contain;margin:auto}
.stage{border-radius:16px;background:#fbf8f1;padding:12px;min-height:390px;border:1px solid #eee4d8}
.stage h2{font-size:17px;margin:0 0 8px}
.stage p{margin:6px 0;font-size:13px;line-height:1.6}
.zones{display:grid;gap:10px;margin:18px 0}
.zone{display:flex;align-items:center;gap:12px;min-height:76px;text-align:left;background:#fffdf9}
.zone b{font-size:28px}
.zone small{display:block;font-size:11px;color:#6e626a;margin-top:4px}
.tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:14px 0}
.tile{height:76px;background:#edf1e5;font-size:25px}
.tile small{font-size:11px;display:block}
.tile:disabled{opacity:1;background:#fffdf9}
.primary{display:block;width:100%;background:#92546f;color:white;border:0;font-weight:600;margin-top:10px}
.egg-art{width:105px;height:125px;border-radius:50% 50% 45% 45%/65% 65% 35% 35%;background:var(--egg);border:3px solid #fff;margin:10px auto;display:grid;place-items:center;font-size:30px;box-shadow:0 4px 0 #dfd7c9}
.heat-track{display:flex;justify-content:center;gap:6px;margin:10px 0}
.heat-track span{background:white;border:1px solid #e5ded3;border-radius:8px;padding:6px;font-size:12px;min-width:64px;text-align:center}
.choices{display:flex;gap:6px;margin:6px 0 10px}
.choices button{flex:1;font-size:13px;padding:7px 3px}
.choices small{display:block;font-size:11px}
.label{font-size:12px;font-weight:600}
.memo{background:#fffdf9;border-radius:8px;padding:8px;margin:8px 0}
.memo p{font-size:12px;margin:3px 0}
.secondary{width:100%;margin-top:8px}
.creature{display:block;width:160px;height:150px;margin:8px auto}
.result{text-align:center}
.result .memo{text-align:left}
.collection{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.book-card{background:#f8f7f5;border-radius:10px;padding:8px;text-align:center}
.book-card .creature{width:100px;height:90px}
.book-card p{font-size:12px;margin:4px 0}
.book-card small{font-size:11px;color:#6e626a}
.unknown{font-size:46px;line-height:90px;color:#aaa5aa}
.help{font-size:12px;color:#6e626a;margin-top:12px}
.help summary{min-height:44px;padding:12px 0}
.help p{line-height:1.7}
#save-note{font-size:12px;color:#9a3746}
.complete{padding:10px;border-radius:8px;background:#f5eaf0;text-align:center;font-weight:600}
.game-title-accessible{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(prefers-reduced-motion:no-preference){.care-overview .egg-art{animation:sway 3s ease-in-out infinite}
.result .creature{animation:arrive .4s ease-out}
@keyframes sway{50%{transform:rotate(4deg)}
}
@keyframes arrive{from{transform:translateY(12px);opacity:0}
to{transform:translateY(0);opacity:1}
}
}


/* Keep the egg, current total and next action together on a portrait screen. */
.care-overview{display:flex;align-items:center;justify-content:center;gap:20px;margin:6px 0}

.care-overview .egg-art{width:63px;height:76px;margin:0;font-size:23px}

.care-overview strong{font-size:17px}

.heat-track{margin:8px 0}
.heat-track span{flex:1;min-width:0;line-height:1.5}

.stage .selection-preview{font-size:12px;margin:5px 0;color:#6e626a}


/* A check mark keeps selection legible without relying on accent color. */
.choices button[aria-pressed=true]::after,.cast-options button[aria-pressed=true]::after{content:'✓';position:absolute;right:3px;top:0;font-size:10px;font-weight:700;line-height:14px}

.choices button{padding-top:11px}

.recipe-status{display:block;color:#6e626a;font-size:11px}

.memo p+p{border-top:1px solid #eee9e3;padding-top:5px;margin-top:5px}

#book{margin:0;padding:10px 0}


/* Narrow phones keep every touch target in normal flow; text may wrap. */
.companion>div,.cast-options button,.choices button,.book-card{min-width:0;overflow-wrap:anywhere}

.collection{grid-template-columns:repeat(2,minmax(0,1fr))}

@media(max-width:350px){.shell{padding-left:8px;padding-right:8px}
.stage{padding:10px}
.care-overview{gap:12px}
.choices{gap:4px}
.cast-options{gap:4px}
}

@media(max-height:740px){.companion{min-height:74px}
.portrait{height:70px;width:66px}
.portrait img{height:60px;width:66px}
.portrait small{left:18px}
.care-overview .egg-art{height:61px;width:51px}
.care-overview{margin:4px 0}
.stage{min-height:0}
.heat-track{margin:6px 0}
}
