:root{color-scheme:light;font-family:system-ui,-apple-system,'Hiragino Kaku Gothic ProN',sans-serif;color:#2a2328;background:#f5f0eb;--accent:#b94f7c}*{box-sizing:border-box}body{margin:0;height:100svh;height:100dvh;min-height:100svh;display:flex;flex-direction:column;-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{font:inherit;border:0;border-radius:8px;color:inherit;background:#f3f4f6;min-height:44px;padding:6px 12px}button:disabled{opacity:.55}button:focus-visible,a:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}[hidden]{display:none!important}.shell{width:100%;max-width:450px;flex:1 0 auto;margin:0 auto;padding:3px 8px max(8px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:5px;background:#fffdf8}.companion{display:flex;align-items:center;gap:8px;min-height:68px}.companion>img{width:68px;height:68px;object-fit:contain}.companion>div{flex:1;min-width:0}#cast-name{font-size:11px;color:#6e626a}#speech{border:1px solid #e9dfda;background:#fff;border-radius:5px 16px 16px;padding:7px 9px;margin:3px 0;font-size:12px;min-height:34px;line-height:1.4}.hud{display:flex;align-items:center;justify-content:space-between;gap:4px;font-size:12px;font-variant-numeric:tabular-nums}.hud button{min-height:44px;padding:4px 9px}#score{color:var(--accent);font-weight:700}.stage{position:relative;isolation:isolate;border-radius:15px;overflow:hidden;background:#f5ede3;min-height:328px;flex:1 0 328px}#board{display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(7,1fr);height:100%;min-height:328px;position:absolute;inset:0;padding:4px;gap:2px}.tile{position:relative;min-width:0;min-height:44px;padding:0;border-radius:7px;border:1px solid #e4d6c6;background:#faf4eb;display:flex;align-items:center;justify-content:center;font-size:clamp(23px,7vw,32px);overflow:hidden}.tile:nth-child(12n+7),.tile:nth-child(12n+8),.tile:nth-child(12n+9),.tile:nth-child(12n+10),.tile:nth-child(12n+11),.tile:nth-child(12n+12){background:#f1e5d7}.tile.view{background:#f8d1aa}.tile.player{outline:3px solid var(--accent);outline-offset:-3px}.tile.destination:after{content:'◎';position:absolute;right:2px;top:0;color:var(--accent);font-size:15px}.tile .avatar{position:absolute;width:90%;height:95%;object-fit:contain;bottom:0;left:5%;z-index:1;background:#fff9;border-radius:50%}.tile .badge{position:absolute;bottom:0;right:2px;font-size:10px;background:#fff;border-radius:4px;padding:1px 2px;z-index:2}.tile.spent>span:first-child{filter:grayscale(1);opacity:.45}.tile.checked>span:first-child{opacity:.45}.tile:disabled{opacity:1}.tile.npc{outline:2px solid #b87943;outline-offset:-2px}.facing{position:absolute;top:0;left:2px;font-size:13px;z-index:2;background:#fff9}.overlay{position:absolute;inset:0;z-index:5;background:#fffdf8f5;display:flex;flex-direction:column;align-items:center;justify-content:safe center;text-align:center;overflow:auto;padding:15px;gap:10px}.overlay h1{font-size:21px;margin:0}.overlay p{font-size:13px;line-height:1.65;margin:0;white-space:pre-line;max-width:300px}#cast-options{display:flex;gap:10px}#cast-options button{width:66px;height:68px;padding:2px;border:2px solid transparent}#cast-options img{width:100%;height:100%;object-fit:contain}#cast-options [aria-pressed=true]{border-color:var(--accent);background:#fff0f4}#go{background:var(--accent);color:white;min-width:160px;font-weight:700}#best{color:#6e626a}.hint{margin:0;font-size:12px;min-height:34px;line-height:1.4;padding:3px 2px}.meters{display:flex;justify-content:space-between;align-items:center;font-size:11px;gap:6px}.meters label{display:flex;align-items:center;gap:3px}meter{width:75px;height:13px;accent-color:var(--accent)}#morph{background:#eef0f3;font-weight:650}#morph[aria-pressed=true]{background:#fff0f4;color:var(--accent)}#save-note{font-size:11px;margin:0;color:#6e626a}@media(max-height:690px){.companion{min-height:52px}.companion>img{width:52px;height:52px}.overlay{gap:7px}.overlay h1{font-size:18px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* Keep semantic markers legible when a furniture tile is spent or checked. */
.tile.view:before{content:"◉";position:absolute;top:1px;right:3px;font-size:11px;color:#79512d;line-height:1;pointer-events:none}
.tile.destination:after{top:14px;background:#fff;border-radius:50%;line-height:1}
.tile:active:not(:disabled){box-shadow:inset 0 0 0 3px #b94f7c}
#cast-options button{position:relative}
#cast-options [aria-pressed=true]:after{content:"✓";position:absolute;bottom:0;right:1px;color:#fff;background:var(--accent);border-radius:50%;font-size:12px;width:18px;height:18px}
.tile .badge:empty,.facing:empty{display:none}

/* Seven 44px rows + six 2px gaps + 8px padding require 328px. */
body>.game-nav-header,.companion,.hud,.hint,.meters,#morph,#save-note{flex-shrink:0}
.overlay>h1,.overlay>#cast-options,.overlay>#best,.overlay>#go{flex-shrink:0}
.overlay>#panel-detail{min-height:0;flex-shrink:1;overflow-y:auto;overscroll-behavior:contain}
#speech,.hint,#panel-detail{overflow-wrap:anywhere}
.meters{flex-wrap:wrap}
