/* BRM Traitors — shared visual foundation. Native game controls remain in place. */
:root{--ink:#f2e8d4;--gold:#c6a366;--gold-bright:#e6ca88;--muted:#b5a78f;--night:#100d0a;--wine:#3b1017;--line:#8d70413f;--app-font:"trajan-pro-3",Georgia,serif;--ui-serif:var(--app-font)}
*{box-sizing:border-box}body{color:var(--ink);background:#0d0a08;font:14px/1.5 var(--app-font)}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4{font-family:var(--ui-serif);font-weight:400;color:var(--gold-bright)}
button{position:relative;min-height:44px;padding:11px 20px;border:1px solid #a17f44;border-radius:3px;background:linear-gradient(180deg,#531c25,#2a0b11);color:#f6e3b8;font-weight:500;box-shadow:inset 0 1px #e4c17a40,inset 0 -2px #08030280,0 3px 8px #0005;transition:filter .15s,transform .15s}button.alt{background:linear-gradient(#272019,#17120e);color:#dfc794;border-color:#806439}button:hover:not(:disabled){filter:brightness(1.15)}button:active:not(:disabled){transform:translateY(1px)}button:disabled{opacity:.38}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #f7d590;outline-offset:3px}input,textarea,select{border:1px solid #8c704c;border-radius:3px;background:#0e0c0b;color:var(--ink);font-size:16px;padding:12px;min-height:44px}label{color:#cdbd9e;font-size:12px}.small,.muted{color:var(--muted);line-height:1.5}.kicker,.castle-eyebrow{font-size:9px;color:var(--gold);letter-spacing:.2em;text-transform:uppercase}p:empty{display:none}
body:not(.castle-game){background:linear-gradient(#0d090733,#0d0907cc),url('/assets/castle-cinematic.webp') center/cover fixed}body:not(.castle-game) .shell>header{justify-content:center;border:0;margin:0;padding-top:50px;text-align:center}body:not(.castle-game) #connection,body:not(.castle-game) #jumpMission{display:none}body:not(.castle-game) #login{max-width:400px;margin:30px auto;background:#100c09ed;border:1px solid #967340;border-radius:4px;padding:30px}#authBtn{width:100%}
body.castle-game{overflow:hidden}.castle-game .shell{max-width:none;margin:0;padding:0;height:var(--castle-height,100dvh);overflow:hidden;display:flex;flex-direction:column}.castle-game .shell>header{display:none}body.castle-game #app{display:grid!important;flex:1;min-height:0;grid-template-columns:180px minmax(0,1fr);grid-template-rows:76px minmax(0,1fr);gap:0;background:#100d0a}
#castle-nav{grid-column:1;grid-row:1/3;display:flex;flex-direction:column;z-index:5;background:linear-gradient(90deg,#100c09,#17100b);border-right:1px solid #796037;min-height:0}.castle-nav-brand{padding:30px 10px 26px;text-align:center;border-bottom:1px solid var(--line)}.castle-brand{display:block;color:#dfbd75;font:25px/.95 var(--ui-serif);letter-spacing:.025em}.castle-nav-links{padding:20px 8px;display:flex;flex-direction:column;gap:5px;overflow:auto}.castle-nav-link{display:flex;align-items:center;gap:11px;min-height:48px;padding:10px 12px;font-size:12px;text-align:left;box-shadow:none;background:transparent;border:1px solid transparent;color:#d3c5a9}.castle-nav-link[aria-current="page"]{color:#ffe6b4;border-color:#a5844c;background:linear-gradient(100deg,#4d1720,#270c11);box-shadow:inset 0 1px #e7c28524}.castle-icon{display:block;width:27px;height:27px;object-fit:contain;flex:none;filter:brightness(1.8) saturate(.7) drop-shadow(0 2px 1px #0008)}.castle-nav-more{display:none}
#castle-view-heading{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 32px;border-bottom:1px solid #9c7c4359;background:linear-gradient(180deg,#1c130d,#100b08);position:relative;z-index:4}.castle-view-titles{display:flex;align-items:center;gap:22px;min-width:0}.castle-wordmark{display:none}#castle-view-title{margin:0;font-size:25px;line-height:1.2;letter-spacing:.015em;color:#ecd4a0}#castle-view-subtitle{display:none}.castle-header-actions{display:flex;align-items:center;gap:8px}#castle-account{font-size:11px;color:#c7b491;margin-right:6px}.castle-header-actions .castle-nav-link{padding:8px;min-width:44px;min-height:44px;justify-content:center;border-color:#79603755;background:#100b08}.castle-header-actions .castle-nav-link span{display:none}.castle-header-actions .castle-icon{width:23px;height:23px}
body.castle-game #app>.side,body.castle-game #app>.chat{grid-column:2;grid-row:2;min-width:0;min-height:0;overflow:auto;border:0;border-radius:0;margin:0;overflow-anchor:none;scrollbar-color:#856b42 #17110c}body.castle-game #app>.side{display:flex;flex-direction:column;gap:20px;padding:28px 36px;background:#120d09}body.castle-game #app>.chat{display:none!important;background:#110e0c;height:auto}.castle-game #app[data-screen="chat"]>.chat{display:flex!important}.castle-game #app[data-screen="chat"]>.side{display:none!important}
body.castle-game #app>.side>.kicker,body.castle-game #app>.side>#role,body.castle-game #app>.side>.cast-profile,
body.castle-game #app>.side>#settingsBtn,body.castle-game #app>.side>#teamBuildVersion,body.castle-game #app>.side>#detail{display:none!important}
body.castle-game #app:not([data-screen="home"])>.side>#castle-dashboard,
body.castle-game #app:not([data-screen="home"])>.side>.morning,
body.castle-game #app:not([data-screen="home"])>.side>#roleBanner{display:none!important}
body.castle-game #app:not([data-screen="missions"])>.side>#missionCentre{display:none!important}
body.castle-game #app:not([data-screen="players"])>.side>#castBoardPanel{display:none!important}
body.castle-game #app:not([data-screen="round"])>.side>#votePanel{display:none!important}
body.castle-game #app:not([data-screen="tower"])>.side>#traitorPanel,
body.castle-game #app:not([data-screen="tower"])>.side>#murderPanel{display:none!important}
body.castle-game #app:not([data-screen="settings"])>.side>#settingsPanel{display:none!important}
body.castle-game #app[data-screen="settings"]>.side>#settingsPanel{display:block!important}
body.castle-game #app[data-host="false"]>.side>#hostControls{display:none!important}
body.castle-game #app[data-host="true"]>.side>#hostControls{display:contents!important}
body.castle-game #app>.side>#hostControls>*{display:none!important}
body.castle-game #app[data-host="true"][data-screen="home"]>.side>#hostControls>.morning{display:block!important;order:1}
body.castle-game #app[data-host="true"][data-screen="players"]>.side>#hostControls>.players-panel{display:block!important}
body.castle-game #app[data-host="true"][data-screen="tower"]>.side>#hostControls>.murder-panel{display:block!important}
body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>.hostactions,
body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>#hostVoteInfo{display:flex!important}
body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>#hostVoteInfo{display:block!important}
body.castle-game #app[data-host="true"][data-screen="chat"]>.side>#hostControls>.buttons{display:flex!important}

body.castle-game #app[data-host="true"][data-screen="players"]>.side>#hostControls>.players-panel{display:none!important}
body.castle-game #app[data-screen="chat"][data-host="true"]{grid-template-rows:76px minmax(0,1fr) auto}body.castle-game #app[data-screen="chat"][data-host="true"]>.side{display:flex!important;grid-row:3;padding:10px 30px;max-height:130px}
body.castle-game #app>.side>section,body.castle-game #hostControls>.morning,body.castle-game #hostControls>.murder-panel{margin:0;width:100%;border:1px solid #846639;border-radius:4px;padding:22px;background:#17110ceb;box-shadow:0 10px 24px #0003}.morning h2,.settings-panel h2{font-size:23px}.morning-controls{display:flex;gap:10px;margin:16px 0;flex-wrap:wrap}#sendAnnouncement{margin-top:12px}#announcementText{margin-top:4px}#announcementText::placeholder{color:#8c7c65}
body.castle-game #app[data-screen="home"]>.side{background:#151210}body.castle-game #app>.side>#castle-dashboard{padding:0;border:0;background:none;box-shadow:none;max-width:1100px;margin:0 auto;order:-1}.castle-overview{display:grid;grid-template-columns:1.45fr 1fr;gap:32px;align-items:center}.castle-treasury{position:relative;min-width:0;background:#0c0907;border:1px solid #806335;box-shadow:0 12px 28px #0008}.castle-treasury>img{display:block;width:100%;aspect-ratio:3/2;object-fit:cover}.castle-pot-plaque{padding:13px 20px;text-align:center;border-top:1px solid #92703c;background:linear-gradient(#25130e,#140c08)}.castle-pot-plaque span{display:block;font-size:9px;letter-spacing:.18em;color:#cfb47b}.castle-pot-plaque strong{display:block;color:#f5d68a;font:38px/1.2 var(--ui-serif);margin-top:4px}.castle-game-status{padding:12px 0;border:0;background:transparent}.castle-game-status[hidden]{display:none}.castle-game-status h3{font:22px var(--ui-serif);margin:0 0 12px;padding-bottom:15px;border-bottom:1px solid #b796555c}.castle-game-status dl{margin:0}.castle-game-status dl>div{display:flex;justify-content:space-between;gap:10px;padding:14px 0;border-bottom:1px solid #b796552e;font-size:13px}.castle-game-status dt{color:#bba98b}.castle-game-status dd{margin:0;color:#f1dfb9}#hostMorningStatus{display:none}.castle-game-status p{font-size:11px;line-height:1.5;color:#c0aa82;margin-top:18px}.castle-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-top:24px}.castle-action-card{display:flex;align-items:center;justify-content:center;gap:10px;min-height:74px;padding:12px 16px;border:1px solid #9e7d44;box-shadow:inset 0 1px #f5db9d22,0 4px 12px #0006;font:18px var(--ui-serif);background:linear-gradient(#4f1a22,#260c11)}.castle-action-card .castle-icon{width:33px;height:33px}.castle-action-copy small{display:none}.castle-action-copy strong{font-weight:400}.castle-welcome[hidden],.castle-roster-preview[hidden],#castle-dash-heading[hidden]{display:none}.castle-game #app[data-screen="home"]>.side>.morning,.castle-game #app[data-screen="home"] #hostControls>.morning{max-width:1100px;margin:0 auto}.castle-game #app[data-screen="home"]>.side>.morning{order:2}#hostControls .morning{order:1}
/* Portraits are mounted inside real gilt frames, over the gallery wall. */
body.castle-game #app[data-screen="players"]>.side{background:linear-gradient(#16070b44,#16070b33),url('/assets/gallery-wall-v3.webp') center top/900px auto;box-shadow:inset 0 10px 25px #0007;padding:34px 44px}body.castle-game #app>.side>#castBoardPanel{max-width:1030px;margin:0 auto;padding:0;border:0;background:none;box-shadow:none}#castBoardPanel>.kicker,#castBoardPanel>h2{display:none}body.castle-game #app>.side .cast-board-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:26px 30px}body.castle-game #app>.side .cast-player{position:relative;margin:0;padding:0 0 6px;background:none;border:0;border-radius:0;overflow:visible;clip-path:none;box-shadow:none;min-width:0;text-align:center}.castle-portrait-art{position:relative;display:block;width:100%;aspect-ratio:4/5;filter:drop-shadow(3px 6px 4px #0009)}body.castle-game #app>.side .castle-portrait-art>img{position:absolute;display:block;left:13%;top:12.5%;width:74%;height:75%;aspect-ratio:auto;object-fit:cover;object-position:center 28%;border:0;border-radius:0;background:#160806}.castle-frame{position:absolute;display:block;inset:0;background:url('/assets/portrait-frame-v3.png') center/100% 100% no-repeat;z-index:2;pointer-events:none}.cast-player.ghost .castle-portrait-art:after{content:"";position:absolute;inset:13% 14%;z-index:3;background-image:url('/assets/traitors-paint-slash-rising.png'),url('/assets/traitors-paint-slash-falling.png');background-position:center,center;background-size:100% 100%,100% 100%;background-repeat:no-repeat;pointer-events:none}body.castle-game #app>.side .cast-player.ghost img{filter:grayscale(1) brightness(.65);opacity:1}.cast-status{display:none!important}body.castle-game #app>.side .cast-player figcaption{display:table;margin:9px auto 0;padding:2px 12px 1px;color:#eed8a8;font:15px/1.3 var(--ui-serif);background:#1a0b0bba;border:1px solid #ad885c5c;border-bottom:0}.castle-player-role{display:table;margin:0 auto;padding:0 12px 3px;font:10px/1.4 var(--ui-serif);color:#e0cba4;background:#1a0b0bba}.cast-player[data-secret-role="traitor"] .castle-player-role{color:#ee9d83}.castle-manageable{cursor:pointer}.castle-manageable:focus-visible{outline:2px solid #f2ce80;outline-offset:4px}.castle-manageable:hover .castle-portrait-art{filter:drop-shadow(2px 7px 6px #000b) brightness(1.08)}
/* Settings share the same controls and deliberate vertical rhythm. */
body.castle-game #app>.side>#settingsPanel{max-width:760px;margin:0 auto;padding:28px;background:#160f0be8}.settings-panel h2{margin:0 0 18px}.settings-panel h2:not(:first-of-type){margin-top:30px;padding-top:24px;border-top:1px solid var(--line)}.settings-panel form{display:flex;flex-direction:column;gap:12px;margin:0}.settings-panel form label{margin:0}.settings-panel form input{margin-top:0}.settings-panel form>button{align-self:flex-start;margin-top:10px}#settingsPanel .settings-row{margin:18px 0}.settings-row label{margin:0}#settingsPanel>#logout{margin-top:28px}#chatContext:empty{display:none}.chathead{background:#18100c;padding:18px 24px}.composer{background:#100b08;gap:12px}.bubble p{border:1px solid #7f613e;background:#262019}.bubble.mine p{background:#401921}.buttons,.hostactions,.secret-compose{gap:12px}.mission-centre .item-image{max-width:80px}.mission-centre .mission-object{background:#251a10}.role-banner{color:#e8d09a}.secret-feed{overflow:auto}.secret-compose input{min-width:0;flex:1}
/* Player sheet */
.castle-player-sheet{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));background:#080504c9;backdrop-filter:blur(6px)}.castle-player-dialog{width:min(100%,440px);max-height:100%;overflow:auto;padding:24px;background:linear-gradient(#22140e,#120b08);color:var(--ink);border:1px solid #be9657;border-radius:4px;box-shadow:inset 0 0 0 4px #110a08, inset 0 0 0 5px #7a5a3055,0 24px 70px #000b}.castle-player-dialog-heading{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:16px}.castle-player-dialog h2{font-size:30px;margin:3px 0}.castle-player-close{width:38px;min-height:38px;padding:0;font-size:23px;background:transparent;border:0;box-shadow:none}.castle-player-identity{display:flex;align-items:center;gap:20px;margin:20px 0}.castle-player-dialog-portrait{position:relative;width:90px;height:112px;flex:none;padding:13px 12px;background:url('/assets/portrait-frame-v3.png') center/100% 100%;}.castle-player-dialog-portrait img{width:100%;height:100%;object-fit:cover}.castle-player-dialog-portrait.eliminated img{filter:grayscale(1)}.castle-player-identity-copy strong{font:24px var(--ui-serif);color:var(--gold-bright)}.castle-player-field{margin:20px 0}.castle-player-field select{width:100%;margin-top:6px}.castle-player-shield{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.castle-player-shield input{width:20px;height:20px;min-height:0;accent-color:#c6a366}.castle-player-shield strong{font-weight:400}.castle-player-shield small{display:block;color:var(--muted);font-size:11px}.castle-player-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:22px}.castle-player-actions button{flex:1}.castle-player-action.danger{background:linear-gradient(#531923,#290a11)}.castle-player-note{display:none}
@media(max-width:1050px){body.castle-game #app>.side .cast-board-grid{grid-template-columns:repeat(3,minmax(0,1fr))}body.castle-game #app{grid-template-columns:160px minmax(0,1fr)}body.castle-game #app>.side{padding:22px}.castle-overview{gap:24px;grid-template-columns:1.2fr 1fr}.castle-action-card{padding:10px;font-size:15px;gap:7px}.castle-action-card .castle-icon{width:27px;height:27px}body.castle-game #app[data-screen="players"]>.side{padding:26px}.castle-view-titles{gap:12px}#castle-view-title{font-size:23px}}
@media(max-width:760px){body.castle-game #app>.side,body.castle-game #app>.chat{grid-column:1;grid-row:2}body.castle-game #app{grid-template-columns:minmax(0,1fr);grid-template-rows:calc(70px + env(safe-area-inset-top)) minmax(0,1fr) auto}#castle-nav{grid-column:1;grid-row:3;border-right:0;border-top:1px solid #9a7944;background:#110c09;padding-bottom:env(safe-area-inset-bottom)}.castle-nav-brand{display:none}.castle-nav-links{flex-direction:row;justify-content:space-around;padding:4px;gap:0;overflow:visible}.castle-nav-links>.castle-nav-link{display:none}.castle-nav-links>.castle-primary{display:flex;flex:1;flex-direction:column;gap:3px;min-width:0;min-height:59px;padding:5px 1px;font-size:9px;border:0;box-shadow:none}.castle-nav-link[aria-current="page"]{background:#3b161c}.castle-nav-link .castle-icon{width:27px;height:27px}#castle-view-heading{grid-column:1;padding:10px 14px;gap:8px}#castle-view-title{font-size:20px}.castle-view-titles{gap:12px}.castle-wordmark{display:block;padding-right:12px;border-right:1px solid #7e643b55;font:15px/.95 var(--ui-serif);color:#c3a369;letter-spacing:.02em}.castle-wordmark>span{display:block;font-size:12px}.castle-header-actions{gap:3px}#castle-account{display:none}.castle-header-actions .castle-nav-link{min-width:34px;min-height:40px;padding:5px;border:0;background:transparent}.castle-header-actions .castle-icon{width:23px;height:23px}body.castle-game #app>.side{padding:18px 16px;gap:18px}.castle-overview{display:flex;flex-direction:column;gap:18px}.castle-treasury{width:100%;max-width:480px}.castle-treasury>img{aspect-ratio:3/1.8}.castle-pot-plaque{padding:10px 16px}.castle-pot-plaque strong{font-size:32px}.castle-pot-plaque span{font-size:8px}.castle-game-status{padding:0;width:100%}.castle-game-status h3{font-size:19px;margin:0;padding-bottom:10px}.castle-game-status dl{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.castle-game-status dl>div{font-size:11px;padding:10px 0}.castle-game-status p{margin:10px 0 0;font-size:10px}.castle-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:18px}.castle-action-card{min-height:58px;font-size:16px;gap:9px}.castle-action-card .castle-icon{width:28px;height:28px}body.castle-game #app>.side>section,body.castle-game #hostControls>.morning{padding:18px}body.castle-game #app[data-screen="players"]>.side{padding:24px 14px}body.castle-game #app>.side .cast-board-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:26px 20px}body.castle-game #app>.side .cast-player figcaption{font-size:13px;padding:2px 8px}.castle-player-role{font-size:10px;padding:0 8px 3px}.castle-game #app[data-screen="chat"][data-host="true"]{grid-template-rows:calc(70px + env(safe-area-inset-top)) minmax(0,1fr) auto auto}.castle-game #app[data-screen="chat"][data-host="true"]>#castle-nav{grid-row:4}.castle-game #app[data-screen="chat"][data-host="true"]>.side{grid-row:3;padding:8px 14px}.castle-player-dialog{padding:20px}.castle-player-actions{flex-direction:column}.settings-panel form>button{width:100%}body.castle-game #app>.side>#settingsPanel{padding:20px}.composer{padding-bottom:calc(12px + env(safe-area-inset-bottom))}}
@media(max-width:360px){.castle-wordmark{display:none}#castle-view-title{font-size:19px}.castle-action-card{font-size:14px}.castle-game-status dl{gap:0 12px}body.castle-game #app>.side .cast-board-grid{gap:20px 8px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* Distinct game environments. Ornate gilding is reserved for the portrait wall. */
body:not(.castle-game){min-height:100dvh;background:linear-gradient(#05080b15,#080a0de0),url('/assets/login-v4.webp') center/cover fixed}body:not(.castle-game) .shell{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 20px}body:not(.castle-game) .shell>header{padding:0;margin:0;flex:none}body:not(.castle-game) .shell>header h1{display:flex;flex-direction:column;font:clamp(42px,6vw,72px)/.95 var(--ui-serif);letter-spacing:.05em;color:#decba4;text-shadow:0 3px 16px #000}body:not(.castle-game) .shell>header h1 small{font:22px/1.4 var(--ui-serif);letter-spacing:.25em}body:not(.castle-game) #login{width:min(100%,370px);margin:28px auto 0;background:#101311e8;border:1px solid #8e7b56;padding:26px 30px;box-shadow:0 18px 45px #0008}body:not(.castle-game) #login h2{font-size:24px;text-align:center;margin:0 0 22px;color:#e8dbc2}body:not(.castle-game) #login input{background:#e4d9bf;color:#251e16;border-color:#bcae8c}body:not(.castle-game) #login input::placeholder{color:#726650}#authError:empty{min-height:0;margin:0}#authBtn{margin:18px 0 0;letter-spacing:.08em;text-transform:uppercase}
.castle-action-card,#authBtn,#changePasswordForm>button,#sendAnnouncement,.castle-player-action,.morning-controls button,#enablePush,#logout,.mission-centre button,#votePanel button,#hostControls .hostactions button,#hostControls .murder-panel button,#traitorCompose button,#compose button{border:1px solid #88734e;border-image:none;padding:12px 18px;box-shadow:inset 0 1px #ffffff0c,0 2px 5px #0005;border-radius:2px;background:linear-gradient(#3b2022,#211317);color:#e7dcc4;font-weight:500;min-height:44px}.castle-action-card{background:#27191a;min-height:70px}.castle-action-card:hover:not(:disabled){border-color:#cab78b;background:#3a2326}.castle-nav-link[aria-current="page"]{border-color:#8b7657;background:#302023;color:#eadcc2}.castle-icon{filter:grayscale(.8) sepia(.2) brightness(1.9) drop-shadow(0 1px 1px #0005)}h1,h2,h3,h4,#castle-view-title{color:#dfd1b4}body.castle-game #app[data-screen="home"]>.side{background:#151210}.castle-treasury{border-color:#6e6048}.castle-pot-plaque{background:#171512;border-color:#6e6048}.castle-pot-plaque strong{color:#e2c991}#enablePush{margin:0 10px 12px 0}
body.castle-game #app>.side>#castle-dashboard{width:100%}#castle-player-home[hidden]{display:none}#castle-player-home{min-height:400px;position:relative;display:flex;align-items:flex-end;padding:40px;background:linear-gradient(90deg,#0c1009d9,#0b100824 80%),url('/assets/faithful-v4.webp') center/cover;border:1px solid #76694e}#castle-player-home[data-role="traitor"]{background-image:linear-gradient(90deg,#090d0ce8,#0b100824 80%),url('/assets/traitor-v4.webp');background-position:center}#castle-player-home[data-role="ghost"]{background-image:linear-gradient(90deg,#131313e8,#10101055),url('/assets/faithful-v4.webp');filter:saturate(.3)}.castle-role-copy{max-width:390px}.castle-role-copy h2{font:clamp(42px,5vw,68px)/1 var(--ui-serif);margin:12px 0;color:#e9ddc4}.castle-role-copy p{max-width:330px;color:#e0d8c7;line-height:1.65;font-size:14px}.castle-game #app[data-host="false"] #castle-dashboard .castle-overview{display:block;margin-top:16px}.castle-game #app[data-host="false"] #castle-dashboard .castle-treasury{max-width:none;background:#171512}.castle-game #app[data-host="false"] #castle-dashboard .castle-treasury>img{display:none}.castle-game #app[data-host="false"] #castle-dashboard .castle-pot-plaque{display:flex;align-items:center;justify-content:space-between;padding:16px 22px;border-top:0}.castle-game #app[data-host="false"] #castle-dashboard .castle-pot-plaque strong{font-size:28px;margin:0}body.castle-game #app>.side>#roleBanner{display:none!important}.ghost-notice{order:-2;border:1px solid #82745b;background:#29241c;color:#dcd0b9;padding:12px 16px;border-radius:2px;font-size:12px}
#castle-round-scene,#castle-tower-scene{display:none}body.castle-game #app[data-screen="round"]>.side>#castle-round-scene,body.castle-game #app[data-screen="tower"]>.side>#castle-tower-scene{display:block}.castle-room-scene{position:relative;overflow:hidden;min-height:300px;flex:none}body.castle-game #app>.side>.castle-room-scene{padding:0;border:1px solid #796a4c;border-radius:2px;background:#0c0d0b;box-shadow:none}.castle-room-scene>img{display:block;width:100%;height:360px;object-fit:cover}.castle-room-caption{position:absolute;bottom:0;left:0;right:0;padding:36px 26px 20px;background:linear-gradient(transparent,#090b0aee)}.castle-room-caption h2{margin:7px 0;font-size:30px;color:#e8d8b7}.castle-room-caption p{margin:0;font-size:12px;color:#ccbea2}body.castle-game #app[data-screen="tower"]>.side{background:#101211}body.castle-game #app[data-screen="tower"] #castle-tower-scene>img{object-position:center 45%}#castle-tower-scene .castle-room-caption{text-align:right}.castle-game #app[data-screen="tower"] #hostControls>.murder-panel{order:0}.castle-game #app[data-screen="tower"] #traitorPanel{order:2}.castle-game #app[data-screen="tower"] #murderPanel{order:1}.murder-grid{grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:12px}.murder-grid .portrait{width:70px;height:82px;border:1px solid #8c7752;background:#211d18;border-radius:2px;overflow:hidden}.portrait>img{width:100%;height:100%;object-fit:cover}.murder-result{background:#1e251f;border-left:2px solid #9c865e;border-radius:0;padding:14px}
/* Existing chat remains in its original DOM position beside the open Round Table. */
body.castle-game #app[data-screen="round"][data-round-open="true"]{grid-template-columns:180px minmax(0,1fr) minmax(300px,.65fr)}body.castle-game #app[data-screen="round"][data-round-open="true"]>#castle-view-heading{grid-column:2/4}body.castle-game #app[data-screen="round"][data-round-open="true"]>.chat{display:flex!important;grid-column:3;grid-row:2;border-left:1px solid #675b44}body.castle-game #app[data-screen="round"]>.side{background:#17110f}#votePanel .votegrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(90px,1fr));gap:10px}.brm-vote-target{display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;padding:10px!important}.brm-vote-portrait{width:55px;height:66px;object-fit:cover;border:1px solid #8a7551;border-radius:2px}#votePanel h2{font-size:23px}#voteInfo,#hostVoteInfo{font-size:12px;line-height:1.6;color:#c7b99c}.hostactions{display:flex;flex-wrap:wrap;gap:10px;padding:16px 0;border-top:1px solid #6b5b403b}.hostactions button{flex:1 1 135px;font-size:12px}.chathead #sceneTitle{font-size:23px}.chathead .kicker{display:none}body.castle-game #app>.chat .feed{padding:20px;min-height:0}.bubble p{border-radius:3px;background:#242621;color:#e8e3d7}.bubble.mine p{background:#2e3630}.bubble small{font-size:10px;color:#aca48e}.composer{flex:none;padding:14px;gap:10px;background:#151814}.composer input{font-size:16px;min-height:44px}.composer button{padding:10px 15px!important}.secret-feed{max-height:340px;min-height:80px;overflow:auto}.secret-entry{background:#1f2a25;border-left:2px solid #6f8871;border-radius:2px}.secret-entry small{color:#a8b79f}.secret-compose{display:flex;gap:10px;padding-top:12px}.secret-compose input{min-width:0;font-size:16px}.castle-game #app[data-screen="chat"]>.chat{background:linear-gradient(#111710e8,#111710f5),url('/assets/mission-study-v4.webp') center/cover}.castle-game #app[data-screen="chat"] #sceneTitle{color:#e3d9c3}
/* The current mission is the focus; host configuration and live answers remain separate. */
body.castle-game #app[data-screen="missions"]>.side{background:linear-gradient(#11130fc9,#11130fe8),url('/assets/mission-study-v4.webp') center/cover}body.castle-game #app>.side>#missionCentre{max-width:1050px;margin:0 auto;border:0;padding:0;background:none;box-shadow:none}.mission-title-line{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.mission-title-line h2{font-size:27px;margin:0}.mission-title-line .pot{font:25px var(--ui-serif);color:#e2cc9b}.mission-centre>.mission-kicker{display:none}.mission-centre #missionContent h3{font:30px/1.15 var(--ui-serif);color:#2f271b;margin:5px 0 16px}.mission-centre #missionContent .mission-text{color:#4b3d29;font-size:13px;line-height:1.6}.mission-centre #missionContent select{background:#f1e4c8;color:#32281b;border-color:#a7956e}.mission-centre #missionContent label{color:#3f3322}.mission-centre #missionContent .mission-line{background:#5d45220a;border:1px solid #9f8e674f;border-radius:2px}.mission-centre #missionContent .mission-note{background:#e3d4b5;color:#3c3727;border-left:2px solid #756849;padding:13px;border-radius:0;line-height:1.6}.mission-centre #missionContent .mission-result{background:#e7dabd;border-left:2px solid #897754;color:#493a25;border-radius:0;padding:12px}.mission-centre #missionHost{margin-top:22px;background:#131810f2;border:1px solid #74674a;padding:24px;color:#dbd6c5}.mission-centre #missionHost:empty{display:none}.mission-centre #missionHost>.mission-kicker{margin-bottom:18px}.mission-centre #missionHost>.mission-line{background:none;border:0;padding:0;margin:0}.mission-centre #missionHost input,.mission-centre #missionHost select{margin:8px 0 12px}.mission-centre #missionHost h3{font-size:24px;color:#d9cbae}.mission-centre #missionHost>button{margin:12px 10px 0 0}.mission-participants{display:grid;grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:8px}.mission-participant{display:flex;align-items:center;gap:10px;background:#222a1e;border:1px solid #77805a55;padding:10px;margin:0}.mission-participant input{width:18px;height:18px;min-height:0;accent-color:#8d9877;margin:0!important;flex:none}.mission-team-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}.mission-team-card{background:#20281e;border:1px solid #78836355;padding:16px;border-radius:2px}.mission-team-card h4{margin:0 0 12px;font-size:18px}.mission-validation{line-height:1.6;font-size:12px}.mission-validation.invalid{color:#efab8a}.mission-validation.valid{color:#bed2ad}.mission-live{padding:14px;border:1px solid #737d5955;background:#20271c;margin:12px 0;color:#d5dbca}.mission-live summary{cursor:pointer}.mission-live p{font-size:12px;line-height:1.5}.mission-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.mission-object{padding:6px!important;border:1px solid #9c8b6255!important;background:#e7dabd!important;border-radius:2px}.mission-object .item-image{display:block;width:100%;max-width:none;height:105px;object-fit:contain}.mission-object .item-label{font-size:11px;color:#413525}.team-play-card{padding:16px;background:#e8dbbf;border:1px solid #a3916b;margin:14px 0}.team-play-summary{padding-bottom:10px}.team-choice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.team-choice{min-height:50px!important;color:#f0e4ca;font-size:13px;padding:9px!important}.team-choice[aria-pressed="true"]{background:#41533c!important;border-color:#829c72!important;box-shadow:inset 0 0 0 1px #c3d2b466}.mission-answers>button{margin-top:14px}.shield-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.mission-centre #missionContent .shield-chest{padding:6px!important;background:#3c3429;border:1px solid #8e7a56;border-radius:3px;min-height:130px;display:flex;flex-direction:column;align-items:center}.shield-chest>img{width:100%;height:100px;max-width:160px;object-fit:contain}.shield-chest>span{font:12px var(--ui-serif);color:#eee0c1}.shield-chest:disabled{opacity:.8}#missionContent button{margin-top:10px;max-width:100%}
@media(max-width:1050px){body.castle-game #app[data-screen="round"][data-round-open="true"]{grid-template-columns:160px minmax(0,1fr) minmax(260px,.6fr)}#castle-player-home{padding:30px;min-height:360px}.castle-room-scene>img{height:300px}.castle-room-caption h2{font-size:26px}}
@media(max-width:760px){body:not(.castle-game) .shell{padding:28px 20px;justify-content:center}body:not(.castle-game) .shell>header h1{font-size:45px}body:not(.castle-game) #login{margin-top:24px;padding:24px;max-width:350px}body:not(.castle-game){background-position:43% center}#castle-player-home{min-height:390px;padding:24px;align-items:flex-end;background-position:58% center}.castle-role-copy h2{font-size:45px}.castle-role-copy p{font-size:13px;max-width:260px}.castle-game #app[data-host="false"] #castle-dashboard .castle-pot-plaque{padding:12px 16px;gap:16px}.castle-game #app[data-host="false"] #castle-dashboard .castle-pot-plaque span{font-size:8px}.castle-game #app[data-host="false"] #castle-dashboard .castle-pot-plaque strong{font-size:25px}.castle-room-scene{min-height:260px}.castle-room-scene>img{height:300px}.castle-room-caption{padding:35px 18px 18px}.castle-room-caption h2{font-size:25px}.castle-room-caption p{font-size:11px;line-height:1.5}body.castle-game #app[data-screen="round"][data-round-open="true"]{grid-template-columns:minmax(0,1fr);grid-template-rows:calc(70px + env(safe-area-inset-top)) minmax(0,.58fr) minmax(120px,.42fr) auto}body.castle-game #app[data-screen="round"][data-round-open="true"]>#castle-view-heading{grid-column:1}body.castle-game #app[data-screen="round"][data-round-open="true"]>.side{grid-column:1;grid-row:2}body.castle-game #app[data-screen="round"][data-round-open="true"]>.chat{grid-column:1;grid-row:3;border-left:0;border-top:1px solid #6b5c41}body.castle-game #app[data-screen="round"][data-round-open="true"]>#castle-nav{grid-row:4}body.castle-game #app[data-screen="round"][data-round-open="true"] .castle-room-scene>img{height:150px}body.castle-game #app[data-screen="round"][data-round-open="true"] .castle-room-scene{min-height:150px}body.castle-game #app[data-screen="round"][data-round-open="true"] .chathead{padding:10px 16px}body.castle-game #app[data-screen="round"][data-round-open="true"] #sceneTitle{font-size:18px}body.castle-game #app[data-screen="round"][data-round-open="true"] .feed{padding:12px}.composer{padding:10px}.bubble p{font-size:13px}.hostactions button{flex-basis:120px}.murder-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.murder-grid .portrait{width:58px;height:70px}.murder-grid button{font-size:12px}.secret-feed{max-height:300px}.mission-title-line h2{font-size:22px}.mission-title-line .pot{font-size:21px}.mission-centre #missionContent{border-width:20px;padding:4px}.mission-centre #missionContent h3{font-size:25px}.mission-centre #missionHost{padding:16px}.mission-centre #missionHost h3{font-size:21px}.mission-participants{grid-template-columns:repeat(2,minmax(0,1fr))}.mission-gallery{gap:6px}.mission-object .item-image{height:62px}.mission-object .item-label{font-size:9px}.team-choice-grid{gap:5px}.team-choice{font-size:11px;padding:7px!important}.shield-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.shield-chest>img{height:88px}.mission-centre #missionContent .shield-chest{min-height:110px}.mission-centre #missionHost>button{width:100%;margin-right:0}}

/* Readable team briefing and compact previous results during a private chest visit. */
.mission-centre #missionContent .team-play-summary{background:#e6d8b9;color:#463b29;border:1px solid #a28f67;border-radius:2px;padding:16px}.mission-results>summary{cursor:pointer;color:#5d4c32;font-size:12px;padding:10px 0;border-bottom:1px solid #9c8b6655;margin-bottom:14px}.mission-centre #missionContent .question-heading{color:#30291e}.mission-centre[data-phase="shield"] #missionContent>.mission-text{margin:6px 0 12px}


body:not(.castle-game) #login .password-wrap button{color:#4d4030;background:transparent;box-shadow:none;border:0}

@media(max-width:760px){#castle-view-heading{padding-top:calc(10px + env(safe-area-inset-top))}body:not(.castle-game) .shell{padding-top:calc(28px + env(safe-area-inset-top));padding-bottom:calc(28px + env(safe-area-inset-bottom))}.composer{padding-bottom:12px}}

/* Preserve the composer when a phone keyboard reduces the visual viewport. */
body.castle-keyboard #app>.chat .chathead{display:none}body.castle-keyboard #app>.chat .feed{padding:0 12px}
@media(max-width:760px) and (max-height:600px){body.castle-game #app>.chat .chathead{display:none}body.castle-game #app>.chat .feed{padding:0 12px}}

/* Generated oxblood leather and brass button artwork; preserve real text and controls. */
#authBtn,.castle-action-card,#send,.hostactions button,#hostControls button,#settingsPanel button:not(.password-wrap button),#missionHost>button,#missionContent>button,#missionContent form>button,.team-submit,#traitorPanel button:not(.murder-choice),#murderPanel>button,.castle-manage-actions button{
 border:8px solid transparent;
 border-image:url('/assets/button-plate-v3.png') 130 fill / 8px / 0 stretch;
 background:transparent;
 padding:9px 18px;
 color:#ffedc4;
 box-shadow:0 3px 9px #0006;
}
.castle-action-card{padding:12px 16px}
#castle-nav .castle-nav-link[aria-current="page"]{border:7px solid transparent;border-image:url('/assets/button-plate-v3.png') 130 fill / 7px / 0 stretch;background:transparent;padding:4px 6px}
@media(max-width:760px){#castle-nav .castle-nav-link[aria-current="page"]{padding:2px;border-width:5px;border-image-width:5px}.castle-action-card{padding:9px 8px}}


/* Player-first chat home. Host dashboard / phase screens remain untouched. */
body.castle-game #app[data-host="false"][data-screen="home"]{
  grid-template-rows:76px minmax(0,1fr);
  background:#13100d;
}
/* Player Castle announcements are transient within the social-room view.
   There is never a permanent side panel or extra announcements grid row. */
body.castle-game #app[data-host="false"][data-screen="home"]>.side{display:none!important}
/* The five social rooms own all Castle conversations; the obsolete shared chat
   must never take a grid row away from the player's Castle lobby. */
body.castle-game #app[data-host="false"][data-screen="home"]>.chat{display:none!important}
/* Host Chat is now just the five social-room entrances, never the old shared composer. */
body.castle-game #app[data-host="true"][data-screen="chat"]>.chat,
body.castle-game #app[data-host="true"][data-screen="chat"]>.side{display:none!important}
body.castle-game #app[data-host="false"] #castle-dashboard{display:none!important}
body.castle-game #app[data-host="false"] #castle-view-heading .castle-header-chat{display:none!important}
body.castle-game #app[data-host="false"] #castle-view-heading .castle-wordmark{display:none!important}
.castle-role-reveal{
 display:none;align-items:center;justify-content:center;min-height:39px;min-width:102px;
 padding:6px 11px;border:1px solid #947247;background:#231a16;color:#f0d9af;
 border-radius:4px;box-shadow:none;font:12px/1.2 var(--app-font);white-space:nowrap
}
body.castle-game #app[data-host="false"] .castle-role-reveal{display:inline-flex}
.castle-role-reveal[aria-pressed="true"]{background:#482029;border-color:#c6a368;color:#ffe3b0}
#castle-settings-role{display:none;border-bottom:1px solid #91734465;margin-bottom:20px;padding-bottom:17px}
body.castle-game #app[data-host="false"] #castle-settings-role{display:block}
#castle-settings-role .castle-eyebrow{font-size:10px}
#castle-settings-role strong{display:block;font:25px var(--app-font);color:#f2d399;margin-top:5px}
#castle-settings-role p{font-size:12px;color:#bfad92;margin:5px 0 0}
/* Two compact and consistent, accessible notification actions. */
#settingsPanel .notification-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin:0 0 10px}
#settingsPanel .notification-actions button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:50px;min-height:50px;margin:0;padding:8px 11px!important;font-size:13px;line-height:1.25;text-align:center;white-space:normal}
#settingsPanel .notification-actions button[aria-pressed="true"]{color:#ffedca;filter:brightness(1.15)}
#settingsPanel .notification-actions button:disabled{opacity:.48;cursor:not-allowed}
#settingsPanel #mutePush,#settingsPanel .settings-row:has(#mutePush){display:none!important}
#settingsPanel #pushStatus{min-height:0;font-size:12px;color:#cebca0;margin:7px 0 12px;line-height:1.45}
@media(max-width:760px){
 body.castle-game #app[data-host="false"][data-screen="home"]{
   grid-template-columns:minmax(0,1fr);
   grid-template-rows:calc(70px + env(safe-area-inset-top)) minmax(0,1fr) auto;
 }
 body.castle-game #app[data-host="false"][data-screen="home"]>#castle-nav{
   grid-column:1;grid-row:3;
 }
 body.castle-game #app[data-host="false"] #castle-view-heading{gap:6px;padding-right:8px;padding-left:10px}
 body.castle-game #app[data-host="false"] #castle-view-title{font-size:19px}
 body.castle-game #app[data-host="false"] .castle-view-titles{gap:15px;min-width:0}
 body.castle-game #app[data-host="false"] .castle-header-actions{gap:6px}
 body.castle-game #app[data-host="false"] .castle-role-reveal{min-height:36px;min-width:84px;padding:4px 7px;font-size:11px}
 body.castle-game #app[data-host="false"] .castle-header-settings{min-width:32px!important}
 #settingsPanel .notification-actions{gap:7px}
 #settingsPanel .notification-actions button{font-size:12px;padding:7px 5px!important}
}
@media(max-width:350px){
 body.castle-game #app[data-host="false"] #castle-view-title{font-size:17px}
  body.castle-game #app[data-host="false"] .castle-view-titles{gap:11px}
 body.castle-game #app[data-host="false"] .castle-role-reveal{min-width:74px;font-size:10px}
}

/* Approved mission and top banner artwork, November 2026.
   Keep title and player controls readable over the quiet banner edges. */
body.castle-game #castle-view-heading{
 background-color:#101a29;
 background-image:
  linear-gradient(90deg,rgba(8,15,26,.93) 0%,rgba(8,15,26,.73) 27%,rgba(8,15,26,.13) 50%,rgba(8,15,26,.73) 73%,rgba(8,15,26,.93) 100%),
  url('/assets/traitors-top-banner.webp');
 background-position:center,center 52%;
 background-size:cover,cover;
 background-repeat:no-repeat;
}
body.castle-game #castle-view-heading .castle-view-titles,
body.castle-game #castle-view-heading .castle-header-actions{position:relative;z-index:1}
body.castle-game #castle-view-heading #castle-view-title,
body.castle-game #castle-view-heading .castle-wordmark{
 text-shadow:0 2px 6px rgba(0,0,0,.94);
}
@media(max-width:760px){
 body.castle-game #castle-view-heading{
  background-image:
   linear-gradient(90deg,rgba(8,15,26,.90),rgba(8,15,26,.76) 45%,rgba(8,15,26,.91)),
   url('/assets/traitors-top-banner.webp');
  background-position:center,center center;
 }
}


/* Consistent castle header: profile identity left, remaining controls right. */
body.castle-game #castle-view-heading{
 height:100%;min-height:0;box-sizing:border-box;padding-block:7px;
}
body.castle-game #castle-view-heading .castle-view-titles{
 display:flex;align-items:center;gap:20px;min-width:0;flex:1 1 auto;
}
body.castle-game #castle-view-heading #castle-view-title,
body.castle-game #castle-view-heading #castle-view-subtitle,
body.castle-game #castle-view-heading .castle-wordmark{display:none!important}
body.castle-game #castle-view-heading #castle-account{
 display:block!important;flex:1 1 auto;min-width:0;max-width:100%;
 overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 margin:0;font:600 17px/1.2 var(--app-font);color:#f2d9ab;
 text-shadow:0 2px 6px #000;
}
body.castle-game #castle-view-heading .castle-header-avatar{
 flex:none;display:grid;place-items:center;width:46px;height:46px;
 border:2px solid #c6a366;border-radius:50%;
 overflow:hidden;background:linear-gradient(135deg,#4f2d23,#17110e);
 box-shadow:0 2px 8px #0009;isolation:isolate;
}
body.castle-game #castle-view-heading .castle-header-avatar img{
 display:block;width:100%;height:100%;object-fit:cover;object-position:center 28%;
}
body.castle-game #castle-view-heading .castle-header-avatar span{
 font:600 22px/1 var(--app-font);color:#f4dcac;
}
body.castle-game #castle-view-heading .castle-header-avatar [hidden]{display:none!important}
body.castle-game #castle-view-heading .castle-header-actions{flex:none;min-width:0}
body.castle-game #castle-settings-role .castle-role-reveal{margin-top:10px;box-shadow:none}
@media(max-width:760px){
 body.castle-game #castle-view-heading{
  padding:calc(5px + env(safe-area-inset-top)) 10px 5px;gap:7px;
 }
 body.castle-game #castle-view-heading .castle-view-titles{gap:15px}
 body.castle-game #castle-view-heading .castle-header-avatar{width:40px;height:40px}
 body.castle-game #castle-view-heading #castle-account{
  font-size:clamp(13px,3.8vw,16px);
 }
 body.castle-game #castle-view-heading .castle-header-actions{gap:3px}
}
@media(max-width:350px){
 body.castle-game #castle-view-heading{padding-inline:7px;gap:4px}
 body.castle-game #castle-view-heading .castle-view-titles{gap:12px}
 body.castle-game #castle-view-heading .castle-header-avatar{width:35px;height:35px}
 body.castle-game #castle-view-heading #castle-account{font-size:12px}
}

/* Desktop header castle framed in full, without stretching or cropping the tower. */
@media(min-width:761px){
 body.castle-game #castle-view-heading{
  background-color:#08192a;
  background-image:radial-gradient(ellipse 55% 100% at 50% 62%,#21314b 0%,#091a2c 61%,#05101d 100%);
  background-position:center;
  background-size:cover;
 }
 body.castle-game #castle-view-heading::before{
  content:"";
  position:absolute;inset:0;
  pointer-events:none;
  z-index:0;
  background-image:url('/assets/traitors-top-banner.webp');
  background-repeat:no-repeat;
  background-position:center center;
  background-size:auto 100%;
  -webkit-mask-image:linear-gradient(to right,transparent calc(50% - 330px),black calc(50% - 205px),black calc(50% + 205px),transparent calc(50% + 330px));
  mask-image:linear-gradient(to right,transparent calc(50% - 330px),black calc(50% - 205px),black calc(50% + 205px),transparent calc(50% + 330px));
 }
}

