.town-shell{--pq-color-surface:#eef0df;--pq-color-surface-raised:#fbf8ec;--pq-color-border:#cbd2ba;--pq-color-text:#163f35;--pq-color-text-muted:#53695d;--pq-color-on-dark:#163f35;background:#eef0df;color:#163f35}
.town-shell .workspace{max-width:1440px}
.town-shell :is(main,article,section,details,fieldset){min-width:0}
.town-shell :is(h1,h2,h3,h4,label,legend,dt,dd,summary){color:#163f35}
.town-shell :is(.card,.panel,.record-card,.quest-card,.base-guide,.challenge-branch,.challenge-node){background:#fbf8ec;color:#163f35;border:1px solid #cbd2ba;border-radius:20px;box-shadow:0 5px 18px #304b3210}
.town-shell :is(.card,.panel,.record-card,.challenge-detail) p{color:inherit;line-height:1.7}
.town-shell .eyebrow{color:#7b5b24}
.town-shell a{color:#245e49;text-underline-offset:3px}
.town-shell :is(button,.button):not(.secondary):not([aria-disabled]):not(.header-avatar):not(.owner-avatar):not(.base-return){background:#174e3e;color:#fffaf0;border-radius:14px;border:1px solid #174e3e;min-height:44px}
.town-shell .bottom-nav button{background:transparent!important;color:#53695d!important;border:0!important}
.town-shell .bottom-nav button.active{background:#174e3e!important;color:#fffaf0!important}
.town-shell :is(input,select,textarea){background:#fffdf6;color:#163f35;border:1px solid #b6c1a8;max-width:100%;min-width:0}
.town-shell input:is([type=checkbox],[type=radio]){width:22px;min-height:22px;height:22px;accent-color:#174e3e;flex:none}
.town-shell :is(pre,.operation-result){background:#f3f0df;color:#163f35;white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;border-radius:12px}
.town-shell .operation-result{white-space:normal}
.town-shell table{color:#163f35;background:#fbf8ec}
.town-shell :is(th,td){border-color:#cbd2ba;overflow-wrap:anywhere}
.town-shell th{background:#e3e8d1;color:#163f35}
.town-shell :is(.tag,.badge,.chip){background:#e3e8d1;color:#163f35;border:1px solid #cbd2ba}
.town-shell :is(.base-guide,.challenge-branch,.challenge-node,.challenge-detail){color:#163f35}
.town-shell .challenge-node.achieved{border-color:#477f55}
.town-shell .challenge-node.in_progress{border-color:#9f7229}
.town-shell :is(.branch-number,.challenge-id){background:#dce6c5;color:#163f35}
.town-shell .mobile-menu{display:block}
.town-shell .mobile-menu>summary{cursor:pointer;min-height:44px;border:1px solid #cbd2ba;border-radius:12px;padding:10px}
.town-shell .mobile-menu nav{position:absolute;right:0;z-index:31;background:#fbf8ec;color:#163f35;border:1px solid #cbd2ba;border-radius:16px;max-height:70dvh;overflow:auto;width:min(300px,calc(100vw - 30px));display:grid;gap:8px;padding:12px}
.town-shell .mobile-menu nav button{white-space:normal;text-align:left}
.town-current-place{display:flex;align-items:center;gap:12px;margin-bottom:18px;padding:10px 16px;border:1px solid #cbd2ba;border-radius:20px;background:#fbf8ec}
.town-current-place img{object-fit:contain;flex:none;width:50px;height:64px}
.town-current-place p{margin:0;color:#53695d;font-size:.85rem;line-height:1.6}
.town-current-place strong{display:block;font-size:1rem;color:#163f35}
.town-current-place p{flex:1;min-width:0}
.town-state-note{display:block;font-size:.75rem;margin-top:4px}
.town-current-place button{flex:none;max-width:100%;white-space:normal}
.town-shell .mobile-menu{position:relative}
.town-shell #statusMessage{margin:12px 4vw;padding:12px 16px;border:1px solid #aab68c;border-radius:14px;background:#fbf8ec;color:#163f35;overflow-wrap:anywhere}
.town-shell main:focus{outline:3px solid #93643a;outline-offset:3px}
.town-shell .table-wrap{overflow:auto}
@media(max-width:700px){.town-current-place{flex-wrap:wrap}.town-current-place p{flex-basis:calc(100% - 62px)}.town-current-place button{width:100%}}
.town-shell:has([data-home-view]) .town-current-place{display:none}
.town-shell .gate{background:#fbf8ec;color:#163f35;border:1px solid #cbd2ba;border-radius:20px}
.town-shell .audience-search{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:var(--pq-space-4);align-items:end}
.town-shell .audience-search label{display:grid;gap:var(--pq-space-2);min-width:0}
.town-shell #audienceTimeline{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:var(--pq-space-5);margin-block:var(--pq-space-5)}
.town-shell #audienceTimeline .record-card{padding:0;overflow:hidden;min-width:0;overflow-wrap:anywhere}
.town-shell #audienceTimeline .record-card>.photo-placeholder,.town-shell #audienceTimeline .record-card>img{display:block;width:100%;height:auto;aspect-ratio:16/10;object-fit:cover;margin:0;background:var(--pq-color-surface);border-bottom:1px solid var(--pq-color-border)}
.town-shell #audienceTimeline .photo-placeholder{display:block!important;padding:0;overflow:hidden}
.town-shell #audienceTimeline .photo-placeholder>svg{display:block;width:100%;height:100%}
.town-shell [data-resource-card]>.photo-placeholder>svg{display:block;width:100%;height:auto}
.town-shell [data-resource-card]{position:relative}
.town-shell [data-resource-card][data-ended]>:is(.photo-placeholder,img){filter:grayscale(.75) opacity(.72)}
.town-shell .audience-ended-stamp{position:absolute;top:14px;right:14px;display:grid;place-items:center;width:76px;height:76px;border:3px solid #c0392b;border-radius:50%;outline:1px solid #c0392b;outline-offset:-7px;background:#fbf8ecd9;color:#c0392b;font-family:"Hiragino Mincho ProN","Yu Mincho","Noto Serif JP",serif;font-weight:900;font-size:24px;letter-spacing:.08em;line-height:1;transform:rotate(-14deg);pointer-events:none;z-index:1;text-indent:.08em}
.town-shell .audience-card-copy{padding:var(--pq-space-5)}
.town-shell .audience-date{font-weight:var(--pq-font-weight-bold);font-size:var(--pq-font-size-lg);line-height:1.5}
.town-shell .audience-card-copy a{display:inline-flex;align-items:center;min-height:var(--pq-control-min-size)}
.town-shell #audienceTimeline:has(>section){display:block}
@media(max-width:700px){.town-shell header{gap:6px!important}.town-shell .workspace{padding-inline:14px!important}.town-current-place{padding:8px 12px;gap:10px}.town-current-place img{width:40px;height:52px}.town-shell .card{padding:18px}.town-shell .table{overflow:auto}.town-shell .form-grid{grid-template-columns:1fr!important}.town-shell .form-grid>label,.town-shell .form-grid>fieldset{min-width:0}.town-shell :is(.record-card,.card) button{white-space:normal;max-width:100%}}

/* Keep navigation available without covering the content being read. */
.player-shell header{position:relative}
.player-shell .workspace{padding-bottom:130px}
.town-shell #statusMessage:empty{display:none}
.town-shell .operation-result:empty{display:none}
.town-current-place{margin-bottom:8px;padding:8px 12px;gap:8px}
.town-current-place img{width:32px;height:40px}
.town-current-place p{font-size:.85rem;line-height:1.4}
.town-current-place strong{display:inline;margin-right:.5em;font-size:.9rem}
.town-current-place span{display:inline}
.town-current-place button{min-height:38px;font-size:.8rem}
.town-shell .workspace:has(#pqWorldRoot)>.town-current-place{display:flex;margin-bottom:4px}
.town-shell .workspace:has(#pqWorldRoot)>.town-current-place :is(img,button){display:none}
.town-shell .workspace:has(#pqWorldRoot)>.page-heading{display:none}
.town-shell .gate{margin:5vh auto;padding:24px}
.warning-box{padding:6px 12px;font-size:.85rem;line-height:1.4}
.warning-box details{margin:2px 0 0}.warning-box details p{margin:4px 0}
.home-route-note{margin:8px 0;padding:10px 12px;background:#fbf8ec;border-radius:12px}
@media(max-width:700px){
 .player-shell .workspace{padding-bottom:130px!important}
 .town-current-place p{flex:1 1 0}
 .town-current-place button{width:auto}
 .player-shell .bottom-nav button{font-size:.65rem}
}
@media(max-width:600px){
 .town-shell.player-shell>header{display:grid;grid-template-columns:minmax(50px,1fr) auto auto auto auto;grid-template-areas:"brand back avatar shortcuts logout" "points points points settings menu";align-items:center;gap:4px!important;padding:6px 8px!important;min-height:0}
 .town-shell.player-shell>header>.brand{grid-area:brand;min-width:0;width:auto}
 .town-shell.player-shell>header .pq-town-logo{width:78px;max-width:100%}
 .town-shell.player-shell>header .pq-town-logo img{width:100%;max-height:38px;object-fit:contain}
 .town-shell.player-shell>header>#appBack{grid-area:back}
 .town-shell.player-shell>header>.header-avatar{grid-area:avatar;min-width:36px;padding:3px}
 .town-shell.player-shell>header>.header-avatar span{display:none}
 .town-shell.player-shell>header>.party-shortcuts{grid-area:shortcuts;gap:2px}
 .town-shell.player-shell>header>.party-shortcuts :is(a,button){min-width:0;min-height:38px;padding:4px;font-size:.65rem}
 .town-shell.player-shell>header>.party-shortcuts svg{width:15px;height:15px}
 .town-shell.player-shell>header>.pq-point-header{grid-area:points;min-width:0;width:auto;gap:2px}
 .town-shell.player-shell>header .point-pill{padding:2px 4px;font-size:.68rem}
 .town-shell.player-shell>header .point-inventory-link{padding:2px;font-size:.7rem}
 .town-shell.player-shell>header>[data-nav="player-settings"]{grid-area:settings}
 .town-shell.player-shell>header>.mobile-menu{grid-area:menu;margin:0}
 .town-shell.player-shell>header>.mobile-menu>summary{min-height:38px;padding:8px 5px;font-size:.67rem;white-space:nowrap}
 .town-shell.player-shell>header>#logout{grid-area:logout}
 .town-shell.player-shell>header :is(#appBack,#logout,[data-nav="player-settings"]){min-height:38px;padding:5px;font-size:.68rem;white-space:nowrap}
 .town-shell.player-shell>header{display:flex!important;flex-wrap:wrap;justify-content:flex-start}
 .town-shell.player-shell>header::before{content:"";flex-basis:100%;height:0;order:6}
 .town-shell.player-shell>header>.brand{order:1;flex:0 1 78px!important}
 .town-shell.player-shell>header>#appBack{order:2}
 .town-shell.player-shell>header>.header-avatar{order:3}
 .town-shell.player-shell>header>.party-shortcuts{order:4}
 .town-shell.player-shell>header>#logout{order:5;margin-left:auto}
 .town-shell.player-shell>header>.pq-point-header{order:7;flex:1 1 auto;flex-wrap:nowrap}
 .town-shell.player-shell>header>[data-nav="player-settings"]{order:8}
 .town-shell.player-shell>header>.mobile-menu{order:9}
}

@media(max-width:700px){.town-shell.player-shell>header :is(#appBack,#logout,[data-nav="player-settings"]){min-height:40px}}
@media(max-width:700px){.town-shell button{min-height:40px}}
@media(max-width:700px){.town-shell.player-shell>header .point-inventory-link{min-height:40px;box-sizing:border-box}}

/* 行の削除や取消は、主要な実行操作と見分けやすくする。 */
.town-shell button:is(.remove,[data-remove-rule],[data-cancel-invite],[data-revoke],[data-delete],[data-unsave],[data-remove]){background:transparent!important;color:#644a40!important;border:1px solid #ad988b!important;box-shadow:none!important}
.town-shell button:is(.remove,[data-remove-rule],[data-cancel-invite],[data-revoke],[data-delete],[data-unsave],[data-remove]):hover{background:#f2e9e2!important}

.town-shell button[data-disclosure-cancel]{background:transparent!important;color:#644a40!important;border:1px solid #ad988b!important;box-shadow:none!important}
