/* Nine selector games only. Keep board art, data scale, and exported canvas coordinates. */
body[data-tm-game-ui]{
  --tm-game-title:32px;--tm-game-section:24px;--tm-game-body:16px;
  --tm-game-helper:14px;--tm-game-input:16px;--tm-game-primary:48px;
  --tm-game-secondary:44px;--tm-game-input-height:48px;
  font-family:var(--tm-font-ui);font-size:var(--tm-game-body);line-height:1.5;
}
body[data-tm-game-ui] :is(h1,#title,.game-heading h1,.game-intro h1){font-family:var(--tm-font-display)!important;font-size:var(--tm-game-title);font-weight:700;line-height:1.2}
body[data-tm-game-ui] :is(h2,.side h2,.role-heading h2,.ready-summary h2,.result-summary h2){font-family:var(--tm-font-display)!important;font-size:var(--tm-game-section);font-weight:700;line-height:1.25}
body[data-tm-game-ui] :is(h3,h4,h5,h6):not(.team-group>h3,.role-result>h3){font-family:var(--tm-font-ui)!important;font-size:18px;line-height:1.4}
/* Interface prose, not speech bubbles, tickets, result numbers, or race HUD. */
body[data-tm-game-ui] :is(#intro,.intro p,#purposeHint,.how p,#confirm-body,.exit-dialog>p,.usage-guide p,.story-overlay p,.intro-copy p,.tiny-story,.result-panel .ending){font-family:var(--tm-font-ui)!important;font-size:var(--tm-game-body);font-weight:400;line-height:1.5}
body[data-tm-game-ui] :is(.hint,.notice,.privacy,.input-help,.input-caption,.input-caption span,.role-labels,.role-heading>span,.total,.progress,.result-caption,.result-reaction,.storage-notice,.demo-note,.balance-note,.play-warning,.drawing-hint,.drawing-progress,.error,#error,.error-banner,.game-guide,.guide-section,footer){font-size:var(--tm-game-helper);line-height:1.5}
/* Exclude illustration/board choices: their hit areas and type are scene geometry. */
body[data-tm-game-ui] button:not(:is(.mascot,.follow-name,.path-button,.team-choice,.ticket)),
body[data-tm-game-ui] :is(a.button,.home-button){font-family:var(--tm-font-ui)!important;font-size:var(--tm-game-body)!important;font-weight:700;line-height:1.4;min-height:var(--tm-game-secondary)!important}
body[data-tm-game-ui] :is(button.primary,.btn-game-spin,.btn-game-reset,#previewBtn){min-height:var(--tm-game-primary)!important}
body[data-tm-game-ui] :is(header button,header .home-link,header .home-button){font-size:var(--tm-game-helper)!important;min-height:var(--tm-game-secondary)!important}
body[data-tm-game-ui] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),textarea,select){font-family:var(--tm-font-ui)!important;font-size:var(--tm-game-input)!important;line-height:1.5}
body[data-tm-game-ui] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select){min-height:var(--tm-game-input-height)!important}
/* Square increment controls retain their existing horizontal geometry. */
/* Older iOS Safari requires none on the actual buttons to suppress double-tap zoom. */
body[data-tm-game-ui] .stepper button { touch-action: none; }
body[data-tm-game-ui] .stepper :is(button,input){min-height:var(--tm-game-secondary)!important}
@media(max-width:600px){body[data-tm-game-ui]{--tm-game-title:28px}}

/* A selected name is participant data even when its semantic element is h2. */
body[data-tm-game-ui="cloud-pick"] #winner.winner.result-heading{font-family:var(--tm-font-ui)!important;font-size:var(--tm-game-title);font-weight:700;line-height:1.25;overflow-wrap:anywhere;word-break:break-word}

/* Shared selector header. Icon-only sound with explicit accessible state and touch targets. */
body[data-tm-game-ui] .tm-selector-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
body[data-tm-game-ui] .tm-selector-controls{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-left:auto}
body[data-tm-game-ui] .tm-selector-controls>span[data-t="prototype"]{display:none}
body[data-tm-game-ui] .tm-selector-controls button:is(.tm-sound-control,#soundToggleBtn),
body[data-tm-game-ui] .tm-selector-controls button.tm-language-control,
body[data-tm-game-ui] .tm-selector-controls .festival-menu>summary{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:44px;min-height:44px;padding:9px 12px;border:1px solid #b6a38c;border-radius:12px;background:#fffaf0;color:#453025;font:400 14px/1.5 Pretendard,sans-serif;white-space:nowrap;box-sizing:border-box;box-shadow:none;cursor:pointer}
body[data-tm-game-ui] .tm-selector-controls button:is(.tm-sound-control,#soundToggleBtn)[aria-pressed="true"]{background:#e8d3b9;border-color:#92795c}
body[data-tm-game-ui] .tm-selector-controls button:is(.tm-sound-control,#soundToggleBtn){width:44px;flex:0 0 44px;padding:9px!important}
body[data-tm-game-ui] .tm-selector-controls .tm-sound-control svg{flex:none;width:18px;height:18px}
body[data-tm-game-ui] .tm-selector-controls :is(button,summary):focus-visible{outline:3px solid #386087;outline-offset:3px}
body[data-tm-game-ui] .tm-audio-warning{font:400 14px/1.5 Pretendard,sans-serif;color:#70462f;margin:4px auto 12px;max-width:100%;padding:0 16px}
body[data-tm-game-ui] .tm-selector-controls .festival-menu{margin:0}
@media(max-width:480px){
 body[data-tm-game-ui] .tm-selector-header{gap:8px;flex-wrap:nowrap;align-items:center}
 body[data-tm-game-ui] .tm-selector-controls{gap:6px;flex-wrap:nowrap;flex:none}
 body[data-tm-game-ui] .tm-selector-controls .tm-language-control{padding:9px 10px!important}
 body[data-tm-game-ui] .tm-selector-controls .festival-menu>summary{width:44px;padding:9px;font-size:0}
 body[data-tm-game-ui] .tm-selector-controls .festival-menu>summary:after{content:'⚙';font-size:20px;line-height:1}
}

@media(max-width:340px){
 body[data-tm-game-ui] .tm-selector-header{gap:4px}
 body[data-tm-game-ui] .tm-selector-controls{gap:4px}
 body[data-tm-game-ui="signature-race"] .tm-selector-header{padding-inline:12px}
 body[data-tm-game-ui="signature-race"] .tm-selector-controls .tm-language-control{padding-inline:6px!important}
}

/* Desktop density is limited to five large-group selectors. Touch and narrow views keep the incumbent layout. */
@media (min-width:1100px) and (any-pointer:fine) and (any-hover:hover) {
 body:is([data-tm-game-ui="signature-race"],[data-tm-game-ui="ticket-order"],[data-tm-game-ui="cloud-pick"],[data-tm-game-ui="constellation-teams"],[data-tm-game-ui="camp-role"]) {
  --tm-game-title:28px;--tm-game-section:22px;--tm-game-helper:13px;
 }
 body:is([data-tm-game-ui="ticket-order"],[data-tm-game-ui="cloud-pick"],[data-tm-game-ui="camp-role"]) header {width:calc(100% - 64px);max-width:1320px;padding:10px 0}
 body:is([data-tm-game-ui="ticket-order"],[data-tm-game-ui="cloud-pick"],[data-tm-game-ui="camp-role"]) main {width:calc(100% - 64px);max-width:1280px;padding:8px 0 32px}
 body:is([data-tm-game-ui="ticket-order"],[data-tm-game-ui="cloud-pick"],[data-tm-game-ui="camp-role"]) .actions {gap:8px;margin-top:12px}
 body:is([data-tm-game-ui="ticket-order"],[data-tm-game-ui="cloud-pick"],[data-tm-game-ui="camp-role"]) .privacy {margin-top:20px}
 /* Unified 1.5px button and input borders are maintained across desktop and mobile below. */

 /* The race keeps its viewport-sized course; four columns allow 44px name targets for fifty people. */
 body[data-tm-game-ui="signature-race"] .running-layout .camera-controls {margin:0 0 4px;gap:6px}
 body[data-tm-game-ui="signature-race"] .running-layout .side>h2 {margin:0 0 2px}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .running-layout .side {display:grid;grid-template-columns:1fr;align-content:start}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .running-layout .side>h2 {display:none}
 body[data-tm-game-ui="signature-race"] .running-layout #record-status:empty {display:none}
 body[data-tm-game-ui="signature-race"] .running-layout .side>.hint {margin:4px 0 8px;font-size:13px}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .running-layout .roster {
  grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(13,minmax(44px,auto));height:auto;column-gap:8px;align-content:start
 }
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .roster li {position:relative;min-height:44px;display:block;padding:0}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .roster .follow-name {
  display:block;width:100%;min-height:44px;padding:3px 3px 17px;font-size:13px;line-height:1.25;border-radius:5px
 }
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .roster .follow-name:before {content:"#" attr(data-racer-number) " · ";font-variant-numeric:tabular-nums;font-weight:700}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .roster .arrival {position:absolute;left:4px;bottom:1px;font-size:12px;line-height:15px;pointer-events:none}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .roster li:has(.follow-name:focus-visible) {z-index:1}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .roster .follow-name:focus-visible {white-space:normal;overflow:visible;position:relative;background:var(--light);z-index:2;min-height:44px}
 body[data-tm-game-ui="signature-race"]:has(.result-layout) main {max-width:1600px}
 body[data-tm-game-ui="signature-race"] .roster[data-rank-slots] li {display:grid;grid-template-columns:30px minmax(0,1fr);gap:2px;align-items:center}
 body[data-tm-game-ui="signature-race"] .roster[data-rank-slots] .live-rank {font-size:13px;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
 body[data-tm-game-ui="signature-race"] .roster[data-rank-slots] .follow-name {min-height:44px}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .roster[data-rank-slots] .follow-name {padding:3px;font-size:13px}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .roster[data-rank-slots] li:has(.arrival:not(:empty)) .follow-name {padding-bottom:17px}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .roster[data-rank-slots] .arrival {left:35px}
 body[data-tm-game-ui="signature-race"] .result-layout {grid-template-columns:minmax(0,1fr);gap:0}
 body[data-tm-game-ui="signature-race"] .result-layout .stage {display:none}
 body[data-tm-game-ui="signature-race"] .result-layout .side {grid-column:1;grid-row:1}
 body[data-tm-game-ui="signature-race"] .result-layout .ranking {grid-template-columns:repeat(3,minmax(0,1fr));column-gap:16px}
 body[data-tm-game-ui="signature-race"][data-large-race="true"] .result-layout .ranking {grid-template-columns:repeat(4,minmax(0,1fr))}
 body[data-tm-game-ui="signature-race"] .result-layout .ranking li {padding:3px 0;font-size:15px;min-height:34px}
 body[data-tm-game-ui="signature-race"] .result-layout .participant-portrait {width:28px;height:28px}
 body[data-tm-game-ui="signature-race"] .result-layout .rank-number {font-size:23px;width:27px}
 body[data-tm-game-ui="signature-race"] .result-layout .result-panel h2 {margin-bottom:6px}
 body[data-tm-game-ui="signature-race"] .result-layout .ending-row {gap:12px;max-width:900px}
 body[data-tm-game-ui="signature-race"] .result-layout .ending-row canvas {width:48px;height:52px}
 body[data-tm-game-ui="signature-race"] .result-layout .result-panel .ending {margin:0}
 body[data-tm-game-ui="signature-race"] .result-layout .result-panel>.hint {margin:4px 0 10px}
 body[data-tm-game-ui="signature-race"] .result-layout .actions {justify-content:flex-start;gap:8px;margin:12px 0}
 body[data-tm-game-ui="signature-race"] .result-layout .actions>button {flex:0 1 auto;width:auto;padding:9px 16px}

 /* Name cards use their space for the person and revealed number, rather than fifty identical instructions. */
 body[data-tm-game-ui="ticket-order"] .page-heading {gap:24px;min-height:88px;align-items:center}
 body[data-tm-game-ui="ticket-order"] .page-heading img {width:154px;height:88px}
 body[data-tm-game-ui="ticket-order"] .setup {max-width:820px}
 body[data-tm-game-ui="ticket-order"] .count-setting {margin-bottom:12px}
 body[data-tm-game-ui="ticket-order"] #app:has(.ticket-board) {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 24px;align-items:start}
 body[data-tm-game-ui="ticket-order"] #app:has(.ticket-board)>h2 {grid-column:1;margin:4px 0}
 body[data-tm-game-ui="ticket-order"] #app:has(.ticket-board)>.progress {grid-column:1;margin:0}
 body[data-tm-game-ui="ticket-order"] #app:has(.ticket-board)>.hint {grid-column:1;margin:2px 0}
 body[data-tm-game-ui="ticket-order"] #app:has(.ticket-board)>.actions {grid-column:2;grid-row:1 / 4;margin:4px 0}
 body[data-tm-game-ui="ticket-order"] .ticket-board {grid-column:1 / -1;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;margin-top:12px}
 body[data-tm-game-ui="ticket-order"] .ticket-board.large {grid-template-columns:repeat(10,minmax(0,1fr));gap:8px}
 body[data-tm-game-ui="ticket-order"] .ticket-board .ticket {min-height:78px;min-width:44px;padding:8px;gap:4px;font-size:14px;justify-content:center;border-width:1px;box-shadow:none}
 body[data-tm-game-ui="ticket-order"] .ticket:not(.open) .name {display:block;overflow:visible;-webkit-line-clamp:unset;line-height:1.35}
 body[data-tm-game-ui="ticket-order"] .ticket .tap {display:none}
 body[data-tm-game-ui="ticket-order"] .ticket .number {font-size:26px}
 body[data-tm-game-ui="ticket-order"] #app:has(.ticket-board)>.silent-note {grid-column:1 / -1;margin:8px 0 0}
 body[data-tm-game-ui="ticket-order"] .result-layout {grid-template-columns:280px minmax(0,1fr);gap:32px;margin-top:12px}
 body[data-tm-game-ui="ticket-order"] .turn-progress {padding:10px 0}
 body[data-tm-game-ui="ticket-order"] .current-name {font-size:30px}
 body[data-tm-game-ui="ticket-order"] .order-list {grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 16px}
 body[data-tm-game-ui="ticket-order"] .order-list li {padding:4px 0;gap:7px;font-size:15px;line-height:1.35}
 body[data-tm-game-ui="ticket-order"] .order-list .rank {font-size:22px;min-width:26px}
 body[data-tm-game-ui="ticket-order"] .order-list .tag {font-size:12px}

 /* A delivery sits next to its two live rosters throughout the round. */
 body[data-tm-game-ui="cloud-pick"] #app:has(>.rosters) {display:grid;grid-template-columns:minmax(300px,.8fr) minmax(0,1.4fr);gap:32px;align-items:start}
 body[data-tm-game-ui="cloud-pick"] #app:has(>.rosters)>.layout {display:flex;flex-direction:column;gap:16px;min-width:0}
 body[data-tm-game-ui="cloud-pick"] #app:has(>.rosters) .setup-panel {width:100%}
 body[data-tm-game-ui="cloud-pick"] #app:has(>.rosters) .setup-panel>p {margin-bottom:6px}
 body[data-tm-game-ui="cloud-pick"] #app:has(>.rosters) .setup-panel>.actions {margin-top:8px}
 body[data-tm-game-ui="cloud-pick"] #app:has(>.rosters) .setup-panel>.count-field {margin-top:8px;margin-bottom:4px}
 body[data-tm-game-ui="cloud-pick"] #app:has(>.rosters) .setup-panel>.count-field .hint {margin:4px 0}
 body[data-tm-game-ui="cloud-pick"] .stage {width:100%;min-height:0;padding:16px;border-width:1px}
 body[data-tm-game-ui="cloud-pick"] .scene {width:130px;margin-bottom:6px}
 body[data-tm-game-ui="cloud-pick"] .letter {min-height:96px;padding:20px 14px 14px;border-width:1px;box-shadow:none}
 body[data-tm-game-ui="cloud-pick"] .selected-people {font-size:26px;line-height:1.3;margin-top:4px}
 body[data-tm-game-ui="cloud-pick"] .selected-people:has(li:nth-child(5)) {font-size:18px;columns:2;column-gap:24px}
 body[data-tm-game-ui="cloud-pick"] .selected-people li {break-inside:avoid}
 body[data-tm-game-ui="cloud-pick"] .stage-caption {font-size:14px;margin-top:8px}
 body[data-tm-game-ui="cloud-pick"] .rosters {margin:0;padding-top:12px;gap:24px}
 body[data-tm-game-ui="cloud-pick"] .rosters h3 {font-size:18px;margin-bottom:12px}
 body[data-tm-game-ui="cloud-pick"] .rosters li {font-size:15px;line-height:1.45;padding:3px 0;margin:0;min-width:0}
 body[data-tm-game-ui="cloud-pick"] .rosters ol:has(li:nth-child(13)) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}
 body[data-tm-game-ui="cloud-pick"] .count {margin-bottom:6px}
 body[data-tm-game-ui="cloud-pick"] .count-field {max-width:260px;margin-bottom:8px}
 body[data-tm-game-ui="cloud-pick"] .count-field .field-label {min-height:0}
 body[data-tm-game-ui="cloud-pick"] .actions .primary {flex:0 1 auto}
 body[data-tm-game-ui="cloud-pick"] .setup-layout {grid-template-columns:minmax(300px,.8fr) minmax(0,1.4fr);gap:32px}
 body[data-tm-game-ui="cloud-pick"] .list-preview {max-height:none;font-size:15px}
 body[data-tm-game-ui="cloud-pick"] .list-preview ol {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 28px}
 body[data-tm-game-ui="cloud-pick"] .count-controls {grid-template-columns:repeat(2,minmax(0,260px));gap:20px}

 /* Team drawing and the entire team board share the desktop width. */
 body[data-tm-game-ui="constellation-teams"] .page {max-width:1360px;padding:0 32px}
 body[data-tm-game-ui="constellation-teams"] .topbar {height:66px}
 body[data-tm-game-ui="constellation-teams"] main {max-width:1280px;margin:20px auto 0}
 body[data-tm-game-ui="constellation-teams"] .intro {margin-bottom:16px}
 body[data-tm-game-ui="constellation-teams"] .intro p {margin-top:6px}
 body[data-tm-game-ui="constellation-teams"] .mascot {width:72px;height:66px}
 body[data-tm-game-ui="constellation-teams"] .mascot>div {transform:scale(.2);top:0}
 body[data-tm-game-ui="constellation-teams"] .workspace {padding:24px 28px;border-width:1px}
 body[data-tm-game-ui="constellation-teams"] .fields {grid-template-columns:minmax(0,1.5fr) minmax(240px,.7fr);gap:40px}
 body[data-tm-game-ui="constellation-teams"] .teams-field select {margin-top:14px;max-width:240px}
 body[data-tm-game-ui="constellation-teams"] :is(#setup,#result)>.primary {width:auto;min-width:200px;display:inline-flex;margin-top:16px;padding:9px 18px}
 body[data-tm-game-ui="constellation-teams"] #result>.secondary {margin-top:16px;margin-right:8px}
 body[data-tm-game-ui="constellation-teams"] .demo-note {text-align:left;margin-top:10px}
 body[data-tm-game-ui="constellation-teams"] .team-list {gap:20px 28px}
 body[data-tm-game-ui="constellation-teams"] .team-list:has(.team-group:nth-child(3)) {grid-template-columns:repeat(3,minmax(0,1fr))}
 body[data-tm-game-ui="constellation-teams"] .team-group {padding-top:8px;border-top-width:1px}
 body[data-tm-game-ui="constellation-teams"] .team-group h3 {font-size:18px;margin-bottom:6px;flex-wrap:wrap}
 body[data-tm-game-ui="constellation-teams"] .team-group li {font-size:15px;padding:4px 0;line-height:1.4;gap:6px;flex-wrap:wrap}
 body[data-tm-game-ui="constellation-teams"] .result-heading {margin-bottom:16px}
 body[data-tm-game-ui="constellation-teams"] #drawing:not([hidden]) {display:grid;grid-template-columns:minmax(280px,.75fr) minmax(0,1.6fr);gap:0 32px;align-items:start}
 body[data-tm-game-ui="constellation-teams"] #drawing-title {grid-column:1;grid-row:1}
 body[data-tm-game-ui="constellation-teams"] .drawing-hint {grid-column:1;grid-row:2}
 body[data-tm-game-ui="constellation-teams"] .assignment {grid-column:1;grid-row:3;margin-top:16px}
 body[data-tm-game-ui="constellation-teams"] .drawing-progress {grid-column:1;grid-row:4;margin:12px 0}
 body[data-tm-game-ui="constellation-teams"] .drawing-teams {grid-column:2;grid-row:1 / 6;max-height:none;overflow:visible;padding:0}
 body[data-tm-game-ui="constellation-teams"] .drawing-teams .team-group {min-height:70px}
 body[data-tm-game-ui="constellation-teams"] .drawing-actions {grid-column:1 / -1;grid-row:6;position:static;justify-content:flex-start;margin-top:20px;padding:0;gap:8px}
 body[data-tm-game-ui="constellation-teams"] .drawing-actions :is(.primary,.secondary) {flex:0 1 auto;width:auto;padding:9px 16px}
 body[data-tm-game-ui="constellation-teams"] #drawing>.demo-note {grid-column:1 / -1;grid-row:7}
 body[data-tm-game-ui="constellation-teams"] .name-ticket {padding:10px 14px;border-width:1px;box-shadow:none}
 body[data-tm-game-ui="constellation-teams"] .name-ticket>span:first-child {font-size:28px}
 body[data-tm-game-ui="constellation-teams"] .decision-board {margin-top:14px}
 body[data-tm-game-ui="constellation-teams"] .team-choice {min-height:64px;border-width:1px}
 body[data-tm-game-ui="constellation-teams"] .team-choice strong {font-size:23px}
 body[data-tm-game-ui="constellation-teams"] footer {max-width:1280px;margin-top:24px}

 /* The camp scene accompanies the assignments instead of placing the board below it. */
 body[data-tm-game-ui="camp-role"] .page-heading {display:flex;align-items:baseline;gap:24px;justify-content:space-between;margin-bottom:16px}
 body[data-tm-game-ui="camp-role"] .page-heading :is(h1,p) {margin-bottom:0}
 body[data-tm-game-ui="camp-role"] .setup-layout {gap:40px}
 body[data-tm-game-ui="camp-role"] #app:has(>.camp-stage) {display:grid;grid-template-columns:minmax(280px,.75fr) minmax(0,1.8fr);gap:16px 32px;align-items:start}
 body[data-tm-game-ui="camp-role"] .stage-top {grid-column:1 / -1;margin-top:0}
 body[data-tm-game-ui="camp-role"] .camp-stage {grid-column:1;grid-row:2;height:215px;margin:0}
 body[data-tm-game-ui="camp-role"] #app:has(>.camp-stage)>.role-board {grid-column:2;grid-row:2;margin:0}
 body[data-tm-game-ui="camp-role"] .camp-stage .wagon {width:170px;left:calc(50% - 70px)}
 body[data-tm-game-ui="camp-role"] .camp-stage .mascot {width:80px;height:96px;left:calc(50% - 145px)}
 body[data-tm-game-ui="camp-role"] .camp-stage .delivery-mascot {left:auto;right:0;width:70px}
 body[data-tm-game-ui="camp-role"] .speech {font-size:20px;padding:8px 16px;max-width:100%}
 body[data-tm-game-ui="camp-role"] .role-board {gap:20px 28px;margin:16px 0;grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-tm-game-ui="camp-role"] .role-board:has(.role-result:nth-child(3)) {grid-template-columns:repeat(3,minmax(0,1fr))}
 body[data-tm-game-ui="camp-role"] .role-result {padding-top:8px;border-top-width:1px}
 body[data-tm-game-ui="camp-role"] .role-result h3 {font-size:20px;line-height:1.3;margin-bottom:4px}
 body[data-tm-game-ui="camp-role"] .role-result .role-meta {margin-bottom:6px}
 body[data-tm-game-ui="camp-role"] .role-result li {padding:4px 0 4px 17px;font-size:15px;line-height:1.5}
 body[data-tm-game-ui="camp-role"] .role-result.pending {min-height:96px}
 body[data-tm-game-ui="camp-role"] .result-heading img {width:120px;height:70px}
 body[data-tm-game-ui="camp-role"] .result-help {margin-top:12px}
}


/* ==========================================================================
   Turnmori Unified Button & Name-Input GUI System (2026-11-23)
   Applies cohesive role colors, sizing, borders, radii, focus rings,
   steppers, count badges, and input surfaces across all 9 selectors while
   preserving board/scene art (.mascot, .follow-name, .team-choice, .ticket).
   ========================================================================== */
body[data-tm-game-ui] {
  --tm-ui-ink: #453025;
  --tm-ui-muted: #604a3b;
  --tm-ui-focus: #625074;
  --tm-btn-radius: 10px;
  --tm-btn-border: 1.5px;
  --tm-btn-primary-bg: #f9c29d;
  --tm-btn-primary-hover: #f0af86;
  --tm-btn-primary-active: #e7a174;
  --tm-btn-secondary-bg: #d7dcc0;
  --tm-btn-secondary-hover: #c7ceb0;
  --tm-btn-secondary-active: #bac2a0;
  --tm-btn-utility-bg: #fffaf0;
  --tm-btn-utility-hover: #f2e5cf;
  --tm-btn-utility-active: #e8d7bc;
  --tm-btn-utility-border: #8a7461;
  --tm-input-bg: #fffdf8;
  --tm-input-border: #b3a089;
  --tm-input-border-hover: #8a7461;
  --tm-input-radius: 10px;
}

/* Always honor the HTML hidden attribute over unified button display rules */
body[data-tm-game-ui] [hidden] {
  display: none !important;
}

/* Unified keyboard focus ring across all controls */
body[data-tm-game-ui] :is(button, a, input, textarea, select, summary):focus-visible {
  outline: 3px solid var(--tm-ui-focus) !important;
  outline-offset: 3px !important;
}

/* 1. Shared Header Controls (Sound / Language / Settings) */
body[data-tm-game-ui] .tm-selector-controls button:is(.tm-sound-control, #soundToggleBtn),
body[data-tm-game-ui] .tm-selector-controls button.tm-language-control,
body[data-tm-game-ui] .tm-selector-controls .festival-menu > summary {
  border: var(--tm-btn-border) solid #b6a38c !important;
  border-radius: var(--tm-btn-radius) !important;
  background: var(--tm-btn-utility-bg) !important;
  color: var(--tm-ui-ink) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: background-color 120ms ease, border-color 120ms ease;
}
body[data-tm-game-ui] .tm-selector-controls button:is(.tm-sound-control, #soundToggleBtn):hover:not(:disabled),
body[data-tm-game-ui] .tm-selector-controls button.tm-language-control:hover:not(:disabled),
body[data-tm-game-ui] .tm-selector-controls .festival-menu > summary:hover {
  background: var(--tm-btn-utility-hover) !important;
  border-color: var(--tm-ui-ink) !important;
}
body[data-tm-game-ui] .tm-selector-controls button:is(.tm-sound-control, #soundToggleBtn)[aria-pressed="true"] {
  background: #e8d3b9 !important;
  border-color: var(--tm-ui-ink) !important;
}

/* 2. Base Unified Action Button Geometry (Utility Cream default) */
body[data-tm-game-ui] button:not(:is(.mascot, .follow-name, .team-choice, .ticket, .selector-like, .tm-sound-control, #soundToggleBtn, .tm-language-control)) {
  border: var(--tm-btn-border) solid var(--tm-btn-utility-border);
  border-radius: var(--tm-btn-radius);
  background: var(--tm-btn-utility-bg);
  color: var(--tm-ui-ink);
  font-weight: 700;
  padding: 9px 15px;
  min-height: var(--tm-game-secondary);
  box-shadow: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.35;
  transition: background-color 120ms ease, border-color 120ms ease;
}
body[data-tm-game-ui] button:not(:is(.mascot, .follow-name, .team-choice, .ticket, .selector-like, .tm-sound-control, #soundToggleBtn, .tm-language-control)):hover:not(:disabled) {
  background: var(--tm-btn-utility-hover);
  border-color: var(--tm-ui-ink);
  filter: none;
}
body[data-tm-game-ui] button:not(:is(.mascot, .follow-name, .team-choice, .ticket, .selector-like, .tm-sound-control, #soundToggleBtn, .tm-language-control)):active:not(:disabled) {
  background: var(--tm-btn-utility-active);
  transform: translateY(1px);
  box-shadow: none;
}
body[data-tm-game-ui] button:not(:is(.mascot, .follow-name, .team-choice, .ticket, .selector-like)):disabled {
  opacity: 0.52;
  cursor: not-allowed;
  filter: none;
}

/* 3. Primary CTA Role (Peach — Start / Spin / Draw / Redraw / Skip-to-result) */
body[data-tm-game-ui] button:is(
  .primary,
  .btn-game-spin,
  #skipSpinBtn,
  #skip,
  #start,
  #again,
  #new-draw,
  #reshuffle,
  #submit
) {
  background: var(--tm-btn-primary-bg) !important;
  border: var(--tm-btn-border) solid var(--tm-ui-ink) !important;
  color: var(--tm-ui-ink) !important;
  min-height: var(--tm-game-primary) !important;
  padding: 10px 18px;
  font-weight: 700 !important;
}
body[data-tm-game-ui] button:is(
  .primary,
  .btn-game-spin,
  #skipSpinBtn,
  #skip,
  #start,
  #again,
  #new-draw,
  #reshuffle,
  #submit
):hover:not(:disabled) {
  background: var(--tm-btn-primary-hover) !important;
  border-color: var(--tm-ui-ink) !important;
}
body[data-tm-game-ui] button:is(
  .primary,
  .btn-game-spin,
  #skipSpinBtn,
  #skip,
  #start,
  #again,
  #new-draw,
  #reshuffle,
  #submit
):active:not(:disabled) {
  background: var(--tm-btn-primary-active) !important;
}

/* 4. Secondary Role (Soft Sage — Edit / Pause / Captains / Show-all / Undo / Add candidate) */
body[data-tm-game-ui] button:is(
  .secondary,
  #edit,
  #edit-names,
  #addItemBtn,
  #pause,
  #pauseSpinBtn,
  #resumeSpinBtn,
  #captains,
  #instant,
  #show-all,
  #undo,
  #fast-forward,
  .stage-pause,
  .countdown-pause
):not(.primary):not(.tm-restart-button),
body[data-tm-game-ui="roulette"] #previewPanel[data-phase="result"] #resetWheelBtn,
body[data-tm-game-ui="random-number"][data-phase="result"] #restart {
  background: var(--tm-btn-secondary-bg) !important;
  border: var(--tm-btn-border) solid var(--tm-ui-ink) !important;
  color: var(--tm-ui-ink) !important;
  min-height: var(--tm-game-secondary) !important;
  padding: 9px 16px;
}
body[data-tm-game-ui] button:is(
  .secondary,
  #edit,
  #edit-names,
  #addItemBtn,
  #pause,
  #pauseSpinBtn,
  #resumeSpinBtn,
  #captains,
  #instant,
  #show-all,
  #undo,
  #fast-forward,
  .stage-pause,
  .countdown-pause
):not(.primary):not(.tm-restart-button):hover:not(:disabled),
body[data-tm-game-ui="roulette"] #previewPanel[data-phase="result"] #resetWheelBtn:hover:not(:disabled),
body[data-tm-game-ui="random-number"][data-phase="result"] #restart:hover:not(:disabled) {
  background: var(--tm-btn-secondary-hover) !important;
  border-color: var(--tm-ui-ink) !important;
}
body[data-tm-game-ui] button:is(
  .secondary,
  #edit,
  #edit-names,
  #addItemBtn,
  #pause,
  #pauseSpinBtn,
  #resumeSpinBtn,
  #captains,
  #instant,
  #show-all,
  #undo,
  #fast-forward,
  .stage-pause,
  .countdown-pause
):not(.primary):not(.tm-restart-button):active:not(:disabled),
body[data-tm-game-ui="roulette"] #previewPanel[data-phase="result"] #resetWheelBtn:active:not(:disabled),
body[data-tm-game-ui="random-number"][data-phase="result"] #restart:active:not(:disabled) {
  background: var(--tm-btn-secondary-active) !important;
}

/* 5. Utility / Share / Restart-during-play Role (Warm Cream) */
body[data-tm-game-ui] .tm-result-share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
body[data-tm-game-ui] .tm-result-share button,
body[data-tm-game-ui] button.tm-restart-button:not([data-role="edit"]) {
  background: var(--tm-btn-utility-bg) !important;
  border: var(--tm-btn-border) solid var(--tm-btn-utility-border) !important;
  border-radius: var(--tm-btn-radius) !important;
  color: var(--tm-ui-ink) !important;
  min-height: var(--tm-game-secondary) !important;
  padding: 9px 15px !important;
  box-shadow: none !important;
}
body[data-tm-game-ui] .tm-result-share button:hover:not(:disabled),
body[data-tm-game-ui] button.tm-restart-button:not([data-role="edit"]):hover:not(:disabled) {
  background: var(--tm-btn-utility-hover) !important;
  border-color: var(--tm-ui-ink) !important;
}
/* Keep result-mode edit buttons Sage when reusing .tm-restart-button */
body[data-tm-game-ui="roulette"] #previewPanel[data-phase="result"] #resetWheelBtn.tm-restart-button,
body[data-tm-game-ui="random-number"][data-phase="result"] #restart.tm-restart-button {
  background: var(--tm-btn-secondary-bg) !important;
  border-color: var(--tm-ui-ink) !important;
}
body[data-tm-game-ui="roulette"] #previewPanel[data-phase="result"] #resetWheelBtn.tm-restart-button:hover:not(:disabled),
body[data-tm-game-ui="random-number"][data-phase="result"] #restart.tm-restart-button:hover:not(:disabled) {
  background: var(--tm-btn-secondary-hover) !important;
}

/* 6. Toggle / Segmented controls (signature-race options & camera) */
body[data-tm-game-ui="signature-race"] .segmented button,
body[data-tm-game-ui="signature-race"] .camera-controls button,
body[data-tm-game-ui="signature-race"] .festival-controls button {
  background: var(--tm-btn-utility-bg);
  border: var(--tm-btn-border) solid var(--tm-btn-utility-border);
  border-radius: var(--tm-btn-radius);
}
body[data-tm-game-ui="signature-race"] .segmented button[aria-pressed="true"],
body[data-tm-game-ui="signature-race"] .camera-controls button[aria-pressed="true"],
body[data-tm-game-ui="signature-race"] .festival-controls button[aria-pressed="true"] {
  background: #c8d6e5 !important;
  border-color: var(--tm-ui-ink) !important;
  color: var(--tm-ui-ink) !important;
}

/* 7. Unified Confirm / Exit / Duplicate Dialogs */
body[data-tm-game-ui] dialog {
  border: 1.5px solid var(--tm-ui-ink);
  border-radius: 16px;
  background: #fbf4e6;
  color: var(--tm-ui-ink);
  box-shadow: 0 12px 30px #45302530;
}
body[data-tm-game-ui] dialog button {
  min-height: 44px !important;
  border-radius: var(--tm-btn-radius) !important;
  padding: 9px 16px !important;
}
body[data-tm-game-ui] dialog:is(#confirm, #leave-dialog, #exit, #duplicates, #restart-confirm, dialog) button:is([value="cancel"], [value="stay"], #dupe-edit) {
  background: var(--tm-btn-utility-bg) !important;
  border: var(--tm-btn-border) solid var(--tm-btn-utility-border) !important;
  color: var(--tm-ui-ink) !important;
}
body[data-tm-game-ui] dialog:is(#confirm, #leave-dialog, #exit, #duplicates, #restart-confirm, dialog) button:is([value="cancel"], [value="stay"], #dupe-edit):hover:not(:disabled) {
  background: var(--tm-btn-utility-hover) !important;
  border-color: var(--tm-ui-ink) !important;
}
body[data-tm-game-ui] dialog:is(#confirm, #leave-dialog, #exit, #duplicates, #restart-confirm, dialog) button:is(.primary, [value="restart"], [value="leave"], #dupe-go) {
  background: var(--tm-btn-primary-bg) !important;
  border: var(--tm-btn-border) solid var(--tm-ui-ink) !important;
  color: var(--tm-ui-ink) !important;
}
body[data-tm-game-ui] dialog:is(#confirm, #leave-dialog, #exit, #duplicates, #restart-confirm, dialog) button:is(.primary, [value="restart"], [value="leave"], #dupe-go):hover:not(:disabled) {
  background: var(--tm-btn-primary-hover) !important;
}

/* 8. Unified Result Action Bar Alignment */
body[data-tm-game-ui] .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
@media (min-width: 701px) {
  body[data-tm-game-ui="constellation-teams"] .team-result-actions,
  body[data-tm-game-ui="constellation-teams"] .team-result-controls {
    align-items: center;
  }
  body[data-tm-game-ui="constellation-teams"] #result .team-result-controls .primary {
    width: auto !important;
    min-width: 0;
  }
}
body[data-tm-game-ui="signature-race"] .result-actions-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}
body[data-tm-game-ui="signature-race"] .result-actions-wrap .actions,
body[data-tm-game-ui="signature-race"] .result-actions-wrap .tm-result-share {
  margin: 0 !important;
  display: contents;
}
body[data-tm-game-ui="signature-race"] .result-actions-wrap .tm-result-share [role="status"],
body[data-tm-game-ui="signature-race"] .result-actions-wrap .tm-result-share textarea {
  flex-basis: 100%;
  margin-top: 6px;
}
body[data-tm-game-ui="signature-race"] .result-actions-wrap button {
  flex: 0 1 auto;
}
@media (max-width: 700px) {
  body[data-tm-game-ui="signature-race"] .result-actions-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body[data-tm-game-ui="signature-race"] .result-actions-wrap #again {
    grid-column: 1 / -1;
  }
  body[data-tm-game-ui="signature-race"] .result-actions-wrap button {
    width: 100%;
    min-width: 0;
  }
  body[data-tm-game-ui="signature-race"] .result-actions-wrap .tm-result-share :is([role="status"], textarea) {
    grid-column: 1 / -1;
  }
}

/* 9. Unified Name-Input GUI (All 6 People-Name Selectors + Roulette Inputs) */
body[data-tm-game-ui] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  textarea,
  select
) {
  background: var(--tm-input-bg);
  border: var(--tm-btn-border) solid var(--tm-input-border);
  border-radius: var(--tm-input-radius);
  color: var(--tm-ui-ink);
  box-shadow: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}
body[data-tm-game-ui] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  textarea,
  select
):hover:not(:disabled) {
  border-color: var(--tm-input-border-hover);
}
body[data-tm-game-ui] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  textarea,
  select
)[aria-invalid="true"] {
  border: 2px solid #9c3d32 !important;
  background: #fff6f4;
}
body[data-tm-game-ui] textarea {
  padding: 12px 14px;
  line-height: 1.6;
}

/* Uniform 168px Participant Stepper across all 6 name selectors */
body[data-tm-game-ui] .stepper {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  width: auto !important;
  max-width: 100%;
  flex: none;
}
body[data-tm-game-ui] .stepper button {
  width: 44px !important;
  min-width: 44px !important;
  flex: 0 0 44px !important;
  height: 44px;
  min-height: 44px !important;
  padding: 0 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  border-radius: var(--tm-btn-radius) !important;
  background: var(--tm-btn-utility-bg) !important;
  border: var(--tm-btn-border) solid var(--tm-btn-utility-border) !important;
  touch-action: none;
}
body[data-tm-game-ui] .stepper button:hover:not(:disabled) {
  background: var(--tm-btn-utility-hover) !important;
  border-color: var(--tm-ui-ink) !important;
}
body[data-tm-game-ui] .stepper input {
  width: 68px !important;
  min-width: 68px !important;
  flex: 0 0 68px !important;
  height: 44px;
  min-height: 44px !important;
  padding: 6px 4px !important;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
body[data-tm-game-ui] .stepper input::-webkit-inner-spin-button,
body[data-tm-game-ui] .stepper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Uniform Count Row & Name Header + Live Pill Badge */
body[data-tm-game-ui] .tm-name-head,
body[data-tm-game-ui="constellation-teams"] .field-heading,
body[data-tm-game-ui="signature-race"] .input-head,
body[data-tm-game-ui="camp-role"] .input-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
body[data-tm-game-ui] :is(.tm-name-head, .field-heading, .input-head, .input-caption) label {
  margin: 0 !important;
  font-weight: 700;
}
body[data-tm-game-ui] .tm-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: #efe4d0;
  color: var(--tm-ui-ink) !important;
  font-size: 13px !important;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Consistent Count Setting Row across constellation-teams, ticket-order, ladder-role, camp-role, signature-race */
body:is(
  [data-tm-game-ui="constellation-teams"],
  [data-tm-game-ui="ticket-order"],
  [data-tm-game-ui="ladder-role"],
  [data-tm-game-ui="camp-role"]
) .count-setting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  margin-bottom: 14px;
  max-width: none;
}
body:is(
  [data-tm-game-ui="constellation-teams"],
  [data-tm-game-ui="ticket-order"],
  [data-tm-game-ui="ladder-role"],
  [data-tm-game-ui="camp-role"]
) .count-setting > label {
  margin: 0;
  font-weight: 700;
}
body:is(
  [data-tm-game-ui="constellation-teams"],
  [data-tm-game-ui="ticket-order"],
  [data-tm-game-ui="ladder-role"],
  [data-tm-game-ui="camp-role"]
) .count-setting > .hint {
  flex: 1 0 100%;
  margin: 0;
}
body[data-tm-game-ui="signature-race"] .people-control {
  margin-bottom: 6px;
}
body[data-tm-game-ui="cloud-pick"] .count-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 14px;
}
body[data-tm-game-ui="cloud-pick"] .count-field {
  flex: 0 1 auto;
  margin: 0;
}
body[data-tm-game-ui="cloud-pick"] .count-field .field-label {
  min-height: 0 !important;
  margin-bottom: 6px;
}

/* Harmonize desktop page width across coin-flip, random-number, ladder-role */
@media (min-width: 768px) and (min-height: 481px) {
  body:is([data-tm-game-ui="coin-flip"], [data-tm-game-ui="random-number"], [data-tm-game-ui="ladder-role"]) :is(header, main) {
    max-width: 1280px !important;
  }
}

/* Shared gentle mascot idle motion tokens */
@keyframes tm-mascot-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) rotate(1deg);
  }
}

