/* This layer only applies to the mobile UI; the desktop composition is intact. */
.mobile-only{display:none}
.desktop-only{display:inline}
[id^="watch-"][id$="-think-setting"][hidden]{display:none}
/* Pointer activation keeps the normal button border. Keyboard focus is intact. */
html[data-focus-input="pointer"] :is(button,a,summary,[tabindex]):focus-visible,
html[data-focus-input="pointer"] .option input:focus-visible+.option-face{outline:none}
@media(max-width:1100px){
 .site-footer{display:none}
 .mobile-only{display:block}.header-actions>[data-audio-settings],.header-fullscreen,.watch-fullscreen{display:none!important}
 .site-header,.game-scene .site-header,.spectator-page .site-header{height:calc(48px + env(safe-area-inset-top));min-height:calc(48px + env(safe-area-inset-top));padding:env(safe-area-inset-top) max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));flex-wrap:nowrap;gap:8px;flex:none}
 .site-header .brand{gap:7px}.site-header .brand-mark{width:26px;height:30px;font-size:16px}.site-header .brand-name{font-size:21px}.site-header .brand-sub,.site-header .brand-divider,.site-header .watch-heading,.site-header .header-status{display:none}
 .header-actions,.watch-audio-tools{margin-left:auto;flex-wrap:nowrap;gap:0}.mobile-menu-button{min-height:40px!important;padding:7px 11px;background:#fff;border:1px solid #d5c4ad;border-radius:10px;color:#29445f;font:700 14px Meiryo,sans-serif;white-space:nowrap}
 html.mobile-playing,html.mobile-playing body{height:100%;overscroll-behavior:none}.mobile-play-scene{--mobile-seat-height:clamp(78px,14dvh,118px);height:var(--mobile-screen-height,100dvh)!important;min-height:0!important;display:flex;flex-direction:column;overflow:visible!important}
 html.mobile-playing .site-footer,html.mobile-playing .pwa-tools{display:none}
 .mobile-play-scene .game-layout{flex:1;min-height:0;width:100%;max-width:none;margin:0;padding:3px max(6px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));height:auto;display:grid;grid-template-rows:20px calc(var(--mobile-seat-height) + var(--mobile-speech-extra,0px)) minmax(0,1fr) auto;gap:4px}
 .mobile-play-scene .game-topbar{grid-row:1;margin:0;padding:0;min-height:0;height:20px;justify-content:center}.mobile-play-scene .game-topbar>div{display:none}.mobile-play-scene .game-top-note{font:700 12px/20px Meiryo,sans-serif;white-space:nowrap}.mobile-play-scene .note-dot{width:6px;height:6px;margin-right:5px}
 .mobile-play-scene .game-columns,.mobile-play-scene .watch-columns{display:contents}
 .mobile-play-scene .manager-panel{grid-row:2;grid-column:1;min-height:0;height:100%;max-height:none;margin:0;border-radius:12px;display:block;position:relative;overflow:hidden;border:1px solid #d6c3a5}
 .mobile-play-scene .manager-stage{height:100%;min-height:0;display:grid;grid-template-columns:76px minmax(0,1fr);background:#fff9ee}
 .mobile-play-scene .manager-stage::after{display:none}.mobile-play-scene .manager-stage .speech-stack{grid-row:1;grid-column:2;height:100%;min-height:0;width:100%;padding:4px 7px 4px 0;display:grid;grid-template-rows:1fr 1fr;gap:4px;overflow:hidden}
 .mobile-play-scene .manager-stage .speech-bubble,.mobile-play-scene .manager-stage .speech-bubble.second{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--mobile-speech-lines,2);overflow:hidden;min-height:0;height:auto;max-height:100%;margin:0;transform:none;border:1px solid #bacbd0;border-radius:9px;padding:3px 7px;font:700 13px/1.35 Meiryo,sans-serif;letter-spacing:0;box-shadow:none;cursor:pointer;background:#fffef9;color:#214564}
 .mobile-play-scene .speech-bubble::before,.mobile-play-scene .speech-bubble::after{display:none}.mobile-play-scene .manager-stage .speech-bubble.second{background:#fff2d6}
 .mobile-play-scene .manager-stage .manager-portrait{position:relative;grid-row:1;grid-column:1;align-self:stretch;justify-self:stretch;width:76px;height:100%;min-height:0;margin:0;padding:0;overflow:hidden}
 .mobile-play-scene .manager-stage .manager-portrait img{position:absolute;width:160px!important;max-width:none!important;height:160px!important;left:50%;top:-5px;transform:translateX(-50%);object-fit:contain!important;object-position:center top!important}
 .mobile-play-scene .manager-panel .manager-info{display:none}
 .mobile-play-scene .board-column{grid-row:3;grid-column:1;--board-size:var(--mobile-board-size,220px)!important;width:100%;height:100%;min-height:0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;overflow:visible}
 .mobile-play-scene .board-frame{flex:none;margin:0;padding:3px 5px 4px;border-radius:10px;box-shadow:0 3px 0 #7d4926,0 5px 9px #442b1922;max-width:100%}
 .mobile-play-scene .file-coordinates{height:13px;font-size:9px;padding-right:12px}.mobile-play-scene .rank-coordinates{width:12px;font-size:9px}.mobile-play-scene .board-grid{width:var(--board-size);height:var(--board-size);flex:none}
 .mobile-play-scene .piece{font-size:clamp(17px,calc(var(--board-size)/17),45px);width:76%;height:84%}.mobile-play-scene .square{min-height:0!important;min-width:0!important;padding:0;touch-action:manipulation}
 .mobile-play-scene .hand-strip{width:calc(var(--board-size) + 22px);max-width:100%;min-height:32px;height:32px;flex:none;padding:2px 4px;gap:3px;border-radius:8px;flex-wrap:nowrap;font:11px Meiryo,sans-serif}
 .mobile-play-scene .hand-owner{padding:4px;font-size:10px;white-space:nowrap}.mobile-play-scene .hand-content{flex:1;flex-wrap:nowrap;min-width:0;overflow-x:auto;overflow-y:hidden;white-space:nowrap;gap:2px;font-size:10px;scrollbar-width:none}.mobile-play-scene .hand-content::-webkit-scrollbar{display:none}
 .mobile-play-scene .hand-piece{flex:none;min-width:26px;min-height:27px!important;height:27px;padding:1px 3px;font-size:18px;line-height:1;border-radius:4px}.mobile-play-scene .hand-piece small{font-size:9px}.mobile-play-scene .clock-chip{flex:none;padding:3px;font-size:10px}
 .mobile-normal-dock{grid-row:4;grid-column:1;display:grid;gap:4px;padding-top:1px}.mobile-primary-actions,.mobile-panel-tabs{display:grid;gap:4px;grid-template-columns:repeat(2,minmax(0,1fr))}.mobile-panel-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}
 .mobile-normal-dock button,.mobile-play-scene .watch-controls button,.mobile-play-scene .watch-speed{min-height:40px!important;height:40px;border:1px solid #c6bba9;background:#fffaf2;border-radius:8px;color:#29445f;font:700 12px Meiryo,sans-serif;padding:4px;letter-spacing:0;box-shadow:none;margin:0;white-space:nowrap}
 .mobile-normal-dock button:disabled{opacity:.5}.mobile-normal-dock [data-action=resign]{color:#a72e42}.mobile-panel-tabs button{background:#eaf0f2;border-color:#b7c8cf}.mobile-declaration{background:#b23248!important;color:#fff!important}
 .mobile-play-scene .watch-layout{grid-template-rows:28px calc(var(--mobile-seat-height) + var(--mobile-speech-extra,0px)) minmax(0,1fr) auto;--mobile-seat-height:clamp(82px,15dvh,134px);gap:4px}
 .mobile-play-scene .watch-summary{grid-row:1;grid-column:1;position:static;height:28px;min-height:0;margin:0;padding:0;display:flex;flex-direction:column;gap:0;justify-content:center;overflow:hidden}
 .mobile-play-scene .watch-summary h1{display:none}.mobile-play-scene .watch-summary p{margin:0;font:700 11px/1.35 Meiryo,sans-serif;white-space:nowrap}.mobile-play-scene .watch-summary .watch-result{font-size:12px;gap:4px;flex-wrap:nowrap}.mobile-play-scene .watch-result-reason{font-size:11px}
 .mobile-watch-seats{grid-row:2;grid-column:1;display:grid;grid-template-columns:1fr 1fr;gap:5px;min-height:0}
 .mobile-play-scene .watch-seat,.mobile-play-scene .watch-seat[data-seat]{grid-row:auto;grid-column:auto;width:100%;height:100%;min-height:0;max-width:none;display:flex;flex-direction:column}
 .mobile-play-scene .watch-seat .manager-stage{flex:1;min-height:0;grid-template-columns:56px minmax(0,1fr)}
 .mobile-play-scene .watch-seat .watch-speech-stack{padding:3px 4px 3px 0;gap:3px}.mobile-play-scene .watch-seat .watch-bubble{font-size:11px!important;padding:3px 4px!important;border-radius:6px;height:auto!important;min-height:0!important;max-height:100%}
 .mobile-play-scene .watch-bubble-text{display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:var(--mobile-speech-lines,2);overflow:hidden!important;font:700 11px/1.35 Meiryo,sans-serif!important;white-space:normal!important;height:auto!important;max-height:100%;letter-spacing:0!important}
 .mobile-play-scene .watch-seat .manager-stage .watch-portrait{width:56px!important;height:100%!important;min-height:0!important}.mobile-play-scene .watch-seat .watch-portrait svg{position:absolute;left:50%;top:0;transform:translateX(-50%);width:145px!important;min-width:0!important;max-width:none!important;height:145px!important;aspect-ratio:1}
 .mobile-play-scene .watch-seat .manager-info{display:flex;flex:none;height:20px!important;min-height:20px;padding:2px 4px;flex-direction:row;gap:4px;align-items:center;background:#244968}
 .mobile-play-scene .watch-seat-info small{font-size:9px}.mobile-play-scene .watch-seat-info strong{font:700 10px Meiryo,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-play-scene .watch-seat-info>span{display:none}
 .mobile-play-scene .watch-board-stack{height:100%;min-height:0;width:100%;gap:4px;flex:1;justify-content:center}.mobile-play-scene .watch-controls{grid-row:4;grid-column:1;width:100%;height:auto;margin:0;display:grid;grid-template-columns:1fr 1fr 1.25fr;gap:4px;overflow:visible}
 .mobile-play-scene .watch-controls>[data-watch=first],.mobile-play-scene .watch-controls>[data-watch=live],.mobile-play-scene .watch-controls>[data-watch=download],.mobile-play-scene .watch-controls>[data-watch=exit]{display:none}
 .mobile-play-scene .watch-speed{display:flex;grid-column:3;grid-row:1;gap:3px;min-width:0;padding:2px 4px;position:relative}.mobile-play-scene .watch-speed-label-full{display:none}.mobile-play-scene .watch-speed-label-short{display:inline;font-size:10px}.mobile-play-scene .watch-speed select{width:100%;min-width:0;min-height:32px;height:32px;padding:2px 15px 2px 0;font-size:16px;background:transparent;border:0;color:#29445f;-webkit-tap-highlight-color:transparent;appearance:none;-webkit-appearance:none}
 .mobile-play-scene .watch-speed::after{content:'';position:absolute;right:9px;top:calc(50% - 4px);width:6px;height:6px;border-right:2px solid #29445f;border-bottom:2px solid #29445f;transform:rotate(45deg);pointer-events:none}
 .mobile-play-scene .watch-speed select:focus:not(:focus-visible),.mobile-play-scene .watch-speed select[data-pointer-focus]:focus{outline:none;box-shadow:none}
 .mobile-play-scene .watch-speed select:focus-visible:not([data-pointer-focus]){outline:3px solid #bf4253;outline-offset:2px}
 .mobile-watch-tabs{grid-column:1/-1}.mobile-play-scene .watch-feedback{position:absolute;bottom:90px;left:8px;right:8px;z-index:5;height:auto;padding:0;pointer-events:none}.mobile-play-scene .watch-feedback .watch-error{background:#fff3de;font-size:11px;margin:0;padding:3px 7px;border-radius:6px}
 .mobile-sheet[hidden]{display:none!important}.mobile-sheet{position:fixed;inset:0;z-index:220;display:flex;align-items:flex-end;justify-content:center}.mobile-sheet-backdrop{position:absolute;inset:0;background:#172c3d66}.mobile-sheet-card{position:relative;display:flex;flex-direction:column;width:min(100%,720px);max-height:calc(100dvh - 56px - env(safe-area-inset-top));min-height:150px;padding:0 0 env(safe-area-inset-bottom);background:#fffbf4;border:1px solid #cdb897;border-radius:20px 20px 0 0;box-shadow:0 -10px 40px #182c3930;color:#29445f;overflow:hidden}
 .mobile-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;padding:10px 14px;border-bottom:1px solid #e5d7c2}.mobile-sheet-heading h2{margin:0;font:700 18px 'Yu Mincho',serif}.mobile-sheet-heading button{min-height:40px!important;padding:6px 10px;border:1px solid #c9b99f;background:#fff;border-radius:8px;color:#29445f;font-size:13px}
 .mobile-sheet-body{padding:12px;overflow:auto;overscroll-behavior:contain;min-height:0;max-height:calc(100dvh - 135px - env(safe-area-inset-top) - env(safe-area-inset-bottom));font:14px/1.7 Meiryo,sans-serif}.mobile-sheet-body [hidden]{display:none!important}
 .mobile-menu-links{display:grid;gap:8px}.mobile-menu-links button,.mobile-menu-links a,.mobile-replay-actions button{min-height:44px;padding:9px 12px;text-align:left;border:1px solid #dbccb6;border-radius:9px;background:#fff;color:#29445f;font:700 14px/1.6 Meiryo,sans-serif;text-decoration:none}
 .mobile-sheet .side-panel{display:flex!important;gap:10px}.mobile-sheet .side-panel[data-mobile-view=records]>.info-card,.mobile-sheet .side-panel[data-mobile-view=records]>.action-card,.mobile-sheet .side-panel[data-mobile-view=info]>.history-card{display:none}
 /* The dock already provides game-actions; keep notices, retry, replay and result controls. */
 .mobile-sheet .side-panel>.action-card:not(:has(> :not(.game-actions))){display:none}
 .mobile-sheet .action-card .game-actions{display:none}.mobile-sheet .history-card{min-height:0;max-height:none;margin:0;flex:none}.mobile-sheet .history-list{height:45dvh;max-height:45dvh;min-height:160px;overflow:auto}.mobile-sheet .info-card,.mobile-sheet .action-card{flex:none}.mobile-replay-actions{display:flex;flex-wrap:wrap;gap:5px;padding-top:8px}.mobile-replay-actions button{font-size:12px;flex:1;text-align:center;padding:7px 4px;white-space:nowrap}
 .mobile-sheet [data-mobile-section=records]:not([hidden]){display:flex;gap:6px}.mobile-sheet .watch-record-panel{display:flex!important;flex:1;min-width:0;width:50%;height:auto;min-height:0;margin:0;padding:8px 5px}.mobile-sheet .watch-record-panel h2{font-size:15px}.mobile-sheet .watch-history .history-row{height:46px;min-height:46px;font-size:13px}
 .mobile-sheet .watch-controls{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:0}.mobile-sheet .watch-controls>[data-watch]{display:block}.mobile-sheet .watch-controls .mobile-watch-tabs{display:none}.mobile-sheet .watch-speed{grid-column:1/-1;grid-row:auto}.mobile-sheet .watch-controls button{min-height:44px!important;height:auto;padding:8px;font-size:13px}
 .mobile-conversation-row{border:1px solid #dfd1bc;background:#fff;border-radius:12px;padding:10px 12px;margin-bottom:10px}.mobile-conversation-row strong{font-size:12px;color:#9f3047}.mobile-conversation-row p{margin:5px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
 .audio-settings-panel{z-index:400}.mobile-play-scene .game-modal{z-index:500}.mobile-play-scene .game-modal>div{max-height:80dvh}.mobile-play-scene .game-toast{z-index:510}
}
@media(max-width:1100px) and (max-height:640px){.mobile-play-scene{--mobile-seat-height:76px}.mobile-play-scene .watch-layout{--mobile-seat-height:80px}.mobile-normal-dock button,.mobile-play-scene .watch-controls button,.mobile-play-scene .watch-speed{min-height:36px!important;height:36px}.mobile-play-scene .hand-strip{min-height:30px;height:30px}.mobile-play-scene .manager-stage .speech-bubble{font-size:12px}.mobile-play-scene .game-layout{gap:3px}}
@media(min-width:600px) and (max-width:1100px){.mobile-play-scene{--mobile-seat-height:128px}.mobile-play-scene .watch-layout{--mobile-seat-height:144px}.mobile-play-scene .manager-stage{grid-template-columns:110px minmax(0,1fr)}.mobile-play-scene .manager-stage .manager-portrait{width:110px}.mobile-play-scene .manager-stage .manager-portrait img{width:220px!important;height:220px!important}.mobile-play-scene .manager-stage .speech-bubble{font-size:16px;line-height:1.5}.mobile-play-scene .watch-seat .manager-stage{grid-template-columns:85px minmax(0,1fr)}.mobile-play-scene .watch-seat .manager-stage .watch-portrait{width:85px!important}.mobile-play-scene .watch-seat .watch-portrait svg{width:220px!important;height:220px!important}.mobile-play-scene .watch-bubble-text{font-size:14px!important;line-height:1.45!important}.mobile-play-scene .watch-seat-info strong{font-size:13px}.mobile-play-scene .hand-strip{height:38px;min-height:38px}.mobile-play-scene .hand-piece{min-width:36px;min-height:32px!important;height:32px;font-size:23px}.mobile-play-scene .clock-chip,.mobile-play-scene .hand-owner,.mobile-play-scene .hand-content{font-size:12px}.mobile-normal-dock button,.mobile-play-scene .watch-controls button{font-size:15px;min-height:44px!important;height:44px}}


@media(max-width:1100px){.mobile-play-scene .watch-seat .watch-portrait img{width:145px!important;height:145px!important;top:0}.mobile-play-scene .watch-seat .watch-portrait img.mirrored{transform:translateX(-50%) scaleX(-1)}}
@media(min-width:600px) and (max-width:1100px){.mobile-play-scene .watch-seat .watch-portrait img{width:220px!important;height:220px!important}}

/* Only the mobile presentation changes; the same controls own their state. */
@media(max-width:1100px){
 html.mobile-setup-page,html.mobile-setup-page body{height:100%;overscroll-behavior-y:none}
 html.mobile-setup-page .pwa-tools:not(:has(.pwa-message)){display:none}
 .mobile-setup-scene{height:var(--mobile-screen-height,100dvh);min-height:0;display:flex;flex-direction:column;overflow:visible}
 .mobile-setup-scene>.welcome-layout,.mobile-setup-scene>.setup-layout,.mobile-setup-scene>.watch-setup-layout{flex:1;min-height:0;width:100%;max-width:780px;margin:0 auto;padding:8px max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));gap:8px}
 .mobile-setup-scene .welcome-layout{display:grid;grid-template-rows:minmax(100px,1fr) auto;align-items:stretch}
 .mobile-setup-scene .welcome-character{grid-row:1;position:relative;inset:auto;width:100%;height:100%;min-height:0;justify-self:center}
 .mobile-setup-scene .welcome-character img{height:100%;max-height:100%;width:auto;object-fit:contain}
 .mobile-setup-scene .welcome-speech{top:8px;left:auto;right:2%;padding:8px 12px;font-size:13px}
 .mobile-setup-scene .welcome-card{grid-row:2;width:100%;max-width:none;padding:16px 18px;border-radius:18px}
 .mobile-setup-scene .eyebrow{font-size:12px;margin:0;letter-spacing:.06em}
 .mobile-setup-scene .welcome-card h1{font-size:clamp(23px,6.5vw,38px);line-height:1.4;letter-spacing:.02em;margin:9px 0}
 .mobile-setup-scene .welcome-card h1 br{display:none}
 .mobile-setup-scene .welcome-lead{font-size:14px;line-height:1.6;margin:6px 0 12px}
 .mobile-setup-scene .welcome-actions{display:flex;flex-wrap:wrap;gap:7px;margin:0}
 .mobile-setup-scene .welcome-actions button{flex:1;min-height:44px;padding:8px 10px;font-size:15px;white-space:nowrap}
 .mobile-saved-button{min-height:44px;width:100%;margin-top:9px;padding:8px 12px;border:1px solid #bdcbd1;background:#edf2f3;color:#294b65;border-radius:10px;font:700 14px Meiryo,sans-serif}
 .mobile-setup-scene .setup-layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:clamp(72px,12dvh,112px) minmax(0,1fr)}
 .mobile-setup-scene .setup-aside{grid-row:1;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;height:100%;min-height:0}
 .mobile-setup-scene .setup-aside img{order:-1;width:90px;height:100%;max-width:30%;object-fit:contain;object-position:center}
 .mobile-setup-scene .setup-aside-bubble{position:static;transform:none;max-width:330px;padding:9px 12px;font-size:13px;line-height:1.5}
 .mobile-setup-scene .setup-aside-foot{display:none}
 .mobile-setup-scene .setup-card{grid-row:2;display:flex;flex-direction:column;min-height:0;max-height:none;overflow:visible;width:100%;padding:13px 14px;border-radius:17px}
 .mobile-setup-scene .section-kicker{font-size:11px;flex:none}
 .mobile-setup-scene .setup-card h1{font-size:clamp(20px,5.4vw,28px);line-height:1.4;margin:4px 0 6px;flex:none}
 .mobile-setup-scene .setup-intro{font-size:12px;line-height:1.6;margin:0 0 8px;flex:none}
 .mobile-setup-scene .setup-options{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;padding-right:2px;touch-action:pan-y}
 .mobile-setup-scene .option-group{padding:7px 0;margin:0;min-width:0}
 .mobile-setup-scene .option-group legend{font-size:13px;line-height:1.5;white-space:normal;float:none;margin:0;padding:0 0 5px}
 .mobile-setup-scene .option-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .mobile-setup-scene .difficulty-grid,.mobile-setup-scene #think-setting .option-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .mobile-setup-scene .option-group:has([name=clock]) .option-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 .mobile-setup-scene .option-face{min-height:40px;padding:5px 4px}.mobile-setup-scene .option-face strong{font-size:13px;line-height:1.4;letter-spacing:0}
 .mobile-setup-scene .option{position:relative;min-width:0}
 .mobile-setup-scene .volume-setting{display:none}
 .mobile-setup-scene .setup-footer{flex:none;flex-wrap:nowrap;margin-top:6px;padding-top:9px;gap:6px}
 .mobile-setup-scene .setup-footer button{padding:8px 10px;font-size:13px;min-height:44px}
 .mobile-setup-scene .setup-footer-right{gap:5px;flex-wrap:wrap;justify-content:flex-end}
 .mobile-setup-scene .watch-setup-layout{display:flex;flex-direction:column}
 .mobile-setup-scene .watch-config{flex:1;min-height:0;overflow:visible;gap:8px;padding:18px 15px}
 .mobile-setup-scene .watch-setup-options{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;padding-right:2px;touch-action:pan-y}
 .mobile-setup-scene .watch-config h1{font-size:clamp(21px,5.4vw,28px);margin:0}
 .mobile-setup-scene .watch-note{font-size:13px;line-height:1.6;margin:4px 0}
 .mobile-setup-scene .watch-pickers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:4px 0}
 .mobile-setup-scene .watch-pickers label,.mobile-setup-scene .watch-extras label{font-size:13px;min-width:0;gap:5px}
 .mobile-setup-scene .watch-pickers select,.mobile-setup-scene .watch-extras select{width:100%;min-height:44px;font-size:16px;padding:7px 8px}
 .mobile-setup-scene .watch-card-label{font-size:13px;margin:2px 0}
 .mobile-setup-scene .watch-extras{display:grid;grid-template-columns:1fr;gap:10px;margin:3px 0}
 .mobile-setup-scene .watch-setup-actions{margin-top:auto;display:grid;grid-template-columns:1fr 1fr;gap:7px;padding-top:12px}
 .mobile-setup-scene .watch-setup-actions button,.mobile-setup-scene .watch-setup-actions a{min-height:44px;padding:9px 6px;font-size:14px;text-align:center}
 .mobile-setup-scene .watch-setup-actions .mobile-saved-button{grid-column:1/-1;margin:0}
 .mobile-sheet [data-mobile-section=saved] .saved-records,.mobile-sheet [data-mobile-section=saved] .watch-records{display:block;margin:0;padding:0;border:0;background:transparent;box-shadow:none}
 .mobile-sheet [data-mobile-section=saved] .watch-record-list{max-height:none;overflow:visible}
 .mobile-sheet [data-mobile-section=saved] :is(.saved-records,.watch-records)>h2{display:none}
 .mobile-sheet [data-mobile-section=saved] .saved-record{width:100%;min-height:56px}
 /* These are the existing desktop time elements, updated by the same tick. */
 .mobile-play-scene{--mobile-seat-height:clamp(100px,16dvh,136px)}
 .mobile-play-scene .manager-panel:not(.watch-seat){display:flex;flex-direction:column}
 .mobile-play-scene .manager-panel:not(.watch-seat) .manager-stage{flex:1;min-height:0;height:auto}
 .mobile-play-scene .manager-panel:not(.watch-seat) .manager-info{display:flex;flex:none;height:20px;min-height:20px;flex-direction:row;justify-content:center;padding:2px 6px}
 .mobile-play-scene .manager-panel:not(.watch-seat) .manager-info small,.mobile-play-scene .manager-panel:not(.watch-seat) .manager-info strong{display:none}
 .mobile-play-scene .manager-panel .manager-info>span{display:block;font:700 11px/16px Meiryo,sans-serif;color:#fff;white-space:nowrap}
 .mobile-play-scene .watch-layout{--mobile-seat-height:clamp(102px,17dvh,154px)}
 .mobile-play-scene .watch-seat .manager-info{height:34px!important;min-height:34px;display:grid;grid-template-columns:auto 1fr;gap:0 4px;padding:2px 5px}
 .mobile-play-scene .watch-seat .manager-info>span{grid-column:1/-1;font-size:10px;line-height:14px}
 .mobile-play-scene .watch-seat .manager-info>span:not(:has(time:not([hidden]))){overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:1100px) and (max-height:650px){
 .mobile-setup-scene .welcome-card{padding:10px 14px}.mobile-setup-scene .welcome-card h1{margin:5px 0}.mobile-setup-scene .welcome-lead{margin:4px 0 8px;font-size:13px}
 .mobile-setup-scene .setup-layout{grid-template-rows:64px minmax(0,1fr);gap:5px}.mobile-setup-scene .setup-card{padding:9px 11px}.mobile-setup-scene .setup-intro{font-size:11px}.mobile-setup-scene .option-group{padding:5px 0}
 .mobile-setup-scene .watch-config{padding:12px;gap:5px}.mobile-setup-scene .watch-note{font-size:12px}.mobile-setup-scene .watch-extras{gap:7px}
}


/* Compact controls retain the desktop arrangement and expose history on demand. */
@media(min-width:1101px){
 .desktop-sheet:not([hidden]){position:fixed;inset:0;z-index:80;display:flex;align-items:center;justify-content:center}
 .desktop-sheet .mobile-sheet-backdrop{position:absolute;inset:0;background:#172c3d66}
 .desktop-sheet .mobile-sheet-card{position:relative;width:min(720px,90vw);max-height:85dvh;display:flex;flex-direction:column;background:#fffbf4;border:1px solid #cdb897;border-radius:18px;overflow:hidden;padding:16px}
 .desktop-sheet .mobile-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}
 .desktop-sheet .mobile-sheet-heading h2{margin:0;font-size:23px}.desktop-sheet button{padding:8px 14px}
 .desktop-sheet .mobile-sheet-body{overflow:auto;max-height:70dvh;min-height:0}
 .desktop-sheet .mobile-sheet-card[aria-label="メニュー"]{width:min(460px,90vw);padding:0}
 .desktop-sheet .mobile-sheet-card[aria-label="メニュー"] .mobile-sheet-heading{padding:14px 18px;border-bottom:1px solid #e5d7c2}
 .desktop-sheet .mobile-sheet-card[aria-label="メニュー"] .mobile-sheet-body{padding:16px 18px 18px}
 .desktop-sheet .mobile-menu-links{display:grid;gap:8px}
 .desktop-sheet .mobile-menu-links :is(button,a){display:block;width:100%;min-height:44px;padding:10px 14px;text-align:left;border:1px solid #dbccb6;border-radius:9px;background:#fff;color:#29445f;font:700 14px/1.6 Meiryo,sans-serif;text-decoration:none}
 .desktop-sheet .mobile-menu-links :is(button,a):hover{background:#f4f0e8;border-color:#bca78b}
 .desktop-sheet [hidden]{display:none!important}.desktop-sheet .mobile-conversation-row{border-bottom:1px solid #dfd1bc;padding:10px 0}.desktop-sheet p{white-space:pre-wrap}
}
.audio-panel-close{float:right;margin-top:-45px;border:1px solid #cdb897;border-radius:8px;background:#fff;color:#29445f;padding:6px 10px}
.record-save-notice{position:fixed;left:50%;top:64px;transform:translateX(-50%);z-index:600;width:min(560px,94vw);padding:10px 14px;background:#fff3db;border:2px solid #bd7a35;border-radius:12px;color:#543c27;font:14px/1.5 Meiryo,sans-serif;box-shadow:0 6px 20px #0002}
.record-save-notice p{margin:0 0 7px}.record-save-notice button{margin-right:8px;padding:7px 10px}
.record-save-notice.recovery-offer{position:absolute;left:50%;right:auto;top:auto;bottom:8px;width:min(420px,94%);transform:translateX(-50%);z-index:3;padding:9px 12px;font-size:13px;line-height:1.45;box-sizing:border-box}
.recovery-notice-actions{display:flex;flex-wrap:wrap;gap:7px}
.record-save-notice .recovery-notice-actions button{margin:0;min-height:44px}
@media(max-width:1100px){
 .mobile-setup-scene .welcome-character>.recovery-offer{bottom:2px;width:min(420px,96%);padding:7px 9px;font-size:12px;line-height:1.45;border-radius:12px}
 .recovery-offer .recovery-notice-actions{display:grid;grid-template-columns:1fr 1fr}
 .recovery-offer .recovery-notice-actions button{padding:6px 4px;font-size:12px;letter-spacing:0}
}
@media(max-width:1100px){.desktop-conversation-button{display:none}.mobile-normal-dock .mobile-primary-actions:empty{display:none}.mobile-seat-toggle{min-height:20px!important;padding:1px 6px;font:10px Meiryo,sans-serif;border:1px solid #c6bba9;border-radius:5px;color:#29445f;background:#fffaf2}.mobile-play-scene .game-topbar,.mobile-play-scene .watch-summary{position:relative}.mobile-seat-toggle{position:absolute;right:0;top:0}.mobile-seat-compact{--mobile-seat-height:45px!important}.mobile-seat-compact .watch-layout{--mobile-seat-height:54px!important}.mobile-seat-compact .manager-stage{grid-template-columns:42px minmax(0,1fr)}.mobile-seat-compact .manager-stage .manager-portrait{width:42px}.mobile-seat-compact .manager-stage .manager-portrait img{width:100px!important;height:100px!important}.mobile-seat-compact .manager-stage .speech-bubble{padding:1px 4px;font-size:11px;-webkit-line-clamp:var(--mobile-speech-lines,1)}.mobile-seat-compact .watch-seat .manager-stage{grid-template-columns:32px minmax(0,1fr)}.mobile-seat-compact .watch-seat .manager-stage .watch-portrait{width:32px!important}.mobile-seat-compact .watch-bubble-text{-webkit-line-clamp:var(--mobile-speech-lines,1);font-size:10px!important}.mobile-seat-compact .watch-seat .manager-stage .watch-portrait img{width:95px!important;height:95px!important}}

.watch-feedback button{pointer-events:auto}

/* Mobile text fitting changes only typography inside the existing fixed slots. */
@media(max-width:1100px){
 .desktop-only{display:none}
 .mobile-play-scene .manager-stage .speech-bubble{--mobile-bubble-base:13px;--mobile-bubble-min:11px;--mobile-bubble-base-leading:1.35;--mobile-bubble-pad-x:7;font-size:var(--mobile-bubble-font,var(--mobile-bubble-base))!important;line-height:var(--mobile-bubble-leading,var(--mobile-bubble-base-leading))!important;padding:var(--mobile-bubble-inset,3px 7px)!important}
 .mobile-play-scene .watch-seat .watch-bubble{--mobile-bubble-base:11px;--mobile-bubble-min:10px;--mobile-bubble-pad-x:4;padding:var(--mobile-bubble-inset,3px 4px)!important}
 .mobile-play-scene .watch-bubble-text{font-size:var(--mobile-bubble-font,var(--mobile-bubble-base))!important;line-height:var(--mobile-bubble-leading,var(--mobile-bubble-base-leading))!important}
 .mobile-setup-scene .setup-footer{display:grid;grid-template-columns:1fr 1fr;gap:7px;--mobile-setup-action-row:1}
 .mobile-setup-scene .setup-footer:has(>[data-screen="game"]){--mobile-setup-action-row:2}
 .mobile-setup-scene .setup-footer-right{display:contents}
 .mobile-setup-scene .setup-footer>[data-screen="game"]{grid-column:1/-1;grid-row:1}
 .mobile-setup-scene .setup-footer>[data-screen="title"]{grid-column:1;grid-row:var(--mobile-setup-action-row)}
 .mobile-setup-scene .setup-footer [data-action="new-game"]{grid-column:2;grid-row:var(--mobile-setup-action-row)}
 .mobile-setup-scene .watch-setup-actions .mobile-saved-button{grid-row:1}
 .mobile-setup-scene .watch-setup-actions .watch-home{grid-column:1;grid-row:2}
 .mobile-setup-scene .watch-setup-actions [data-watch="start"]{grid-column:2;grid-row:2}
 .mobile-setup-scene :is(.setup-footer,.watch-setup-actions)>:is(button,a),.mobile-setup-scene .setup-footer-right>button{display:flex;align-items:center;justify-content:center;min-height:44px;width:100%;margin:0;padding:8px 6px;border-radius:9px;font:700 14px/1.4 Meiryo,sans-serif;letter-spacing:0;text-align:center;text-decoration:none}
 .mobile-setup-scene .setup-footer>[data-screen="title"],.mobile-setup-scene .watch-home{background:#fffaf2;border:1px solid #c6bba9;color:#29445f;box-shadow:none}
}
@media(min-width:600px) and (max-width:1100px){
 .mobile-play-scene .manager-stage .speech-bubble{--mobile-bubble-base:16px;--mobile-bubble-min:14px;--mobile-bubble-base-leading:1.5}
 .mobile-play-scene .watch-seat .watch-bubble{--mobile-bubble-base:14px;--mobile-bubble-min:12px;--mobile-bubble-base-leading:1.45}
}
@media(max-width:1100px){
 .mobile-seat-compact .manager-stage .speech-bubble{--mobile-bubble-base:11px;--mobile-bubble-min:10px}
 .mobile-seat-compact .watch-seat .watch-bubble{--mobile-bubble-base:10px;--mobile-bubble-min:10px}
}

.mobile-primary-actions:has(> :only-child){grid-template-columns:1fr}
/* Transfer the exact control-height saving to speech; the board row is unchanged. */
@media(max-width:1100px){
 .mobile-play-scene .watch-layout{--watch-control-saving:8px;--watch-lower-extra:4px;--watch-control-height:36px;grid-template-rows:28px calc(var(--mobile-seat-height) + var(--mobile-speech-extra,0px) + var(--watch-control-saving)) minmax(0,1fr) auto}
 .mobile-play-scene .watch-controls{grid-template-columns:repeat(3,minmax(0,1fr))}
 .mobile-play-scene .watch-controls button,.mobile-play-scene .watch-speed{height:var(--watch-control-height);min-height:var(--watch-control-height)!important}
 .mobile-play-scene .watch-speed select{height:28px;min-height:28px;font-size:16px}
 .mobile-play-scene .watch-seat .watch-speech-stack{grid-template-rows:minmax(0,calc(50% - 1.5px - var(--watch-lower-extra))) minmax(0,1fr)}
 .mobile-play-scene .watch-seat .watch-bubble{--mobile-bubble-min:9px;cursor:default;background:#fffef9}
 .mobile-play-scene .watch-seat .watch-bubble.lower:not(.luna-latest){background:#fffef9}
 .mobile-play-scene .watch-seat .watch-bubble.lower.luna-latest{background:#fff2d6}
}
@media(max-width:359px){
 .mobile-play-scene .watch-speed{gap:0;padding:2px}
 .mobile-play-scene .watch-speed select{padding-right:9px}
 .mobile-play-scene .watch-speed::after{right:5px;width:5px;height:5px}
}
@media(max-width:1100px) and (max-height:640px){
 .mobile-play-scene .watch-layout{--watch-control-saving:0px;--watch-lower-extra:0px}
}
@media(min-width:600px) and (max-width:1100px){
 .mobile-play-scene .watch-layout{--watch-control-height:40px}
}
@media(max-width:1100px){.review-coach-explanation{max-height:none!important;overflow:visible!important}.review-coach-modal>section{overflow:auto}}

/* Normal-game speech is read in place. Only genuine height shortages grow the
   page; the existing square size and the desktop/watch layouts are preserved. */
@media(max-width:1100px){
 .mobile-play-scene:not(.spectator-page){height:calc(var(--mobile-screen-height,100dvh) + var(--mobile-normal-speech-overflow,0px))!important}
 .mobile-play-scene:not(.spectator-page) .game-layout{grid-template-rows:20px calc(var(--mobile-seat-height) + var(--mobile-speech-extra,0px) + var(--mobile-normal-speech-extra,0px)) minmax(0,1fr) auto}
 .mobile-play-scene:not(.spectator-page) .manager-stage .speech-bubble[data-speech]{display:block;-webkit-line-clamp:none;max-height:none;overflow:visible;overflow-wrap:anywhere;cursor:default}
}

/* Keep the mobile welcome speech and portrait in separate layout rows. */
@media(max-width:1100px){
 .mobile-setup-scene .welcome-character{display:grid;grid-template-rows:auto minmax(0,1fr);row-gap:26px;align-items:stretch;justify-items:center}
 .mobile-setup-scene .welcome-character img{grid-row:2;min-height:0;max-width:100%;align-self:end;justify-self:center}
 .mobile-setup-scene .welcome-speech{grid-row:1;position:relative;top:auto;left:auto;right:auto;justify-self:end;max-width:96%;margin:4px 2% 0 0;padding:5px 12px}
 /* The recovery offer overlays the lower portrait; it never participates in the image grid. */
}

@media(max-width:1100px){.mobile-setup-scene .welcome-character>.recovery-offer{padding:4px 7px;line-height:1.35}.mobile-setup-scene .recovery-offer p{margin-bottom:4px}.mobile-setup-scene .recovery-offer .recovery-notice-actions button{min-height:40px}}
@media(max-width:360px) and (max-height:620px){.mobile-setup-scene .welcome-character>.recovery-offer{bottom:-40px}}

/* Title artwork is one immutable image; no independently positioned bubble. */
@media(max-width:1100px){
 .mobile-setup-scene .welcome-character-composite{display:block}
 .mobile-setup-scene .welcome-character-composite img{display:block;width:100%;height:100%;max-width:100%;object-fit:contain;object-position:center bottom}
}
