* { box-sizing: border-box; }
:not(:defined) > * { display: none; }
html { min-height: 100%; }
body { --ink:#4d4350; --accent:#ed8c83; --accent-dark:#9b514b; --pale:#fff3ee; --edge:#f2dcd6; margin:0; min-height:100vh; min-height:100dvh; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background:#fffaf7; color:var(--ink); font-family:system-ui,-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN",sans-serif; display:flex; flex-direction:column; }
body.reverse { --accent:#83aacb; --accent-dark:#527e9d; --pale:#f1f8fc; --edge:#d9e9f0; background:#f8fbfc; }
.site-header { width:min(100%, 1050px); margin:0 auto 18px; min-height:48px; display:flex; align-items:center; }
.brand { display:flex; align-items:center; gap:11px; }
.brand-mark { display:grid; place-items:center; width:43px; height:43px; border-radius:15px; background:var(--accent); color:white; font-size:23px; }
.brand-caption { display:block; color:var(--accent-dark); font-size:9px; font-weight:800; letter-spacing:.16em; line-height:1.4; }
h1 { margin:2px 0 0; font-size:17px; line-height:1.3; letter-spacing:.04em; }
.qr-open { position:absolute; z-index:2; top:max(22px, env(safe-area-inset-top)); right:max(20px, calc((100vw - 1050px) / 2)); border:1px solid var(--edge); border-radius:999px; background:white; color:var(--ink); font:700 12px system-ui,sans-serif; padding:11px 15px; cursor:pointer; }
.qr-open span { color:var(--accent-dark); font-size:16px; vertical-align:-1px; margin-right:3px; }
.stage { position:relative; width:min(100%, 1050px); flex:1; min-height:420px; margin:0 auto; overflow:hidden; border:1px solid var(--edge); border-radius:30px; background:linear-gradient(155deg, #fffdfc, var(--pale)); }
.reverse .stage { background:linear-gradient(155deg, #fff, var(--pale)); }
model-viewer { position:absolute; inset:0; width:100%; height:100%; background:transparent; }
.stage-label { position:absolute; z-index:1; top:22px; left:24px; display:flex; align-items:center; gap:8px; color:var(--accent-dark); font-size:12px; font-weight:700; letter-spacing:.04em; pointer-events:none; }
.stage-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); }
#ar-button { position:absolute; left:50%; bottom:30px; transform:translateX(-50%); display:flex; align-items:center; justify-content:center; gap:12px; white-space:nowrap; min-height:58px; padding:0 20px 0 13px; border:2px solid white; border-radius:999px; background:var(--accent); box-shadow:0 5px 0 var(--accent-dark), 0 10px 20px #725f5a25; color:white; font:800 15px system-ui,sans-serif; letter-spacing:.04em; cursor:pointer; }
#ar-button:active { transform:translate(-50%, 3px); box-shadow:0 2px 0 var(--accent-dark); }
#ar-button:focus-visible, .qr-open:focus-visible, #qr-close:focus-visible { outline:3px solid var(--accent-dark); outline-offset:3px; }
.ar-sparkle { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; background:#ffffff40; font-size:19px; }
.ar-arrow { font-size:18px; }
.progress-bar { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:120px; height:7px; overflow:hidden; border-radius:10px; background:#ffffffaa; }
.progress-bar.hide { visibility:hidden; transition:visibility .3s; }
.update-bar { width:0; height:100%; border-radius:10px; background:var(--accent); transition:width .3s; }
@keyframes circle { from { transform:translateX(-50%) rotate(0deg) translateX(50px) rotate(0deg); } to { transform:translateX(-50%) rotate(360deg) translateX(50px) rotate(-360deg); } }
@keyframes elongate { from { transform:translateX(100px); } to { transform:translateX(-100px); } }
model-viewer > #ar-prompt { position:absolute; left:50%; bottom:90px; animation:elongate 2s infinite ease-in-out alternate; display:none; }
model-viewer[ar-status="session-started"] > #ar-prompt { display:block; }
model-viewer > #ar-prompt > img { animation:circle 4s linear infinite; }
#qr-dialog { width:min(340px, calc(100vw - 40px)); border:1px solid var(--edge); border-radius:24px; padding:24px; color:var(--ink); font-family:inherit; box-shadow:0 14px 50px #51454a33; }
#qr-dialog::backdrop { background:#453d4380; }
.qr-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.qr-head h2 { margin:0; font-size:18px; }
#qr-close { border:0; background:var(--pale); border-radius:50%; width:36px; height:36px; color:inherit; font-size:25px; cursor:pointer; }
#qr-dialog p { font-size:14px; line-height:1.6; }
#qr-code { min-height:220px; display:grid; place-items:center; margin:20px auto; }
#qr-code img { max-width:100%; }
#qr-url { display:block; overflow-wrap:anywhere; text-align:center; font-size:13px; color:var(--accent-dark); }
@media (max-width:600px) { body { padding: max(15px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); } .site-header { margin-bottom:14px; } .qr-open { top:max(18px, env(safe-area-inset-top)); right:14px; } .stage { min-height:350px; border-radius:25px; } .stage-label { top:19px; left:19px; font-size:11px; } #ar-button { bottom:25px; } }

.qr-credit { display:flex; align-items:center; justify-content:center; gap:8px; margin-top:22px; padding-top:15px; border-top:1px solid var(--edge); color:var(--ink); }
.qr-credit small { font-size:10px; line-height:1.5; }
.qr-credit img { width:34px; height:34px; flex:none; }

.portal-back { align-self: flex-start; margin: 0 0 14px max(0px, calc((100% - 1050px) / 2)); padding: 7px 14px; border: 1px solid var(--edge); border-radius: 999px; background: white; color: var(--accent-dark); font-size: 13px; font-weight: 700; text-decoration: none; }
.portal-back[hidden] { display: none; }
.portal-back:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 3px; }

/* ポータルと共通の色と太い輪郭 */
body, body.reverse { --ink:#171717; --accent:#ffdc4a; --accent-dark:#171717; --pale:#fff8df; --edge:#171717; background:#fff8df; color:#171717; }
.brand-mark { background:#ffdc4a; color:#171717; border:3px solid #171717; border-radius:4px; box-shadow:3px 3px #171717; }
.brand-caption { color:#171717; }
.qr-open, .portal-back { border:2px solid #171717; border-radius:4px; background:#fff; color:#171717; box-shadow:3px 3px #171717; }
.qr-open span { color:#171717; }
.stage, .reverse .stage { border:3px solid #171717; border-radius:4px; background:#fff; box-shadow:7px 7px #171717; }
.stage-label { color:#171717; }
.stage-dot { background:#ffdc4a; border:1px solid #171717; width:9px; height:9px; }
#ar-button { border:3px solid #171717; border-radius:4px; background:#ffdc4a; color:#171717; box-shadow:5px 5px #171717; }
#ar-button:active { box-shadow:2px 2px #171717; }
.ar-sparkle { border:2px solid #171717; border-radius:4px; background:#fff; }
#qr-dialog { border:3px solid #171717; border-radius:4px; background:#fff8df; box-shadow:7px 7px #171717; }
#qr-close { border:2px solid #171717; border-radius:4px; background:#fff; }
#qr-url { color:#171717; }
.qr-credit { border-color:#171717; }
@media (max-width:600px) { .stage { border-radius:4px; box-shadow:5px 5px #171717; } }
.controls-help { width:min(100%, 1050px); margin:0 auto 16px; border:2px solid #171717; border-radius:4px; background:#fff; box-shadow:3px 3px #171717; font-size:14px; }
.controls-help summary { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:9px 14px; cursor:pointer; font-weight:800; list-style:none; }
.controls-help summary::-webkit-details-marker { display:none; }
.controls-help summary span { font-size:20px; line-height:1; }
.controls-help[open] summary span { transform:rotate(45deg); }
.controls-help summary:focus-visible { outline:3px solid #7554d3; outline-offset:3px; }
.controls-help-body { border-top:2px solid #171717; padding:12px 16px; line-height:1.6; }
.controls-help-body p { margin:0 0 6px; font-weight:800; }
.controls-help-body ul { margin:0; padding-left:1.4em; }