/* Video Diary: independent, private recording and host inbox. */
body.castle-game #app:not([data-screen="diary"])>.side>#castle-diary-panel{display:none!important}
body.castle-game #app[data-screen="diary"]>.side{background:linear-gradient(#090708dd,#130c0bbb),url('/assets/gallery-wall-v3.webp') center/cover;align-items:center}
body.castle-game #app[data-screen="diary"]>.side>#castle-diary-panel{display:flex;flex-direction:column;gap:18px;max-width:900px;padding:22px;width:100%;margin:0 auto;background:#130c0de8;border:1px solid #8c6a3e;box-shadow:0 16px 45px #0008}
#castle-diary-panel h2{font-size:clamp(28px,4vw,42px);margin:3px 0 0}
#castle-diary-panel h3{font:24px var(--app-font);color:#e7c88f;margin:0}
#castle-diary-panel p{margin:7px 0;color:#d4c09d}
#castle-diary-panel .diary-camera{position:relative;max-width:780px;background:#050404;border:1px solid #947747;border-radius:4px;overflow:hidden;aspect-ratio:16/9}
#castle-diary-panel .diary-camera video{display:block;width:100%;height:100%;object-fit:contain;background:#050404}
#castle-diary-panel #diary-clock{position:absolute;top:12px;right:12px;background:#13080bdc;border:1px solid #bf9955;padding:3px 12px;color:#f1dfb5;font:24px var(--app-font);font-variant-numeric:tabular-nums}
#castle-diary-panel .diary-buttons{display:flex;gap:10px;flex-wrap:wrap;margin-top:13px}
#castle-diary-panel .diary-buttons button{flex:1;min-width:120px}
#castle-diary-panel .diary-status{padding:8px 11px;background:#1d1613;border-left:3px solid #b79256;color:#edcf9b}
#castle-diary-panel .diary-question{padding:13px;border:1px solid #927447;background:#322016;font-family:var(--app-font);font-size:18px}
#castle-diary-panel .diary-inbox{border-top:1px solid #9874466c;padding-top:20px}
#castle-diary-panel .diary-inbox-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
#castle-diary-panel .diary-entry{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px;border-bottom:1px solid #86684355}
#castle-diary-panel .diary-entry strong,#castle-diary-panel .diary-entry small{display:block}
#castle-diary-panel .diary-entry small{color:#bdab90}
#castle-diary-panel .diary-entry>div:last-child{display:flex;gap:7px}
#castle-diary-panel .diary-entry button{padding:8px 11px;min-height:38px}
#castle-diary-panel .diary-prompt-edit{display:flex;gap:10px;margin-top:8px}
#castle-diary-panel .diary-prompt-edit input{flex:1;min-width:0}
#castle-diary-panel #diary-playback{width:100%;max-height:440px;background:#000;margin-top:10px}
#castle-diary-panel [hidden]{display:none!important}
@media(max-width:760px){
 body.castle-game #app[data-screen="diary"]>.side{padding:8px 10px}
 body.castle-game #app[data-screen="diary"]>.side>#castle-diary-panel{padding:13px;gap:13px}
 #castle-diary-panel h2{font-size:27px}
 #castle-diary-panel .diary-entry{align-items:flex-start;flex-direction:column}
 #castle-diary-panel .diary-buttons button{min-width:0}
 #castle-diary-panel #diary-clock{font-size:18px;top:7px;right:7px}
 #castle-diary-panel .diary-prompt-edit{flex-direction:column}
}