@keyframes tm-mascot-breathe {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.018);
  }
}

.tm-mascot-float {
  animation: tm-mascot-float 3.6s ease-in-out infinite;
  will-change: transform;
}

.tm-mascot-breathe {
  animation: tm-mascot-breathe 3.8s ease-in-out infinite;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .tm-mascot-float,
  .tm-mascot-breathe {
    animation: none !important;
  }
}

/* ==========================================================================
   Desktop stage view (무대 크게). Narrow headers never receive the control.
   ========================================================================== */
body[data-tm-game-ui] .tm-present-control { display: none !important; }
@media (min-width: 1024px) {
  body[data-tm-game-ui] .tm-selector-controls button.tm-present-control {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 9px 12px;
    border: var(--tm-btn-border) solid #b6a38c !important;
    border-radius: var(--tm-btn-radius) !important;
    background: #fffaf0 !important;
    color: var(--tm-ui-ink) !important;
    font: 600 14px/1.5 Pretendard, sans-serif !important;
    white-space: nowrap;
    box-sizing: border-box;
    box-shadow: none !important;
    cursor: pointer;
  }
  body[data-tm-game-ui] .tm-selector-controls button.tm-present-control:hover:not(:disabled) {
    background: var(--tm-btn-utility-hover) !important;
    border-color: var(--tm-ui-ink) !important;
  }
  body[data-tm-game-ui] .tm-selector-controls button.tm-present-control[aria-pressed="true"] {
    background: #e8d3b9 !important;
    border-color: var(--tm-ui-ink) !important;
  }
  body[data-tm-game-ui] .tm-present-control svg { flex: none; width: 18px; height: 18px; }

  /* Common: remove prose chrome around the stage. */
  body[data-tm-present="1"] :is(#intro, .game-intro > p, .privacy, .help, footer) { display: none !important; }

  /* roulette: editor column is #editorPanel; wheel and actions stay in #previewPanel. */
  body[data-tm-present="1"][data-tm-game-ui="roulette"] #editorPanel { display: none !important; }
  body[data-tm-present="1"][data-tm-game-ui="roulette"] .roulette-workspace {
    display: grid !important; grid-template-columns: minmax(0, 960px) !important; justify-content: center;
  }

  /* cloud-pick: round view keeps stage + actions; rosters (right column) and count controls hide. */
  body[data-tm-present="1"][data-tm-game-ui="cloud-pick"] #app:has(> .rosters) {
    grid-template-columns: minmax(0, 960px); justify-content: center;
  }
  body[data-tm-present="1"][data-tm-game-ui="cloud-pick"] #app:has(> .rosters) > .rosters,
  body[data-tm-present="1"][data-tm-game-ui="cloud-pick"] .round-layout .count-field { display: none !important; }

  /* random-number / coin-flip: hide inputs, keep result column, submit, restart. */
  body[data-tm-present="1"][data-tm-game-ui="random-number"] #draw > :is(.range-presets, .range, .draw-options, .hint) { display: none !important; }
  body[data-tm-present="1"][data-tm-game-ui="random-number"] #draw {
    grid-template-columns: minmax(0, 960px); justify-content: center;
  }
  body[data-tm-present="1"][data-tm-game-ui="random-number"] #draw > :is(.result-column, .error, .primary, #restart) { grid-column: 1; }
  body[data-tm-present="1"][data-tm-game-ui="coin-flip"] #draw :is(.coin-labels-row, .coin-mode-row) { display: none !important; }

  /* constellation-teams: setup keeps poster and start button; draw/result unchanged. */
  body[data-tm-present="1"][data-tm-game-ui="constellation-teams"] #setup :is(.names-field, .teams-field, .demo-note, #error) { display: none !important; }
  body[data-tm-present="1"][data-tm-game-ui="constellation-teams"] main { max-width: 960px; }

  /* ticket-order, camp-role, ladder-role, signature-race: their setup and stage are separate
     phases, so only the shared prose chrome above is hidden. */
}

/* Keep Korean words together in controls and headings, with a safe fallback for long labels. */
:lang(ko) body[data-tm-game-ui] :is(button, h1, h2, h3, [role="status"], [role="alert"], .badge, .banner) {
  word-break: keep-all;
  overflow-wrap: break-word;
}
:lang(ko) body[data-tm-game-ui="cloud-pick"] #winner.winner.result-heading {
  word-break: keep-all;
  overflow-wrap: break-word;
}
