:root{color-scheme:dark;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans",sans-serif;background:#080e1b;color:#f5f5fb;-webkit-text-size-adjust:100%}*{box-sizing:border-box}body{margin:0}button{font:inherit;color:inherit;border:1px solid #77879b;background:#1c293d;border-radius:8px;min-height:44px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.5}button:focus-visible,a:focus-visible{outline:3px solid #ffe4a7;outline-offset:-3px}[hidden]{display:none!important}.mystery-shell{max-width:450px;margin:auto;padding:3px 5px max(5px,env(safe-area-inset-bottom))}.mansion{position:relative;min-height:calc(100svh - var(--nav-height,88px) - 8px);padding:7px;border:1px solid #b6a079;border-radius:16px;background:radial-gradient(ellipse at top,#233449,#101a2a 65%);display:flex;flex-direction:column;gap:7px}.hud{display:flex;align-items:center;justify-content:space-between;gap:4px;font-size:12px;color:#f6dca0}.hud button{width:44px;min-height:32px}.hud span{margin-left:auto}.buddy{display:flex;align-items:center;gap:9px;min-height:58px;font-size:13px}.buddy img{width:58px;height:58px;object-fit:cover;border:1px solid #e8c77c;border-radius:50%;background:#0e1828}.buddy span{line-height:1.5}.rooms{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;flex:1}.room{position:relative;display:grid;grid-template-columns:32px 1fr;grid-template-rows:auto 24px;align-items:center;gap:1px 4px;min-height:72px;padding:6px 7px;text-align:left;border-color:#b6a07980;background:linear-gradient(135deg,#253a50,#152337)}.room:disabled{opacity:1;background:#101c2c;border-color:#657284}.room:disabled small{color:#abb7c6}.room strong{font-size:14px}.room-icon{font-size:25px;grid-row:span 2}.room small{font-size:10px;color:#e8c77c}.occupants{position:absolute;bottom:7px;right:5px;display:flex;gap:2px}.occupants span{display:grid;place-items:center;width:19px;height:19px;border:1px solid;border-radius:50%;background:#101725;font-size:11px}.suspects{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.suspect{padding:4px 2px;display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0;background:#142339}.suspect img{width:clamp(40px,15vw,64px);height:clamp(40px,15vw,64px);object-fit:cover;border-radius:9px}.suspect strong{font-size:10px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.suspect small{font-size:10px;color:#d2dfeb}.suspect[aria-pressed=true]{border:2px solid #f2d08a;padding:3px 1px;background:#39402f;box-shadow:0 0 10px #f2d08a30}.actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}.gold{border-color:#ffe3a1;background:linear-gradient(#f1d595,#b98a43);color:#231b14;font-weight:800}.notebook{padding:7px 8px;background:#0b1421;border:1px solid #6e7e9366;border-radius:8px;font-size:12px;line-height:1.5}.notebook>strong{font-size:11px;color:#e8c77c}.notebook>strong span{margin-left:6px;color:#b7c5d6}.notebook p{margin:4px 0;min-height:36px}.notebook summary{min-height:32px;padding:6px 0;color:#cbd6e5;touch-action:manipulation}.notebook ul{padding-left:18px;margin:4px 0;max-height:150px;overflow:auto}.notebook li{padding:4px 0}.overlay{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;padding:14px;background:#060d1ce8;border-radius:15px}.panel{width:100%;text-align:center;background:#152337;border:1px solid #b6a079;border-radius:14px;padding:20px 12px}.seal{display:block;color:#ffe2a0;font-size:56px;text-shadow:0 0 25px #e8c77c70}.panel h2{font-size:22px;color:#ffe6af;margin:7px 0 12px}.panel p{font-size:13px;line-height:1.7;margin:10px 0}.panel>button{width:100%;font-size:16px}.cast-picker{display:flex;gap:7px;overflow:auto;padding:8px 2px}.cast-picker button{padding:2px;flex:none;width:52px;height:52px;border-color:#657284}.cast-picker img{display:block;width:44px;height:44px;border-radius:7px}.cast-picker [aria-pressed=true]{border:2px solid #ffe2a0}.won .seal{animation:reward .8s ease-out both}.won .panel{box-shadow:0 0 25px #e7bc5350}dialog{max-width:360px;width:calc(100% - 28px);border:1px solid #b6a079;border-radius:12px;background:#152337;color:#f5f5fb;padding:18px;font-size:14px;line-height:1.7}dialog::backdrop{background:#050b16c9}dialog h2{margin:0;font-size:18px}dialog button{width:100%}@keyframes reward{from{transform:scale(.5) rotate(-20deg);opacity:.3}to{transform:scale(1) rotate(0);opacity:1}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
/* Keep short portrait screens focused on the rooms and touch controls. */
@media(max-height:740px){.rooms{grid-template-columns:repeat(3,minmax(0,1fr))}.room{grid-template-columns:1fr;grid-template-rows:18px 22px 14px;text-align:center;min-height:70px;padding:4px 2px;gap:1px}.room-icon{display:none}.room strong{font-size:12px}.occupants{position:static;justify-content:center;min-height:22px}.room small{font-size:10px}.buddy{min-height:46px}.buddy img{width:46px;height:46px}.mansion{gap:5px}.suspect img{width:44px;height:44px}.notebook p{min-height:0}.panel{padding:12px}.seal{font-size:42px}}

/* Suspect markers stay readable independently of their portrait colors. */
.suspect{position:relative}.suspect[aria-pressed=true]::after{content:'✓';position:absolute;top:3px;right:3px;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#ffe2a0;color:#231b14;font-size:13px;font-weight:900}.traits{padding:2px 6px;border-radius:5px;border:1px solid #788eac;background:#101c2c}.traits[data-color=紅]{border-left:4px solid #ff7f9a}.traits[data-color=蒼]{border-left:4px solid #7acaff}

.result-portrait{display:block;width:100px;height:100px;margin:0 auto 7px;object-fit:cover;border:2px solid #b6a079;border-radius:16px}.won .result-portrait{border-color:#ffe3a1;box-shadow:0 0 18px #e8c77c50}.result-portrait:not([hidden])+.seal{font-size:30px}

.last-turn{padding:3px 7px;border:1px solid #ffad8b;border-radius:6px;color:#ffd3bd;background:#612b26}

/* Separate room occupants from the search status, including four-person rooms. */
@media(min-height:741px){.room{grid-template-columns:30px minmax(0,1fr);grid-template-rows:22px 22px 15px}.room-icon{grid-row:1/3}.occupants{position:static;grid-column:2;grid-row:2;min-height:21px}.room small{grid-column:1/3;text-align:center}}
.hud button{min-height:44px}.notebook summary{min-height:44px;padding:11px 0}
