/* 独立したゲームの世界観。質問画面は動的ビューポート内の三段構成。 */
:root{color-scheme:light;--bg:#28103e;--fg:#332440;--ac:#88561d;--mu:#76677d;--line:#ddcfe0;--paper:#faf1ef;--sans:"Hiragino Sans","Noto Sans JP","Yu Gothic",sans-serif}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 30%,#693a79,transparent 70%),#1b0a2b;color:var(--fg);font:14px/1.6 var(--sans);-webkit-font-smoothing:antialiased}button,input,select{font:inherit}button,a,input,select,summary{-webkit-tap-highlight-color:transparent}button,a,summary{touch-action:manipulation}button{cursor:pointer;border:0;color:inherit}button:disabled{cursor:default;opacity:.4}:focus-visible{outline:3px solid #9754bf;outline-offset:3px}a{color:#744692;text-underline-offset:3px}h1,h2,p{margin:0}h2{font-weight:700;line-height:1.5;text-wrap:balance;overflow-wrap:anywhere}main{position:relative;width:100%;max-width:480px;height:100svh;height:100dvh;margin:auto;display:flex;flex-direction:column;overflow:hidden;background:radial-gradient(ellipse at 48% 25%,#854583 0,#4b235f 48%,#2d123f 90%);box-shadow:0 0 90px #11031d80}
.game-title{flex:none;position:relative;display:flex;align-items:center;justify-content:center;padding:calc(8px + env(safe-area-inset-top)) 60px 6px;color:#f9e8d4;z-index:1}h1{line-height:0}.logo{display:block;width:auto;height:52px}.game-title:has(+.stage[data-screen="intro"]) .logo{height:clamp(72px,12dvh,96px)}.info-button{position:absolute;right:16px;top:calc(12px + env(safe-area-inset-top));width:34px;height:34px;display:grid;place-items:center;border:1px solid #deb88180;border-radius:50%;background:#28103e50;color:#f9d7a1;font:700 18px Georgia,serif}.info-button:hover{background:#774474}.stage{flex:1;min-height:0;position:relative;text-align:center;display:flex;flex-direction:column}.character{position:relative;flex:1;min-height:0;overflow:hidden;isolation:isolate;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 13% 18%,#ffe7ba 0 1px,transparent 1.5px),radial-gradient(circle at 80% 28%,#f8d0ff 0 1px,transparent 1.5px),radial-gradient(circle at 29% 45%,#ffd9a8 0 1px,transparent 1.5px),radial-gradient(circle at 69% 11%,#eed0f4 0 1px,transparent 1.5px),radial-gradient(circle at 91% 60%,#ffe3b8 0 1px,transparent 1.5px)}.character:before{content:"";position:absolute;inset:22% 0 0;background:url('/kemuri-majin/images/palace-v1.svg') center bottom/100% auto no-repeat;opacity:.65;z-index:-1}.character:after{content:"";position:absolute;inset:0;z-index:-1;background:radial-gradient(ellipse at 50% 65%,#d787b92e,transparent 55%)}.character img{display:block;height:94%;max-width:85%;width:auto;object-fit:contain;filter:drop-shadow(0 8px 18px #14062345);position:relative;z-index:1}.moon{position:absolute;width:35px;height:35px;top:16%;left:10%;border-radius:50%;box-shadow:-8px 4px 0 0 #d7a5c17a;transform:rotate(-20deg)}.character[data-pose="success"] img{filter:drop-shadow(0 0 24px #efb95770)}
.stage[data-screen="game"]{display:grid;grid-template-rows:50% minmax(0,1fr) auto}.game-title:has(+.stage:is([data-screen="game"],[data-screen="result"])){position:absolute;top:0;left:0;right:0;background:linear-gradient(#28103e90,transparent)}.stage:is([data-screen="game"],[data-screen="result"]) .character img{height:calc(100% - 52px);max-width:94%;top:24px}.stage[data-screen="game"] .question-panel{min-height:0}.stage[data-screen="game"] .question-panel{position:relative;flex:none;display:flex;flex-direction:column;justify-content:center;min-height:clamp(160px,24dvh,210px);background:var(--paper);padding:30px 22px 28px;border-radius:22px 22px 0 0;box-shadow:0 -4px 24px #19062225}.progress{position:absolute;left:24px;right:24px;bottom:0;height:2px;background:#d7c7dc}.progress span{display:block;background:#af75b2;height:100%;transition:width .2s}.question-number{font-size:10px;letter-spacing:.13em;color:#8c6592;margin:2px 0 7px}.question{font-size:clamp(18px,4.6vw,22px);line-height:1.45;letter-spacing:.01em;max-width:420px;margin:0 auto;word-break:auto-phrase}.hint{font-size:11px;line-height:1.5;color:var(--mu);margin:6px auto 0;max-width:420px;text-wrap:pretty;word-break:auto-phrase}.controls-panel{background:var(--paper);padding:12px 18px calc(3px + env(safe-area-inset-bottom));flex:none}.answers{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));border:1px solid #b77b29;border-radius:12px;overflow:hidden;box-shadow:0 3px 0 #bd883c,0 6px 12px #754e2220}.answer{grid-column:span 2;border-right:1px solid #c58c3880;min-height:36px;padding:4px 12px;background:linear-gradient(100deg,#ffda75,#ffedaa 48%,#ffd06b);color:#553613;font-size:12px;font-weight:700;letter-spacing:.05em;border-bottom:1px solid #c58c3880;position:relative}.answer:nth-child(-n+2){grid-column:span 3}.answer:nth-child(n+3){border-bottom:0}.answer:nth-child(2),.answer:last-child{border-right:0}.answer:focus-visible{outline-offset:-4px;z-index:1}.answer:active{background:#f0c663}@media(hover:hover){.answer:hover{background:#ffe6a3}}.nav{display:flex;justify-content:center;align-items:center;gap:4px;margin-top:7px;flex-wrap:wrap}.text-button{background:transparent;min-height:34px;padding:6px 8px;color:#7f6689;font-size:11px;text-decoration:underline;text-underline-offset:3px}.intro-panel{flex:none;padding:20px 24px calc(22px + env(safe-area-inset-bottom));background:var(--paper);border-radius:24px 24px 0 0;box-shadow:0 -4px 24px #19062225}.intro-lead{font-size:21px;margin:8px 0 10px}.description{font-size:13px;line-height:1.8;margin-bottom:18px}.muted,.small,.loading{color:var(--mu)}.small{font-size:12px}.loading{margin:auto;color:#f1d9f1}.primary{background:linear-gradient(100deg,#ffd16a,#ffe7a4,#ffd16a);border:1px solid #bf8d42;box-shadow:0 3px 0 #b97d29;color:#543213;border-radius:12px;min-height:50px;padding:12px 25px;min-width:220px;font-size:14px;font-weight:700}.primary:hover{background:#ffe9ab}.secondary{border:1px solid #b690be;background:#efe1f1;border-radius:12px;padding:12px 18px;min-height:48px;font-size:14px}.notice{font-size:11px;color:var(--mu);line-height:1.6;margin:15px auto 0}.region-note{font-size:10px;color:#97849b;margin-top:12px}
/* 結果の詳細は画面内でスクロール。質問中は全回答が常に見える。 */
.stage[data-screen="result"],.stage[data-screen="success"]{overflow-y:auto;background:var(--paper);padding-bottom:20px}.stage[data-screen="result"] .character,.stage[data-screen="success"] .character{flex:none;height:180px;background-color:#572965;margin-bottom:18px}.stage[data-screen="success"] .character{height:clamp(180px,36dvh,350px)}.stage[data-screen="success"] h2{font-size:24px;margin:8px 15px 18px}.stage[data-screen="success"]>.primary{align-self:center}.stage[data-screen="result"]>h2{font-size:22px;padding:12px 18px}.stage[data-screen="result"]>.hint,.stage[data-screen="result"]>.description{padding:0 20px}.stage[data-screen="result"]>.primary{align-self:center}.result{flex:1;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;margin:0;text-align:center;padding:48px 28px}.place{font-size:11px;color:var(--ac)}.result h2{font-size:clamp(25px,6vw,30px);margin:0 0 16px}.address{max-width:340px;font-size:13px;line-height:1.8;color:var(--mu);margin:0}.tags{display:flex;flex-wrap:wrap;gap:5px}.tag{font-size:10px;border:1px solid var(--line);background:#f5edf6;border-radius:5px;padding:3px 7px}.sources{display:flex;flex-wrap:wrap;gap:10px 15px;margin-top:14px;font-size:12px}.freshness{font-size:11px;color:var(--mu);margin-top:10px;overflow-wrap:anywhere}.result-actions{display:flex;justify-content:center;gap:10px;margin:20px 20px 0}.result-actions button{flex:1;min-width:0}.alternatives{text-align:left;margin:18px 20px;font-size:12px}.alternatives summary{min-height:44px;padding:10px 0;cursor:pointer}.alternatives button{background:transparent;text-align:left;display:block;padding:10px;border-bottom:1px solid var(--line);width:100%;min-height:44px}
dialog{width:calc(100% - 28px);max-width:600px;max-height:85dvh;border:1px solid #d6bddb;border-radius:20px;background:#faf1ef;color:var(--fg);padding:20px;box-shadow:0 20px 100px #10001980}dialog::backdrop{background:#1b052cbb;backdrop-filter:blur(5px)}.dialog-heading{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:14px}.dialog-heading h2{font-size:19px}.close-button{width:44px;height:44px;flex:none;border-radius:50%;background:#ebdfed;color:#755080;font-size:25px}.database-body{padding:16px 0}.db-caption{font-size:12px;color:var(--mu);line-height:1.8;margin-bottom:18px}.filters{display:grid;grid-template-columns:2fr 1fr;gap:12px}.filters label{font-size:11px;color:var(--mu)}select,input{border:1px solid var(--line);border-radius:8px;background:#fffbf9;padding:9px 10px;color:var(--fg);min-height:44px;width:100%;margin:5px 0 12px}.store-row{border-top:1px solid var(--line);padding:15px 0;font-size:12px}.store-row>summary{cursor:pointer;list-style:none;display:flex;gap:10px;align-items:baseline;justify-content:space-between;min-height:32px}.store-row>summary::-webkit-details-marker{display:none}.store-row strong{font-size:14px}.store-status{font-size:10px;color:var(--mu)}.store-row p{margin:8px 0;overflow-wrap:anywhere}.source-entry{font-size:11px;margin:15px 0}.source-entry small{display:block;color:var(--mu)}.download{display:inline-block;font-size:12px;margin-top:20px}footer{text-align:center;color:var(--mu);font-size:10px;padding:12px 0;line-height:1.8}footer p{margin-top:6px}#history-list{padding-left:22px;font-size:13px}#history-list li{padding:10px 0;border-bottom:1px solid var(--line)}#history-list strong{display:block;color:#8e6129;font-size:12px;margin-top:4px}.noscript{position:fixed;inset:60px 0 auto;text-align:center;color:white}
@media(max-width:360px){.info-button{right:12px}.question-panel{padding-left:15px;padding-right:15px}.question{font-size:18px}.controls-panel{padding-left:14px;padding-right:14px}.text-button{font-size:10px;padding:6px}.intro-lead{font-size:18px}.filters{grid-template-columns:1fr}.store-row>summary{display:block}}
@media(max-height:650px){.game-title{padding-top:calc(4px + env(safe-area-inset-top));padding-bottom:4px}.logo{height:44px}.question-panel{padding-top:22px;padding-bottom:20px}.question-number{margin-bottom:4px}.controls-panel{padding-top:8px}.hint{font-size:10px;margin-top:4px}.intro-panel{padding-top:12px;padding-bottom:calc(12px + env(safe-area-inset-bottom))}.intro-lead{margin:5px 0 7px}.description{margin-bottom:12px}.notice{margin-top:10px}.region-note{margin-top:7px}}
@media(max-height:450px) and (orientation:landscape){main{max-width:850px}.game-title{justify-content:flex-start;padding:calc(4px + env(safe-area-inset-top)) 60px 4px 16px}.logo,.game-title:has(+.stage[data-screen="intro"]) .logo{height:38px}.info-button{top:calc(6px + env(safe-area-inset-top));background:#4b235f}.stage[data-screen="game"]{grid-template-columns:50% 50%;grid-template-rows:minmax(0,1fr) auto}.stage[data-screen="game"] .character{grid-row:1/3;height:100%}.stage[data-screen="game"] .question-panel{border-radius:18px 0 0 0;min-height:0;padding:16px 18px}.stage[data-screen="game"] .question{font-size:16px;line-height:1.35;max-width:none}.stage[data-screen="game"] .question-number{font-size:9px;margin-bottom:2px}.stage[data-screen="game"] .hint{font-size:9px}.stage[data-screen="game"] .nav{margin-top:4px}.stage[data-screen="game"] .text-button{min-height:28px;padding:4px 8px}.controls-panel{padding:6px 18px}.answer{grid-column:span 2;border-right:1px solid #c58c3880;min-height:36px;padding:4px}.stage[data-screen="intro"]{flex-direction:row}.intro-panel{width:60%;overflow:auto}.stage[data-screen="intro"] .character{height:100%}}
@media(prefers-reduced-motion:reduce){.progress span{transition:none}}

/* 候補画面も質問と同じ、上半分に魔人、下半分に店名と住所。 */
.stage[data-screen="result"]{display:grid;grid-template-rows:50% minmax(0,1fr) auto;padding-bottom:0;background:transparent}
.stage[data-screen="result"] .character{height:auto;margin:0;background-color:transparent}
.stage[data-screen="result"] .result{min-height:0;padding:20px 28px;background:var(--paper);border-radius:22px 22px 0 0}
.result-controls{background:var(--paper);padding:0 20px calc(8px + env(safe-area-inset-bottom))}
.result-controls .result-actions{margin:0;gap:10px}
.result-options{margin-top:6px;text-align:center}
.result-options>summary{font-size:11px;color:var(--mu);cursor:pointer;min-height:34px;padding:8px}
.result-options .alternatives{margin:8px 0;text-align:left}
.stage[data-screen="result"]:has(.result-options[open]){grid-template-rows:minmax(0,1fr) auto auto}
.result-options[open]{max-height:38dvh;overflow-y:auto;overscroll-behavior:contain}
@media(max-height:500px) and (orientation:portrait){.stage:is([data-screen="game"],[data-screen="result"]){grid-template-rows:40% minmax(0,1fr) auto}.stage[data-screen="game"] .question-panel{padding:22px 18px 16px}}
@media(max-height:450px) and (orientation:landscape){.stage[data-screen="result"]{grid-template-columns:50% 50%;grid-template-rows:minmax(0,1fr) auto}.stage[data-screen="result"] .character{grid-row:1/3}.stage[data-screen="result"] .result{border-radius:22px 0 0 0}.stage[data-screen="result"]:has(.result-options[open]){grid-template-rows:minmax(140px,1fr) auto}}
.request-link{display:inline-block;font-size:11px;margin-top:6px;color:#7f5a88}.listing-policy{border-top:1px solid var(--line);padding-top:14px;font-size:11px;line-height:1.8;color:var(--mu)}.listing-policy h3{font-size:12px;color:var(--fg);margin-bottom:4px}.listing-policy p{margin:4px 0}
.owner-list{border-top:1px solid var(--line);margin-top:18px;padding-top:14px}.owner-list h3{font-size:12px;margin-bottom:10px}.listing-policy .request-link{font-size:12px;font-weight:700}

/* 採用デザイン：05の透過ロゴ × 砂漠のクリーム（2026-10-28） */
:root{--paper:#fffaf1;--fg:#3e3022;--mu:#756049}
    body{background:#cfa56f}main{background:radial-gradient(ellipse at 48% 25%,#fff1ce 0,#cfa56f 90%)}
    .character:before{opacity:.24;filter:grayscale(1)}
    .character:after{background:none}.moon{box-shadow:-8px 4px 0 0 #fff3d680}
    .info-button{background:#fffaf1;color:#3e3022;border-color:#756049}
    .info-button:hover{background:#fffaf1}
    .stage[data-screen="success"] .character{background:radial-gradient(ellipse at 48% 25%,#fff1ce 0,#cfa56f 90%)}
    .region-note,.question-number,.text-button,.request-link{color:#756049}
    .game-title:has(+.stage:is([data-screen="game"],[data-screen="result"])){background:linear-gradient(#cfa56f90,transparent)}
    dialog{background:#fffaf1}
.game-title h1{max-width:100%;padding:0;background:transparent;border:0;border-radius:0;box-shadow:none}
.game-title .logo{height:44px;max-width:100%;object-fit:contain;filter:drop-shadow(0 0 1px #ead292)}
.game-title:has(+.stage[data-screen="intro"]){padding:12px 56px 5px}
.game-title:has(+.stage[data-screen="intro"]) h1{width:100%;max-width:331px}
.game-title:has(+.stage[data-screen="intro"]) .logo{width:100%;height:auto;max-height:170px}
.loading{color:var(--fg)}
/* 紫テーマの残りを砂漠のクリームへ寄せる */
:root{--line:#e6d6bb}:focus-visible{outline-color:#b07a2a}a{color:#8a5a1c}
.character{background-image:radial-gradient(circle at 13% 18%,#fff8e6 0 1px,transparent 1.5px),radial-gradient(circle at 80% 28%,#fff8e6 0 1px,transparent 1.5px),radial-gradient(circle at 69% 11%,#fff8e6 0 1px,transparent 1.5px)}.character img{filter:drop-shadow(0 8px 18px #5a3d1a40)}
.stage[data-screen="game"] .question-panel,.intro-panel{box-shadow:0 -4px 24px #5a3d1a20}
.progress{background:#eadcc3}.progress span{background:#c08a3a}
.secondary{border-color:#c9ab7f;background:#f5ead6;color:var(--fg)}.tag{background:#f6eddc}
dialog{border-color:#e2cfae;box-shadow:0 20px 100px #3e302260}dialog::backdrop{background:#3e3022aa}.close-button{display:grid;place-items:center;padding:0;line-height:1;background:#f1e4cc;color:var(--mu)}
@media(max-height:650px){.game-title:has(+.stage[data-screen="intro"]){padding-top:7px}.game-title:has(+.stage[data-screen="intro"]) .logo{max-height:120px}}
@media(max-height:450px) and (orientation:landscape){.game-title:has(+.stage[data-screen="intro"]) h1{width:auto}.game-title:has(+.stage[data-screen="intro"]) .logo{width:auto;height:38px}}
/* 正解画面もロゴを絵に重ね、帯との境目を出さない */
.game-title:has(+.stage[data-screen="success"]){position:absolute;top:0;left:0;right:0;background:linear-gradient(#cfa56f90,transparent)}.stage[data-screen="success"] .character{height:clamp(170px,calc(100dvh - 300px),420px)}.stage[data-screen="success"] .character img{height:calc(100% - 52px);top:24px}
@media(max-height:450px) and (orientation:landscape){.stage[data-screen="success"]{display:grid;grid-template-columns:50% 50%;align-content:center;padding-bottom:0}.stage[data-screen="success"] .character{grid-column:1;grid-row:1/6;height:100%;margin:0}.stage[data-screen="success"]>:not(.character){grid-column:2;justify-self:center}.stage[data-screen="success"] h2{margin:4px 15px 10px}.stage[data-screen="success"] .description{margin-bottom:12px}}
/* 遊び方ダイアログの下にS2 SHISHAの文字ロゴ（トップへのリンク） */
.site-link{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;margin-top:10px;padding:8px;opacity:.8}.site-link:hover{opacity:1}.site-link img{display:block;width:auto;height:12px}