/* Mobile navigation: a fixed-height, fixed-slot footer on every game screen.
   The active gold plate uses the same border/padding as inactive buttons. */
@media(max-width:760px){
 body.castle-game{--castle-mobile-nav-height:calc(70px + env(safe-area-inset-bottom))}
 body.castle-game #app #castle-nav{
  box-sizing:border-box;
  height:var(--castle-mobile-nav-height);
  min-height:var(--castle-mobile-nav-height);
  max-height:var(--castle-mobile-nav-height);
  padding-bottom:env(safe-area-inset-bottom);
  overflow:hidden;
 }
 body.castle-game #app #castle-nav .castle-nav-links{
  display:grid;
  grid-template-columns:repeat(var(--castle-mobile-primary-count,6),minmax(0,1fr));
  align-items:stretch;
  justify-content:stretch;
  gap:0;
  width:100%;
  height:100%;
  min-height:0;
  padding:3px 3px 4px;
  overflow:hidden;
 }
 body.castle-game #app #castle-nav .castle-nav-links>.castle-nav-link.castle-primary{
  display:flex;
  flex:none;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  width:100%;
  height:100%;
  min-height:0;
  min-width:0;
  max-width:100%;
  margin:0;
  gap:2px;
  border:5px solid transparent;
  border-image:none;
  padding:2px!important;
  line-height:1.05;
  text-align:center;
  overflow:hidden;
 }
 body.castle-game #app #castle-nav .castle-nav-links>.castle-nav-link.castle-primary[aria-current="page"]{
  border:5px solid transparent;
  border-image:url('/assets/button-plate-v3.png') 130 fill / 5px / 0 stretch;
  padding:2px!important;
 }
 body.castle-game #app #castle-nav .castle-nav-links>.castle-nav-link.castle-primary .castle-icon{
  flex:0 0 27px;
  width:27px;
  height:27px;
 }
 body.castle-game #app #castle-nav .castle-nav-links>.castle-nav-link.castle-primary span{
  display:block;
  width:100%;
  min-width:0;
  font-size:clamp(8px,2.15vw,10px);
  line-height:1.07;
  text-align:center;
  overflow-wrap:break-word;
 }
}
/* Mim's collective gold pot: display the live amount inside the artwork's
   dark right-hand plaque; the original below-image strip is no longer a row. */
