:root{font-family:-apple-system,BlinkMacSystemFont,'Hiragino Sans','Noto Sans JP',sans-serif;color:#2a2328;background:#fff;color-scheme:light}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-height:100svh;min-height:100dvh;display:flex;flex-direction:column}button,select{font:inherit;color:inherit;touch-action:manipulation}button{min-height:44px;border:0;border-radius:8px;background:#f3f4f6;padding:8px 10px}button:disabled{opacity:.48}button:focus-visible,select:focus-visible{outline:3px solid #8a576f;outline-offset:2px}.shell{width:100%;max-width:450px;margin:0 auto;display:flex;flex-direction:column;gap:5px;min-height:calc(100svh - 55px);min-height:calc(100dvh - 55px);padding:3px 8px max(8px,env(safe-area-inset-bottom))}.companion{display:flex;gap:7px;align-items:center;min-height:56px}.companion>img{width:56px;height:56px;object-fit:contain}.companion>div{flex:1;min-width:0}#cast-name{font-size:11px;color:#6e626a}#speech{font-size:13px;line-height:1.4;margin:3px 0}.companion>button{width:44px;padding:0;flex-shrink:0}.hud{display:flex;align-items:center;gap:6px;font-size:12px}.hud select{flex:1;min-width:0;border:0;border-radius:8px;background:#f3f4f6;min-height:44px;padding:6px;font:inherit}.hud>span{white-space:nowrap}.hud>button{padding:6px 9px}.stage{position:relative;flex:1;min-height:330px;background:radial-gradient(ellipse at 50% 5%,#fffaf0,#f1e9e3);border-radius:14px;overflow:hidden;display:flex;border:1px solid #eadfd7}#board{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:1fr;gap:8px;padding:12px 8px;align-content:center;min-height:100%}.tray{position:relative;display:flex;flex-direction:column;justify-content:center;gap:5px;padding:5px 4px 6px;min-width:0;border:2px solid #d7bfa7;background:linear-gradient(120deg,#fffdf8,#f5eadb);border-radius:12px;box-shadow:inset 0 0 0 3px #ffffff88;isolation:isolate}.tray:disabled{opacity:1}.tray-top{display:flex;justify-content:space-between;gap:2px;align-items:center;font-size:11px;color:#67564b;padding:0 3px}.tray .wells{display:flex;flex-direction:column;align-items:center;gap:3px;min-height:74px;justify-content:center}.well{width:27px;height:clamp(14px,2.6dvh,24px);min-height:14px;border-radius:50%;background:#dfcdb94a;border:1px solid #baa18d42;display:flex;align-items:center;justify-content:center}.bead{position:relative;width:24px;height:clamp(14px,2.6dvh,24px);border-radius:50%;background:radial-gradient(circle at 30% 20%,#fff 0%,#ffffffa6 10%,var(--bead) 43%,color-mix(in srgb,var(--bead),#46323d 24%) 100%);border:1px solid #ffffffbb;color:#fff;font-size:11px;line-height:1;display:flex;align-items:center;justify-content:center;text-shadow:0 1px 2px #382c3c;box-shadow:0 1px 2px #71504e3d}.bead::after{content:'';position:absolute;top:2px;left:7px;width:5px;height:2px;border-radius:50%;background:#5c3e4e77}.bead.top::before{content:'↑';position:absolute;left:-18px;color:#6a445a;font-size:17px;text-shadow:none;font-weight:bold}.tray.selected{border-color:#874f70;background:#f9edf2;box-shadow:inset 0 0 0 2px #b2869d}.tray.available{border-style:dashed;border-color:#6e8e83}.tray.complete{background:linear-gradient(130deg,#fff8df,#f7ead4);border-color:#ba9654}.tray.hinted{outline:3px solid #9679b4;outline-offset:1px}.tray .tray-status{font-size:10px;color:#6e626a;min-height:12px}.panel{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:10px;background:#f4ebe2cf;overflow:auto;z-index:2}.panel-card{background:#fff;border:1px solid #e4d8ce;border-radius:12px;width:100%;max-width:315px;text-align:center;padding:13px;max-height:100%;overflow:auto;box-shadow:0 4px 16px #53374612}.panel-card>img{width:84px;height:84px;object-fit:contain}.panel h2{font-size:20px;margin:3px 0 8px}.panel p{font-size:13px;line-height:1.6;margin:6px 0}.panel button{margin:4px 2px;min-width:100px}#go,#next{background:#6a4d5f;color:#fff}#record{color:#6e626a;font-size:11px}#message{min-height:34px;line-height:17px;font-size:12px;text-align:center;margin:0;padding:1px 0}#message[data-status=error]{background:#eef0f3;border-radius:8px;font-weight:700}.controls{display:flex;gap:6px}.controls>button{flex:1;font-size:13px}.collection-button{display:flex;justify-content:space-between;align-items:center;gap:4px;width:100%;font-size:11px;min-height:36px;padding:5px 9px;background:#faf8f5}#save-note{font-size:11px;margin:0;color:#6e626a}dialog{width:calc(100% - 32px);max-width:410px;border:1px solid #ddd;border-radius:12px;padding:18px;max-height:85dvh;overflow:auto}dialog::backdrop{background:#3f2b3980}dialog h2{font-size:19px;margin-top:0}dialog p{font-size:13px;line-height:1.7}dialog>button{width:100%}#casts{display:flex;gap:7px;justify-content:center;margin:12px 0}#casts button{width:88px;padding:4px;border:2px solid transparent}#casts img{width:52px;height:52px;object-fit:contain}#casts span{font-size:11px;display:block}#casts button[aria-pressed=true]{border-color:#8a576f;background:#eef0f3}#casts button[aria-pressed=true] span::after{content:' ✓'}.accessory{margin:8px 0 14px;text-align:center;border-bottom:1px solid #eee;padding:4px 0 12px}.accessory h3{font-size:14px;margin:5px 0}.accessory p{font-size:11px;margin:4px 0}.jewel-art{width:150px;height:92px;display:block;margin:auto}.jewel-art .missing{opacity:.13;filter:grayscale(1)}#reward .jewel-art{width:135px;height:78px}#ranking:empty{display:none}#ranking button{font-size:12px;min-height:40px}.game-ranking-open{width:100%}@media(max-height:680px){.companion{min-height:46px}.companion>img{width:46px;height:46px}.shell{gap:3px}.stage{min-height:270px}.tray{gap:2px}.tray .wells{gap:2px;min-height:60px}#board{padding:8px 6px;gap:6px}.panel-card>img{width:62px;height:62px}.panel-card{padding:9px}.panel h2{font-size:18px}#message{font-size:11px}.collection-button{min-height:32px}}@media(prefers-reduced-motion:no-preference){.tray.selected .top{animation:lift .7s ease-in-out infinite alternate}.accessory .new-part{animation:shine .6s ease-out 2}@keyframes lift{to{transform:translateY(-2px)}}@keyframes shine{50%{filter:brightness(1.4)}}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

/* Seven trays fit in two rows so small portrait screens keep every action visible. */
#board[data-trays="7"]{grid-template-columns:repeat(4,minmax(0,1fr))}
#board[data-trays="7"] .tray-status{display:none}
#board[data-trays="7"] .tray-top{font-size:10px;padding:0 1px}
#board[data-trays="7"] .tray{padding-inline:2px}
#board[data-trays="7"] .bead.top::before{left:-15px;font-size:15px}
