/* Compact controls leave the stage to the characters. */
.message.log.story{color:#59452f;border-left-color:#b78334;background:#f4e6c94d}
.preset-preview .guaranteed-roles{display:flex;align-items:center;gap:5px}.preset-preview .guaranteed-art{width:24px;border-width:1px;border-radius:7px}
.brand-wolf{width:36px;height:36px;filter:drop-shadow(0 2px 0 #49385877)}
.identity-row{display:flex;align-items:end;gap:12px}.identity-row .field{flex:1}.choose-character{position:relative;border:0;padding:0;background:none;flex:none}.choose-character .portrait{width:64px}.choose-character>.avatar-edit{position:absolute;bottom:0;right:0;border-radius:50%;background:#2e8581;color:white;width:23px;height:23px;display:grid;place-items:center;border:2px solid #fff3d7}
.room-toolbar{display:flex;align-items:center;gap:4px;background:#fff4dfee;color:#63492e;border:1px solid #eed299;border-radius:15px;padding:6px 8px;flex:none}.room-identity{min-width:0;flex:1}.room-identity .title{font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.room-code{background:none;color:#2e7b79;border:0;min-height:28px;padding:0;font-weight:900;font-size:14px;letter-spacing:2px}.room-code span{letter-spacing:0}.room-toolbar .icon-button{padding:7px;color:#735634}.room-toolbar .icon-button:hover{background:#ddc8a7}.room-toolbar .exit-button{align-self:center}
.ready-mark,.speaker-mark,.wolf-mark{position:absolute;width:23px;height:23px;border-radius:50%;display:grid;place-items:center;z-index:3;border:2px solid #fff5db;box-shadow:0 2px 4px #173b4b55;pointer-events:none}.ready-mark{right:0;bottom:0}.ready-mark.is-ready{background:#21865f;color:white}.ready-mark.is-waiting{background:#ffe7a5;color:#876329}.ready-mark .ui-icon{width:15px;height:15px;stroke-width:3}.speaker-mark{right:0;top:0;background:#188c84;color:white;visibility:hidden}.speaker-mark .ui-icon{width:14px;height:14px}.player[data-speaking=true] .speaker-mark{visibility:visible}.player[data-speaking=true] .portrait{box-shadow:0 0 0 3px #8af2d4,0 0 16px #31e5bfbb}.wolf-mark{left:0;bottom:0;background:#8b3f64;border-color:#ffd6e7}.wolf-mark img{width:100%;height:100%;border-radius:50%}.player.wolf .portrait{border-color:#ffafd3;box-shadow:0 0 0 3px #7d3b68,0 3px 12px #461d4a99}.player.wolf .name{background:#682f57;color:#fff0f8;border-color:#ffb5db}.host-crown{left:-1px;top:-1px;right:auto}.selection-mark{right:-1px;bottom:-1px;top:auto}.player.wolf.selected .portrait{outline:3px solid #ffc744;outline-offset:3px}
.unread-badge{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 4px;margin-left:5px;border-radius:10px;background:#cb4e47;color:#fff;font-size:10px;font-weight:900;line-height:1}.chat-tab:has(.unread-badge){color:#9c3b34}.chat-tabs{align-items:center}.chat-tabs #unlock-audio{margin-left:auto;font-size:9px;max-width:105px}
.avatar-choices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:15px 8px;margin-top:18px}.avatar-choice{position:relative;min-width:0;padding:2px;border:2px solid transparent;border-radius:50%;background:none}.avatar-choice .portrait{width:100%}.avatar-choice.chosen{border-color:#268b7f;background:#a7e4c9}.avatar-choice>.ui-icon{position:absolute;width:22px;height:22px;bottom:-3px;right:0;background:#278772;color:white;border-radius:50%;padding:3px}.language-choices{display:flex;flex-direction:column;gap:12px}.narration-toggle{display:flex;align-items:center;justify-content:space-between;gap:16px;font-weight:800;padding:12px 0}.narration-toggle>span{display:flex;align-items:center;gap:8px}.narration-toggle input{width:24px;height:24px;accent-color:#298b7c}.audio-details{margin:12px 0;padding:8px;border:1px solid var(--line);border-radius:12px}.audio-details summary{padding:5px;cursor:pointer;font-size:12px}.audio-details[open] summary{margin-bottom:10px}#dialog[data-kind=audio] .button{margin-top:10px}#narration-volume,#effects-volume,#music-volume{accent-color:#2a8a7a;box-shadow:none;padding:0;background:none;border:0;min-height:38px}
.preset-field{border:0;margin:0 0 16px;padding:0}.preset-field>legend{font-size:12px;font-weight:800;margin-bottom:8px}.preset-cards{display:grid;grid-template-columns:1fr 1fr;gap:9px}.preset-card{position:relative;display:flex;align-items:center;gap:8px;min-width:0;padding:11px 9px;border:2px solid #dfcaa9;border-radius:16px;background:linear-gradient(140deg,#fff9e9,#f0dfc4);cursor:pointer;box-shadow:0 3px 0 #9a774629}.preset-card:has(input:checked){border-color:#2c8a7d;background:linear-gradient(130deg,#e6f6df,#a7dac9);box-shadow:0 3px 0 #2d7868}.preset-card:has(input:focus-visible){outline:3px solid #267b9b;outline-offset:2px}.preset-card input{position:absolute;opacity:0;width:1px;height:1px}.preset-card .portrait{width:48px;border-width:2px;border-radius:12px}.preset-card>span{min-width:0;flex:1}.preset-card strong{display:block;font-size:14px}.preset-card small{display:block;font-size:10px;line-height:1.3;margin-top:3px}.preset-card i{display:none;position:absolute;right:-4px;top:-6px;background:#2c8a7d;color:white;border:2px solid #fff5db;border-radius:50%;width:21px;height:21px;place-items:center}.preset-card i svg{width:14px;height:14px}.preset-card:has(input:checked) i{display:grid}.preset-preview{margin-top:12px;padding:10px 12px;border-radius:12px;background:#e9e2cd;font-size:11px;line-height:1.5}.preset-preview strong{display:block;color:#286a57;margin-top:4px}.preset-preview small{display:block;margin-top:4px;font-size:10px}.settings-note{font-size:11px}html[lang^=zh]{font-family:'Microsoft YaHei','Noto Sans SC','Segoe UI',sans-serif}html[lang^=zh] .label,html[lang^=zh] .eyebrow{letter-spacing:0}
@media(max-width:760px){
 #app{padding-left:8px;padding-right:8px}.topbar{min-height:46px!important;gap:3px}.brand{font-size:15px;letter-spacing:.4px;gap:5px;padding:2px;min-height:40px}.brand-wolf{width:29px;height:29px}.connection{font-size:8px;max-width:72px}.topbar .icon-button{min-width:34px;width:34px;min-height:36px;height:36px;padding:5px;font-size:12px}.topbar #guide{min-width:30px;width:30px;height:32px;min-height:32px;font-size:18px}.topbar .ui-icon{width:18px;height:18px}
 .room-toolbar{min-height:49px;padding:3px 7px;border-radius:11px;gap:1px}.room-identity .title{font-size:14px}.room-code{font-size:12px;min-height:25px;letter-spacing:1.5px}.room-toolbar .icon-button{min-width:36px;width:36px;min-height:40px;height:40px}.room-toolbar .ui-icon{width:18px;height:18px}
 .table-scene{padding:8px!important;gap:6px!important;--avatar-size:55px}.roster-panel{margin-top:0;gap:5px!important}.roster{gap:5px 4px!important;align-content:center}.roster-title .label{font-size:8px!important}.roster-title .roster-count{font-size:9px;padding:2px 6px}.roster .player{gap:2px;padding:0}.roster .player .avatar-wrap{width:var(--avatar-size)!important;max-width:100%!important;padding:2px!important}.roster .player .portrait{border-width:3px}.roster .player .name{font-size:10px!important;padding:2px 5px!important;line-height:1.15;display:block;white-space:nowrap;text-overflow:ellipsis;max-width:100%}.roster .player .status{display:none!important}.ready-mark,.speaker-mark,.wolf-mark{width:20px;height:20px;border-width:1.5px}.ready-mark .ui-icon,.speaker-mark .ui-icon{width:13px;height:13px}.roster .host-crown,.roster .selection-mark{width:19px;height:19px}.roster .host-crown svg,.roster .selection-mark svg{width:13px;height:13px}
 .table-sidebar{flex:1 1 0}.messages{min-height:32px}.chat-tab{min-height:32px!important;font-size:11px}.lobby-hint{display:none}.self-bar{padding:4px 8px!important;gap:8px}.self-bar .role-art{width:38px!important}.self-copy strong{font-size:16px!important}.self-copy small{display:none}.self-copy .eyebrow{font-size:7px!important}.self-copy .eyebrow svg{width:10px;height:10px}.role-more{padding:4px}.phase-line{padding:5px 8px!important}.phase-medallion{width:28px;height:28px}.phase{font-size:18px!important}.clock{font-size:20px!important}.phase-line .label{font-size:8px}.phase-line .exit-button{min-height:32px;height:32px}.phase-line .progress{margin-top:3px;height:3px}
 .identity-row{gap:10px}.choose-character .portrait{width:52px}.choose-character>.avatar-edit{width:20px;height:20px;font-size:13px}.preset-card{padding:8px 6px;gap:6px;min-height:83px}.preset-card .portrait{width:43px}.preset-card strong{font-size:12px}.preset-card small{font-size:9px}.preset-preview{font-size:10px;padding:8px}.settings-grid{gap:9px}.settings-grid .field{font-size:10px}.settings-grid select{font-size:13px;min-height:40px;padding:6px}.avatar-choices{gap:12px 6px}.avatar-choice .portrait{border-width:2px}
}
@media(max-width:350px){.brand{font-size:13px}.connection{max-width:53px;font-size:7px}.topbar .icon-button{min-width:31px;width:31px}.brand-wolf{width:27px;height:27px}.preset-card .portrait{width:36px}.preset-card small{font-size:8px}}
@media(max-width:760px){
 .chat-tabs,.compose,.locked-chat,.actions{flex:none}.chat-area{flex:1 1 0}.host-crown{transform:none}
 body[data-compact=short] .self-bar{padding:3px 7px!important;min-height:30px}.self-bar .self-copy{min-width:0}
 body[data-compact=short] .self-bar .role-art{width:24px!important;border-width:2px}
 body[data-compact=short] .self-copy .eyebrow,body[data-compact=short] .self-bar .role-more{display:none}
 body[data-compact=short] .self-copy strong{font-size:13px!important}
 body[data-compact=short] .roster .player .name{font-size:8px!important;padding:1px 4px!important}
 body[data-compact=short] .roster-title .roster-count{font-size:8px;padding:1px 5px}
 body[data-compact=short] .locked-chat{display:none}
 body[data-compact=short] .messages{min-height:28px}
}
/* Shared shell and phone-first refinements. */
.avatar-art{border-radius:12%}
.avatar-choice{border-radius:14%}
.roster .player{width:100%;max-width:100px;justify-self:center}
.roster .player .avatar-wrap{max-width:100%}
.topbar{height:62px;min-height:62px;flex-shrink:0}
.choose-character .portrait{position:relative;display:block;aspect-ratio:1;height:auto}
.identity-row .field{min-width:0}
.actions{order:0;border-top:0;border-bottom:2px dashed #e4d1b0;padding-top:0;padding-bottom:9px}
.chat-area{order:1;position:relative}
.latest-messages{position:absolute;right:8px;bottom:53px;z-index:2;min-height:30px;border:1px solid #b8d6ce;border-radius:16px;padding:4px 10px;background:#e3f5ec;color:#225e58;font-size:11px;font-weight:800;box-shadow:0 2px 8px #183c5425}
.latest-messages[hidden]{display:none}
.connection-mark{position:absolute;right:0;bottom:0;z-index:4;width:24px;height:24px;border:2px solid #fff3d7;border-radius:50%;background:#b65316;color:#fff;display:grid;place-items:center}
.connection-mark svg{width:16px;height:16px}
.player.disconnected .connection-label{display:block!important;max-width:100%;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:#fff0d2;color:#843a10;line-height:1.25;border-radius:6px;padding:1px 3px}
.player.disconnected .ready-mark,.player.disconnected .speaker-mark{display:none}
.clock.urgent{color:#a13327!important;background:transparent;border-radius:0;padding:0;letter-spacing:0}
body[data-scene=night] .clock.urgent{color:#ffb38f!important}
.clock.urgent:before{content:'◷';margin-right:3px}
@media(max-width:760px){
 .topbar{height:46px!important;min-height:46px!important;max-height:46px;flex:0 0 46px}
 .roster .player{max-width:var(--avatar-size,96px)}
 .hero{padding:0;min-height:0!important;overflow:hidden}
 .hero-kicker,.hero>p{display:none}
 .hero-characters{width:112%;max-width:none;max-height:none!important;object-fit:contain;margin:0 -6% -5px}
 .game-logo{font-size:clamp(34px,10vw,47px)!important;margin:0 0 -5px}
 .welcome-panel .panel-heading{display:none}
 .choose-character .portrait{width:58px}
 .table-sidebar .actions{padding-top:0!important;padding-bottom:6px}
 .player.disconnected .connection-label{font-size:8px;max-height:12px}
 .connection-mark{width:20px;height:20px;border-width:1.5px}
 .connection-mark svg{width:13px;height:13px}
 /* The keyboard leaves a compact, horizontally scrollable village strip. */
 .typing .table-scene{display:flex!important;padding:3px 6px!important;gap:0!important}
 .typing .roster-panel{display:flex!important;margin:0}
 .typing .roster-title,.typing .room-toolbar{display:none}
 .typing .roster{display:flex;overflow-x:auto;gap:8px!important;justify-content:flex-start}
 .typing .roster .player{flex:0 0 40px}
 .typing .roster .player .avatar-wrap{width:32px!important}
 .typing .roster .player .name{font-size:8px!important;padding:0 2px!important}
 .typing .roster .player .connection-label{font-size:7px;max-height:10px}
 .typing .host-crown,.typing .ready-mark,.typing .connection-mark{width:14px;height:14px}
 .typing .host-crown svg,.typing .ready-mark svg,.typing .connection-mark svg{width:10px;height:10px}
}

/* Personal scenery follows the shared day/night transition. */
.world-day{background-image:linear-gradient(180deg,#3a52653b,#123c4b50),var(--scene-day)}
:root[data-night-ready=true] .world-night{background-image:linear-gradient(#17345155,#13273c66),var(--scene-night)}
.table-scene::before{background-image:linear-gradient(180deg,#28474538 0%,#24473512 55%,#1b424e50),var(--scene-day);background-position:center 62%}
:root[data-night-ready=true] .table-scene::after{background-image:linear-gradient(180deg,#132e5110,#14264020),var(--scene-night);background-position:center 62%}
.background-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.background-choice{padding:4px;border:2px solid #d2bd98;border-radius:15px;overflow:hidden;background:#fff8e8;color:#61472f;min-width:0;cursor:pointer}
.background-choice.chosen{border-color:#248c83;background:#def5e9;box-shadow:0 0 0 2px #248c8320}
.background-choice img{display:block;width:100%;height:auto;aspect-ratio:3/4;object-fit:cover;border-radius:10px}
.background-choice>span{display:flex;align-items:center;justify-content:center;gap:3px;min-height:34px;font-size:12px;font-weight:800;line-height:1.2}
.background-choice .ui-icon{width:15px;height:15px;flex:none}
.room-meta{display:flex;align-items:center;gap:10px;min-width:0}
.room-ready{font-size:11px;white-space:nowrap;color:#6a604b}
.invite-button{display:flex;align-items:center;justify-content:center;gap:4px;background:#e0eee1;border:0;border-radius:9px;min-height:40px;padding:6px 9px;font-size:12px;font-weight:800;color:#34635a;cursor:pointer}
.hero-characters{width:96%;max-width:100%;margin:2px auto 0;object-fit:contain;object-position:center bottom;mask-image:linear-gradient(#000 0%,#000 84%,transparent 100%)}
@media(max-width:760px){
 .room-toolbar{min-height:46px;padding:2px 6px;gap:2px}
 .room-identity .title{font-size:13px;line-height:17px}
 .room-meta{gap:5px;height:21px}
 .room-code{font-size:10px;letter-spacing:1px;min-height:21px;padding:0}
 .room-ready{font-size:9px}
 .room-toolbar .icon-button{min-width:34px;width:34px;height:40px;min-height:40px}
 .invite-button{flex-direction:column;gap:0;min-width:44px;padding:3px;font-size:9px;line-height:13px}
 .room-toolbar .invite-button .ui-icon{width:18px;height:18px}
 .background-choices{gap:6px}.background-choice>span{font-size:10px}
 .hero-characters{flex:0 1 auto;height:auto;width:96%;max-width:100%;max-height:calc(100% - 74px)!important;margin:4px auto 0;object-position:center bottom}
}
/* Dense numbered cards and one shared match panel. */
.avatar-art{background-image:url('art-avatars-cutout.png');background-color:var(--avatar-color,#ffe6a4)}
.invite-button{background:transparent;color:inherit}
.invite-button:hover{background:#ffffff20}
.avatar-color-label{font-size:12px;font-weight:800;margin-top:12px}
.avatar-colors{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px;margin:8px 0 12px}
.color-swatch{display:grid;place-items:center;aspect-ratio:1;min-width:0;min-height:30px;background:var(--swatch);border:2px solid #74583d55;border-radius:9px;color:#203d3e;cursor:pointer}
.color-swatch[aria-pressed=true]{border-color:#226e68;outline:2px solid #226e68;outline-offset:1px}
.color-swatch .ui-icon{width:21px;height:21px}
.avatar-choices{margin-top:10px;gap:7px}
.roster{grid-template-columns:repeat(var(--columns,4),minmax(0,1fr));gap:3px!important;justify-content:center}
.roster .player{aspect-ratio:1;width:100%;max-width:128px;padding:0;gap:0;align-self:start;isolation:isolate}
.roster .player .avatar-wrap{width:100%!important;max-width:100%!important;height:100%;padding:0!important;overflow:hidden;border-radius:12%}
.roster .player .portrait{height:100%;border-width:2px;box-shadow:none}
.roster .player .name{position:absolute;top:2px;left:2px;right:2px;z-index:3;max-width:calc(100% - 4px);font-size:11px!important;padding:1px 3px!important;border:0;border-radius:6px 6px 3px 3px;line-height:15px;white-space:nowrap;text-align:left;box-shadow:none;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.roster .host-crown{top:21px;left:2px}
.roster .ready-mark,.roster .connection-mark{bottom:2px;right:2px;top:auto}
.roster .speaker-mark{bottom:2px;left:2px;top:auto;right:auto}
.roster .wolf-mark{top:21px;right:2px}
.roster .player .status{display:none!important}
.roster .player .connection-label{display:block!important;position:absolute;bottom:2px;left:2px;right:23px;margin:0;padding:1px 2px;font-size:8px;line-height:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;z-index:3}
.match-heading,.match-details{display:flex;align-items:center;gap:7px;min-width:0}
.match-heading .grow{min-width:0}
.match-heading .phase{font-size:19px;line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.match-round{display:block;padding:0;border:0;background:none;color:inherit;opacity:.82;font:inherit;font-size:9px;line-height:13px;cursor:pointer;white-space:nowrap}
.match-details{margin-top:4px;justify-content:space-between}
.role-chip{display:flex;align-items:center;gap:5px;min-width:0;border:0;border-radius:7px;padding:2px 5px 2px 0;background:none;color:inherit;text-align:left;font:inherit;cursor:pointer}
.role-chip .role-art{width:28px;flex:0 0 28px;border-width:1px;border-radius:7px}
.role-chip strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.role-chip>.ui-icon{width:15px;height:15px;flex:none;opacity:.8}
.match-count{font-size:10px;line-height:14px;white-space:nowrap;flex:none}
.match-panel .progress{height:3px;margin-top:3px}
@media(max-width:760px){
 .table-scene{padding:5px!important;gap:4px!important}
 .roster{grid-template-columns:repeat(var(--columns,4),minmax(0,var(--avatar-size,80px)));gap:2px!important}
 .roster .player{width:var(--avatar-size,80px);max-width:none}
 .roster .player .name{font-size:10px!important;line-height:14px;padding:1px 3px!important}
 .roster .host-crown,.roster .wolf-mark{top:19px}
 .phase-line.match-panel{padding:4px 6px!important;border-radius:12px}
 .match-heading{gap:6px}
 .match-heading .phase-medallion{width:27px;height:27px;flex:none}
 .match-heading .phase{font-size:17px;line-height:19px}
 .match-heading .clock{font-size:22px;letter-spacing:0}
 .match-details{margin-top:2px;gap:3px}
 .role-chip .role-art{width:23px;flex-basis:23px}
 .role-chip strong{font-size:12px}
 .match-count{font-size:9px}
 body[data-compact=short] .roster .player .name{font-size:9px!important;padding:0 2px!important;line-height:12px}
 body[data-compact=short] .roster .host-crown,body[data-compact=short] .roster .wolf-mark{top:15px}
 body[data-compact=short] .match-heading .phase{font-size:15px;line-height:17px}
 body[data-compact=short] .match-heading .clock{font-size:19px}
 body[data-compact=short] .role-chip strong{font-size:11px}
 body[data-compact=short] .role-chip .role-art{width:20px;flex-basis:20px}
 .typing .roster .player{width:40px;max-width:40px;flex:0 0 40px;aspect-ratio:1}
 .typing .roster .player .avatar-wrap{width:40px!important}
 .typing .roster .player .name{font-size:8px!important;line-height:10px;padding:0 1px!important}
 .typing .roster .host-crown,.typing .roster .wolf-mark{top:13px}
 .typing .roster .player .connection-label{display:none!important}
}
.room-toolbar .invite-button{color:#735634}.room-toolbar .invite-button:hover{background:#ddc8a7}

/* Numbered names have their own row, on the player's chosen card color. */
.roster .player{--name-height:18px;display:grid;grid-template-rows:var(--name-height) minmax(0,1fr);justify-items:center;background:var(--avatar-color,#ffe6a4);border:2px solid #fff0ca;border-radius:10px;overflow:hidden}
.roster .player.self{border-color:#3dafa3}
.roster .player.selected{border-color:#ed9d22;box-shadow:inset 0 0 0 2px #ed9d22}
.roster .player .name{position:static;grid-row:1;width:100%;max-width:100%;height:var(--name-height);line-height:var(--name-height);padding:0 3px!important;margin:0;border-radius:0;background:transparent!important;color:#172331!important;text-shadow:none;box-shadow:none;font-weight:800}
.roster .player .avatar-wrap{grid-row:2;width:auto!important;height:100%;max-width:100%!important;aspect-ratio:1;border-radius:0;align-self:end;justify-self:center}
.roster .player .portrait{width:100%;height:100%;border:0;border-radius:0;background-color:transparent;box-shadow:none}
.roster .host-crown{top:1px!important}
/* Keep the team badge below the name and clear of the card edge and face. */
.roster .wolf-mark{top:4px!important;left:4px;right:auto;bottom:auto;width:min(24px,calc((var(--avatar-size,96px) - var(--name-height)) * .4));height:auto;aspect-ratio:1;border:0;border-radius:0;background:transparent;box-shadow:none}
.roster .wolf-mark img{display:block;border-radius:0}
.typing .roster .wolf-mark{top:2px!important;left:2px;width:12px}
.roster .player[data-speaking=true]{box-shadow:inset 0 0 0 2px #1f9658}
.roster .player[data-speaking=true] .portrait{box-shadow:none}
.roster .player[data-react=selected] .avatar-wrap,.roster .player[data-react=ready] .avatar-wrap,.roster .player[data-speaking=true] .avatar-wrap{animation:none;transform:none}
.roster .player[data-react=selected] .avatar-art,.roster .player[data-react=ready] .avatar-art{animation:character-cheer .48s cubic-bezier(.2,.7,.3,1) both}
.roster .player[data-speaking=true] .avatar-art{animation:character-speaking .65s ease-in-out infinite}
.avatar-owner{font-weight:800;overflow-wrap:anywhere;color:#61472f}
.dialog-head h2{min-width:0;overflow-wrap:anywhere}
.dialog-head .icon-button{flex:none}

/* Active matches use a single, three-part HUD instead of the brand header. */
body[data-playing=true] .topbar{display:none!important}
/* Equal side tracks keep the clock at the geometric center. */
.phase-line.match-panel{display:grid;grid-template-columns:minmax(0,1fr) 100px minmax(0,1fr);column-gap:4px;align-items:center;padding:4px 6px!important}
.match-panel>.role-chip{width:100%;min-width:0;min-height:44px;padding:0;gap:4px;margin:0}
.match-panel .role-chip .role-art{width:38px;flex:0 0 38px;border-radius:7px}
.match-panel .role-chip strong{white-space:normal;overflow-wrap:anywhere;font-size:15px;line-height:17px}
.match-time{min-width:0;display:grid;grid-template-rows:14px 30px;align-items:center;text-align:center}
.match-panel .clock{display:block;min-width:0;text-align:center;font-size:28px!important;line-height:30px;letter-spacing:-1px;white-space:nowrap;font-variant-numeric:tabular-nums}
.match-panel .clock.urgent:before{display:none}
.match-panel .clock[data-recovering=true]{font-size:11px!important;line-height:13px;white-space:normal;letter-spacing:0}
.match-context{min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:2px}
.match-phase{min-width:0;text-align:center;display:flex;align-items:baseline;justify-content:center;gap:3px}
.match-panel .phase{font-size:12px!important;line-height:14px;white-space:nowrap}
.match-phase small{font-size:9px;line-height:12px;white-space:nowrap}
.match-buttons{display:flex;gap:0;flex:none}
.match-buttons .icon-button,.match-buttons .exit-button{width:44px;min-width:44px;height:44px;min-height:44px;padding:8px}
.match-connection{grid-column:1/-1;text-align:center;font-size:11px;line-height:18px;color:#7c3417;background:#fff0ca;border-radius:5px}
.topbar .icon-button{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
.room-toolbar .icon-button,.room-toolbar .invite-button{width:44px;min-width:44px;height:44px;min-height:44px}
/* Phase is already visible in the compact panel; keep its clock unobscured. */
body[data-playing=true] #phase-transition{display:none}

/* A translucent surface preserves contrast while letting the scene show. */
.table-sidebar{background:linear-gradient(145deg,#fff8e8ed,#f7e7cbe0);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);color:#513b2c;transition:background-color .6s,color .6s,border-color .6s}
.table-sidebar .muted,.table-sidebar .locked-chat,.table-sidebar .action-hint{color:#66513f}
body[data-scene=night] .table-sidebar{background:linear-gradient(145deg,#1b2b49ed,#243555e6);border-color:#8c91b3;color:#f9f0dd}
body[data-scene=night] .table-sidebar .muted,body[data-scene=night] .locked-chat,body[data-scene=night] .action-hint{color:#e2e4ef}
body[data-scene=night] .table-sidebar .voice-line{color:#c3cce0}
body[data-scene=night] .chat-tab{color:#c3cce0}
body[data-scene=night] .chat-tab[aria-selected=true]{color:#ffe4a4;border-color:#ebbd69}
body[data-scene=night] .chat-tabs,body[data-scene=night] .table-sidebar .actions{border-color:#7586a257}
body[data-scene=night] .message{background:#34476be6;color:#f6f0e3;border-color:#768ab1}
body[data-scene=night] .message strong{color:#ffe0a0}
body[data-scene=night] .message.log{background:#12213b80;color:#e4e8f4}
body[data-scene=night] .message.private{background:#4a3d66dd;color:#fff0dc}
body[data-scene=night] .message.story{background:#2f425fe6;color:#fff0c6;border-color:#c8aa72}
.actions .row:has(.confirm-button)>.button:not(.confirm-button){flex:0 0 27%;min-width:44px}
.actions .confirm-button{min-width:0;flex:1;padding:4px 8px!important}
.confirm-copy{display:flex;flex-direction:column;align-items:stretch;justify-content:center;min-width:0;width:100%;line-height:1.25}
.confirm-targets{display:flex;justify-content:center;align-items:center;min-width:0;gap:3px;font-size:.92em}
.confirm-targets>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0}
.confirm-targets>b{flex:none}
@media(max-width:760px){
 .roster .player{--name-height:17px}
 .roster .player .name{line-height:var(--name-height);font-size:10px!important}
 body[data-compact=short] .roster .player{--name-height:15px}
 body[data-compact=short] .roster .player .name{line-height:var(--name-height);padding:0 2px!important}
 .typing .roster .player{--name-height:11px}
 .typing .roster .player .avatar-wrap{width:auto!important}
 .typing .roster .player .name{font-size:8px!important;line-height:11px}
 .typing .phase-line.match-panel{display:none}
}
@media(prefers-reduced-motion:reduce){.table-sidebar{transition:none}}
@media(max-width:350px){
 .match-phase .phase-medallion{display:none}
 .match-phase .phase{font-size:14px!important}
}

/* Slim lobby: room name above the code and its copy control. */
.room-toolbar{gap:2px!important;min-height:52px;padding:3px 6px!important}
.room-identity{min-width:0;flex:1;display:flex;flex-direction:column;align-items:stretch;justify-content:center}
.room-identity button{font:inherit;text-align:left;background:none;border:0;color:inherit;padding:0;cursor:pointer}
.room-identity .room-code{display:flex;align-items:center;gap:5px;min-height:23px;font-size:17px;line-height:23px;letter-spacing:1px;font-weight:700;color:#2e7b79}
.room-code .ui-icon{width:19px;height:19px;flex:none}
.room-identity .room-title{min-height:25px;font-size:22px!important;line-height:25px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.full-room-name{overflow-wrap:anywhere}
.room-toolbar .invite-button{width:82px;min-width:82px;font-size:13px;padding:2px!important;gap:3px;flex-direction:row;background:none}
.room-toolbar .invite-button .ui-icon{width:25px;height:25px}
.avatar-art{background-image:none;animation:none!important;transform:none!important}
.avatar-sprite{display:block;width:100%;height:100%;overflow:hidden;transform-origin:50% 95%}
.roster .player .avatar-wrap{width:100%!important;aspect-ratio:auto}
.roster .player .portrait{width:100%!important}
.roster .player .avatar-sprite,.profile-portrait .avatar-sprite{animation:character-idle var(--idle-duration,4000ms) ease-in-out var(--idle-delay,0ms) infinite}
.roster .player[data-react=selected] .avatar-sprite,.roster .player[data-react=ready] .avatar-sprite{animation:character-cheer .48s cubic-bezier(.2,.7,.3,1) both}
.roster .player[data-speaking=true] .avatar-sprite{animation:character-speaking .65s ease-in-out infinite}
.roster .player.dead .avatar-sprite,.roster .player.disconnected .avatar-sprite{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.avatar-sprite{animation:none!important}}
@media(max-width:380px){
 .match-panel .role-chip .role-art{width:30px;flex-basis:30px}
 .match-panel .role-chip strong{font-size:13px;line-height:15px}
}

/* Fill the compact headers with legible content, retaining 44px controls. */
.room-toolbar>.icon-button .ui-icon,.match-buttons .ui-icon{width:26px;height:26px}
@media(max-width:350px){
 .room-identity .room-code{font-size:15px;letter-spacing:.5px}
 .room-toolbar .invite-button{width:76px;min-width:76px;font-size:12px}
 .room-identity .room-title{font-size:18px!important}
}
/* Death is a public game state, independent of connectivity and chosen color. */
.roster .player.dead{background:#d3d9dddb;border-color:#a3afb8}
.roster .player.dead .portrait{filter:grayscale(1);opacity:.62}
.roster .player.dead .avatar-sprite{animation:none!important;transform:none}
.roster .eliminated-mark{left:2px;right:auto;bottom:2px;top:auto;width:min(clamp(21px,6.8vw,30px),calc((100% - 8px)/2));height:auto;aspect-ratio:1;background:transparent;border:0;border-radius:0;z-index:4;box-shadow:none}
.roster .eliminated-mark .death-icon{width:100%;height:100%}
.roster .player.dead .speaker-mark{left:2px;right:auto;top:1px;bottom:auto}
.roster .player.dead .connection-label{left:calc(clamp(21px,6.8vw,30px) + 5px);right:24px}
.roster .player.dead .connection-mark{width:min(24px,calc((100% - 8px)/2));height:auto;aspect-ratio:1}
.roster .player.dead .connection-mark svg{width:75%;height:75%}

/* Shared button panels use the surrounding header's day/night palette. */
.room-toolbar,.match-panel{--header-control-fill:#fff8e6;--header-control-border:#b9925e99;--header-control-hover:#f3dfbc}
body[data-scene=night] .match-panel{--header-control-fill:#43587888;--header-control-border:#bac8df99;--header-control-hover:#536b90}
.room-toolbar>.icon-button,.room-toolbar>.invite-button,.match-buttons>.icon-button{border:1px solid var(--header-control-border);border-radius:10px;background:var(--header-control-fill);color:inherit}
.room-toolbar>.icon-button:hover,.room-toolbar>.invite-button:hover,.match-buttons>.icon-button:hover{background:var(--header-control-hover)}
.match-buttons{gap:2px}
.log-phase{font-size:11px;font-weight:800;line-height:16px;margin:8px 0 3px;padding:1px 3px;color:inherit;opacity:.8;border-bottom:1px solid #b9925e55}
.message.log-important{font-weight:700}
.message .log-player{display:inline;min-width:0;min-height:0;padding:0;border:0;border-radius:0;background:none;color:inherit;font:inherit;font-weight:700;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
.message.log-error{border-left:3px solid #b34b36}
body[data-scene=night] .message.log-error{border-color:#ffb38f}

/* Settings choices stay in the game's cream/teal palette on mobile browsers. */
dialog select[hidden]{display:none}
.themed-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-width:0;min-height:44px;padding:8px 10px;background:#fffcf5;color:#49382e;border:2px solid #dbc5a7;border-radius:12px;font:inherit;font-size:14px;text-align:left;cursor:pointer;box-shadow:inset 0 2px 4px #7d54280b}
.themed-select-trigger[aria-expanded=true]{border-color:#329c98;background:#fff8e6}
.themed-select-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.select-chevron{width:16px;height:16px;flex:none}
.themed-select-options{position:fixed;z-index:10;overflow:auto;overscroll-behavior:contain;padding:4px;background:linear-gradient(145deg,#fff9eb,#f5e5c8);color:#513b2c;border:2px solid #d8b57c;border-radius:13px;box-shadow:0 7px 20px #172b3f45;scrollbar-width:thin}
.themed-select-option{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:44px;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:inherit;font:inherit;font-size:15px;text-align:left;cursor:pointer}
.themed-select-option .ui-icon{width:19px;height:19px;flex:none;visibility:hidden;stroke-width:2.5}
.themed-select-option[aria-selected=true]{background:#d5eedb;color:#245f45;font-weight:800}
.themed-select-option[aria-selected=true] .ui-icon{visibility:visible}
.themed-select-option[data-active=true]{outline:2px solid #329c98;outline-offset:-2px}
@media(hover:hover){.themed-select-option:hover{background:#e1eee0}}

/* A compact home utility row and a single lobby header. */
.topbar[hidden],.brand[hidden],.connection[hidden],.room-connection[hidden],.match-connection[hidden]{display:none!important}
body[data-scene=menu] .topbar{justify-content:flex-end}
.connection{display:flex;align-items:center;gap:4px;margin-right:auto;color:#fff3d6;font-size:11px;max-width:none!important}
.connection .ui-icon,.room-connection .ui-icon,.match-connection .ui-icon{width:16px;height:16px;flex:none}
[data-status=connecting]>.ui-icon{animation:connection-spin 1.2s linear infinite}
@keyframes connection-spin{to{transform:rotate(360deg)}}
.room-connection,.match-connection{display:flex;align-items:center;justify-content:center;gap:5px;flex:none;background:#fff0ca;color:#783c21;padding:3px 6px;border-radius:6px;font-size:11px;line-height:18px}
.room-code-line{display:flex;align-items:center;gap:6px;min-width:0}
.room-access{display:inline-flex;color:#477b73;flex:none}
.room-access .ui-icon{width:15px;height:15px}
#dialog[data-kind=room-options] .button{width:100%;gap:8px}
#dialog[data-kind=room-options] p{margin:0}
/* Compact room sharing uses the existing parchment frame and touch targets. */
#dialog[data-kind=invite]{max-width:420px}
#dialog[data-kind=invite] #dialog-content{gap:14px}
.share-room{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fffaf0a0}
.share-room>img{flex:none;width:48px;height:48px}
.share-room-info{min-width:0;flex:1}
.share-room h3{margin:0;font-size:18px;line-height:1.25;overflow-wrap:anywhere;color:var(--ink)}
.share-code{display:flex;align-items:center;gap:10px;min-height:44px;border:0;padding:4px 0 0;background:none;color:#267d80;font-weight:900;font-size:19px;letter-spacing:2px}
.share-code .ui-icon{width:18px;height:18px}
.share-apps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.share-app{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;padding:10px 2px;border:1px solid var(--line);border-radius:13px;background:#fff9ed;color:var(--ink);font:inherit;font-size:12px;font-weight:700;text-decoration:none}
.share-app:hover{background:#f6e8cf}
.share-symbol{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;color:white}
.share-symbol .ui-icon{width:28px;height:28px}
.share-symbol.whatsapp{background:#25d366}.share-symbol.telegram{background:transparent}.share-symbol.more{background:#e3efdf;color:#37695b}
.share-symbol .brand-share-icon{display:block;width:42px;height:42px;object-fit:contain}
.share-symbol.whatsapp .brand-share-icon{width:28px;height:28px}
.share-link{display:flex;align-items:center;gap:4px;min-width:0;padding:3px 4px 3px 10px;border:1px solid var(--line);border-radius:12px;background:#fffaf0}
.share-link input{min-width:0;width:100%;flex:1;border:0;background:none;color:var(--dim);font-size:13px;min-height:44px;text-overflow:ellipsis}
.share-link .icon-button{flex:none;color:#267d80}
.share-manual textarea{width:100%;min-width:0;resize:vertical;border:1px solid var(--line);border-radius:10px;padding:9px;font:inherit;font-size:14px;line-height:1.5;background:#fffaf0;color:var(--ink)}
.share-manual textarea:focus-visible{outline:3px solid #098c9c;outline-offset:2px}
#share-status{color:#34635a}
.game-logo{width:min(100%,500px);padding:0;text-shadow:none!important;transform:none!important;line-height:0!important}
.game-logo img{display:block;width:100%;height:auto;object-fit:contain}
.hero-characters{aspect-ratio:1;object-fit:contain}
.lobby-screen .roster .player{--badge-size:clamp(13px,calc(var(--avatar-size,96px) * .23),22px)}
.lobby-screen .roster :is(.host-crown,.ready-mark,.speaker-mark,.connection-mark){width:var(--badge-size)!important;height:var(--badge-size)!important;border-width:1px}
.lobby-screen .roster :is(.host-crown,.ready-mark,.speaker-mark,.connection-mark) .ui-icon{width:70%!important;height:70%!important}
@media(max-width:760px){
 body[data-scene=menu] .topbar{height:44px!important;min-height:44px!important;max-height:44px;flex-basis:44px}
 .screen.menu{gap:6px;padding-top:0}
 .screen.menu .hero{flex:1 1 0;min-height:0!important;padding:0;gap:0;justify-content:flex-start;overflow:hidden}
 .screen.menu .game-logo{flex:0 1 auto;width:96%;min-height:0;max-height:100px!important;margin:0!important;display:flex;align-items:center;justify-content:center}
 .screen.menu .game-logo img{width:100%;height:100%;max-height:100px;object-fit:contain}
 .screen.menu .hero-characters{flex:1 1 0;width:100%;height:0;min-height:0;max-height:none!important;margin:0;object-position:center;mask-image:none}
 .screen.menu .hero-badges{display:flex!important;flex:none;min-height:23px;margin-top:2px}
 .screen.menu .welcome-column{gap:7px}
 .screen.menu .welcome-panel{padding:11px 13px;gap:8px}
 .screen.menu .hero-kicker,.screen.menu .hero>p{display:none}
 .typing .lobby-screen .roster .player{--badge-size:12px}
}
@media(max-width:760px) and (max-height:650px){
 .screen.menu .game-logo,.screen.menu .game-logo img{max-height:70px!important}
}
@media(max-width:760px) and (min-height:780px){
 .screen.menu .welcome-panel{padding:14px 15px;gap:10px}
 .screen.menu .welcome-panel .button{min-height:50px;font-size:15px}
 .screen.menu .welcome-panel .field input{min-height:48px;height:48px}
 .screen.menu .mobile-rooms-link{min-height:48px}
 .screen.menu .game-logo,.screen.menu .game-logo img{max-height:115px!important}
}
@media(max-width:760px) and (min-height:900px){
 .screen.menu .welcome-panel{padding:16px;gap:12px}
 .screen.menu .welcome-panel .button{min-height:54px;font-size:16px}
 .screen.menu .welcome-panel .field input{min-height:52px;height:52px}
 .screen.menu .mobile-rooms-link{min-height:52px}
 .screen.menu .game-logo,.screen.menu .game-logo img{max-height:130px!important}
}