#castle-dashboard .castle-treasury{
 position:relative;
 container-type:inline-size;
}
#castle-dashboard .castle-treasury>img{
 display:block;
 width:100%;
 height:auto;
 aspect-ratio:auto;
 object-fit:contain;
}
#castle-dashboard .castle-treasury>.castle-pot-plaque{
 position:absolute;
 left:63%;
 top:30%;
 width:32%;
 height:42%;
 display:flex;
 flex-direction:column;
 justify-content:center;
 align-items:center;
 box-sizing:border-box;
 padding:0 1.5%;
 margin:0;
 border:0;
 background:transparent;
 box-shadow:none;
 gap:3px;
 text-align:center;
 pointer-events:none;
}
#castle-dashboard .castle-treasury>.castle-pot-plaque span{
 display:block;
 max-width:100%;
 font:500 clamp(7px,1.5cqw,13px)/1.2 var(--app-font);
 letter-spacing:.1em;
 color:#f4d69a;
 text-shadow:0 2px 4px #000;
}
#castle-dashboard .castle-treasury>.castle-pot-plaque strong{
 display:block;
 max-width:100%;
 margin:0;
 font:600 clamp(15px,5.3cqw,46px)/1.05 var(--app-font);
 color:#f9dc9d;
 text-shadow:0 2px 5px #000;
 font-variant-numeric:lining-nums tabular-nums;
 white-space:nowrap;
}

