/* Softer pale yellow-white revision with gentle surface separation. Existing controls, art, bindings and data remain authoritative. */
:root {
    
     
     
   --ui-radius:16px;
  --ui-top:16px; --ui-right-reserve:0px; --ui-bottom:calc(16px + var(--desktop-bottom,0px));
}
html.desktop-app:not(.desktop-borderless){--ui-top:54px}
html.desktop-borderless:not(.desktop-only){--ui-right-reserve:138px}

/* Shared panel language. Never skin invisible world/NPC hit targets as buttons. */
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.join-card){
  color:var(--ui-text); background:var(--ui-paper); border:1px solid var(--ui-line);
  border-radius:var(--ui-radius); box-shadow:var(--ui-shadow); font-family:Inter,"Segoe UI",system-ui,sans-serif;
  font-size:13px; line-height:1.5;
}
:is(.keybind-settings,.feedback-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"])::backdrop{background:#4a484042}
:is(.keybind-settings,.feedback-panel,.voice-consent,.hat-closet-dialog,[id="player-database"]){max-width:none;max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.join-card) button{
  min-height:44px; border:1px solid var(--ui-line); border-radius:9px; padding:8px 12px;
  background:var(--ui-soft); color:var(--ui-text); font:inherit; touch-action:manipulation;
}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.join-card) button:hover:enabled{background:#f6f6eb}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.join-card) :is(button,input,textarea,select):focus-visible,
:is(.multiplayer-bar,.performance-stats,.voice-controls,.skill-bar,.item-bar) button:focus-visible,.settings-toggle:focus-visible,.player-chat-toggle:focus-visible,.interaction-hint:focus-visible{
  outline:3px solid #898978;outline-offset:3px;
}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,[id="player-database"],.join-card) :is(input:not([type=radio]),textarea,select){
  min-width:0;min-height:44px;border:1px solid #e8e6db;border-radius:10px;background:var(--ui-input);
  color:var(--ui-text);padding:10px 12px;font:inherit;line-height:1.5;
}
:is(.chat-error,.light-error,.join-error){background:#f4f2e9!important;color:var(--ui-error)!important;border-radius:9px;font-size:13px!important}
:is(.session-strip,.chat-footnote,.host-widget-status,.light-sync,.light-help,.invite-panel p,.invite-panel label,.keybind-settings p,.jukebox-status,.jukebox-controller,.voice-status,.tv-owner,.tv-panel footer,.join-card p,.join-footnote){color:var(--ui-muted);font-size:11px;line-height:1.5}
:is(.chat-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.hat-closet-dialog,[id="player-database"]) :is(header,.chat-header,.database-heading){gap:10px;align-items:center}
:is(.chat-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.hat-closet-dialog,[id="player-database"]) :is(header strong,.chat-header h2,.database-heading h2){font-size:16px;font-weight:600;line-height:1.3;color:var(--ui-text)}
:is(.icon-button,.player-chat-close,.host-widget-close,.challenge-close,.settings-close,[id="close-players"],.jukebox-close){width:44px;min-width:44px;height:44px;padding:0!important;display:grid;place-items:center;border:0!important;background:transparent!important;border-radius:10px!important;color:var(--ui-muted)!important;line-height:1}
#close-players{font-size:24px}

/* Host controls occupy one shared band, with reserved space for both settings buttons. */
.multiplayer-bar,.desktop-app .multiplayer-bar,.desktop-only .multiplayer-bar,.desktop-borderless:not(.desktop-only) .multiplayer-bar{
  top:var(--ui-top);right:calc(128px + var(--ui-right-reserve));left:auto;gap:6px;
}
#host-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.multiplayer-bar button{height:44px;min-height:44px;padding:8px 13px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-paper);box-shadow:0 3px 12px #4b494114;color:var(--ui-text);font-size:13px}
.multiplayer-bar button[aria-pressed=true]{background:var(--ui-tab);border-color:#c5c2b5}
#server-toggle[aria-pressed=true]{color:#68665b;border-color:#b5b2a1}
.multiplayer-bar>span{font-size:11px;color:#6c695d;background:rgba(248,251,255,.82);padding:2px 7px;border-radius:6px}
.settings-toggle{display:grid;top:var(--ui-top)!important;right:calc(16px + var(--ui-right-reserve))!important;width:44px;height:44px;min-height:44px;padding:10px;border-radius:10px;background:var(--ui-paper);border-color:var(--ui-line);color:#797669;box-shadow:0 3px 12px #4b494114}
.settings-toggle svg{width:22px;height:22px}
.model-quality-toggle{right:calc(68px + var(--ui-right-reserve))!important}
.performance-stats{top:var(--ui-top)!important;left:16px!important;right:auto!important;max-width:300px;gap:8px 12px;padding:9px 11px;border-color:var(--ui-line);border-radius:12px;background:var(--ui-paper);box-shadow:0 3px 12px #4b494114;color:var(--ui-muted);font-size:11px}
.performance-stats strong{color:var(--ui-text);font-weight:600}.performance-stats small{font-size:11px;color:var(--ui-muted)}
.local-render-stats{max-width:none;width:100%;gap:5px;margin-top:8px;padding-top:8px;border-color:var(--ui-line)}
.local-render-stats>div>span,.local-render-stats strong{font-size:11px}.local-render-stats small{font-size:11px;color:var(--ui-muted)}
.local-render-stats>div>span{color:var(--ui-muted)}
.performance-stats .prediction-toggle{min-height:44px;font-size:11px;background:var(--ui-soft);border-color:var(--ui-line);border-radius:8px}
.performance-details{width:100%;pointer-events:auto}.performance-details summary{width:max-content;min-height:44px;display:list-item;align-content:center;padding:7px 8px;color:var(--ui-text);font-size:11px;touch-action:manipulation;cursor:pointer;border-radius:7px}
.performance-details summary:focus-visible{outline:3px solid #898978;outline-offset:2px}.performance-details summary:hover{background:var(--ui-soft)}
.performance-details:not([open]){width:auto;margin-left:auto}.performance-details:not([open]) summary{padding-block:5px}
.performance-details .prediction-toggle{margin-top:8px}
.performance-stats:has(.performance-details[open]){z-index:15;max-width:min(340px,calc(100vw - 24px));pointer-events:auto}
.local-render-stats strong{max-width:65%;min-width:0}

/* Player chat follows the supplied reference: soft channel tabs, calm input, character-matched name chips with an outside gap. */
.player-chat,.desktop-only .player-chat,.wallpaper-mode .player-chat{left:16px;bottom:calc(108px + var(--desktop-bottom,0px));width:min(360px,calc(100vw - 32px));border-radius:16px;overflow:hidden;font-size:13px}
.player-chat header{padding:0 8px 0 0;gap:6px;border:0;background:#f7f7ef;min-height:48px}
.player-chat .chat-channels{padding:0;gap:3px;align-self:stretch;flex:1;min-width:0}
.player-chat .chat-channels button{width:auto;min-height:48px;padding:9px 14px;border:0;border-radius:11px 11px 0 0;background:transparent;font-size:13px;font-weight:500}
.player-chat .chat-channels button[aria-pressed=true]{background:var(--ui-solid);color:#5a584f;font-weight:600}
.player-chat .player-chat-close{margin:2px 0;font-size:16px}
.player-chat .player-chat-log{padding:10px 12px;max-height:190px;min-height:52px;scrollbar-width:thin;scrollbar-color:#dcd9c9 transparent}
.player-chat-log p{margin:5px 0;line-height:1.5;color:var(--ui-text)}
.player-chat-log strong{--player-color:#91a5b6;display:inline;padding:2px 5px;margin-inline-end:6px;border-radius:6px;font-weight:600;background:color-mix(in srgb,var(--player-color) 18%,var(--ui-solid));color:color-mix(in srgb,var(--player-color) 40%,#24313e);box-decoration-break:clone;-webkit-box-decoration-break:clone}
.player-chat-log strong[data-player-color="sky"]{--player-color:#73bdfa}
.player-chat-log strong[data-player-color="rose"]{--player-color:#f58ec7}
.player-chat-log strong[data-player-color="mint"]{--player-color:#55d5c2}
.player-chat-log strong[data-player-color="sunshine"]{--player-color:#ffc65b}
.player-chat-log strong[data-player-color="violet"]{--player-color:#ad8ee8}
.player-chat-log strong[data-player-color="coral"]{--player-color:#ff998b}
.player-chat-log strong[data-player-color="lime"]{--player-color:#95d96b}
.player-chat-log strong[data-player-color="ocean"]{--player-color:#57b4cc}
.player-chat-log strong[data-player-color="cherry"]{--player-color:#ed637c}
.player-chat-log strong[data-player-color="lavender"]{--player-color:#c4a9e2}
.player-chat-log strong[data-player-color="peach"]{--player-color:#f4bc8f}
.player-chat-log strong[data-player-color="teal"]{--player-color:#26808e}
.player-chat-time{font-size:11px;font-weight:400;color:#6d6d65;line-height:1.8;margin-left:8px}
.player-chat form{gap:7px;padding:10px;border-top:1px solid #eeece4;align-items:stretch}
.player-chat textarea{min-height:48px;height:48px;max-height:120px;border-radius:10px!important;font-size:13px;resize:vertical;outline-offset:2px}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.join-card) :is(input,textarea)::placeholder{color:var(--ui-muted);opacity:1}
.player-chat form button{width:44px;min-width:44px;align-self:stretch;padding:3px;border:0;background:transparent;color:var(--ui-blue);font-size:25px;border-radius:9px}
.player-chat form button:hover:enabled{background:#f6f6eb}.chat-empty{color:var(--ui-muted)}
.player-chat.is-feed{background:transparent;border:0;box-shadow:none;overflow:visible}
.player-chat.is-feed .player-chat-log{padding:0;min-height:0;max-height:135px;gap:5px}
.player-chat.is-feed .player-chat-log p{font-size:13px;line-height:1.5;padding:7px 9px;background:var(--ui-paper);border-radius:10px;box-shadow:0 2px 8px #4b494112}
.player-chat-feed-channel{font-size:11px;color:#737164}.chat-unread{font-size:11px;background:#ac626d;border-color:var(--ui-solid)}
.player-chat-toggle{left:16px;bottom:var(--ui-bottom);width:44px;height:44px;border-color:var(--ui-line);border-radius:11px;background:var(--ui-paper);color:#6d6d65;box-shadow:0 3px 12px #4b494118}
.voice-controls{left:68px;bottom:var(--ui-bottom);gap:6px;font-size:11px}.voice-controls button{width:44px;min-height:44px;padding:9px;border-color:var(--ui-line);border-radius:11px;background:var(--ui-paper);color:#6d6d65;box-shadow:0 3px 12px #4b494118}.voice-controls button[aria-pressed=true]{background:var(--ui-tab);color:#5c5a50}
.voice-status{background:var(--ui-paper);padding:8px 10px;border:1px solid var(--ui-line);border-radius:10px;max-width:240px;font-size:11px;color:var(--ui-muted);box-shadow:var(--ui-shadow)}
.player-speech{background:var(--ui-paper);border-color:var(--ui-line);border-radius:13px;color:var(--ui-text);font-size:13px;line-height:1.5;box-shadow:0 4px 14px #4b49411c}

/* Existing skill and inventory artwork is retained. */
.skill-bar{gap:7px;padding:8px;border-color:var(--ui-line);border-radius:13px;background:var(--ui-paper);box-shadow:var(--ui-shadow);bottom:var(--ui-bottom)}
.desktop-only .skill-bar,.wallpaper-mode .skill-bar{bottom:var(--ui-bottom)}
.skill-bar .slap-skill{border-color:#e8e5da;border-radius:9px;box-shadow:inset 0 0 0 1px #fffffc,0 1px 3px #4b494114}
.skill-bar:has(.tooltip-open),.skill-bar:has(.skill-slot:focus-within){z-index:14}
@media(hover:hover) and (pointer:fine){.skill-bar:has(.skill-slot:not([data-touch-input]):hover){z-index:14}}
.skill-hotkey,.item-hotkey{font-size:11px;color:#69675c}.skill-hotkey{background:#fffffcf2;border-color:#e8e6dc;border-radius:4px;padding:1px 4px}
.skill-counter{font-size:13px;color:#646156;background:#fffffcf2;border-radius:5px;padding:0 4px}.skill-bar .skill-active{border-color:#aeaa97;box-shadow:0 0 0 2px #cac7bb55}
.skill-cooldown{background:#8e8b7c33}.skill-tooltip{background:var(--ui-paper);border-color:var(--ui-line);border-radius:13px;padding:14px 16px;color:var(--ui-text);box-shadow:var(--ui-shadow);font-size:13px;line-height:1.5;max-height:calc(100dvh - 32px);overflow:auto}
.skill-tooltip strong{font-size:13px}.skill-tooltip p{font-size:13px;color:var(--ui-muted);line-height:1.5}.skill-tooltip-state{font-size:11px}
.momentum-gauge{padding:8px 10px;border-color:var(--ui-line);border-radius:10px;background:var(--ui-paper);box-shadow:0 3px 12px #4b494118}.momentum-label{font-size:11px;line-height:1.2;color:#69675c}.momentum-label strong{color:#716f63}
.item-bar{right:16px;bottom:var(--ui-bottom);padding:8px;gap:7px;border-color:var(--ui-line);border-radius:13px;background:var(--ui-paper);box-shadow:var(--ui-shadow)}
.item-slot{border-radius:9px;border-color:#e8e5da;background:#fbfaf7}.item-slot[aria-pressed=true]{background:#f4f2e8;border-color:#b0ad9b;box-shadow:0 0 0 2px #cac7bb55}
.item-throw{min-height:44px;border-radius:10px;background:var(--ui-paper);color:var(--ui-text);border-color:var(--ui-line);font-size:13px}
.throw-power{width:42px;padding:4px;border-radius:10px;border-color:var(--ui-line);background:var(--ui-paper);font-size:11px;color:#6d6b5f;z-index:12}
.interaction-hint{min-height:44px;max-width:calc(100vw - 24px);padding:9px 12px;border-color:var(--ui-line);border-radius:11px;background:var(--ui-paper);color:#69675b;font-size:13px;box-shadow:0 4px 16px #52524a18;z-index:12}
.interaction-hint kbd{font-size:11px;border-color:#cbc8bc;background:#f8f8f2;border-radius:5px}
.entity-label,.light-npc .entity-label,.host-widget-npc .entity-label{--name-label-contour:0 0 1px #17201b66,0 1px 1.5px #17201b66,0 1px 1px #fffffc55;font-size:11px;font-weight:600;text-shadow:var(--name-label-contour)}
.entity.enduring .entity-label{text-shadow:var(--name-label-contour),0 0 5px #7fe5d6}
.agent-worker .entity-label{font-size:11px;line-height:1.2;max-width:110px}.pet-npc .entity-label{font-size:11px}

/* NPC conversations, live-device panels and host services. */
.chat-panel,.host-widget-panel,.invite-panel,.challenge-panel{z-index:20}
.chat-panel:not(.light-panel){height:min(460px,calc(100dvh - 40px));max-height:calc(100dvh - 40px);width:min(390px,calc(100vw - 24px));border-radius:18px}
.chat-panel .chat-header{height:64px;padding:10px 16px}.chat-panel .chat-header h2{font-size:16px}.chat-header div>span{font-size:11px;color:var(--ui-muted)}
.avatar{width:34px;height:34px;border-radius:10px;background:#f5f3eb;border-color:#eae8df;color:#868374}
.chat-panel .session-strip{display:flex;padding:8px 16px;background:#f8f8f2;border-color:#eceae1;font-size:11px;flex-shrink:0}.session-strip>span:last-child{font-size:11px;letter-spacing:.5px}
.chat-panel .messages{padding:14px 16px;min-height:48px}.welcome h3{font-size:16px}.welcome p,.chat-panel .message-text{font-size:13px;line-height:1.6;color:var(--ui-text)}.message-author{font-size:11px;color:#7d7a6c}.suggestion{font-size:13px;border-radius:9px}
.chat-panel .composer{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:6px;margin:0 12px 12px;padding:10px;border:1px solid var(--ui-line);border-radius:12px;background:#f9f8f2}
.chat-panel .composer textarea{grid-column:1/-1;min-height:58px;height:58px;border:0!important;background:transparent!important;padding:4px!important;outline-offset:2px}
.chat-panel .composer .attachments{grid-column:1/-1;margin:0;max-height:96px}
.chat-panel .composer .attach-row{grid-column:1;align-self:center;margin:0}
.chat-panel .composer-footer{position:static;grid-column:2;gap:8px}.composer-footer>span{font-size:11px;color:var(--ui-muted)}.composer-footer button{min-width:44px;min-height:44px;width:44px;height:44px;padding:0;color:var(--ui-blue);background:#f6f6eb;border-color:#e5e2d6}
.composer :is(#send,#stop){width:44px;height:44px;border-radius:10px;background:#f6f6eb;color:var(--ui-blue);font-size:16px}
.attach-row{gap:8px;flex-wrap:wrap}.attach-row>span{font-size:11px;color:var(--ui-muted)}.attach-row button{font-size:11px;padding:5px 8px;min-height:36px}.chat-footnote{font-size:11px;padding:7px 12px;color:var(--ui-muted)}
.attachment{border-color:var(--ui-line);border-radius:8px;background:#f8f8f2}.attachment-details strong{font-size:11px;color:#737164}.attachment-details span{font-size:11px;color:var(--ui-muted)}.attachment button{min-width:32px;min-height:32px;padding:0}
.chat-panel.light-panel{width:min(310px,calc(100vw - 24px));height:auto;max-height:calc(100dvh - 32px);border-radius:16px}.chat-panel.light-panel .chat-header{height:auto;min-height:58px;padding:8px 12px}.chat-panel.light-panel .chat-header h2{font-size:13px}.light-panel .chat-header div>span{font-size:11px}.light-panel .chat-header .avatar{width:32px;height:32px;font-size:20px}
.chat-panel.light-panel .light-content{padding:12px 14px}.chat-panel.light-panel .light-content h3{font-size:16px}.light-status-row p{font-size:13px;color:var(--ui-muted)}.chat-panel.light-panel .light-lamp{width:40px;height:40px;flex-basis:40px;font-size:26px}
.chat-panel.light-panel .session-strip{background:#f8f8f2;color:#656257;border-color:#dfdccc}
.chat-panel.workshop-light-panel .session-strip{background:#f7f6f0;color:#777467;border-color:#e7e7de}
.light-panel .light-actions button{font-size:13px;min-height:44px;border-radius:9px}.chat-panel.light-panel .light-sync{font-size:11px;gap:8px}.light-panel .light-sync button{font-size:11px;min-height:44px;padding:8px}.light-help{font-size:11px!important;color:var(--ui-muted)!important}.light-panel .session-strip{font-size:11px}
.host-widget-panel{width:min(420px,calc(100vw - 24px));padding:16px;max-height:calc(100dvh - 32px);font-size:13px}.host-widget-tabs button{flex:1;background:var(--ui-tab);border-color:transparent}.host-widget-tabs button[aria-selected=true]{background:var(--ui-solid);border-color:#c4c1b4;color:#5a584f}.host-widget-list{font-size:13px}.host-widget-list small{font-size:11px;color:var(--ui-muted)}.host-task-actions a{min-height:44px;display:inline-flex;align-items:center;border-radius:9px;color:#716f63;background:var(--ui-soft);font-size:13px}
.host-task strong{font-size:13px;color:var(--ui-text)}
.concept-artwork{border-color:var(--ui-line);border-radius:12px;background:#f8f8f2}.concept-label{font-size:13px}.concept-navigation{margin-top:10px}.concept-actions{gap:8px}.concept-actions button{flex:1;white-space:nowrap}.concept-review h3{font-size:13px}

/* Menus, settings, guest entry and world activities. */
.invite-panel{width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;padding:20px}.invite-panel h2{font-size:16px}.invite-panel p{font-size:13px}.invite-panel label{font-size:13px}.invite-panel select,.invite-panel input{font-size:13px}.invite-panel>button{font-size:13px;background:var(--ui-tab);color:#5f5d52}.invite-actions{gap:8px;flex-wrap:wrap}.invite-actions button{flex:1;font-size:13px;min-height:44px}.invite-actions button:last-child{color:#8b5b50}
.keybind-settings{width:min(420px,calc(100vw - 24px));padding:18px}.keybind-settings p{font-size:13px}.keybind-rows{gap:8px}.keybind-rows label{gap:16px;font-size:13px}.keybind-rows button{min-width:88px}.model-quality-row{gap:16px;margin-top:18px}.model-quality-row select{font-size:13px}.model-quality-status{font-size:13px}
.music-settings{margin-top:14px;padding-bottom:14px;border-bottom:1px solid var(--ui-line)}
.music-settings-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.music-settings h3,.settings-section-title{font-size:13px;font-weight:600;line-height:1.4;color:var(--ui-text);margin:0}
.music-settings .music-mute{min-height:44px;white-space:nowrap;font-size:13px;background:var(--ui-tab)}
.music-settings .music-mute[aria-pressed=true]{background:var(--ui-input);color:var(--ui-muted)}
.music-volume-label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;margin-top:12px}
.music-volume-value{font-variant-numeric:tabular-nums;min-width:3ch;text-align:right;color:var(--ui-muted)}
.keybind-settings .music-settings input[type=range]{display:block;width:100%;min-width:0;min-height:44px;height:44px;margin:0;padding:0;border:0;background:transparent;accent-color:#a7a38e;touch-action:pan-y}
.music-settings .music-settings-status{margin:4px 0 0;font-size:11px;color:var(--ui-muted)}
.music-settings .music-track-name{font-size:13px;color:var(--ui-muted);margin:5px 0 0}
.settings-section-title{margin-top:18px}
.feedback-panel{padding:18px}.feedback-panel label{font-size:13px}.feedback-panel textarea,.feedback-panel select{font-size:13px}.feedback-panel header strong{font-size:16px}.feedback-panel header button{padding:0;min-width:44px}.feedback-records article,.feedback-panel [role=status]{font-size:13px}.feedback-records h3{font-size:13px}
.challenge-panel{padding:18px;max-height:calc(100dvh - 32px)}.challenge-panel header{font-size:16px}.challenge-panel h2{font-size:16px}.challenge-panel h3{font-size:13px}.challenge-panel p,.challenge-panel ol{font-size:13px;line-height:1.6}.challenge-panel li:first-child{color:#5a584f}.challenge-panel button{font-size:13px}
.challenge-hud{font-family:Inter,"Segoe UI",system-ui,sans-serif;line-height:1.3;text-wrap:balance;text-shadow:0 2px 3px #46453d,0 1px 8px #46453d88}.challenge-hud.challenge-announcement{font-weight:700;letter-spacing:.3px}
.hat-closet-dialog{width:min(520px,calc(100vw - 24px));padding:18px;background:var(--ui-paper);color:var(--ui-text)}.hat-closet-dialog::backdrop{background:#4a484042}.hat-closet-dialog h2{font-size:16px}.hat-closet-dialog p{font-size:13px;color:var(--ui-muted)}.hat-closet-dialog button{background:var(--ui-soft);border-color:var(--ui-line);color:var(--ui-text)}.hat-closet-dialog button[aria-pressed=true]{background:var(--ui-tab);border-color:#bbb8a8;box-shadow:inset 0 0 0 1px #bbb8a8}.hat-closet-choices{gap:9px}
#player-database{width:min(780px,calc(100vw - 24px));padding:18px}#player-database h2{font-size:16px}.database-heading{display:flex;justify-content:space-between}.database-tools{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.database-table{overflow:auto}.database-table table{width:100%;min-width:560px;border-collapse:collapse;font-size:13px}.database-table :is(th,td){padding:10px 12px;text-align:left;border-bottom:1px solid #edebe2}.database-table th{color:#7b786b;font-weight:600;background:#f8f8f2}#player-database>p{color:var(--ui-muted);font-size:13px}
.join-card{padding:26px;width:min(420px,100%)}.join-card h1{font-size:24px;line-height:1.2;color:var(--ui-text)}.join-card p{font-size:13px;line-height:1.6}.join-card label,.join-card legend{font-size:13px}.join-card button{background:var(--ui-tab);color:#5f5d52;font-size:13px}.join-card .eyebrow{font-size:11px;letter-spacing:1.2px;color:#787669}.join-footnote{font-size:11px}.color-choice{font-size:11px}.color-choice:has(input:checked){outline-color:#aeab99}
.join-card{min-width:0;max-width:100%}.color-picker{min-inline-size:0}.join-card #color-choices{grid-template-columns:repeat(4,minmax(0,1fr))}.join-card .color-choice{min-width:0;overflow-wrap:anywhere}
.guest-join{display:grid;place-items:center;padding:24px 16px}
.voice-consent{width:min(420px,calc(100vw - 24px));padding:20px}.voice-consent h2{font-size:16px}.voice-consent p{font-size:13px;color:var(--ui-muted)}.voice-consent-note{background:#f8f8f2;border-radius:10px;padding:10px}.voice-consent>div{display:flex;gap:8px;flex-wrap:wrap}.voice-consent button{flex:1}

/* Media content dimensions and playback controls remain intact. */
.tv-panel{border-color:var(--ui-line);border-radius:16px;background:var(--ui-paper);color:var(--ui-text);max-height:calc(100dvh - 24px);overflow:auto}.tv-panel header{padding:10px 12px;gap:8px;flex-wrap:wrap}.tv-panel header strong{font-size:16px}.tv-owner{font-size:11px;color:var(--ui-muted)}.tv-panel .tv-close{min-width:44px;padding:0;font-size:24px}.tv-panel footer{font-size:11px;padding:10px 14px;color:var(--ui-muted)}.tv-placeholder{font-size:13px;color:#f7f7ee}.tv-message{color:#777568}.tv-screen video{object-fit:contain}
.jukebox-panel{padding:13px;width:min(350px,calc(100vw - 24px));max-height:calc(100dvh - 128px);border-radius:16px;font-size:13px}.jukebox-panel header{font-size:16px;margin-bottom:10px}.jukebox-header-actions{gap:2px;flex-wrap:wrap}.jukebox-panel button{min-height:44px;font-size:13px;padding:8px}.jukebox-actions{gap:8px}.jukebox-search,.jukebox-select{gap:8px}.jukebox-search input,.jukebox-select input{font-size:13px}.jukebox-controller,.jukebox-status{font-size:11px}.jukebox-panel.mini{width:252px;min-width:232px;bottom:calc(102px + var(--desktop-bottom,0px));padding:9px}.jukebox-panel.mini header{font-size:13px;margin-bottom:7px}.jukebox-panel.mini button{font-size:11px}
.desktop-titlebar{background:#f7f7ef;color:#787568}.desktop-window-actions button{color:#807d6f}.desktop-title{font-size:11px}

/* Preserve a visible keyboard focus ring above the legacy game-wide reset. */
#game-main :is(button,summary,input,textarea,select,.skill-slot):focus-visible{outline:3px solid #898978;outline-offset:3px}
button:is(.icon-button,.host-widget-close,.challenge-close,.jukebox-close){font-size:24px}
.message-files span{font-size:11px;border-radius:6px;padding:5px 8px;background:var(--ui-soft);color:var(--ui-muted)}
.join-card .color-choice>span:last-child{font-size:11px}

/* Compact HUD keeps all actions reachable; open chat becomes a bounded floating panel. */
@media(max-width:900px),(pointer:coarse){
  :root{--ui-hud-bottom:calc(20px + env(safe-area-inset-bottom,0px) + var(--desktop-bottom,0px));--ui-skill-extra:0px}
  body:has(.skill-bar .momentum-gauge:not([hidden])){--ui-skill-extra:36px}
  .settings-toggle{display:grid;top:var(--ui-top)!important;right:calc(12px + var(--ui-right-reserve))!important}
  .model-quality-toggle{right:calc(64px + var(--ui-right-reserve))!important}
  .multiplayer-bar,.desktop-app .multiplayer-bar,.desktop-only .multiplayer-bar,.desktop-borderless:not(.desktop-only) .multiplayer-bar{top:calc(var(--ui-top) + 54px);left:12px;right:12px;gap:5px}
  #host-controls{width:100%;gap:6px;flex-wrap:nowrap}.multiplayer-bar button{flex:1;min-width:0;height:44px;min-height:44px;padding:8px;font-size:13px;white-space:nowrap}.multiplayer-bar>span{font-size:11px}
  .performance-stats{top:calc(var(--ui-top) + 132px)!important;left:12px!important;max-width:calc(100vw - 24px);gap:8px;padding:7px 10px;font-size:11px}
  .performance-details:not([open]){width:auto}.performance-details[open]{width:100%}.performance-details summary{min-height:36px}
  .joystick{display:flex;position:fixed;left:12px;bottom:var(--ui-hud-bottom);width:104px;height:104px;border-color:#b1ae9c70;background:#fffffc66}.joystick span{width:44px;height:44px;background:#c0bdaec9}
  .skill-bar,.desktop-only .skill-bar,.wallpaper-mode .skill-bar{left:auto;right:12px;bottom:var(--ui-hud-bottom);transform:none;display:grid;grid-template-columns:repeat(2,52px);gap:6px;padding:7px;max-width:none}
  .skill-bar .slap-skill{width:52px;height:52px}.skill-slot:last-child{grid-column:auto}.momentum-gauge{position:static;grid-column:1/-1;padding:4px 3px;border:0;background:none;box-shadow:none}.momentum-label{font-size:11px}
  .item-bar{right:12px;bottom:calc(var(--ui-hud-bottom) + 194px + var(--ui-skill-extra));gap:6px;padding:7px}.item-slot{width:44px;height:44px}.item-slot svg{width:27px}.item-throw{font-size:13px;min-height:44px}
  .player-chat-toggle{left:12px;bottom:calc(var(--ui-hud-bottom) + 116px)}.voice-controls{left:64px;bottom:calc(var(--ui-hud-bottom) + 116px);gap:5px}.voice-status{left:-52px;max-width:210px}
  .player-chat.is-open,.desktop-only .player-chat.is-open,.wallpaper-mode .player-chat.is-open{position:fixed;z-index:16;left:12px;right:auto;top:50%;bottom:auto!important;transform:translateY(-50%);width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 32px);display:flex;flex-direction:column;overflow:hidden}
  .player-chat.is-open .player-chat-log{min-height:36px;flex:1;max-height:min(190px,calc(100dvh - 176px));overflow:auto}.player-chat.is-open header,.player-chat.is-open form{flex-shrink:0}
  .player-chat.is-feed,.desktop-only .player-chat.is-feed,.wallpaper-mode .player-chat.is-feed{left:12px;top:auto;right:auto;bottom:calc(var(--ui-hud-bottom) + 170px);max-height:136px;width:min(230px,calc(100vw - 196px));transform:none;font-size:11px}
  .player-chat.is-feed .player-chat-log{max-height:136px}.player-chat.is-feed .player-chat-log p{font-size:11px}.player-chat.is-feed .player-chat-time{font-size:11px;float:none;display:block;margin:0}
  .chat-panel:not(.light-panel){height:min(440px,calc(100dvh - 32px));max-height:calc(100dvh - 32px)}
  .chat-panel .chat-header{height:58px}.chat-panel .session-strip{display:flex}.chat-panel .composer{padding:8px;margin:0 10px 10px}.chat-panel .composer textarea{min-height:48px;height:48px}
  .chat-panel .chat-footnote{display:none}.chat-panel .attach-row>span,.chat-panel .composer-footer>span{display:none}.chat-panel .attach-row button{min-height:40px}
  .skill-tooltip{right:0;left:auto;transform:none;width:min(280px,calc(100vw - 24px));font-size:13px}
  .interaction-hint{font-size:13px;min-height:44px}.interaction-hint>span:first-child::before{font-size:11px}
  .challenge-hud,.challenge-hud.challenge-announcement{top:35dvh}
  .jukebox-panel,.jukebox-panel.mini{top:12px;right:12px;bottom:auto;max-height:calc(100dvh - 24px);width:min(350px,calc(100vw - 24px))}
  .feedback-panel,.voice-consent,.hat-closet-dialog,[id="player-database"],.keybind-settings{max-height:calc(100dvh - 24px)}
  body[data-mode=guest] .item-bar{bottom:calc(var(--ui-hud-bottom) + 136px + var(--ui-skill-extra))}
  body[data-mode=guest] .multiplayer-bar{top:var(--ui-top);left:12px;right:128px}
  body[data-mode=guest] .performance-stats{top:calc(var(--ui-top) + 54px)!important}
}
@media(pointer:coarse){.performance-details summary{min-height:44px}.attach-row button,.attachment button{min-width:44px;min-height:44px}}
@media(max-width:520px),(pointer:coarse){
  :is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.tv-panel,.join-card) :is(input:not([type=radio]),textarea,select){font-size:13px}
  .chat-header h2{font-size:16px}.invite-panel,.keybind-settings,.feedback-panel,.hat-closet-dialog{padding:14px}
  .keybind-rows label{gap:10px}.keybind-rows button{min-width:76px}
}
@media(max-width:360px){.join-card #color-choices{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-height:480px) and (max-width:900px){
  .player-chat.is-open,.desktop-only .player-chat.is-open,.wallpaper-mode .player-chat.is-open{max-height:calc(100dvh - 24px)}
  .player-chat .player-chat-log{max-height:calc(100dvh - 168px)}
  .chat-panel:not(.light-panel){height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}.chat-panel .chat-header{height:52px}.chat-panel .messages{min-height:36px}.chat-panel .session-strip{padding-block:4px}.chat-panel .composer .attachments{max-height:64px}
  .performance-details[open]{max-height:calc(100dvh - 174px);overflow:auto}
}
@media(max-height:480px) and (min-width:480px) and (max-width:900px){
  .multiplayer-bar,.desktop-app .multiplayer-bar,.desktop-only .multiplayer-bar,.desktop-borderless:not(.desktop-only) .multiplayer-bar{top:var(--ui-top);left:12px;right:calc(128px + var(--ui-right-reserve))}
  .performance-stats{top:calc(var(--ui-top) + 54px)!important}
  .skill-bar,.desktop-only .skill-bar,.wallpaper-mode .skill-bar{grid-template-columns:repeat(3,52px)}
  .item-bar,body[data-mode=guest] .item-bar{bottom:calc(var(--ui-hud-bottom) + 136px + var(--ui-skill-extra))}
  .player-chat.is-feed,.desktop-only .player-chat.is-feed,.wallpaper-mode .player-chat.is-feed{max-height:56px}
  .player-chat.is-feed .player-chat-log{max-height:56px}
  .performance-details[open]{max-height:calc(100dvh - 120px)}
  .performance-stats:has(.performance-details[open]){max-height:calc(100dvh - var(--ui-top) - 70px);overflow:auto}
}

/* Unified inherited component colors and typography. */

:root{--green:#878476;--muted:var(--ui-muted);--line:var(--ui-line);color:var(--ui-text);color-scheme:light}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.join-card,.cpb-dialog){font-family:Inter,"Segoe UI",system-ui,sans-serif;font-size:var(--ui-font-body);scrollbar-color:#ceccc1 transparent}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.join-card) :is(button,input,textarea,select){font-size:var(--ui-font-body)}
:is(.chat-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.hat-closet-dialog,[id="player-database"]) :is(header strong,.chat-header h2,.database-heading h2),.invite-panel h2,.voice-consent h2,.hat-closet-dialog h2,.tv-panel header strong,.jukebox-panel.mini header,.cpb-header h2{font-size:var(--ui-font-heading)}
.player-chat .chat-channels button,.keybind-rows label,.host-widget-list,.light-actions button,.host-task-actions a,.cpb-entry-title,.cpb-tab{font-size:var(--ui-font-body)!important}
:is(.session-strip,.chat-footnote,.host-widget-status,.light-sync,.light-help,.jukebox-status,.jukebox-controller,.voice-status,.tv-owner,.tv-panel footer,.join-footnote,.message-author,.player-chat-time,.music-track-name,.music-settings-status,.skill-tooltip-state,.cpb-eyebrow,.cpb-entry-meta,.cpb-provenance,.cpb-status){font-size:var(--ui-font-small)}
.chat-panel .chat-header div>span,.chat-panel .session-strip>span:last-child,.attachment-details span,.host-widget-list small,.join-card .color-choice>span:last-child{font-size:var(--ui-font-small)}
.welcome h3,.join-card h1{font-size:24px}.challenge-panel h2,.cpb-detail-title{font-size:var(--ui-font-heading)}
.chat-panel .chat-header,.chat-panel.light-panel .chat-header,.host-task,.concept-review,.feedback-records,.feedback-records article,.skill-tooltip-state{border-color:var(--ui-line)}
.chat-panel .message.user .message-text,.chat-panel .suggestion,.attachment,.voice-consent-note{background:var(--ui-soft);border-color:var(--ui-line);color:var(--ui-text)}
.chat-panel .session-strip,.chat-panel.light-panel .session-strip,.chat-panel.workshop-light-panel .session-strip{background:#f5f3eb;color:var(--ui-muted);border-color:var(--ui-line)}
.chat-panel .avatar,.chat-panel .light-avatar,.chat-panel.workshop-light-panel .light-avatar{background:#f4f2e9;color:#8a8779;border-color:var(--ui-line)}
.chat-panel.light-panel .light-content h3,.chat-panel.workshop-light-panel .light-content h3{color:var(--ui-text);font-size:var(--ui-font-heading)}
.chat-panel.light-panel .light-actions button,.chat-panel.workshop-light-panel .light-actions button{background:var(--ui-soft);border-color:var(--ui-line);color:var(--ui-text)}
.chat-panel.light-panel .light-actions button[aria-pressed=true],.chat-panel.workshop-light-panel .light-actions button[aria-pressed=true]{background:var(--ui-tab);border-color:#c4c1b4}
.chat-panel.light-panel .light-actions button:hover:enabled,.chat-panel.workshop-light-panel .light-actions button:hover:enabled{background:#eeece4}
.chat-panel .light-lamp,.chat-panel[data-light-state=on] .light-lamp{background:#f4f2e8;color:#918e80;box-shadow:0 0 20px #aeab9922}
.voice-controls button[aria-pressed=true]{border-color:#b3af9e;box-shadow:inset 0 -3px #b3af9e}.voice-controls button[aria-pressed=false]{color:#888577;background:var(--ui-paper);border-color:var(--ui-line)}
.voice-consent .voice-consent-note{color:var(--ui-muted)}.voice-consent [data-enable]{background:var(--ui-tab)}
.skill-bar .slap-skill,.skill-bar [data-skill=kick],.skill-bar [data-skill=sprint]{background:radial-gradient(circle at 65% 25%,#fff,#f7f6f0 65%,#efede5);color:var(--ui-text)}
.skill-slot:hover .slap-skill:not(:disabled){border-color:#b3af9e}.skill-active .skill-counter,.skill-tooltip .skill-tooltip-stats,.skill-tooltip-state{color:#7c796b}.skill-art{filter:drop-shadow(0 2px 2px #615f5426)}
.momentum-track,.throw-power>div{background:#ebe9e0}.momentum-track>span,.throw-power i{background:linear-gradient(90deg,#c9c7bb,#9d9a8e)}
.concept-image{background:#f8f8f2}.graphics-notice,.tv-hint,.npc-wave-emoji{background:var(--ui-paper);border-color:var(--ui-line);color:var(--ui-muted)}.npc-wave-emoji::after{background:#fcfcfb;border-color:var(--ui-line)}
.entity .voice-speaking{background:#f8f8ef;color:#848172;border-color:#bdbaaa;box-shadow:0 0 0 3px #aeaa9820}
.guest-join{background:linear-gradient(150deg,#f7f7ef,#fbfaf6)}.color-choice{background:rgba(248,251,255,.75);border-color:var(--ui-line)}
.tv-screen,.tv-screen video,.jukebox-video{background:#35342e}.tv-placeholder{color:#f7f7ef}
.desktop-titlebar,.desktop-borderless .desktop-titlebar{background:rgba(235,242,249,.9);color:var(--ui-muted)}.desktop-window-actions button:hover{background:#eae8df}.desktop-window-actions button[data-action=close]:hover{background:#be5c55;color:white}
.cpb-dialog{--cpb-paper:var(--ui-paper);--cpb-ink:var(--ui-text);--cpb-muted:var(--ui-muted);--cpb-rule:var(--ui-line);--cpb-soft:var(--ui-soft);--cpb-sage:var(--ui-tab);border-color:var(--ui-line);background:var(--ui-paper);box-shadow:var(--ui-shadow)}
.cpb-dialog::backdrop{background:#4a484042}.cpb-dialog button:focus-visible{outline-color:#898978}.cpb-tab{background:var(--ui-tab);border-color:var(--ui-tab);color:var(--ui-text)}.cpb-tab[aria-selected=true]{background:var(--ui-solid);color:#5a584f;border-color:#bfbcad;box-shadow:inset 0 -3px #bfbcad}.cpb-button,.cpb-status{background:var(--ui-soft);border-color:var(--ui-line)}.cpb-entry:hover{background:#f5f4ec}.cpb-notice{background:#f5f3eb;color:#716e62}
.player-chat .player-chat-close,.chat-panel .icon-button,.host-widget-close,.challenge-close,.keybind-settings .settings-close,#close-players,.jukebox-panel .jukebox-close{font-size:24px}.player-chat form button,.composer :is(#send,#stop){font-size:24px}
.cpb-notice,.cpb-back,.cpb-explanation,.cpb-empty{font-size:var(--ui-font-body)!important}.cpb-group-label,.cpb-fields dt{font-size:var(--ui-font-small)}.cpb-entry-arrow{font-size:24px}
.chat-panel .messages{scrollbar-color:#ceccc1 transparent}.chat-panel .composer:focus-within{border-color:#b6b2a1;box-shadow:0 0 0 2px #b6b2a123}.chat-panel .session-strip i{background:#b6b2a1}.welcome-mark,.thinking,.attachment-icon{color:#918e80}.thinking{font-size:11px}.chat-panel.drop-hover{box-shadow:inset 0 0 0 3px #b6b2a1,var(--ui-shadow)}
.player-chat-time,.player-chat-feed-channel,.message-author,.music-settings .music-track-name,.music-settings .music-settings-status{color:var(--ui-muted)}
.player-chat.is-feed .player-chat-log p{color:var(--ui-text)}
#player-database{background:var(--ui-paper);color:var(--ui-text);border-color:var(--ui-line)}#player-database button{font-size:13px;background:var(--ui-soft);border-color:var(--ui-line);color:var(--ui-text)}#players-message{font-size:11px;color:var(--ui-muted)}
.message-files span,.invite-actions,.host-task-actions a{border-color:var(--ui-line)}
.join-card :is(label,legend){color:var(--ui-muted)}.join-card .color-choice{border-color:var(--ui-line);background:rgba(248,251,255,.75)}.join-card .color-choice:has(input:checked){border-color:#b4b09f;outline-color:#b4b09f;background:#f5f3eb}.join-card input[type=radio]{background:transparent;color:var(--ui-text)}
.host-widget-panel .host-widget-close,.attachment-icon,.chat-panel .light-avatar,.chat-panel .light-lamp{font-size:24px}
#player-database::backdrop{background:#4a484042}#player-database #close-players{font-size:24px}
.join-card .color-choice:has(input:checked){box-shadow:0 0 0 2px #b4b09f40}.join-card .color-choice:has(input:focus-visible){outline-color:#898978}
@media(max-width:360px){.multiplayer-bar button{padding-inline:6px}#invite-player{flex:1.15}#view-players{flex:.9}}
.multiplayer-bar{color:var(--ui-muted)}.multiplayer-bar i{background:#b4b09f}.performance-stats .prediction-toggle{color:var(--ui-text)}
.skill-tooltip .skill-tooltip-stats{font-size:11px}.challenge-hud,.challenge-hud.challenge-announcement{color:var(--ui-solid)}
.performance-stats .prediction-toggle[aria-pressed=true]{background:var(--ui-tab);border-color:#bbb8a8}
@media(max-width:520px),(pointer:coarse){:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.tv-panel,.join-card) :is(input:not([type=radio]),textarea,select){font-size:16px}}

/* Soft pale yellow revision: pale surfaces, neutral text and a compact type scale. */

:root{--green:#969686;--muted:var(--ui-muted);--line:var(--ui-line);}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.join-card,.cpb-dialog){border-color:#ddddd2;background:var(--ui-paper);box-shadow:var(--ui-shadow)}
:is(.keybind-settings,.feedback-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.cpb-dialog)::backdrop{background:#44443f38}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.join-card) button{border-color:#d2d2c4;background:var(--ui-soft);color:var(--ui-text)}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,[id="player-database"],.join-card) button:hover:enabled{background:#efefe0;border-color:#bebead}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,[id="player-database"],.join-card) :is(input:not([type=radio]),textarea,select){background:var(--ui-input);border-color:#d2d2c4;color:var(--ui-text)}
.player-chat header{background:#f5f5e9;border-bottom:1px solid #e1e1d7}.player-chat .chat-channels button{background:transparent;border:0;color:#6d6d65}.player-chat .chat-channels button[aria-pressed=true]{background:var(--ui-solid);color:#5b5b55;box-shadow:inset 0 -2px #adad91}.player-chat form{border-top-color:#e1e1d7}.player-chat form button{background:#f0f0da;color:#777768;border:1px solid #ceceba}.player-chat form button:hover:enabled{background:#e9e9cd}
.player-chat .player-chat-log{scrollbar-color:#d3d3c5 transparent}.player-chat-log p,.player-chat.is-feed .player-chat-log p{font-size:13px;line-height:1.5}.player-chat.is-feed .player-chat-log p{border:1px solid #e1e1d7}
.multiplayer-bar>span{background:rgba(255,255,248,.95);color:var(--ui-muted)}.multiplayer-bar button,.settings-toggle,.player-chat-toggle,.voice-controls button,.performance-stats,.skill-bar,.item-bar,.item-throw,.interaction-hint,.momentum-gauge{border-color:#ddddd2;box-shadow:0 3px 12px #52524a14}
.multiplayer-bar button[aria-pressed=true],.voice-controls button[aria-pressed=true],.performance-stats .prediction-toggle[aria-pressed=true]{background:#f0f0df;border-color:#adad91}.voice-controls button[aria-pressed=true]{box-shadow:inset 0 -2px #adad91}
.performance-stats .prediction-toggle{border-color:#d2d2c4;background:var(--ui-soft)}.performance-details summary:hover{background:#f0edde}.local-render-stats{border-color:#deded1}
.chat-panel .chat-header{background:#fcfcf5;border-bottom:1px solid #e1e1d7}.chat-panel .session-strip,.chat-panel.light-panel .session-strip,.chat-panel.workshop-light-panel .session-strip{background:#f5f5eb;border-color:#e1e1d7;color:#6d6d65}.chat-panel .avatar,.chat-panel .light-avatar,.chat-panel.workshop-light-panel .light-avatar{background:#f2f2e2;border-color:#d9d9c4;color:#95957d}
.chat-panel .message.user .message-text{background:#f7f7ee;border-color:#e1e1d7}.chat-panel .composer{background:#f8f8ef;border-color:#e1e1d7}.chat-panel .composer:focus-within{border-color:#adad91;box-shadow:0 0 0 2px #adad9125}.chat-panel .composer textarea{background:transparent!important}
.chat-panel .suggestion,.attachment{background:#f7f7ef;border-color:#e1e1d7}.message-author,.attachment-details strong,.attachment-icon,.welcome-mark,.thinking{color:#73736a}.composer :is(#send,#stop){background:#eeeed6;color:#747463;border-color:#cacaae}
.chat-panel .messages{scrollbar-color:#d3d3c5 transparent}.chat-panel.light-panel .light-actions button,.chat-panel.workshop-light-panel .light-actions button{background:var(--ui-soft);border-color:#d2d2c4}.chat-panel.light-panel .light-actions button[aria-pressed=true],.chat-panel.workshop-light-panel .light-actions button[aria-pressed=true]{background:#ebebcf;border-color:#b7b794}.chat-panel .light-lamp,.chat-panel[data-light-state=on] .light-lamp{background:#f5f5df;color:#99997e;box-shadow:0 0 16px #83807120}
.host-widget-tabs button{background:#f5f5e9;border-color:#e1e1d7}.host-widget-tabs button[aria-selected=true]{background:var(--ui-solid);border-color:#adad91;box-shadow:inset 0 -2px #adad91;color:#5b5b55}.host-task-actions a{background:#f6f6ef;border-color:#d2d2c4;color:#79705b}
.music-settings .music-mute{background:#eeeed6;border-color:#cacaae}.music-settings .music-mute[aria-pressed=true]{background:#f7f7ef;border-color:#e1e1d7}.keybind-settings .music-settings input[type=range]{accent-color:#a3a388;background:transparent;border:0}
.hat-closet-dialog button[aria-pressed=true]{background:#eeeed6;border-color:#adad91;box-shadow:inset 0 0 0 1px #adad91}
#player-database{background:var(--ui-paper);color:var(--ui-text);border-color:#ddddd2;box-shadow:var(--ui-shadow)}#player-database::backdrop{background:#44443f38}#player-database button{background:var(--ui-soft);border-color:#d2d2c4;color:var(--ui-text)}.database-table th{background:#f5f5eb;color:#686860}.database-table :is(th,td){border-color:#e2e2d5}
.join-card :is(label,legend){color:var(--ui-muted)}.guest-join{background:linear-gradient(145deg,#f2f2e9,#fcfcf6)}.join-card .color-choice{background:#fcfcf4;border-color:#e1e1d7}.join-card .color-choice:has(input:checked){background:#f1f1d9;border-color:#adad91;box-shadow:0 0 0 2px #adad9135}.join-card .color-choice:has(input:focus-visible){outline-color:#adad91}.join-card button{background:#eeeed6;border-color:#cacaae}.voice-consent-note{background:#f7f7ee}.voice-consent [data-enable]{background:#eeeed6}
.cpb-dialog{--cpb-paper:var(--ui-paper);--cpb-ink:var(--ui-text);--cpb-muted:var(--ui-muted);--cpb-rule:#e1e1d7;--cpb-soft:var(--ui-soft);--cpb-sage:var(--ui-tab);border-color:#ddddd2;background:var(--ui-paper)}.cpb-tabs{gap:5px}.cpb-tab{background:#f5f5e9;border-color:#e1e1d7;color:#6d6d65}.cpb-tab[aria-selected=true]{background:var(--ui-solid);border-color:#adad91;color:#5b5b55;box-shadow:inset 0 -2px #adad91}.cpb-button,.cpb-status{background:#f6f6ef;border-color:#d2d2c4}.cpb-entry:hover{background:#f7f7ee}.cpb-notice{background:#f5f5e4;color:#6d6d60}
.skill-bar .slap-skill,.skill-bar [data-skill=kick],.skill-bar [data-skill=sprint]{background:radial-gradient(circle at 65% 25%,#fffffa,#f8f8ed 65%,#f0f0dd);border-color:#e1e1d7}.skill-bar .skill-active,.item-slot[aria-pressed=true]{background:#f0f0d9;border-color:#adad91;box-shadow:0 0 0 2px #adad9135}.skill-hotkey,.skill-counter{background:#faf9f5f2;color:#6d6d60}.item-slot{background:#f9f9ef;border-color:#e1e1d7}.momentum-track,.throw-power>div{background:#e6e6d9}.momentum-track>span,.throw-power i{background:linear-gradient(90deg,#c5c5a4,#a6a683)}
.joystick{border-color:#d1d1bd;background:#faf9f55e}.joystick span{background:#d8d8c5cc}.tv-screen,.tv-screen video,.jukebox-video{background:#34342f}.tv-placeholder{color:#f6f6ef}.desktop-titlebar,.desktop-borderless .desktop-titlebar{background:rgba(251,251,241,.95);color:#6d6d65}
.welcome h3,.join-card h1{font-size:22px}.cpb-header h2,.cpb-detail-title,.challenge-panel h2,.chat-panel .light-content h3{font-size:16px}
.player-chat .player-chat-close,.chat-panel .icon-button,.host-widget-panel .host-widget-close,.challenge-close,.keybind-settings .settings-close,#player-database #close-players,.jukebox-panel .jukebox-close,.attachment-icon,.chat-panel .light-avatar,.chat-panel .light-lamp{font-size:24px}.player-chat form button,.composer :is(#send,#stop){font-size:24px}
#game-main :is(button,summary,input,textarea,select,.skill-slot):focus-visible,.cpb-dialog button:focus-visible{outline-color:#adad91}
@media(max-width:520px),(pointer:coarse){:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.tv-panel,.join-card) :is(input:not([type=radio]),textarea,select){font-size:16px}}

/* Keep keyboard focus clear while resting borders stay soft. */
#game-main :is(button,summary,input,textarea,select,.skill-slot):focus-visible,.cpb-dialog button:focus-visible{outline-color:#898978}

.voice-consent .voice-consent-note{font-size:var(--ui-font-body)}

/* Small supporting text stays readable on the pale selected surfaces. */
.chat-panel .session-strip,.chat-panel.light-panel .session-strip,.chat-panel.workshop-light-panel .session-strip{color:var(--ui-muted)}
.host-task-actions a,.join-card .color-choice:has(input:checked){color:var(--ui-text)}
.join-card .eyebrow,.skill-active .skill-counter,.skill-tooltip .skill-tooltip-stats,.skill-tooltip-state{color:var(--ui-muted)}

/* Shared emote bubble: the tail joins the flat side, clear of rounded corners. */
.npc-wave-emoji,.entity .player-afk{position:absolute;left:calc(100% + 18px);top:-24px;width:36px;height:34px;box-sizing:border-box;padding:0;display:grid;place-items:center;font-size:20px;line-height:1;background:var(--ui-solid);border:1px solid var(--ui-line);border-radius:11px;box-shadow:0 3px 9px #37363020;pointer-events:none;filter:none}
.npc-wave-emoji .npc-wave-glyph,.entity .player-afk .npc-wave-glyph{position:static;display:block;width:auto;height:auto;margin:0;padding:0;font-size:20px;line-height:1;transform:none}
.npc-wave-emoji::after,.entity .player-afk::after{content:"";position:absolute;left:-4px;top:50%;bottom:auto;width:6px;height:6px;box-sizing:border-box;background:inherit;border:0;border-left:1px solid var(--ui-line);border-bottom:1px solid var(--ui-line);transform:translateY(-50%) rotate(45deg)}
.npc-wave-emoji[hidden],.entity .player-afk[hidden]{display:none}

/* Keep the filled NPC header inside the panel's rounded silhouette. */
.chat-panel .chat-header{border-top-left-radius:calc(var(--ui-radius) - 1px);border-top-right-radius:calc(var(--ui-radius) - 1px)}
.chat-panel .attachment-details strong{color:var(--ui-text)}

/* Narrow override for current inline clock/status styles. No scene changes. */
.player-chat :is(.player-chat-clock, .time-command-response) {
  font-size: var(--ui-font-small, 11px) !important;
  line-height: 1.5;
}
.player-chat.is-feed :is(.player-chat-clock, .time-command-response) {
  color: #fff9eb !important;
  width: fit-content;
  max-width: calc(100% - 24px);
  border-radius: 3px;
  background: rgba(42, 39, 33, .76);
  box-shadow: 0 0 0 2px rgba(42, 39, 33, .76);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  overflow-wrap: anywhere;
}
/* A cream-backed open panel retains dark text and no extra plate. */
.player-chat.is-open :is(.player-chat-clock, .time-command-response) {
  color: var(--ui-muted, #6d6d65) !important;
}
@media (forced-colors: active) {
  .player-chat.is-feed :is(.player-chat-clock, .time-command-response) {
    color: CanvasText !important;
    background: Canvas;
    box-shadow: 0 0 0 2px Canvas;
    text-shadow: none;
  }
}
/* Inherit the existing Graphics dialog and native select theme. */
.model-quality-settings .shadow-quality-row {
  gap: 16px;
  margin-top: 18px;
}
.model-quality-settings .model-quality-row select {
  width: 116px;
  min-width: 116px;
  min-height: 44px;
}
.model-quality-settings .shadow-quality-help {
  margin: 6px 0 0;
  color: var(--ui-muted);
  font-size: var(--ui-font-small, 11px);
  line-height: 1.5;
}


/* Four reading views and a separate, explicit send audience. */
.player-chat[hidden], .player-chat .player-chat-log[hidden] { display: none !important; }
.player-chat.is-open { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.player-chat header { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 0; padding: 0 4px 0 0; }
.player-chat .chat-channels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; }
.player-chat .chat-channels [data-view] {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0; min-height: 48px; padding: 4px 2px; gap: 0;
  border: 0; border-radius: 8px 8px 0 0; background: transparent;
  color: var(--ui-muted); font-size: 13px; font-weight: 500; line-height: 18px;
  box-shadow: none;
}
.player-chat .chat-channels [data-view][aria-selected="true"] {
  background: var(--ui-solid); color: var(--ui-text); font-weight: 600;
  box-shadow: inset 0 -2px #b6aa7b;
}
.player-chat .chat-channels [data-view] > span {
  margin: 0; padding: 0 4px; min-width: 15px; border-radius: 5px;
  background: #e9e4d3; color: #67614f; font-size: 11px; line-height: 14px;
}
.player-chat .chat-channels [data-view] > span[hidden] { display: none; }
.player-chat.is-open .player-chat-log { flex: 1 1 auto; min-height: 64px; max-height: 210px; padding: 4px 12px; overflow: auto; }
.player-chat.is-open .player-chat-log > p { margin: 0; padding: 8px 0; }
.player-chat.is-open .player-chat-log > p + p { border-top: 1px solid #e2ddce80; }
.player-chat [data-channel="nearby"], .player-speech[data-channel="nearby"] { --channel-ink: #4f6670; --channel-paper: #edf2f3; --channel-line: #d6e1e4; }
.player-chat [data-channel="area"], .player-speech[data-channel="area"] { --channel-ink: #746346; --channel-paper: #f3eedf; --channel-line: #e3d8bd; }
.player-chat [data-channel="global"], .player-speech[data-channel="global"] { --channel-ink: #7d5665; --channel-paper: #f3e9ee; --channel-line: #e5d1da; }
.player-chat-feed-channel, .player-speech .speech-channel {
  display: inline-block; box-sizing: border-box; max-width: 100%;
  margin: 0 6px 2px 0; padding: 0 5px; border: 1px solid var(--channel-line, #d8d4c8);
  border-radius: 5px; background: var(--channel-paper, #efede5); color: var(--channel-ink, #69665b);
  font: 500 11px/16px Inter, "Segoe UI", system-ui, sans-serif;
  vertical-align: baseline; overflow-wrap: anywhere;
}
.player-chat .player-chat-time { float: right; display: inline; margin: 1px 0 2px 8px; font-size: 11px; line-height: 18px; color: var(--ui-muted); }
.player-chat form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
.player-chat .chat-send-target { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; grid-column: 1 / -1; margin: 0; color: var(--ui-muted); font-size: 11px; }
.player-chat .chat-send-target select { width: 100%; min-height: 44px; padding: 7px 8px; font-size: 13px; }
.player-chat form textarea { min-height: 60px; height: 60px; resize: vertical; }
.player-chat form button[type="submit"] { width: auto; min-width: 86px; padding: 8px 10px; font-size: 13px; font-weight: 600; line-height: 18px; }
.player-chat .chat-area-change { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; grid-column: 1 / -1; padding: 6px 8px; border: 1px solid #ded3b5; border-radius: 8px; background: #f4efdd; color: #746346; font-size: 11px; }
.player-chat .chat-area-change[hidden] { display: none; }
.player-chat .chat-area-change button { width: auto; min-height: 44px; padding: 6px 8px; font-size: 11px; line-height: 16px; }
.player-chat .chat-send-status { margin: 0; padding: 4px 12px 8px; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
.player-chat .chat-send-status:empty { display: none; }
.player-chat :is(.player-chat-clock, .time-command-response) { margin: 4px 12px; }
.player-chat .player-chat-clock:empty { display: none; }
.player-chat.is-feed :is(header, form) { display: none; }
.player-chat.is-feed .chat-send-status {
  width: fit-content; max-width: calc(100% - 24px); margin: 4px 12px; padding: 0;
  border-radius: 3px; background: rgba(42, 39, 33, .76); color: #fff9eb;
  box-shadow: 0 0 0 2px rgba(42, 39, 33, .76); text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  overflow-wrap: anywhere;
}
.player-chat.is-feed .player-chat-log { opacity: 1; transition: opacity 120ms ease-out; }
.player-chat.is-feed .player-chat-log.is-fading { opacity: 0; transition: opacity 450ms ease-out; }
.player-chat.is-feed .player-chat-log > p { flex-shrink: 0; }
/* Clamp message text only; the channel remains a readable separate line. */
.player-speech { display: block; padding: 8px 10px; -webkit-line-clamp: unset; }
.player-speech .speech-channel { display: table; margin: 0 0 4px; }
.player-speech .speech-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; font-size: 13px; line-height: 1.5; }
@media (max-width: 520px), (pointer: coarse) {
  .player-chat .chat-send-target select, .player-chat form textarea { font-size: 16px; }
}
@media (max-height: 540px) {
  .player-chat.is-open { top: 12px; bottom: auto !important; transform: none; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .player-chat.is-open .player-chat-log { flex: none; min-height: 64px; max-height: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .player-chat.is-feed .player-chat-log, .player-chat.is-feed .player-chat-log.is-fading { transition: none; }
}
@media (forced-colors: active) {
  .player-chat.is-feed .chat-send-status { color: CanvasText; background: Canvas; box-shadow: 0 0 0 2px Canvas; text-shadow: none; }
  .player-chat-feed-channel, .player-speech .speech-channel { color: CanvasText; background: Canvas; border-color: CanvasText; }
  .player-chat .chat-channels [aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* Compact-feed boundary treatment; activate through the reviewed DOM hooks. */
.player-chat.is-feed .player-chat-log[data-chat-edge="top"] {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--chat-edge-size, 18px));
  mask-image: linear-gradient(to bottom, transparent, #000 var(--chat-edge-size, 18px));
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
/* A fragment too small to read is visually omitted, without changing layout,
   message history, scroll position, pointer handling, or accessible text. */
.player-chat.is-feed .player-chat-log > p[data-chat-edge-fragment] { opacity: 0; }
@media (forced-colors: active) {
  .player-chat.is-feed .player-chat-log[data-chat-edge="top"] {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Stable pale night fill retains the base hue; the contour also covers dusk. */
.entity.night-exterior-label .entity-label {
  color:color-mix(in srgb,var(--name-label-base,#72816f) 35%,white);
  text-shadow:var(--name-label-contour);
}

/* Scoped Admin Tools addition. Append after the current Craftopee theme. */
.admin-tools-toggle {
  min-height:44px; padding:8px 12px; display:inline-flex; align-items:center; gap:7px;
  border:1px solid var(--ui-line,#e7e7de); border-radius:10px;
  background:var(--ui-paper,rgba(255,255,248,.95)); color:var(--ui-text,#5b5b55);
  font:500 13px/1.5 Inter,"Segoe UI",system-ui,sans-serif; white-space:nowrap;
}
.admin-tools-toggle[hidden],.admin-tools [hidden] { display:none!important; }
.admin-tools-toggle svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.6; }
.admin-tools {
  box-sizing:border-box; width:min(760px,calc(100vw - 24px)); max-width:none;
  max-height:calc(100dvh - 24px); padding:0; overflow:hidden;
  border:1px solid var(--ui-line,#e7e7de); border-radius:16px;
  background:var(--ui-paper,rgba(255,255,248,.95)); color:var(--ui-text,#5b5b55);
  box-shadow:var(--ui-shadow,0 6px 24px #52524a1a);
  font:400 13px/1.5 Inter,"Segoe UI",system-ui,sans-serif; color-scheme:light;
}
.admin-tools[open] { display:flex; flex-direction:column; }
.admin-tools::backdrop { background:#34394342; }
.admin-tools * { box-sizing:border-box; }
.admin-tools :is(h2,h3,h4,p) { margin:0; }
.admin-tools h2 { font-size:16px; line-height:1.3; font-weight:600; }
.admin-tools h3 { font-size:14px; line-height:1.4; font-weight:600; }
.admin-tools h4 { font-size:13px; font-weight:600; }
.admin-tools small,.admin-help { font-size:11px; line-height:1.5; color:var(--ui-muted,#6d6d65); }
.admin-tools-header { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid var(--ui-line,#e7e7de); }
.admin-tools-heading { flex:1; min-width:0; }
.admin-tools .admin-tools-heading p { margin-top:3px; }
.admin-tools :is(button,input,select,textarea) { font:inherit; color:inherit; }
.admin-tools button {
  min-height:44px; padding:8px 12px; border:1px solid var(--ui-line,#e7e7de);
  border-radius:9px; background:var(--ui-soft,#f8f8f2); touch-action:manipulation; cursor:pointer;
}
.admin-tools button:hover:enabled { background:var(--ui-tab,#f6f6eb); }
.admin-tools button:disabled { opacity:.5; cursor:default; }
.admin-tools :is(button,input,select,textarea):focus-visible,.admin-tools-toggle:focus-visible,.admin-matrix-scroll:focus-visible {
  outline:3px solid #898978; outline-offset:2px;
}
.admin-tools .admin-close { width:44px; height:44px; min-width:44px; padding:0; border:0; background:transparent; font-size:24px; color:var(--ui-muted,#6d6d65); }
.admin-tools input:not([type=checkbox]),.admin-tools select,.admin-tools textarea {
  min-width:0; min-height:44px; padding:9px 11px; border:1px solid var(--ui-line,#e7e7de);
  border-radius:9px; background:var(--ui-input,#f8f8f1);
}
.admin-tools input[type=checkbox] { width:17px; height:17px; margin:0; accent-color:#827696; }
.admin-tools input[type=checkbox]:disabled { opacity:1; }
.admin-tools-body { display:grid; grid-template-columns:134px minmax(0,1fr); min-height:0; overflow:hidden; }
.admin-tools-nav { display:flex; flex-direction:column; gap:4px; padding:12px 8px; border-right:1px solid var(--ui-line,#e7e7de); background:#f8f8ef70; }
.admin-tools-nav button { text-align:left; border-color:transparent; background:transparent; padding:9px 12px; white-space:nowrap; }
.admin-tools-nav button[aria-selected=true] { background:var(--ui-solid,#fffffc); border-color:var(--ui-line,#e7e7de); font-weight:600; }
.admin-tools-content { min-width:0; overflow:auto; overscroll-behavior:contain; padding:20px; max-height:min(474px,calc(100dvh - 164px)); }
.admin-tools [data-admin-panel] { display:flex; flex-direction:column; gap:18px; }
.admin-section-heading { display:flex; flex-direction:column; gap:4px; }
.admin-group { display:flex; flex-direction:column; gap:9px; }
.admin-row { display:flex; align-items:flex-end; gap:8px; flex-wrap:wrap; }
.admin-field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.admin-field-grow { flex:1; }
.admin-preset-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.admin-preset-grid button { display:flex; flex-direction:column; align-items:center; gap:1px; padding:9px 5px; }
.admin-preset-grid button[aria-pressed=true] { background:#f2f2e4; border-color:#d5d5c3; }
.admin-clock { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--ui-line,#e7e7de); border-radius:10px; background:#fffffa88; }
.admin-clock time { font-size:22px; line-height:1.2; font-weight:500; font-variant-numeric:tabular-nums; }
.admin-clock small { display:block; }
.admin-divider { border:0; border-top:1px solid var(--ui-line,#e7e7de); width:100%; margin:0; }
.admin-tools .admin-primary { background:#f0f0df; border-color:#dcdccb; color:#68685a; }
.admin-tools .admin-danger { color:#914c43; background:#f8ede8; border-color:#ead7cf; }
.admin-actions { display:flex; gap:8px; flex-wrap:wrap; }
.admin-note,.admin-confirm { padding:10px 12px; border:1px solid var(--ui-line,#e7e7de); background:#f8f8ef77; border-radius:9px; }
.admin-confirm { display:flex; flex-direction:column; gap:9px; border-color:#ead7cf; }
.admin-player-line { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.admin-player-line strong { font-size:13px; font-weight:600; overflow-wrap:anywhere; }
.admin-matrix-scroll { overflow:auto; max-width:100%; border:1px solid var(--ui-line,#e7e7de); border-radius:10px; overscroll-behavior:contain; }
.admin-permission-matrix { width:100%; min-width:506px; border-collapse:collapse; table-layout:fixed; font-size:11px; }
.admin-permission-matrix th { font-weight:600; color:var(--ui-muted,#6d6d65); background:#f7f7ee; }
.admin-permission-matrix th:first-child { width:176px; }
.admin-permission-matrix :is(th,td) { height:44px; padding:6px; border-bottom:1px solid var(--ui-line,#e7e7de); text-align:center; }
.admin-permission-matrix tbody tr:last-child :is(th,td) { border-bottom:0; }
.admin-permission-matrix :is(th:first-child,td:first-child) { text-align:left; padding-inline:11px; }
.admin-permission-matrix tbody th { background:#fffffa77; font-weight:500; font-size:13px; }
.admin-permission-matrix tbody td { padding-block:0; }
.admin-permission-matrix label { display:flex; justify-content:center; align-items:center; min-width:44px; min-height:44px; cursor:pointer; }
.admin-tools .admin-link-field { width:100%; }
.admin-log { display:flex; flex-direction:column; gap:0; list-style:none; padding:0; margin:0; }
.admin-log li { display:grid; grid-template-columns:54px minmax(0,1fr); gap:8px; padding:11px 0; border-bottom:1px solid var(--ui-line,#e7e7de); }
.admin-log time { font-size:11px; color:var(--ui-muted,#6d6d65); font-variant-numeric:tabular-nums; }
.admin-log p { overflow-wrap:anywhere; }
.admin-log small { display:block; margin-top:3px; }
.admin-tools-footer { min-height:45px; padding:11px 16px; border-top:1px solid var(--ui-line,#e7e7de); font-size:11px; color:var(--ui-muted,#6d6d65); }
.admin-tools-footer[data-state=error] { color:var(--ui-error,#914c43); }
@media(max-width:600px) {
  .admin-tools { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
  .admin-tools-body { grid-template-columns:minmax(0,1fr); }
  .admin-tools-nav { flex-direction:row; overflow-x:auto; padding:6px 8px; border-right:0; border-bottom:1px solid var(--ui-line,#e7e7de); }
  .admin-tools-nav button { flex:none; }
  .admin-tools-content { padding:16px; max-height:calc(100dvh - 211px); }
  .admin-tools-header { padding:9px 12px; }
  .admin-preset-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-tools input:not([type=checkbox]),.admin-tools select,.admin-tools textarea { font-size:16px; }
  .admin-field-grow { flex-basis:100%; }
}
@media(max-height:480px) {
  .admin-tools { overflow:auto; }
  .admin-tools-body,.admin-tools-content { overflow:visible; max-height:none; }
  .admin-tools-content { min-height:0; }
}
@media(forced-colors:active) {
  .admin-tools,.admin-tools button,.admin-tools-nav button[aria-selected=true] { border-color:ButtonText; }
}

/* New role row only: do not restyle or reflow the existing name label. */
.role-badge {
  display:inline-flex; align-items:center; justify-content:center; width:max-content;
  max-width:80px; padding:1px 4px; border:1px solid #d9d8d2; border-radius:4px;
  background:#f1f0eb; color:#62635f; font:700 9px/12px Inter,"Segoe UI",system-ui,sans-serif;
  letter-spacing:.35px; white-space:nowrap; text-shadow:none; box-shadow:0 1px 2px #171d2426;
  vertical-align:middle;
}
.role-badge { display:none!important; }
.entity .entity-label { position:relative; top:var(--name-accessory-offset,0px); }
.entity .player-speech { bottom:calc(100% + 8px - var(--name-accessory-offset,0px)); }
.role-badge[hidden] { display:none!important; }
.role-badge[data-role=ADMIN] { background:#75538f; border-color:#8968a0; color:#fff; }
.role-badge[data-role=NPC] { background:#466f97; border-color:#6386a8; color:#fff; }
.role-badge[data-role=VETERAN] { background:#ede3c7; border-color:#ddd0ab; color:#716039; }
.role-badge[data-role=CASUAL] { background:#e4eaf0; border-color:#d0d9e2; color:#556a7c; }
.role-badge[data-role=NEWBIE] { background:#eeece3; border-color:#ddd9cd; color:#686759; }
.role-badge[data-role=GUEST] { background:#ededef; border-color:#d9dadd; color:#686971; }
.entity > .role-badge {
  position:absolute; z-index:1; left:50%; top:var(--role-badge-top,-14px);
  transform:translateX(-50%); pointer-events:none;
}
@media(forced-colors:active) {
  .role-badge[data-role] { background:Canvas; color:CanvasText; border-color:CanvasText; box-shadow:none; }
}

.entity[data-game-role=NPC] .npc-badge{display:none}.admin-tools-content{overflow:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.admin-tools-status{padding:10px 16px}.admin-tools-nav{display:flex;gap:6px;overflow:auto;padding:10px}.admin-tools fieldset label{display:inline-flex;gap:6px;margin:5px}.role-onboarding{position:absolute;top:70px;left:50%;transform:translateX(-50%);z-index:20;background:#fffff8;padding:10px;border-radius:8px;font-size:12px}.role-onboarding[hidden]{display:none}.admin-player-row{padding-bottom:10px;border-bottom:1px solid #e7e7de}

/* Append after the existing chat theme. Only the composer changes. */
.player-chat form { display:block; padding:8px; }
.player-chat .chat-compose-row {
  display:grid; grid-template-columns:92px minmax(0,1fr) 44px;
  gap:6px; align-items:end; min-width:0;
}
.player-chat .chat-compose-row > :is(select,textarea,button[type="submit"]) {
  box-sizing:border-box; min-width:0; min-height:44px; margin:0;
  border-radius:9px; font-size:13px; line-height:20px;
}
.player-chat .chat-compose-row select {
  width:100%; height:44px; padding:7px 6px;
  background:var(--ui-input); color:var(--ui-text); border:1px solid var(--ui-line);
}
.player-chat .chat-compose-row textarea {
  display:block; width:100%; height:44px; min-height:44px; max-height:120px;
  padding:11px 8px; resize:none; overflow-y:auto;
}
.player-chat .chat-compose-row button[type="submit"] {
  display:grid; place-items:center; width:44px; min-width:44px; height:44px;
  padding:0; align-self:end; color:#707064; background:#f0f0da; border:1px solid #ceceba;
}
.player-chat .chat-compose-row .chat-submit svg {
  display:block; width:20px; height:20px; fill:none; stroke:currentColor;
  stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; pointer-events:none;
}
.player-chat form > .chat-area-change:not([hidden]) { margin-top:8px; }
@media(max-width:520px),(pointer:coarse) {
  .player-chat .chat-compose-row :is(select,textarea) { font-size:16px; }
}

/* User-selected option B. Append after current theme/mobile rules.
   The visible capsule is 32px; transparent vertical padding preserves the 44px button target. */
.interaction-hint {
  display:inline-flex; align-items:center; justify-content:center; gap:0;
  box-sizing:border-box; width:max-content; min-height:44px; padding:6px 0;
  border:0; border-radius:8px; background:transparent; box-shadow:none;
  color:#5b5b55; font:500 13px/18px Inter,"Segoe UI",system-ui,sans-serif;
}
.interaction-hint[hidden] { display:none; }
.interaction-hint > span.interaction-hint-surface {
  display:inline-flex; align-items:center; gap:6px; box-sizing:border-box;
  min-height:32px; padding:5px 8px; border:1px solid #deded1; border-radius:8px;
  background:rgba(255,255,248,.95); color:#5b5b55; box-shadow:0 2px 6px #52524a18;
  font:500 13px/18px Inter,"Segoe UI",system-ui,sans-serif; white-space:nowrap;
}
/* Reset the legacy first-span "Tap" pseudo-label on this new surface wrapper. */
.interaction-hint > span.interaction-hint-surface::before { content:none; }
.interaction-hint .interaction-hint-surface kbd {
  display:inline-grid; place-items:center; flex:none; box-sizing:border-box;
  width:max-content; min-width:20px; height:20px; padding:0 4px;
  border:1px solid #d5d5c6; border-radius:4px; background:#f6f6eb; color:#6c6c60;
  font:650 11px/1 Inter,"Segoe UI",system-ui,sans-serif;
}
.interaction-hint .interaction-hint-label { font:inherit; }
/* Preserve the existing narrow/coarse-pointer Tap presentation. */
@media(max-width:800px),(pointer:coarse) {
  .interaction-hint .interaction-hint-surface kbd { display:none; }
  .interaction-hint > span.interaction-hint-surface::before { content:'Tap'; font:inherit; }
}

/* Scoped Players and NPC Access layout. Append after current Admin Tools styles. */
.admin-tools .admin-player-card,.admin-tools .admin-npc-card {
  display:grid; gap:12px; min-width:0; margin:0; padding:12px;
  border:1px solid var(--ui-line,#e7e7de); border-radius:10px;
  background:rgba(255,254,249,.48);
}
.admin-tools .admin-player-identity,.admin-tools .admin-npc-heading { display:grid; gap:4px; min-width:0; }
.admin-tools .admin-player-name,.admin-tools .admin-npc-name {
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;
  min-width:0; margin:0; overflow-wrap:anywhere; color:var(--ui-text,#5b5b55);
  font-size:13px; font-weight:600; line-height:18px;
}
.admin-tools .admin-player-meta { display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; font-size:11px; line-height:16px; color:var(--ui-muted,#6d6d65); }
.admin-tools .admin-player-state { display:inline-flex; align-items:center; gap:5px; }
.admin-tools .admin-player-state::before { content:''; width:5px; height:5px; border-radius:50%; background:#a7a69f; }
.admin-tools .admin-player-state[data-online=true]::before { background:#758f9e; }
.admin-tools .admin-player-flag { padding:0 5px; border-radius:4px; background:#eee9dd; color:#75694e; }
.admin-tools .admin-player-flag[data-kind=banned] { background:#f3e5df; color:#8a564d; }
.admin-tools .admin-player-controls { display:grid; grid-template-columns:minmax(190px,.85fr) minmax(260px,1.15fr); align-items:end; gap:12px; min-width:0; }
.admin-tools .admin-player-role { display:grid; grid-template-columns:minmax(0,1fr) 92px; align-items:end; gap:6px; min-width:0; }
.admin-tools .admin-player-role label { display:grid; gap:4px; min-width:0; margin:0; color:var(--ui-muted,#6d6d65); font-size:11px; }
.admin-tools .admin-player-role select { width:100%; min-width:0; height:44px; padding:8px; font-size:13px; }
.admin-tools .admin-player-actions { display:grid; grid-template-columns:1fr 1fr; align-items:end; gap:6px; min-width:0; }
.admin-tools .admin-player-utility,.admin-tools .admin-player-moderation { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; min-width:0; }
.admin-tools .admin-player-controls button {
  width:100%; min-width:0; height:44px; min-height:44px; padding:7px 8px;
  white-space:nowrap; font-size:13px; line-height:18px;
}
.admin-tools .admin-player-moderation button { color:#8a564d; background:#f7eee8; border-color:#e7d8cf; }
.admin-tools .admin-player-card .admin-confirm { margin:0; }
.admin-tools .admin-npc-job,.admin-tools .admin-npc-scope,.admin-tools .admin-npc-empty { margin:0; font-size:11px; line-height:1.5; color:var(--ui-muted,#6d6d65); overflow-wrap:anywhere; }
.admin-tools .admin-npc-actions { display:grid; gap:4px; min-width:0; list-style:none; margin:0; padding:0; }
.admin-tools .admin-npc-action { min-width:0; margin:0; font-size:13px; line-height:18px; overflow-wrap:anywhere; }
.admin-tools .admin-npc-role-line { display:flex; flex-wrap:wrap; align-items:baseline; gap:5px 7px; min-width:0; }
.admin-tools .admin-npc-role-caption { font-size:11px; color:var(--ui-muted,#6d6d65); }
.admin-tools .admin-npc-roles { display:flex; flex-wrap:wrap; gap:4px; min-width:0; margin:0; padding:0; list-style:none; }
.admin-tools .admin-access-role { padding:1px 5px; border:1px solid var(--ui-line,#e7e7de); border-radius:4px; background:var(--ui-soft,#f8f8f2); color:var(--ui-muted,#6d6d65); font-size:11px; line-height:16px; font-weight:500; }
.admin-tools .admin-npc-scope { padding-left:8px; border-left:2px solid #d8d2bf; }
.admin-tools .admin-npc-empty { padding-top:9px; border-top:1px solid var(--ui-line,#e7e7de); }
@media(max-width:700px) {
  .admin-tools .admin-player-controls { grid-template-columns:minmax(0,1fr); gap:10px; }
}
@media(max-width:600px),(pointer:coarse) {
  .admin-tools .admin-player-role select { font-size:16px; }
}
@media(max-width:420px) {
  .admin-tools .admin-player-card,.admin-tools .admin-npc-card { padding:10px; gap:10px; }
  .admin-tools .admin-player-actions { grid-template-columns:minmax(0,1fr); }
}

/* Keep the full name in textContent and title; truncate only its presentation. */
.player-chat .player-chat-log strong {
  display:inline-block;
  box-sizing:border-box;
  max-inline-size:min(120px,40%);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  vertical-align:middle;
}

/* Scoped editor inside the existing pale .admin-npc-card shell. */
.admin-tools .admin-npc-access-editor { display:grid; gap:10px; min-width:0; }
.admin-tools .admin-npc-access-intro { margin:0; font-size:11px; line-height:1.5; color:var(--ui-muted); overflow-wrap:anywhere; }
.admin-tools .admin-npc-interaction { min-inline-size:0; margin:0; padding:0; border:0; }
.admin-tools .admin-npc-interaction + .admin-npc-interaction { padding-top:10px; border-top:1px solid var(--ui-line); }
.admin-tools .admin-npc-interaction legend {
  width:100%; min-width:0; padding:0; margin:0 0 6px;
  font-size:13px; font-weight:500; line-height:18px; color:var(--ui-text); overflow-wrap:anywhere;
}
.admin-tools .admin-npc-role-grid {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,92px),1fr));
  gap:4px; min-width:0;
}
/* Overrides the older generic .admin-tools fieldset label margin. */
.admin-tools .admin-npc-role-grid > label {
  display:flex; align-items:center; gap:6px; min-width:0; min-height:44px;
  margin:0; padding:6px 7px; border:1px solid transparent; border-radius:7px;
  background:var(--ui-soft); color:var(--ui-text); font-size:11px; line-height:16px;
  cursor:pointer; touch-action:manipulation;
}
.admin-tools .admin-npc-role-grid > label:has(input:checked) { background:var(--ui-tab); border-color:var(--ui-line); }
.admin-tools .admin-npc-role-grid > label:has(input:disabled) { cursor:default; }
.admin-tools .admin-npc-role-grid input[type=checkbox] { flex:0 0 17px; width:17px; height:17px; margin:0; }
.admin-tools .admin-npc-role-name { min-width:0; overflow-wrap:anywhere; }
.admin-tools .admin-npc-fixed-note { display:block; color:var(--ui-muted); font-size:11px; line-height:16px; }
.admin-tools .admin-npc-access-lock {
  display:grid; gap:4px; min-width:0; padding:8px 10px;
  border:1px solid var(--ui-line); border-radius:8px; background:var(--ui-soft);
  color:var(--ui-muted); font-size:11px; line-height:1.5; overflow-wrap:anywhere;
}
.admin-tools .admin-npc-access-lock strong { color:var(--ui-text); font-size:11px; font-weight:600; }
.admin-tools .admin-npc-save {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px;
  padding-top:10px; border-top:1px solid var(--ui-line); min-width:0;
}
.admin-tools .admin-npc-access-status { min-height:16px; margin:0; color:var(--ui-muted); font-size:11px; line-height:16px; overflow-wrap:anywhere; }
.admin-tools .admin-npc-access-status[data-state=error] { color:var(--ui-error); }
.admin-tools .admin-npc-access-buttons { display:grid; grid-template-columns:repeat(2,minmax(76px,1fr)); gap:6px; }
.admin-tools .admin-npc-access-buttons button { min-width:0; min-height:44px; padding:7px 12px; font-size:13px; line-height:18px; white-space:nowrap; }
@media(max-width:600px) {
  .admin-tools .admin-npc-save { grid-template-columns:minmax(0,1fr); }
  .admin-tools .admin-npc-access-buttons { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(forced-colors:active) {
  .admin-tools .admin-npc-role-grid > label:has(input:checked),.admin-tools .admin-npc-access-lock { border-color:ButtonText; }
}

.admin-tools .admin-npc-save{grid-template-columns:minmax(0,1fr) auto auto}.admin-tools .admin-npc-save button{min-height:44px;min-width:76px}@media(max-width:600px){.admin-tools .admin-npc-save{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-tools .admin-npc-save>span{grid-column:1/-1}}

/* Destination text stays readable in player controls. */
.admin-tools .admin-player-utility,.admin-tools .admin-player-moderation{grid-column:1/-1}
.admin-tools .admin-teleport-destination{grid-column:1/-1}
.admin-tools .admin-teleport-destination select{width:100%;min-width:0}

.entity.night-exterior-label .entity-label{--name-label-contour:0 1px 2px #070c1280}

/* Approved canonical white/gray theme. Change tokens here to update every UI. */
:root{--ui-paper:rgba(255,255,255,.98);--ui-solid:#fff;--ui-input:#f2f2f2;--ui-soft:#ededed;--ui-tab:var(--ui-soft);--ui-line:#c8c8c8;--ui-text:#606060;--ui-muted:#737373;--ui-hover:#e7e7e7;--ui-focus:#777;--ui-accent-strong:#b5b5b5;--ui-blue:var(--ui-muted);--ui-error:#865c55;--ui-error-surface:#faf2ef;--ui-shadow:0 5px 20px #00000012;--ui-backdrop:#00000042;--ui-primary:#dedede;--ui-disabled:#f7f7f7;--ui-disabled-line:#ddd;--ui-radius:20px;--ui-font-body:14px;--ui-font-small:12px;--ui-font-heading:18px;--ui-font:"Segoe UI",Arial,sans-serif}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card):not(.alpha-blackjack){background:var(--ui-paper)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;box-shadow:var(--ui-shadow)!important;font:400 var(--ui-font-body)/1.5 var(--ui-font)!important;border-radius:var(--ui-radius)}
:is(.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle){font-family:var(--ui-font)!important;color:var(--ui-text);border-color:var(--ui-line)}
:is(.maze-controls,.area-load-status,.interaction-hint-surface,.performance-stats,.desktop-titlebar){background:var(--ui-paper)!important;color:var(--ui-text)!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) :is(button,input:not([type=radio]):not([type=checkbox]),select,textarea),:is(.area-return,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle){background:var(--ui-input)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;font:400 var(--ui-font-body)/1.5 var(--ui-font)!important;min-height:44px;border-radius:10px;box-sizing:border-box;max-width:100%}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) button{background:var(--ui-soft)!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) button:hover:enabled{background:var(--ui-hover)!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) :is(button,input,select,textarea):focus-visible{outline:2px solid var(--ui-focus)!important;outline-offset:3px}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) button:disabled{opacity:1!important;color:var(--ui-muted)!important;cursor:default}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) :is(button[aria-selected=true],button[aria-pressed=true],.color-option:has(input:checked)){background:var(--ui-tab)!important;border-color:var(--ui-focus)!important;font-weight:600!important;box-shadow:none!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) :is(h1,h2){font-size:16px!important;font-weight:600!important;color:var(--ui-text)!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card) :is(header h1,header h2),:is(.area-travel-panel,.owner-password-dialog,.irpg-class-dialog,.irpg-progress-panel,.wb-spell-dialog,.alpha-class-dialog)>h2,.area-travel-panel>strong,.admin-tools-heading,.entry-card h1,.loading-card h2,.settings-section-title{font-size:var(--ui-font-heading)!important;font-weight:600!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle):not(.alpha-blackjack) h3{font-size:16px!important;font-weight:600!important;color:var(--ui-text)!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) :is(small,.support,.meta,.design-note,.admin-help,.irpg-support,.intro,.note,.section-label,.state,.tier,.concept,.chat-footnote,.chat-empty,.chat-player-time){font-size:var(--ui-font-small)!important;color:var(--ui-muted)!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) :is(header,footer,nav,.details,.existing-npc-card,.admin-player-card,.admin-npc-card,.design-draft,.character-preview,.irpg-class-preview,.light-panel,.workshop-light-panel,.welcome,.composer,.cpb-entry,.database-tools){border-color:var(--ui-line)!important;background:var(--ui-solid)!important;color:var(--ui-text)!important;box-shadow:none!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) :is(.error,.chat-error,[role=alert]){background:var(--ui-error-surface)!important;color:var(--ui-error)!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) .eyebrow{display:none!important}
:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card)::backdrop{background:var(--ui-backdrop)!important}
:is(.admin-tools,.wb-delivery-placeholder,#developer-tools-dialog) :is(p,label,legend,output,pre,.badge,.developer-player-area,.admin-clock){color:var(--ui-text);border-color:var(--ui-line)}
:is(.admin-clock,.admin-group,.wb-delivery-placeholder .badge,#developer-tools-dialog pre){background:var(--ui-soft)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important}
/* Felt, card art, character colors, cooldown/resource meters and world labels remain semantic artwork. */
.alpha-blackjack .casino-header,.alpha-blackjack .casino-control-panel,.alpha-blackjack .casino-status-bar{background:var(--ui-solid)!important;color:var(--ui-text)!important;padding:8px;border-radius:10px}
.alpha-blackjack :is(.casino-range,.blackjack-turn,.casino-status){color:var(--ui-muted)!important;font-size:var(--ui-font-small)!important}
.alpha-blackjack .casino-header :is(h2,p,strong,span){color:var(--ui-text)!important}
@media(max-width:600px){:is(.player-chat,.chat-panel,.invite-panel,.host-widget-panel,.challenge-panel,.keybind-settings,.feedback-panel,.jukebox-panel,.voice-consent,.tv-panel,.hat-closet-dialog,#player-database,.join-card,.light-panel,.workshop-light-panel,.admin-tools,#developer-tools-dialog,.owner-password-dialog,#design-placement-hud,.area-travel-panel,.area-rpg-panel,.irpg-class-dialog,.irpg-progress-panel,.cpb-dialog,.wb-spell-dialog,.wb-delivery-placeholder,.casino-dialog,.alpha-class-dialog,.entry-card,.loading-card,.multiplayer-bar,.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar,.maze-controls,.area-load-status,.area-return,.interaction-hint-surface,.performance-stats,.desktop-titlebar,.settings-toggle,.player-chat-toggle,.admin-tools-toggle,#developer-tools-toggle) :is(input:not([type=radio]):not([type=checkbox]),select,textarea){font-size:16px!important}.alpha-blackjack .casino-control-panel{flex-wrap:wrap}.alpha-blackjack .casino-membership,.alpha-blackjack .casino-actions{flex:1 1 100%}}

/* Local component aliases and secondary surfaces use the same canonical theme. */
.cpb-dialog{--cpb-paper:var(--ui-paper);--cpb-ink:var(--ui-text);--cpb-muted:var(--ui-muted);--cpb-rule:var(--ui-line);--cpb-soft:var(--ui-soft);--cpb-sage:var(--ui-focus)}
:is(.player-speech,.talk-bubble,.area-load-status,.area-return){background:var(--ui-paper)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;font-family:var(--ui-font)!important}
:is(.player-speech,.talk-bubble) .speech-text{font-size:var(--ui-font-body)}
:is(.light-panel,.workshop-light-panel) :is(p,.chat-footnote,.session-strip,.light-sync,.light-help){color:var(--ui-muted)!important;font-size:var(--ui-font-small)!important}
:is(.light-panel,.workshop-light-panel) .session-strip{background:var(--ui-soft)!important;border-color:var(--ui-line)!important}
.cpb-eyebrow{display:none!important}
:is(.admin-tools,#developer-tools-dialog) :is(label,legend,.admin-field,.npc-role-option){font-size:var(--ui-font-body)!important}
:is(.admin-tools,#developer-tools-dialog,.entry-card) label:has(input[type=checkbox]){min-height:44px;align-content:center}
:is(.wb-delivery-placeholder,.admin-tools) :is(.status,.admin-tools-status){color:var(--ui-muted)!important}
/* Neutralize backdrop only; retain the light-state lamp and resource/world effects. */
#entry-screen{background:var(--ui-soft)}

.alpha-blackjack .casino-table-header{background:var(--ui-solid);color:var(--ui-text);padding-inline:8px;border-radius:10px}
.alpha-blackjack .casino-summary{background:var(--ui-solid);color:var(--ui-text);padding:4px 8px;border-radius:10px}
.alpha-blackjack :is(.casino-summary-label,.casino-escrow-line,.casino-own-total,.casino-own-result,.casino-phase,.casino-bet-timer){color:var(--ui-text)!important}
.alpha-blackjack .casino-rules-disclosure summary{background:var(--ui-soft)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;font-size:var(--ui-font-body);min-height:44px;align-content:center}
.alpha-blackjack .casino-rules{background:var(--ui-solid);color:var(--ui-text);border-color:var(--ui-line)}
.alpha-blackjack .casino-dealer h3{color:#edf3df!important;font-size:12px!important}
:is(.admin-tools,#developer-tools-dialog,.wb-delivery-placeholder,.light-panel,.workshop-light-panel) :is(p:not([role=alert]),label,legend,output,pre){color:var(--ui-text)!important}

.alpha-blackjack .casino-scroll{grid-template-rows:54px minmax(0,1fr) auto}
.alpha-blackjack .casino-bet-countdown{color:var(--ui-text)!important}
.alpha-blackjack .casino-dealer h3{color:#edf3df!important}
.alpha-blackjack .casino-scroll{grid-template-rows:54px minmax(0,1fr) auto!important}@media(max-width:600px){.alpha-blackjack .casino-control-panel{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto auto!important;height:auto!important;min-height:0;gap:6px}.alpha-blackjack .casino-membership,.alpha-blackjack .casino-actions{width:100%;min-width:0}}
:is(.skill-bar,.item-bar,.irpg-skills-bar,.wb-skill-bar){background:var(--ui-paper)!important;border-color:var(--ui-line)!important}.developer-player-menu{background:var(--ui-solid)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important}

/* Toolbar is a layout wrapper, not a panel; individual buttons retain shared theme. */
.multiplayer-bar{background:transparent!important;box-shadow:none!important}

/* Shared desktop tool geometry: Saved Players' existing 780px CSS width.
   760px height follows the reference ratio (975x950 image at 1.25 scale). */
:root{--ui-tool-width:780px;--ui-tool-height:760px}
:is(#player-database,.admin-tools,#developer-tools-dialog){box-sizing:border-box;position:fixed;inset:12px 12px calc(12px + var(--desktop-bottom,0px));margin:auto;width:min(var(--ui-tool-width),calc(100vw - 24px))!important;height:min(var(--ui-tool-height),calc(100dvh - var(--desktop-bottom,0px) - 24px))!important;max-width:none!important;max-height:none!important;overflow:hidden!important}
:is(#player-database,.admin-tools,#developer-tools-dialog)[open]{display:flex!important;flex-direction:column}
:is(#player-database,.admin-tools,#developer-tools-dialog)>:is(header,nav,footer,p,.database-heading,.database-tools,.admin-tools-header,.admin-tools-status){flex:none}
.admin-tools .admin-tools-body{flex:1;min-height:0;overflow:hidden!important}
.admin-tools .admin-tools-content{min-height:0;max-height:none!important;overflow:auto!important}
#developer-tab-panel{flex:1;min-height:0;max-height:none!important;overflow:auto!important}
#player-database .database-table{flex:1;min-height:0;max-height:none!important;overflow:auto}
/* Hide only the visual clock readout; day/night and command feedback remain active. */ .player-chat .player-chat-clock{display:none!important}

:is(.invite-panel,.entry-card,.loading-card,.admin-tools,#developer-tools-dialog,.owner-password-dialog,.wb-delivery-placeholder) :is(button.primary,button.action,button[type=submit]):not(:disabled){background:var(--ui-primary)!important;border-color:var(--ui-focus)!important;font-weight:600!important}
:is(.invite-panel,.entry-card,.loading-card,.admin-tools,#developer-tools-dialog,.casino-dialog,.keybind-settings,.wb-delivery-placeholder) button:disabled:not(.theme-exempt){background:var(--ui-disabled)!important;border-color:var(--ui-disabled-line)!important;border-style:dashed!important;color:var(--ui-muted)!important}
:root{--ui-compact-width:420px}.ui-tool-compact,.invite-panel{width:min(var(--ui-compact-width),calc(100vw - 24px))}.ui-tool-compact{height:auto;max-height:calc(100dvh - 24px);overflow:auto}

#temporary-invite:not(:disabled){background:var(--ui-primary)!important;border-color:var(--ui-focus)!important;font-weight:600!important}

:root{--ui-travel-width:960px;--ui-travel-height:600px}

/* Shared Wide sizing: existing Blackjack dimensions, used by Project Board. */
:root{--ui-wide-width:1440px;--ui-wide-height:860px;--ui-wide-inset:8px;--ui-wide-small-inset:4px}
