/* 公開版の表示レイヤー。ゲーム状態・計算には触れない。 */
:root{--ui-navy:#06324c;--ui-deep:#041f38;--ui-teal:#04b8b6;--ui-cyan:#44dcd7;--ui-gold:#ffc85f;--ui-ink:#102f48;--ui-muted:#527083;--ui-border:#c7e4e8;--ui-shadow:0 16px 38px rgba(4,44,72,.13);color:var(--ui-ink)}
html{background:#d7edf2}body{background:#d7edf2;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif}.app{width:min(100%,900px);background:#f3f9fa;box-shadow:0 0 65px rgba(4,34,60,.16)}button,a,input,select{touch-action:manipulation}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #ffbd46;outline-offset:3px}button:disabled{cursor:not-allowed}
/* 遊び方：島の背景と、二つの選択カード */
.public-mode{min-height:100dvh;background:linear-gradient(180deg,rgba(238,251,255,.02) 0%,rgba(3,47,78,.16) 31%,rgba(2,31,56,.65) 100%),url('assets/kingdom.webp') center 37%/cover no-repeat;display:flex;justify-content:center;color:#fff;padding:calc(26px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom))}
.public-mode-inner{width:min(100%,720px);display:flex;flex-direction:column;justify-content:center;gap:28px}.public-mode-header{text-align:center;text-shadow:0 2px 14px rgba(0,39,68,.5)}.public-mode-header .brand-logo{display:block;width:clamp(210px,64vw,310px);height:auto;margin:0 auto 32px;filter:drop-shadow(0 3px 15px rgba(255,255,255,.55))}.public-mode-header h1{margin:0;font-family:serif;font-size:clamp(2rem,7.2vw,3.2rem);letter-spacing:.1em;font-weight:700}.public-mode-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.public-mode-card{min-width:0;min-height:370px;position:relative;display:flex;flex-direction:column;align-items:center;overflow:hidden;padding:17px 14px 16px;border:2px solid rgba(255,255,255,.9);border-radius:28px;background:linear-gradient(180deg,rgba(219,249,253,.57),rgba(255,255,255,.96) 57%);backdrop-filter:blur(14px);box-shadow:0 15px 35px rgba(1,30,55,.32);color:#073456;text-align:center;text-decoration:none;transition:transform .2s,box-shadow .2s}.public-mode-card:hover{transform:translateY(-4px);box-shadow:0 20px 40px rgba(1,30,55,.4)}.public-mode-card.solo{border-color:#8df4ef;box-shadow:0 0 0 3px rgba(1,205,205,.35),0 16px 35px rgba(1,30,55,.32)}.mode-art{height:146px;width:100%;display:flex;align-items:flex-end;justify-content:center;padding-bottom:10px}.mode-art>img{width:32%;aspect-ratio:1;object-fit:cover;border-radius:50%;border:3px solid white;box-shadow:0 4px 15px rgba(2,44,66,.2);margin:0 -5px}.mode-art>img:nth-child(2){width:39%;z-index:1}.mode-phones{align-items:center;gap:6px}.mode-phones>span{width:28%;height:105px;display:grid;place-items:center;background:#0a4264;border:4px solid #063451;border-radius:13px;box-shadow:0 8px 14px rgba(2,40,70,.25);transform:rotate(-12deg)}.mode-phones>span:nth-child(2){transform:translateY(-10px) rotate(5deg)}.mode-phones>span:nth-child(3){transform:rotate(12deg)}.mode-phones img{width:100%;height:100%;object-fit:cover;border-radius:7px}.mode-symbol{font-size:1rem;color:#0b5b91;letter-spacing:-.12em;min-height:22px}.public-mode-card strong{font-size:clamp(1.32rem,4vw,1.9rem);letter-spacing:.03em;margin-top:5px;white-space:nowrap}.mode-description{font-size:.95rem;line-height:1.45;margin-top:6px}.mode-note{font-size:.8rem;color:#355b70;margin-top:4px}.mode-cta{margin-top:auto;width:100%;min-height:48px;display:grid;place-items:center;border-radius:999px;background:linear-gradient(130deg,#28d7d5,#00989f);color:#fff;font-size:2.5rem;line-height:1;box-shadow:0 6px 15px rgba(0,118,132,.23)}.multi .mode-cta{background:linear-gradient(130deg,#4989bd,#154a82)}.public-mode footer{text-align:center;display:grid;gap:7px;text-shadow:0 2px 8px rgba(2,28,55,.65)}.public-mode footer a{color:white;font-weight:800;text-underline-offset:5px}.public-mode footer small{color:#efffff;font-size:.8rem}
/* 市民カード・初期設定 */
.v30-setup{background:linear-gradient(180deg,#dcf7f8,#f5f9f8 300px);color:var(--ui-ink)}.v30-setup>header{position:relative;background:linear-gradient(0deg,rgba(2,53,78,.78),rgba(2,53,78,.22)),url('assets/kingdom.webp') center 34%/cover no-repeat;padding:calc(30px + env(safe-area-inset-top)) 20px 35px}.v30-setup>header .brand-logo{width:180px;filter:drop-shadow(0 2px 10px white)}.v30-setup>header h1{font-size:clamp(1.65rem,6vw,2.4rem);margin:10px 0}.v30-setup>header small{letter-spacing:.1em;font-weight:800}.v30-setup>header p{font-size:1rem}.setup-back{position:absolute;left:16px;top:calc(18px + env(safe-area-inset-top));color:white;font-size:2.5rem;line-height:1;text-decoration:none}.v30-setup form{width:min(760px,calc(100% - 28px));gap:18px}.v30-setup fieldset{border:1px solid var(--ui-border);border-radius:24px;box-shadow:var(--ui-shadow);padding:18px;gap:14px}.v30-setup legend{color:#075968;font-size:1.05rem}.setup-identity{grid-column:1/-1;display:flex;gap:13px;align-items:center;background:#e9f8f8;padding:12px;border-radius:18px}.setup-identity img{width:72px;height:72px;object-fit:cover;border:3px solid #fff;border-radius:50%}.setup-identity b,.setup-identity span{display:block}.setup-identity span{font-size:.85rem;color:var(--ui-muted);margin-top:4px}.v30-setup label,.mp-form label,.mp-citizen-grid label{font-size:.91rem;font-weight:750;color:#284e64}.v30-setup input,.v30-setup select{min-height:50px;font-size:1rem;border-radius:13px}.v30-setup .primary-action{margin:0 0 30px}.setup-travel{display:block!important}.setup-travel label{display:block}
/* 章のホーム・準備・ボード */
.v30-home,.v30-event,.v30-result,.v30-report,.v30-final,.mp-shell,.records-page{background:#edf7f8;color:var(--ui-ink)}.v30-hero{min-height:245px;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;align-items:start;gap:8px;background:linear-gradient(180deg,rgba(5,49,78,.18),rgba(3,38,65,.84)),url('assets/chapter-1-urban.jpg') center/cover no-repeat;padding:calc(20px + env(safe-area-inset-top)) 20px 25px}.v30-hero>div{grid-column:1}.v30-hero .brand-logo{width:130px;filter:drop-shadow(0 3px 9px white)}.v30-hero>button{grid-column:2;grid-row:1}.v30-hero section{grid-column:1/-1;align-self:end;padding:0}.v30-hero h1{font-size:clamp(1.75rem,6vw,2.4rem);line-height:1.2;margin:6px 0}.v30-hero span{display:inline-block;background:var(--ui-gold);color:#12384e;padding:4px 11px;border-radius:999px;font-size:.82rem;font-weight:900}.v30-hero small{display:block;font-size:.91rem;font-weight:750}.chapter-2 .v30-hero{background-image:linear-gradient(180deg,rgba(5,72,88,.2),rgba(3,54,70,.87)),url('assets/kingdom.webp')}.chapter-3 .v30-hero{background-image:linear-gradient(180deg,rgba(12,70,92,.14),rgba(2,49,65,.87)),url('assets/kingdom.webp')}.chapter-4 .v30-hero{background-image:linear-gradient(180deg,rgba(18,27,62,.45),rgba(9,22,50,.94)),url('assets/kingdom.webp')}.v30-stack,.event-body,.result-body,.report-body{padding:18px 14px 115px}.v30-card,.story-card,.info-card,.item-card,.choice-card,.result-summary,.result-grid,.report-body{border-color:var(--ui-border);border-radius:22px;box-shadow:var(--ui-shadow)}.v30-card h2,.info-card h2,.item-card h2,.choice-card h2{font-size:1.08rem}.player-card{border:2px solid #69d6d2;background:linear-gradient(135deg,#fff,#e9faf7);grid-template-columns:82px 1fr}.player-card .face img{width:80px;height:80px;border:3px solid #fff;box-shadow:0 5px 15px rgba(5,62,80,.16)}.player-card section h2{font-size:1.2rem}.player-card section p{flex-wrap:wrap;font-size:.88rem}.citizen-row{gap:6px}.citizen-row article{background:#eff8f9;padding:8px 2px;border-radius:14px;min-width:0}.citizen-row img{width:clamp(38px,11vw,62px);height:clamp(38px,11vw,62px)}.citizen-row b{font-size:.78rem}.citizen-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.metric-grid article{border:1px solid #d4e9ea;background:#f0f8f8}.metric-grid small{color:var(--ui-muted)}.metric-grid b{font-size:1.02rem;overflow-wrap:anywhere}.prep-card{background:linear-gradient(155deg,#fff,#edfaf8)}.prep-card>div{grid-template-columns:repeat(2,minmax(0,1fr))}.prep-card button{min-height:73px;border:1.5px solid #acd8d8;border-radius:16px;background:#fff;padding:12px}.prep-card button:not(:disabled):hover,.choice-card>button:not(:disabled):hover{border-color:var(--ui-teal)}.prep-card button:disabled{opacity:.55}.outbreak{border-left:5px solid var(--ui-gold)}.last-result{background:#e0f3f1}.primary-action,.confirm-action,.v30-final button,.mp-button{min-height:54px;border-radius:17px;background:linear-gradient(130deg,#1dc9c4,#048f94);color:white;box-shadow:0 9px 20px rgba(0,128,132,.2)}.primary-action:disabled,.confirm-action:disabled{background:#9ab3ba;box-shadow:none}.v30-nav{max-width:900px;margin:auto;left:50%;transform:translateX(-50%);border-radius:15px 15px 0 0}.v30-nav button{min-height:58px}.v30-nav button span{font-size:.77rem}
/* 出来事・政策投票・結果 */
.event-header{min-height:145px;background:linear-gradient(135deg,#06324c,#0c6480);grid-template-columns:44px 100px 1fr;gap:7px;padding:calc(16px + env(safe-area-inset-top)) 15px 16px}.event-header .brand-logo{width:96px}.event-header section{padding-left:0}.event-header h1{font-size:1.2rem}.event-header b{display:inline-block;background:#fbd68e;color:#103d52;border-radius:999px;padding:5px 10px;font-size:.77rem}.v30-event.policy .event-header{background:linear-gradient(135deg,#075475,#163e71)}.v30-event.sudden .event-header{background:linear-gradient(135deg,#845631,#94453b)}.v30-event.zeta .event-header{background:linear-gradient(135deg,#251e48,#5c2658)}.story-card figure{height:clamp(210px,58vw,320px)}.story-card>section{padding:20px}.story-card h2{font-size:clamp(1.3rem,5vw,1.85rem)}.story-card p,.info-card p,.result-summary p{font-size:1rem;line-height:1.8;white-space:pre-line}.choice-card>button,.item-card button{min-height:64px;border:1.5px solid #bad9de;border-radius:17px}.choice-card>button.selected,.item-card button.selected{border:2px solid var(--ui-teal);background:#e4f9f5;box-shadow:0 5px 15px rgba(2,156,153,.1)}.choice-card>button:disabled{opacity:.62}.choice-card b{font-size:1rem}.choice-card small{font-size:.86rem}.v30-event.policy .choice-card{border-top:5px solid #448dc2}.v30-event.sudden .choice-card{border-top:5px solid #f5af66}.v30-event.zeta .choice-card{border-top:5px solid #aa82ce}.no-items{background:#e9edf6;border-radius:14px;padding:13px}.result-header,.v30-report>header{background:linear-gradient(150deg,#06324c,#126e88);padding:calc(25px + env(safe-area-inset-top)) 16px 28px}.result-header .brand-logo{width:165px}.result-grid{border:0;background:transparent;box-shadow:none;padding:0}.result-grid article,.report-cards article{background:#fff;border:1px solid var(--ui-border);border-radius:17px;padding:16px}.result-grid b,.report-cards b{font-size:1.15rem;color:#065f73}.result-summary h2{font-size:1.45rem}.v30-report>nav{max-width:900px;margin:auto;box-shadow:0 5px 20px rgba(4,46,70,.08)}.v30-report>nav button{min-height:58px;font-size:.93rem}.v30-report>nav button.active{border-color:var(--ui-teal);color:#007e82}.report-list p{align-items:baseline;line-height:1.55}.report-list span{text-align:right;overflow-wrap:anywhere}.report-cards article b{font-size:1.5rem}.v30-final{background:linear-gradient(180deg,#bfeef0,#edf7f8 42%);padding:calc(45px + env(safe-area-inset-top)) 15px 45px}.v30-final .brand-logo{width:240px}.v30-final h1{font-size:2.2rem}.v30-final>section{grid-template-columns:1fr}.v30-final article{border-color:var(--ui-border);padding:20px}.v30-final article b{color:#055b79}.v30-final article small{color:var(--ui-muted);line-height:1.65;overflow-wrap:anywhere}.v30-final h2{color:#075474}
/* 複数人プレイ：同じ盤面・カードのトーン */
.mp-shell{max-width:900px;padding:calc(20px + env(safe-area-inset-top)) 15px 118px}.mp-top{background:rgba(255,255,255,.85);padding:10px 15px;border-radius:18px}.mp-brand img{width:155px}.mp-top a{font-weight:800;color:#075977}.mp-panel,.mp-event,.mp-status{border:1px solid var(--ui-border);box-shadow:var(--ui-shadow);padding:19px}.mp-intro{min-height:175px;background:linear-gradient(90deg,rgba(5,58,81,.91),rgba(5,58,81,.6)),url('assets/kingdom.webp') center/cover;color:#fff}.mp-intro .mp-muted{color:#ecffff}.mp-kicker{color:#087d86}.mp-intro h1{margin:0 0 12px}.mp-actions{grid-template-columns:1fr 1fr}.mp-form input,.mp-form select{min-height:50px;font-size:1rem}.mp-member{background:#eaf6f7;border:1px solid #d4e8e9}.mp-member.active{outline:3px solid var(--ui-gold)}.mp-member small{font-size:.82rem}.mp-room-code{font-size:clamp(2rem,9vw,3rem)}.mp-citizen{background:#f3faf9;border:1px solid var(--ui-border)}.mp-citizen-grid input,.mp-citizen-grid select{min-height:48px}.mp-status{background:linear-gradient(135deg,#07526d,#0c7790);color:white}.mp-status .mp-kicker{color:#b3f6f3}.mp-status h1{margin:6px 0 17px}.mp-stats article{background:rgba(255,255,255,.96);color:var(--ui-ink)}.mp-event{border-top:5px solid var(--ui-teal)}.mp-event h2{font-size:1.48rem}.mp-event>p{line-height:1.75;white-space:pre-line}.mp-choice{min-height:69px;border-radius:17px}.mp-choice b{font-size:1rem}.mp-choice:disabled{opacity:.65}.mp-footer{max-width:900px;left:50%;right:auto;transform:translateX(-50%);width:100%;border-top:1px solid var(--ui-border)}.mp-button.secondary{background:#e4f3f5;color:#07526a;box-shadow:none}.mp-final-list{margin-top:16px}.mp-score{background:#f1faf9;border:1px solid var(--ui-border)}.mp-score b{display:block;color:#065f73}.mp-score small{line-height:1.65}
/* マイページ・図鑑 */
.records-page{max-width:900px;margin:auto;padding:0 15px 55px}.records-page>header{max-width:none;background:linear-gradient(180deg,#d1f3f2,#edf7f8);margin:0 -15px;padding:calc(30px + env(safe-area-inset-top)) 18px 30px}.records-page>header>div{width:200px}.records-page>header>a{left:20px}.records-page>header h1{font-size:2rem}.records-page>section{max-width:760px}.record-card,.records-loading,.records-error,.records-empty,.records-progress,.disease-chips{border-color:var(--ui-border);border-radius:20px;box-shadow:var(--ui-shadow)}.record-card>header{background:transparent}.record-score b{color:#065e70}.disease-chips span{font-size:.85rem;padding:9px 12px}.disease-chips span.discovered{background:#d7f4ea;color:#05534f}.records-page>footer{max-width:760px}
@media(max-width:560px){.public-mode{padding-left:12px;padding-right:12px}.public-mode-inner{gap:20px}.public-mode-header .brand-logo{margin-bottom:17px}.public-mode-cards{gap:9px}.public-mode-card{min-height:305px;padding:10px 6px 11px;border-radius:21px}.mode-art{height:116px}.mode-phones>span{height:84px;border-width:3px}.public-mode-card strong{font-size:clamp(1.17rem,4.8vw,1.5rem)}.mode-description{font-size:.78rem}.mode-note{font-size:.68rem}.mode-cta{min-height:44px}.mp-actions,.mp-citizen-grid{grid-template-columns:1fr}.v30-setup fieldset{grid-template-columns:1fr}.setup-identity{grid-column:auto}.v30-final>section{grid-template-columns:1fr}.report-list p{display:block}.report-list span{display:block;text-align:left;margin-top:5px}}
@media(max-width:370px){.public-mode-card strong{font-size:1.07rem}.public-mode-card{min-height:300px}.mode-description{font-size:.73rem}.mode-phones>span{height:72px}.mode-art{height:102px}.v30-hero h1{font-size:1.55rem}.event-header{grid-template-columns:34px 73px 1fr}.event-header .brand-logo{width:73px}}
@media(min-width:700px){.public-mode{background-position:center 30%}.public-mode-card{min-height:430px}.mode-art{height:190px}.mode-phones>span{height:140px}.mp-grid{grid-template-columns:1fr}.mp-actions{grid-template-columns:1fr 1fr}.v30-final>section{grid-template-columns:1fr 1fr}}
@media(prefers-reduced-motion:reduce){.public-mode-card{transition:none}}
/* 第1〜3章の購入画面 */
.v30-prep{min-height:100dvh;background:linear-gradient(180deg,#d4f4f2,#f0f9f8 290px);color:var(--ui-ink)}.v30-prep>header{position:relative;padding:calc(25px + env(safe-area-inset-top)) 20px 35px;text-align:center;color:white;background:linear-gradient(180deg,rgba(5,65,84,.27),rgba(3,53,75,.91)),url('assets/kingdom.webp') center 35%/cover no-repeat}.v30-prep>header .brand-logo{width:155px;filter:drop-shadow(0 2px 9px white)}.v30-prep>header span{display:block;margin-top:12px;font-weight:800}.v30-prep>header h1{font-size:1.8rem;margin:6px 0 0}.v30-prep>header>button{position:absolute;top:calc(20px + env(safe-area-inset-top));left:18px;border:1px solid #fff8;border-radius:50%;width:40px;height:40px;background:#083e5d99;color:white;font-size:2rem;line-height:1}.prep-content{width:min(760px,100%);margin:auto;padding:16px 14px 36px}.prep-overview,.prep-products,.prep-help,.prep-total{background:white;border:1px solid var(--ui-border);border-radius:20px;padding:18px;margin-bottom:15px;box-shadow:var(--ui-shadow)}.prep-overview{display:grid;grid-template-columns:1fr 1fr;gap:12px}.prep-overview>div:first-child{border-right:1px solid var(--ui-border)}.prep-overview small,.prep-overview b{display:block}.prep-overview small,.prep-total span{color:var(--ui-muted)}.prep-overview b{color:#066c76;font-size:1.2rem;margin-top:8px}.prep-overview p{margin:8px 0 0;line-height:1.6}.prep-products>header{display:flex;justify-content:space-between;align-items:center;gap:10px}.prep-products h2{font-size:1.17rem;margin:0 0 12px}.prep-products>header span{font-weight:850;color:#047982}.prep-products-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.prep-products-grid button{min-height:83px;border:1.5px solid #badfe0;border-radius:15px;padding:13px;background:#f8fcfc;color:var(--ui-ink);text-align:left}.prep-products-grid button.selected{border:2px solid var(--ui-teal);background:#e3f9f5}.prep-products-grid button:disabled{opacity:.53}.prep-products-grid b,.prep-products-grid span,.prep-products-grid small{display:block}.prep-products-grid span{font-size:.91rem;color:#087180;margin-top:5px}.prep-products-grid small{color:var(--ui-muted)}.prep-help summary{font-weight:800;color:#08747d;cursor:pointer}.prep-help p{line-height:1.7;margin-bottom:0}.prep-total p{display:flex;justify-content:space-between;gap:10px;margin:0;padding:10px 0;border-bottom:1px solid #e2eeee}.prep-total p:last-child{border:0}.prep-total b{text-align:right}.prep-continue,.prep-open{width:100%;min-height:48px;border:1.5px solid #0f8591;border-radius:14px;background:white;color:#075e70;font-weight:850;margin-top:10px}.prep-open{margin-top:4px}.prep-card p{line-height:1.65;color:var(--ui-muted)}
@media(max-width:440px){.prep-overview{grid-template-columns:1fr}.prep-overview>div:first-child{border-right:0;border-bottom:1px solid var(--ui-border);padding-bottom:10px}.prep-products-grid{grid-template-columns:1fr 1fr}.prep-products-grid button{padding:11px}}
/* 複数人の出来事と章末レポート */
.mp-event{padding:0 0 20px;overflow:hidden;background:#fff}.mp-event>figure{height:clamp(205px,58vw,340px);margin:0 0 18px;overflow:hidden;background:#bbd9dc}.mp-event>figure img{display:block;width:100%;height:100%;object-fit:cover}.mp-event>.mp-kicker,.mp-event>h2,.mp-event>p,.mp-event>.mp-choice-list{margin-left:18px;margin-right:18px}.mp-event>h2{line-height:1.4;margin-top:8px}.mp-event>p{margin-top:12px;margin-bottom:12px}.mp-event.policy{border-top-color:#558bca}.mp-event.zeta{border-top-color:#9661b0;background:linear-gradient(180deg,#f8f3ff,#fff 45%)}.mp-event.sudden{border-top-color:#e59d53}.mp-event .mp-choice-list{margin-top:20px}.mp-event .mp-choice{border-color:#c7e2e5}.mp-event .mp-choice:not(:disabled):hover{border-color:#0da9a7}.mp-report{background:#fff}.mp-report h2{color:#074f68}.mp-report nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:16px 0 18px;padding:5px;border-radius:14px;background:#edf7f7}.mp-report nav button{min-width:0;min-height:42px;border:0;border-radius:10px;background:transparent;color:#4d6978;font:inherit;font-size:.86rem;font-weight:800}.mp-report nav button.active{background:#fff;color:#007d86;box-shadow:0 3px 10px rgba(6,50,70,.1)}.mp-report .report-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.mp-report .report-cards article{background:#f3faf9}.mp-report .report-list p{display:flex;justify-content:space-between;gap:10px;align-items:baseline;padding:12px 2px;border-bottom:1px solid #dcecef;line-height:1.55}.mp-report .report-list span{text-align:right;overflow-wrap:anywhere}.mp-report .report-list b{overflow-wrap:anywhere}
@media(max-width:560px){.mp-report .report-list p{display:block}.mp-report .report-list span{display:block;text-align:left;margin-top:4px}.mp-footer div{flex-wrap:wrap}.mp-footer .mp-button{font-size:.88rem;padding:12px 8px}.mp-event>figure{height:220px}}