/* Two real painterly PNG strokes, never SVG or CSS-drawn red lines. */
.castle-player-dialog-portrait.eliminated:after{
 content:"";pointer-events:none;position:absolute;inset:10% 10%;z-index:3;
 background:url('/assets/traitors-paint-slash-rising.png') center/100% 100% no-repeat,
            url('/assets/traitors-paint-slash-falling.png') center/100% 100% no-repeat;
}
/* The morning reveal seizes every connected screen, without moving or deleting
   their actual gameplay nodes. Everything returns after the cinematic. */
.brm-reveal-stage{
 position:fixed;inset:0;z-index:30000;isolation:isolate;
 display:flex;align-items:center;justify-content:center;
 background:linear-gradient(90deg,#090408df,#10070bc9,#090408df),url('/assets/gallery-wall-v3.webp') center/cover;
 overflow:hidden;opacity:1;transition:opacity .5s ease;
 color:#eacb91;outline:0;
}
.brm-reveal-stage.brm-reveal-dismiss{opacity:0;pointer-events:none}
.brm-reveal-gallery{
 width:min(94vw,1020px);
 height:min(82dvh,790px);
 min-height:0;
 display:grid;
 grid-template-columns:repeat(5,minmax(0,1fr));
 grid-template-rows:repeat(4,minmax(0,1fr));
 gap:clamp(5px,1.4vw,18px);
 align-items:center;
 justify-items:center;
 filter:drop-shadow(1px 5px 6px #000a);
}
.brm-reveal-card{margin:0;min-height:0;min-width:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative}
.brm-reveal-art{position:relative;display:block;width:auto;max-width:100%;height:min(88%,100%);aspect-ratio:4/5;flex-shrink:1;isolation:isolate;filter:drop-shadow(2px 3px 3px #000c)}
.brm-reveal-photo{position:absolute;left:13%;top:12.5%;width:74%;height:75%;object-fit:cover;object-position:center 28%;background:#29170d}
.brm-reveal-frame{position:absolute;inset:0;z-index:3;display:block;background:url('/assets/portrait-frame-v3.png') center/100% 100% no-repeat;pointer-events:none}
.brm-reveal-card figcaption{
 margin:3px 0 0;max-width:100%;text-align:center;overflow:hidden;
 text-overflow:ellipsis;white-space:nowrap;color:#ead0a0;font:clamp(8px,1vw,13px)/1.15 var(--app-font);
 text-shadow:0 2px 3px #000;
}
.brm-reveal-card.is-ghost .brm-reveal-photo{filter:grayscale(1) brightness(.62)}
.brm-reveal-strokes{
 position:absolute;inset:12% 12%;z-index:4;pointer-events:none;
}
.brm-reveal-stroke{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:fill}
.brm-reveal-vacant{visibility:hidden}
.brm-reveal-fly{position:fixed;z-index:10;transform-origin:top left;pointer-events:none}
.brm-reveal-fly .brm-reveal-art{width:100%;height:100%;max-width:none}
.brm-reveal-fly .brm-reveal-stroke{clip-path:inset(0 0 100% 0);opacity:0}
.brm-reveal-fly.brm-reveal-painting .brm-reveal-stroke-1{
 opacity:1;animation:brm-reveal-brush 800ms cubic-bezier(.2,.3,.6,1) both;
}
.brm-reveal-fly.brm-reveal-painting .brm-reveal-stroke-2{
 opacity:1;animation:brm-reveal-brush 880ms cubic-bezier(.2,.3,.6,1) 850ms both;
}
@keyframes brm-reveal-brush{from{clip-path:inset(0 0 100% 0)}to{clip-path:inset(0 0 0 0)}}
.brm-reveal-heading{position:absolute;left:0;right:0;top:clamp(14px,3vh,40px);z-index:5;
 color:#edcd91;letter-spacing:.24em;text-align:center;font:clamp(12px,2.4vw,23px)/1.2 var(--app-font);text-shadow:0 2px 8px #000}
.brm-reveal-announcement{position:absolute;left:5%;right:5%;bottom:clamp(10px,3vh,36px);z-index:5;
 text-align:center;color:#f0d5aa;font:clamp(13px,2.6vw,24px)/1.2 var(--app-font);text-shadow:0 3px 8px #000}
body.brm-reveal-running{overflow:hidden!important}
@media(max-width:760px){
 .brm-reveal-gallery{
  width:96vw;height:min(80dvh,720px);
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-template-rows:repeat(5,minmax(0,1fr));
  gap:clamp(2px,1vw,8px);
 }
 .brm-reveal-card figcaption{font-size:clamp(8px,2vw,11px);margin-top:2px}
 .brm-reveal-heading{font-size:14px;top:calc(12px + env(safe-area-inset-top))}
 .brm-reveal-announcement{font-size:15px;bottom:calc(12px + env(safe-area-inset-bottom))}
}
@media(prefers-reduced-motion:reduce){
 .brm-reveal-stage{transition:none}
 .brm-reveal-fly.brm-reveal-painting .brm-reveal-stroke-1,.brm-reveal-fly.brm-reveal-painting .brm-reveal-stroke-2{animation-duration:150ms}
}

/* Mobile host Mission Control: one clear flow; player's mission retains its
   original themed briefing, parchment and game controls. */
.mission-host-mobile-summary,.mission-host-results{display:none}
@media(max-width:760px){
 body.castle-game #app[data-screen="missions"]>.side{
  padding:14px 14px calc(18px + env(safe-area-inset-bottom));
  gap:0;background:linear-gradient(#101610ef,#131711f5),url('/assets/mission-study-v4.webp') center/cover;
 }
 #missionCentre[data-host="true"]{
  width:100%;max-width:680px;margin:0 auto;padding:0;
  display:flex;flex-direction:column;gap:0;
 }
 #missionCentre[data-host="true"] .mission-title-line{
  margin:0;padding:6px 2px 16px;align-items:baseline;gap:12px;
 }
 #missionCentre[data-host="true"] .mission-title-line h2{
  font:clamp(22px,6vw,29px)/1.12 var(--ui-serif);
 }
 #missionCentre[data-host="true"] .mission-title-line .pot{
  font:600 20px/1.1 var(--ui-serif);white-space:nowrap;
 }
 #missionCentre[data-host="true"]>#missionContent{display:none!important}
 #missionCentre[data-host="true"] #missionHost{
  display:flex!important;flex-direction:column;gap:0;
  margin:0;padding:0;background:none;border:0;box-shadow:none;
 }
 #missionCentre[data-host="true"] #missionHost>.mission-host-mobile-summary{
  display:block;margin:0;padding:17px 16px 15px;
  background:#242c21;border:1px solid #83745580;border-bottom:0;
 }
 #missionCentre[data-host="true"] .mission-host-stage{
  text-transform:uppercase;letter-spacing:.14em;font-size:10px;
  font-weight:700;color:#d9bf89;
 }
 #missionCentre[data-host="true"] .mission-host-mobile-summary h3{
  font:clamp(22px,5.8vw,28px)/1.15 var(--ui-serif);
  color:#efe0be;margin:8px 0 6px;
 }
 #missionCentre[data-host="true"] .mission-host-mobile-summary p{
  font-size:12px;line-height:1.55;margin:0;color:#d4cbb9;
 }
 #missionCentre[data-host="true"] #missionHost>form,
 #missionCentre[data-host="true"] #missionHost>.mission-team-grid,
 #missionCentre[data-host="true"] #missionHost>.mission-primary-actions{
  margin:0;padding:16px;background:#171e17;
  border:1px solid #83745580;border-top:0;
 }
 #missionCentre[data-host="true"] #missionHost>form{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  column-gap:12px;row-gap:10px;align-items:start;
 }
 #missionCentre[data-host="true"] #missionHost>form>h3{display:none}
 #missionCentre[data-host="true"] #missionHost>form>.mission-config-field{
  min-width:0;margin:0;display:flex;flex-direction:column;gap:4px;
  font-size:12px;line-height:1.35;color:#e2d6bb;
 }
 #missionCentre[data-host="true"] #missionHost>form>.mission-field-wide,
 #missionCentre[data-host="true"] #missionHost>form>.mission-player-select,
 #missionCentre[data-host="true"] #missionHost>form>button{grid-column:1/-1}
 #missionCentre[data-host="true"] #missionHost input:not([type="checkbox"]),
 #missionCentre[data-host="true"] #missionHost select{
  box-sizing:border-box;display:block;min-width:0;width:100%;
  height:45px;font-size:16px;margin:4px 0 0;padding:9px 11px;
  border:1px solid #71694e;background:#22291f;border-radius:3px;
 }
 #missionCentre[data-host="true"] #missionHost .mission-player-select{
  margin:4px 0 0;padding:14px 0 0;border:0;border-top:1px solid #85745155;
  background:transparent;
 }
 #missionCentre[data-host="true"] .mission-player-select h4{
  font:18px/1.2 var(--ui-serif);color:#eadbb8;margin:0 0 11px;
 }
 #missionCentre[data-host="true"] .mission-participants{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;margin:0;
 }
 #missionCentre[data-host="true"] .mission-participant{
  min-width:0;min-height:48px;padding:9px;gap:8px;
  font-size:11px;line-height:1.3;overflow-wrap:anywhere;
  background:#252c22;border:1px solid #7770537a;border-radius:3px;
 }
 #missionCentre[data-host="true"] .mission-participant input[type="checkbox"]{
  width:19px;height:19px;margin:0!important;flex:none;accent-color:#b8ae7e;
 }
 #missionCentre[data-host="true"] #missionHost .mission-validation{
  margin:10px 0 0;font-size:12px;line-height:1.4;
 }
 #missionCentre[data-host="true"] #missionHost button{
  box-sizing:border-box;width:100%;margin:0!important;
  min-height:48px;border-radius:3px;font-size:14px;line-height:1.3;
 }
 #missionCentre[data-host="true"] #missionHost .mission-main-action{
  background:linear-gradient(180deg,#936f42,#5d421f);
  border:1px solid #d3b477;color:#fff0d3;font-weight:700;
  margin-top:12px!important;
 }
 #missionCentre[data-host="true"] #missionHost .mission-secondary-action{
  min-height:42px;color:#c6b9a2;background:#171e17;
  border:1px solid #716550;font-size:12px;
 }
 #missionCentre[data-host="true"] #missionHost>.mission-team-grid{
  display:grid;grid-template-columns:1fr;gap:0;
 }
 #missionCentre[data-host="true"] #missionHost .mission-team-card{
  padding:10px 0 17px;margin:0;background:none;
  border:0;border-bottom:1px solid #87745155;
 }
 #missionCentre[data-host="true"] #missionHost .mission-team-card:last-child{border-bottom:0}
 #missionCentre[data-host="true"] #missionHost>.mission-primary-actions{
  display:grid;grid-template-columns:1fr;gap:10px;
 }
 #missionCentre[data-host="true"] #missionHost>.mission-primary-actions .mission-main-action{margin-top:0!important}
 #missionCentre[data-host="true"] #missionHost>.mission-text,
 #missionCentre[data-host="true"] #missionHost>.mission-validation,
 #missionCentre[data-host="true"] #missionHost>label{
  margin:0;padding:14px 16px;background:#171e17;
  border:0;border-left:1px solid #83745580;border-right:1px solid #83745580;
  font-size:12px;line-height:1.5;
 }
 #missionCentre[data-host="true"] #missionHost>.mission-answer-review,
 #missionCentre[data-host="true"] #missionHost>.mission-host-results{
  display:block;margin:0;padding:14px 16px;
  background:#171e17;border:1px solid #83745580;border-top:0;
 }
 #missionCentre[data-host="true"] #missionHost>.mission-answer-review summary,
 #missionCentre[data-host="true"] #missionHost>.mission-host-results summary{
  cursor:pointer;list-style-position:inside;display:list-item;
  font-size:13px;font-weight:600;color:#ebdcb7;padding:5px 0;
 }
 #missionCentre[data-host="true"] #missionHost>.mission-answer-review .mission-live{
  margin:10px 0;padding:11px;font-size:12px;
 }
 #missionCentre[data-host="true"] #missionHost>.mission-host-results p{
  color:#d1c7af;font-size:12px;line-height:1.5;
 }
 #missionCentre[data-host="true"] #missionHost>button{
  padding:13px 16px!important;border-radius:0;
 }
 #missionCentre[data-host="true"] #missionHost>button.mission-main-action{
  margin-top:0!important;min-height:55px;
 }
 #missionCentre[data-host="true"] #missionHost>button.mission-secondary-action{
  margin-top:0!important;background:#171e17;color:#c8baa1;
 }
}
@media(max-width:360px){
 #missionCentre[data-host="true"] .mission-participants{grid-template-columns:1fr}
}

/* Mim's Round Table: chat and voting are independently controlled.
   Private tally and vote-order console appear only in the host view. */
body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>#hostLiveVotes{
 display:block!important;order:1;
}
body.castle-game #app[data-screen="round"]>.side>#votePanel{order:2}
body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>.hostactions{
 order:0;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));
 width:100%;gap:9px;margin:0;padding:14px;border:1px solid #79684988;background:#171b16;
}
body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>.hostactions button{
 flex:none;min-width:0;min-height:46px;padding:10px 7px;font-size:12px;line-height:1.3;
}
body.castle-game #app[data-screen="round"] #hostControls>.hostactions #castleBtn,
body.castle-game #app[data-screen="round"] #hostControls>.hostactions #roundBtn{
 background:#353323;border:1px solid #93815e;font-weight:650;
}
body.castle-game #app[data-screen="round"] #hostControls>.hostactions button:disabled{
 opacity:.35;filter:grayscale(1);cursor:not-allowed;
}
body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>#hostVoteInfo{
 display:block!important;order:3;margin:0;padding:10px 14px 17px;
 color:#cabda3;font-size:12px;background:#171b16;border:1px solid #79684988;border-top:0;
}
#hostLiveVotes.round-host-live{
 width:100%;padding:17px 15px;background:#191e18;
 border:1px solid #79684988;color:#e4d8bc;
}
#hostLiveVotes h3{
 margin:0 0 8px;font:23px/1.18 var(--ui-serif);color:#e8d5a4;
}
#hostLiveVotes h4{margin:16px 0 9px;font:17px/1.2 var(--ui-serif);color:#decda9}
#hostLiveVotes .round-host-vote-status{
 margin:0;padding:5px 0 10px;font-size:12px;color:#d4c4a4;
 border-bottom:1px solid #79684966;
}
#hostLiveVotes .round-host-tally{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 10px;
 padding:12px 0;border-bottom:1px solid #79684966;
}
#hostLiveVotes .round-host-tally h4{grid-column:1/-1;margin:0 0 4px}
#hostLiveVotes .round-host-tally p{
 margin:0;padding:10px;background:#303626;border:1px solid #82745855;
 color:#eee0be;font-size:12px;
}
#hostLiveVotes .round-host-ballots{display:flex;flex-direction:column;gap:7px}
#hostLiveVotes .round-host-ballot{
 display:flex;align-items:center;justify-content:space-between;gap:10px;
 padding:11px;background:#283026;border:1px solid #82745855;
 min-width:0;font-size:12px;line-height:1.4;
}
#hostLiveVotes .round-host-ballot span{min-width:0;overflow-wrap:anywhere}
#hostLiveVotes .round-host-ballot button{
 flex:none;padding:8px 12px;min-height:42px;font-size:12px;
 border:1px solid #bba173;background:#5a4330;color:#f6e6be;
}
#hostLiveVotes .round-host-ballot.is-revealed{opacity:.65}
#hostLiveVotes .round-host-ballot.is-waiting{color:#acaa9a;background:#1b201b}
#voteResult .round-public-reveals-title{margin:15px 0 8px;font-size:20px}
#voteResult .round-public-votes{list-style:decimal;padding-left:22px;margin:0}
#voteResult .round-public-votes li{
 border-bottom:1px solid #89745555;padding:12px 0;color:#f1dab0;font:16px/1.4 var(--ui-serif);
}
@media(max-width:760px){
 body.castle-game #app[data-screen="round"]>.side{gap:12px;padding:14px}
 body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>.hostactions{padding:12px;gap:8px}
 body.castle-game #app[data-screen="round"] #hostControls>.hostactions button{font-size:11px}
 #hostLiveVotes.round-host-live{padding:15px 12px}
 #hostLiveVotes h3{font-size:21px}
 #hostLiveVotes .round-host-tally{grid-template-columns:repeat(2,minmax(0,1fr))}
 #hostLiveVotes .round-host-ballot{padding:10px}
 #hostLiveVotes .round-host-ballot button{padding:9px;min-height:43px}
}

/* Mim's actual Control Centre: one mobile dashboard, not a second site menu.
   The original game controls retain their IDs and existing click handlers. */
.castle-control-intro,.castle-control-label{display:none}
.castle-control-publisher summary,.castle-control-danger summary,
.castle-control-announcements-disclosure summary{display:none}
@media(max-width:760px){
 body.castle-game #app[data-host="true"][data-screen="home"]>.side{
  display:flex;flex-direction:column;gap:12px;
  padding:12px 12px calc(22px + env(safe-area-inset-bottom));
  background:#111610;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>#castle-dashboard{
  order:0;max-width:680px;margin:0 auto;width:100%;padding:0;box-shadow:none;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>#castle-dashboard .castle-control-intro{
  display:block;padding:3px 1px 13px;margin:0;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-label{
  display:block;font:700 10px/1.5 var(--app-font);letter-spacing:.16em;
  text-transform:uppercase;color:#c6ab7b;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-intro h2{
  font:clamp(27px,7vw,34px)/1.12 var(--app-font);letter-spacing:0;margin:4px 0 4px;
  color:#f1ddb4;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-intro p{
  margin:0;line-height:1.4;font-size:12px;color:#c9c0ae;
 }
 /* The bottom navigation already provides these destinations. */
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-actions{
  display:none!important;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-overview{
  display:flex;flex-direction:column;gap:0;margin:0;
  border:1px solid #81714f;background:#1b221a;overflow:hidden;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-treasury{
  width:100%;max-width:none;margin:0;border:0;border-radius:0;
  background:#12180f;box-shadow:none;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-treasury>img{
  width:100%;height:auto;aspect-ratio:auto;object-fit:contain;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status{
  width:100%;margin:0;padding:11px 14px 13px;
  border:0;border-top:1px solid #81714f;background:#20281e;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status h3{
  margin:0 0 8px;padding:0;border:0;font:18px/1.25 var(--app-font);
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dl{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dl>div{
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;
  gap:3px;margin:0;padding:10px 11px;min-width:0;
  background:#2b3428;border:1px solid #81714f55;border-radius:2px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dt{
  color:#c8bda6;font-size:11px;line-height:1.3;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dd{
  font:600 21px/1.1 var(--app-font);color:#f0dab1;
 }
 /* Murder readiness belongs with the actual action, not duplicated in stats. */
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-attention{
  display:none!important;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>#hostControls>.morning,
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-control-announcements{
  order:1;box-sizing:border-box;width:100%;max-width:680px;margin:0 auto;
  padding:16px;background:#1b221a;border:1px solid #81714f;
  border-radius:2px;box-shadow:none;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-control-announcements{
  order:2;padding:13px 16px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions h2{
  margin:4px 0 8px;font:24px/1.15 var(--app-font);
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions #hostMorningStatus{
  display:block;margin:0 0 11px;
  color:#cfc6b3;font-size:12px;line-height:1.5;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions .morning-controls{
  display:flex;flex-direction:column;gap:9px;margin:0;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions #revealMorning{
  width:100%;min-height:54px;margin:0;border:1px solid #b28b57;
  background:linear-gradient(#774429,#522820);color:#fae9c8;
  font-size:16px;font-weight:700;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions #revealMorning:not(:disabled){
  border-color:#f5d48c;box-shadow:0 0 0 2px #f5d48c33,inset 0 1px #fff6;
  background:linear-gradient(#96603a,#6b3027);opacity:1;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions #revealMorning:disabled{
  filter:grayscale(.55);opacity:.48;box-shadow:none;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions #startGame{
  width:100%;min-height:48px;margin:0;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-publisher,
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-danger,
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-announcements-disclosure{
  display:block;margin-top:12px;padding:0;border:1px solid #81714f66;
  border-radius:2px;background:#20281d;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-publisher summary,
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-danger summary,
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-announcements-disclosure summary{
  display:list-item;list-style-position:inside;cursor:pointer;
  padding:13px 12px;min-height:44px;box-sizing:border-box;
  color:#e3d3b1;font-size:13px;font-weight:650;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-disclosure-content{
  padding:3px 12px 13px;border-top:1px solid #81714f66;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-disclosure-content label{
  display:block;margin-top:13px;color:#d5cab3;font-size:12px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #announcementText{
  width:100%;margin-top:6px;min-height:46px;font-size:16px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #sendAnnouncement{
  width:100%;min-height:46px;margin-top:10px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-danger{
  background:#1c201a;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #resetGame{
  width:100%;min-height:44px;background:#2a1c1c;border:1px solid #965b55;
  color:#e6bcb6;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-control-announcements>h2{
  display:none;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-control-announcements>#dayLabel,
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-control-announcements>#morningStatus{
  display:none;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-announcements-disclosure{
  margin:0;background:transparent;border:0;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-announcements-disclosure summary{
  padding:4px 0;min-height:36px;font-size:14px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #announcements{
  margin:10px 0 0;padding:3px 0 0;border-top:1px solid #81714f66;
 }
}

/* Mim Control Centre: concise overview and controls, no cloned navigation. */
body.castle-game #app>.side>.castle-control-extras{display:none}
body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-control-extras{
 display:block;box-sizing:border-box;width:100%;max-width:680px;margin:0 auto;
 padding:13px 15px;background:#1b221a;border:1px solid #81714f;
}
.castle-control-extras>h3{font:19px/1.2 var(--app-font);color:#eedbb8;margin:0 0 8px}
.castle-control-extras .castle-control-announcements{
 width:100%;margin:0;padding:0;border:0;box-shadow:none;background:transparent;
}
.castle-control-extras .castle-control-announcements>h2,
.castle-control-extras .castle-control-announcements>#dayLabel,
.castle-control-extras .castle-control-announcements>#morningStatus{display:none}
.castle-control-extras>details,.castle-control-extras .castle-control-announcements-disclosure{
 display:block;margin:0;border:0;border-top:1px solid #81714f66;padding:0;background:none;
}
.castle-control-extras summary,.castle-control-extras .castle-control-announcements-disclosure summary{
 display:list-item;cursor:pointer;list-style-position:inside;min-height:44px;
 padding:12px 4px;box-sizing:border-box;font-size:13px;font-weight:650;color:#e8d8b8;
}
.castle-control-extras .castle-control-disclosure-content{padding:6px 4px 14px;border:0}
.castle-control-extras #announcementText{width:100%;min-height:45px;font-size:16px}
.castle-control-extras #sendAnnouncement{width:100%;min-height:44px;margin-top:8px}
.castle-control-extras #resetGame{width:100%;min-height:44px}
.castle-control-extras #announcements{padding:0;margin:5px 0 12px}
@media(max-width:760px){
 body.castle-game #app[data-host="true"][data-screen="home"]>.side{
  padding:10px 11px calc(18px + env(safe-area-inset-bottom));gap:10px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard{order:0}
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-intro{
  padding:1px 0 8px!important;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-intro p{display:none}
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-intro h2{
  font-size:25px;margin:0!important;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status{
  padding:8px 9px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status h3{display:none}
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dl{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dl>div{
  box-sizing:border-box;min-width:0;padding:7px 5px;
  flex-direction:column;align-items:center;text-align:center;gap:3px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dt{
  font-size:10px;line-height:1.2;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dd{
  font-size:19px;line-height:1.1;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>#hostControls>.castle-control-actions{
  order:1;padding:10px 12px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions>.castle-control-label,
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions>h2{display:none}
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions #hostMorningStatus{
  font-size:11px;margin:0 0 7px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions #revealMorning{
  min-height:43px;padding:8px 12px;font-size:14px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-actions #startGame{
  min-height:43px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-rooms-admin{
  order:2;box-sizing:border-box;width:100%;max-width:680px;margin:0 auto;
  border:1px solid #81714f;background:#1b221a;padding:12px;box-shadow:none;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-rooms-home{
  order:3;box-sizing:border-box;width:100%;max-width:680px;margin:0 auto;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-control-extras{
  order:4;padding:9px 12px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-extras .castle-control-publisher summary,
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-extras .castle-control-danger summary,
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-extras .castle-control-announcements-disclosure summary{
  display:list-item;margin:0;padding:11px 4px;min-height:43px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-control-extras>details{
  margin:0;border:0;border-top:1px solid #81714f55;background:none;
 }
}

/* No blank description rows when a section has nothing to report. */
body.castle-game #castle-attention:empty,body.castle-game #hostMorningStatus:empty,body.castle-game #morningStatus:empty,body.castle-game #detail:empty,body.castle-game #diary-setup:empty{display:none!important}

/* Video Diary: full-camera 3–2–1 countdown and clear local-draft actions. */
#castle-diary-panel .diary-countdown{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;pointer-events:none;background:rgba(7,5,5,.5);color:#f9d99c;font:700 clamp(80px,21vw,154px)/1 var(--app-font);text-shadow:0 3px 18px #000,0 0 35px #d6a04a80;font-variant-numeric:tabular-nums}
#castle-diary-panel #diary-delete{background:linear-gradient(180deg,#3d1d25,#211318);border-color:#986773;color:#f4d2cf}
#castle-diary-panel #diary-retake{background:linear-gradient(180deg,#3c3023,#1b1712);border-color:#9b8158}
#castle-diary-panel #diary-send{background:linear-gradient(180deg,#7b4029,#47211b);border-color:#d7af68;color:#fff0ca}
#castle-diary-panel .diary-buttons button[disabled]{opacity:.5;cursor:wait}

/* One parchment takes the full remaining Missions viewport below Mim's pot. */
body.castle-game #app[data-screen="missions"]>.side>#missionCentre{
 display:flex;flex-direction:column;flex:1 0 auto;
 box-sizing:border-box;width:100%;min-height:100%;
 max-width:1050px;min-width:0;margin:0 auto;
 padding:0;border:0;background:transparent;box-shadow:none;
}
#missionCentre .castle-mission-treasury{
 position:relative;box-sizing:border-box;container-type:inline-size;
 display:block;flex:none;width:min(100%,720px);max-width:100%;
 margin:0 auto clamp(12px,1.8vw,20px);
 padding:0;overflow:hidden;
 border:0;border-radius:0;background:transparent;box-shadow:none;
}
#missionCentre .castle-mission-treasury>img{
 display:block;width:100%;height:auto;aspect-ratio:auto;
 object-fit:contain;object-position:center;
}
#missionCentre .castle-mission-treasury>.castle-pot-plaque{
 position:absolute;left:63%;top:30%;width:32%;height:42%;
 display:flex;flex-direction:column;justify-content:center;align-items:center;
 box-sizing:border-box;padding:0 1.5%;margin:0;gap:3px;
 border:0;background:transparent;box-shadow:none;
 text-align:center;pointer-events:none;
}
#missionCentre .castle-mission-treasury>.castle-pot-plaque strong{
 display:block;max-width:100%;margin:0;
 font:600 clamp(15px,5.3cqw,46px)/1.05 var(--app-font);
 color:#f9dc9d;text-shadow:0 2px 5px #000;
 font-variant-numeric:lining-nums tabular-nums;white-space:nowrap;
}
/* A single full-size artwork layer: no repeated border-image tiles, no second
   parchment, and the text is written directly over the paper texture. */
body.castle-game #app #missionCentre #missionContent{
 display:block;flex:1 0 auto;box-sizing:border-box;
 min-width:0;width:100%;min-height:clamp(280px,43dvh,700px);
 margin:0;padding:clamp(35px,5vw,78px) clamp(30px,8vw,108px);
 border:0;border-image:none;outline:0;border-radius:0;box-shadow:none;
 background-color:transparent;
 background-image:url('/assets/parchment-plain-v5.png');
 background-position:center;background-size:100% 100%;background-repeat:no-repeat;
 color:#352516;
 font-family:"Petit Formal Script","Snell Roundhand","Apple Chancery","Segoe Script",cursive;
 font-size:clamp(19px,2.1vw,25px);line-height:1.5;
 overflow-wrap:anywhere;
}
body.castle-game #app #missionCentre #missionContent h3,
body.castle-game #app #missionCentre #missionContent h4{
 font-family:inherit;font-weight:400;
 font-size:clamp(27px,3vw,38px);line-height:1.25;
 color:#382413;
}
body.castle-game #app #missionCentre #missionContent :is(.mission-text,.mission-result,.mission-note,.question-heading,.team-play-summary p){
 font-family:inherit;font-size:clamp(19px,2.1vw,25px);
 line-height:1.5;color:#352516;
}
body.castle-game #app #missionCentre #missionContent>.mission-text{
 display:block;margin:0;padding:0;background:transparent!important;
 border:0!important;outline:0!important;box-shadow:none!important;
}
body.castle-game #app #missionCentre #missionContent :is(button,input,select,textarea){
 font-family:var(--app-font);
 font-size:16px;
}
@media(max-width:760px){
 body.castle-game #app[data-screen="missions"]>.side>#missionCentre{
  width:100%;min-height:100%;flex:1 0 auto;
 }
 #missionCentre .castle-mission-treasury{
  width:100%;margin-bottom:10px;
 }
 body.castle-game #app #missionCentre #missionContent{
  min-height:clamp(260px,47dvh,650px);
  padding:clamp(34px,9vw,55px) clamp(25px,8vw,45px);
  font-size:clamp(19px,5vw,23px);line-height:1.4;
 }
 body.castle-game #app #missionCentre #missionContent :is(.mission-text,.mission-result,.mission-note,.question-heading,.team-play-summary p){
  font-size:clamp(19px,5vw,23px);line-height:1.4;
 }
}
/* Mim's mobile administration stays a usable controls panel instead of
   reserving empty parchment space that is intentionally hidden there. */
@media(max-width:760px){
 body.castle-game #app[data-screen="missions"] #missionCentre[data-host="true"]{
  min-height:0;flex:0 0 auto;
 }
}
/* Compact Settings page: identity and sign out share the top row. */
body.castle-game #app #castle-settings-role{display:block;border:0;margin:0;padding:0;min-width:0;flex:1 1 auto}
body.castle-game #app #castle-settings-role .castle-eyebrow{text-transform:none;letter-spacing:.025em;font-size:13px;color:#cfb68d}
body.castle-game #app #castle-settings-role strong{margin-top:4px;font-size:clamp(25px,4vw,32px);line-height:1.2}
body.castle-game #app>.side>#settingsPanel .castle-settings-top{
 display:flex;align-items:flex-start;justify-content:space-between;gap:14px;
 width:100%;padding:0 0 19px;margin:0 0 22px;border-bottom:1px solid #8a6d476b;
}
body.castle-game #app #settingsPanel .castle-settings-top #logout{
 flex:0 0 auto;align-self:flex-start;margin:0;padding:8px 12px;min-height:40px;
 font-size:12px;white-space:nowrap;
}
body.castle-game #app #settingsPanel .notification-actions{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;margin:0;
}
body.castle-game #app #settingsPanel .notification-actions button{
 width:100%;min-width:0;min-height:44px;height:auto;padding:8px 5px!important;
 margin:0!important;font-size:clamp(10px,2.8vw,13px);line-height:1.3;
}
body.castle-game #app #settingsPanel #pushStatus:empty,
body.castle-game #app #settingsPanel #passwordStatus:empty{display:none}
body.castle-game #app #settingsPanel #pushStatus{margin:9px 0 0}
body.castle-game #app #settingsPanel .settings-password-disclosure{
 border:1px solid #90764f;background:#1d1613;margin:22px 0 0;border-radius:3px;overflow:hidden;
}
body.castle-game #app #settingsPanel .settings-password-disclosure>summary{
 cursor:pointer;min-height:48px;display:flex;align-items:center;
 padding:11px 17px;color:#ead0a3;font:19px/1.25 var(--app-font);
 list-style:none;user-select:none;
}
body.castle-game #app #settingsPanel .settings-password-disclosure>summary::-webkit-details-marker{display:none}
body.castle-game #app #settingsPanel .settings-password-disclosure>summary::after{
 content:"+";margin-left:auto;font:22px/1 var(--app-font);color:#d4b77e;
}
body.castle-game #app #settingsPanel .settings-password-disclosure[open]>summary::after{content:"−"}
body.castle-game #app #settingsPanel .settings-password-disclosure[open]>summary{border-bottom:1px solid #90764f68}
body.castle-game #app #settingsPanel .settings-password-disclosure form{padding:17px;gap:10px}
body.castle-game #app #settingsPanel .settings-password-disclosure #passwordStatus{padding:0 17px 13px}
@media(max-width:760px){
 body.castle-game #app>.side>#settingsPanel{padding:18px 16px}
 body.castle-game #app #settingsPanel .castle-settings-top #logout{min-height:38px}
}

/* Completed victim-only artwork animation; portrait and banishment styles remain separate. */
.brm-murder-letter-stage{position:fixed;inset:0;z-index:30020;isolation:isolate;overflow:hidden;background:#100e0c;outline:none;color:#eed9b4}
.brm-murder-animation{display:block;border:0;width:100%;height:100%;background:#100e0c}
.brm-murder-continue{position:absolute;bottom:calc(18px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);min-height:44px;padding:10px 26px;visibility:hidden}
.brm-murder-reading .brm-murder-continue{visibility:visible}
.brm-murder-fallback{position:absolute;inset:8% 8% 100px;overflow:auto;background:#e4cea6;color:#24170e;text-align:center;padding:30px 20px;box-shadow:0 15px 60px #0008;font:22px/1.5 Georgia,serif}
.brm-murder-fallback[hidden]{display:none}.brm-murder-fallback p{color:inherit}.brm-murder-fallback em{display:block}.brm-murder-dismiss{opacity:0;transition:opacity 250ms ease}

/* Private banishment: final-thoughts prompt and accessible Video Diary invitation. */
.brm-banishment-message{
 position:fixed;inset:0;z-index:31000;
 display:flex;align-items:center;justify-content:center;
 padding:calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
 background:linear-gradient(165deg,#0d0907eb,#221711ed),url('/assets/gallery-wall-v3.webp') center/cover;
 color:#f1dcb7;overflow-y:auto;overscroll-behavior:contain;
}
.brm-banishment-message-card{
 display:flex;flex-direction:column;align-items:center;
 box-sizing:border-box;width:min(100%,550px);
 padding:clamp(26px,6vw,46px) clamp(20px,5vw,38px);
 border:1px solid #bb925a;
 background:linear-gradient(145deg,#281c18,#100d0c);
 box-shadow:0 16px 55px #000c;
 text-align:center;
}
.brm-banishment-eyebrow{
 display:block;font:600 12px/1.5 var(--app-font);
 letter-spacing:.15em;color:#c3a77f;
}
.brm-banishment-message h2{
 color:#f2d7a3;font:clamp(25px,5.4vw,42px)/1.18 var(--app-font);
 margin:15px 0 18px;
}
.brm-banishment-message p{
 color:#e1d0b3;font:clamp(15px,3.5vw,19px)/1.65 var(--app-font);
 margin:0 0 24px;
}
.brm-banishment-actions{
 display:flex;flex-direction:column;gap:12px;width:100%;
}
.brm-banishment-actions button{
 box-sizing:border-box;width:100%;min-height:52px;
 padding:11px 15px;font:600 15px/1.25 var(--app-font);
 border-radius:3px;cursor:pointer;
}
.brm-banishment-diary-button{
 color:#20140c;background:linear-gradient(#f4d596,#c49858);border:1px solid #e8cc97;
}
.brm-banishment-later{
 color:#e5d1b0;background:transparent;border:1px solid #816d52;
}
body.castle-game #app #castle-nav .castle-nav-link.brm-diary-final-thoughts-flash{
 position:relative;z-index:1;overflow:visible;
 outline:2px solid #f6d28d;outline-offset:-3px;
 box-shadow:0 0 0 2px #5e351c,0 0 16px 4px #f3c96d90;
 animation:brm-diary-final-invite 1.3s ease-in-out infinite;
}
@keyframes brm-diary-final-invite{
 0%,100%{filter:brightness(1);box-shadow:0 0 0 2px #5e351c,0 0 8px 2px #f3c96d50}
 50%{filter:brightness(1.45);box-shadow:0 0 0 3px #e6bf79,0 0 20px 6px #e6bf79b0}
}
#castle-diary-panel .diary-final-thoughts{
 border:1px solid #ba9760;background:#2c2319;color:#f4d7a1;
 padding:13px 15px;font:16px/1.5 var(--app-font);text-align:center;
}
@media(prefers-reduced-motion:reduce){
 body.castle-game #app #castle-nav .castle-nav-link.brm-diary-final-thoughts-flash{animation:none;filter:none}
}

/* Empty and inactive status areas should not occupy space or repeat headings. */
#voteInfo:empty,#morningStatus:empty,#murderInfo:empty,#castle-round-status:empty,
#castle-tower-status:empty,#hostMorningStatus:empty,#connection:empty{display:none!important}
body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>#hostLiveVotes[hidden],
body.castle-game #app[data-host="true"][data-screen="round"]>.side>#hostControls>#hostVoteInfo:empty{display:none!important}

/* Mim desktop: one compact administration workspace instead of full-width,
   loosely stacked cards. The real game controls remain in their original DOM. */
@media(min-width:761px){
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard #castle-actions{
  display:none!important; /* The left navigation already serves these pages. */
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side{
  gap:12px;padding:16px clamp(16px,2vw,28px);
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>#castle-dashboard{
  width:100%;max-width:none;margin:0;order:0;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-overview{
  grid-template-columns:minmax(0,1.4fr) minmax(260px,.8fr);
  gap:12px;align-items:center;margin:0;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-treasury>img{
  max-height:175px;object-fit:contain;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status{
  padding:8px 10px;background:#1b221a;border:1px solid #81714f;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status h3{display:none}
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dl{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dl>div{
  box-sizing:border-box;min-width:0;margin:0;padding:9px 4px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  background:#283226;border:1px solid #81714f55;gap:4px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dt{font-size:10px}
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-game-status dd{
  font-size:clamp(17px,2vw,24px);line-height:1.1;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>#hostControls>.castle-control-actions,
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-rooms-admin,
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-rooms-home,
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-control-extras{
  box-sizing:border-box;width:100%;max-width:none;min-width:0;margin:0;
  padding:12px 14px;border:1px solid #81714f;background:#1b221a;box-shadow:none;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-rooms-home{
  align-self:stretch;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-rooms-home-grid{
  gap:7px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-rooms-home-grid .castle-room-home-door{
  min-height:94px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"] .castle-rooms-home-grid>.castle-room-home-door[data-room="breakfast"]{
  min-height:107px;
 }
}
@media(min-width:900px){
 body.castle-game #app[data-host="true"][data-screen="home"]>.side{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:auto auto auto;
  align-content:start;align-items:start;column-gap:12px;row-gap:12px;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>#castle-dashboard{
  grid-column:1/-1;grid-row:1;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>#hostControls>.castle-control-actions{
  grid-column:1;grid-row:2;align-self:stretch;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-rooms-admin{
  grid-column:2;grid-row:2;align-self:stretch;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-rooms-home{
  grid-column:1;grid-row:3;
 }
 body.castle-game #app[data-host="true"][data-screen="home"]>.side>.castle-control-extras{
  grid-column:2;grid-row:3;display:block;
 }
}
@media(min-width:761px) and (max-width:899px){
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-overview{
  grid-template-columns:minmax(0,1fr);
 }
 body.castle-game #app[data-host="true"][data-screen="home"] #castle-dashboard .castle-treasury>img{
  max-height:145px;
 }
}

/* Parchment copy and Shield Room result presentation. */
body.castle-game #app #missionCentre #missionContent,
body.castle-game #app #missionCentre #missionContent :is(h3,h4,p,label,summary,.mission-text,.mission-result,.mission-note,.question-heading,.team-play-summary){text-align:center}
body.castle-game #app #missionCentre #missionContent .shield-result{background:transparent;border:0;box-shadow:none;outline:0;padding:12px 0}
body.castle-game #app #missionCentre #missionContent .shield-leave{display:block;margin:18px auto 0}

/* Murdered and banished player portraits: same real red brushstroke artwork
   as the Players Board, including the owner's header and historical messages.
   All styling is on portraits only; game/chat permissions remain independent. */
body[data-player-state="ghost"] #castle-view-heading .castle-header-avatar img,
body[data-player-state="ghost"] #profilePicture,
.brm-chat-avatar.is-eliminated img,
.brm-roster-avatar.is-eliminated img,
#castle-rooms .castle-room-person.is-eliminated img,
.castle-portrait.ghost img{
 filter:grayscale(1) brightness(.63)!important;
}
body[data-player-state="ghost"] #castle-view-heading .castle-header-avatar,
.brm-chat-avatar.is-eliminated,
.brm-roster-avatar.is-eliminated,
.brm-own-profile-portrait,
.castle-portrait.ghost{
 position:relative;isolation:isolate;
}
.brm-roster-avatar{display:inline-block;flex:none;line-height:0}
.brm-roster-avatar img{display:block}
.brm-own-profile-portrait{display:inline-flex;flex:none}
body[data-player-state="ghost"] #castle-view-heading .castle-header-avatar::after,
body[data-player-state="ghost"] .brm-own-profile-portrait:has(#profilePicture:not([style*="display:none"]))::after,
.brm-chat-avatar.is-eliminated::after,
.brm-roster-avatar.is-eliminated::after,
.castle-portrait.ghost::after{
 content:"";position:absolute;inset:1px;z-index:3;pointer-events:none;
 background-image:url('/assets/traitors-paint-slash-rising.png'),url('/assets/traitors-paint-slash-falling.png');
 background-repeat:no-repeat;background-position:center;background-size:100% 100%,100% 100%;
}
body[data-player-state="ghost"] #castle-view-heading .castle-header-avatar::after,
.brm-chat-avatar.is-eliminated::after{border-radius:50%}
.castle-portrait.ghost::after{bottom:auto;height:75%}
#castle-rooms .castle-room-person.is-eliminated{position:relative}
#castle-rooms .castle-room-person.is-eliminated::after{
 content:"";position:absolute;top:3px;left:50%;z-index:3;
 width:30px;height:30px;transform:translateX(-50%);pointer-events:none;
 background-image:url('/assets/traitors-paint-slash-rising.png'),url('/assets/traitors-paint-slash-falling.png');
 background-position:center;background-repeat:no-repeat;background-size:100% 100%,100% 100%;
}
@media(max-width:760px){
 #castle-rooms .castle-room-person.is-eliminated::after{width:28px;height:28px}
}

/* Mim-only active shield: genuine-alpha PNG from the uploaded gold compass shield. */
body.castle-game #app[data-host="true"] .castle-portrait-art>.castle-shield-badge{
 position:absolute;z-index:5;pointer-events:none;
 right:5%;bottom:8%;width:27%;aspect-ratio:100/132;
 background:url('/assets/earned-shield-badge.png') center/contain no-repeat;
 filter:drop-shadow(0 2px 2px #000b);
}
body.castle-game #app[data-host="true"] #castle-portraits .castle-portrait{
 position:relative;
}
body.castle-game #app[data-host="true"] #castle-portraits .castle-portrait-shield{
 position:absolute;z-index:5;pointer-events:none;
 right:3px;bottom:17px;width:26%;aspect-ratio:100/132;
 background:url('/assets/earned-shield-badge.png') center/contain no-repeat;
 filter:drop-shadow(0 1px 2px #000a);
}
body.castle-game #app:not([data-host="true"]) .castle-shield-badge,
body.castle-game #app:not([data-host="true"]) .castle-portrait-shield{
 display:none!important;
}

/* Claire: read-only observer, with existing castle look and no admin controls. */
body.castle-game #app[data-observer="true"] #hostControls,
body.castle-game #app[data-observer="true"] #missionHost,
body.castle-game #app[data-observer="true"] #traitorCompose,
body.castle-game #app[data-observer="true"] #compose,
body.castle-game #app[data-observer="true"] #voteChoices,
body.castle-game #app[data-observer="true"] #roleBanner,
body.castle-game #app[data-observer="true"] #ghostNotice,
body.castle-game #app[data-observer="true"] #murderChoices,
body.castle-game #app[data-observer="true"] #castle-room-compose,
body.castle-game #app[data-observer="true"] #castle-room-spectator{
 display:none!important;
}
body.castle-game #app[data-observer="true"] #brm-observer-votes,
body.castle-game #app[data-observer="true"] #brm-observer-tower{
 display:block;max-width:760px;margin:12px auto;padding:14px 16px;
 background:#21181b;border:1px solid #80643d;border-radius:8px;
}
body.castle-game #app:not([data-observer="true"]) #brm-observer-votes,
body.castle-game #app:not([data-observer="true"]) #brm-observer-tower,
body.castle-game #app:not([data-observer="true"]) #brm-observer-landing,
body.castle-game #app[data-observer="true"] #brm-observer-landing{display:none!important}
body.castle-game #app[data-observer="true"] #brm-observer-votes[hidden]{display:none!important}
.brm-observer-vote-list>div,.brm-observer-tower-list>div{
 padding:7px 0;border-bottom:1px solid #745b4633;
}
#brm-claire-setup{margin-top:12px;padding:12px;border:1px solid #80643d;border-radius:7px}
#brm-claire-setup>summary{cursor:pointer}
body.castle-game #app:not([data-host="true"]) #brm-claire-setup{display:none!important}
body.castle-game #app[data-observer="true"]>.side>#castle-room-archive{
 display:none!important;
}
body.castle-game #app[data-observer="true"][data-screen="archive"]>.side>#castle-room-archive{
 display:block!important;width:100%;max-width:880px;margin:0 auto;padding:14px;
}
body.castle-game #app[data-observer="true"][data-screen="archive"]>.side>#castle-room-archive>summary{
 font-size:18px;font-weight:bold;cursor:pointer;
}
body.castle-game #app[data-observer="true"][data-screen="archive"]>.side>#castle-room-archive>.castle-archive-content{
 display:block;
}
body.castle-game #app[data-observer="true"][data-screen="archive"]>.side>#castBoardPanel,
body.castle-game #app[data-observer="true"][data-screen="archive"]>.side>#castle-round-scene,
body.castle-game #app[data-observer="true"][data-screen="archive"]>.side>#castle-tower-scene{
 display:none!important;
}

/* Private shield status on the signed-in player's OWN top-left header portrait.
   CSS is driven solely by the server-provided me.shielded value, never by
   other players' private data. Removing the shield updates this badge live. */
body.castle-game #castle-view-heading .castle-header-avatar{
 position:relative;overflow:visible;
}
body.castle-game #castle-view-heading .castle-header-avatar img{
 border-radius:50%;
}
body.castle-game[data-own-shield="true"][data-player-state="active"] #castle-view-heading .castle-header-avatar::before{
 content:"";position:absolute;z-index:5;pointer-events:none;
 width:55%;aspect-ratio:100/132;right:-10%;bottom:-15%;
 background:url('/assets/earned-shield-badge.png') center/contain no-repeat;
 filter:drop-shadow(0 1px 2px #070402) drop-shadow(0 0 3px #e2b35b);
}
