/* Shared phone layouts for the word games. Native scroll/zoom remain available
   outside the letter-entry controls; no maximum-scale viewport restriction. */
.word-phone-home,.word-phone-only {display:none!important;}
.wurdle-board-viewport,.word-phone-dock {display:contents;}
.word-phone-sheet {width:min(560px,calc(100vw - 24px));max-height:85dvh;overflow:auto;padding:18px;border:1px solid #c9c3df;border-radius:18px;background:#fffdf9;color:#292538;}
.word-phone-sheet::backdrop {background:#18142d88;}
.word-phone-sheet>header {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;}
.word-phone-sheet h2 {font:750 20px/1.3 system-ui;margin:0;}
.word-phone-sheet button {min-width:44px;min-height:44px;padding:8px 14px;border:1px solid #d5cee5;border-radius:10px;background:#eee8f8;color:#38275c;font:650 14px system-ui;touch-action:manipulation;}
.word-phone-sheet p {font:15px/1.6 system-ui;}
.word-phone-held {filter:brightness(.85);transform:translateY(1px);}
.keyboard__row[hidden] {display:none!important;}

@media(pointer:coarse) and (max-width:1100px){
 .word-phone-only {display:inline-flex!important;}
 :is(.wurdle-body,.texttwirl-body) {height:100dvh;min-height:0;overflow:hidden;background:#f6f6fb;}
 :is(.wurdle-body,.texttwirl-body)>.app-navbar,:is(.wurdle-body,.texttwirl-body) #playsible-leaderboard-widget,:is(.wurdle-body,.texttwirl-body) #playsible-leaderboard-reopen {display:none!important;}
 :is(.wurdle-page,.texttwirl-page) {position:fixed;inset:0;min-height:0;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);}
 :is(.wurdle-game-section,.texttwirl-game-section),:is(.wurdle-shell,.texttwirl-shell) {height:100%;width:100%;padding:0;margin:0;min-height:0;}
 :is(.wurdle-game-panel,.texttwirl-game-panel) {display:flex;flex-direction:column;height:100%;min-height:0;border:0;border-radius:0;box-shadow:none;overflow:hidden;}
 :is(.wurdle-toolbar,.texttwirl-toolbar) {flex:0 0 auto;flex-direction:row;align-items:center;gap:6px;min-height:56px;padding:5px 8px;}
 .word-phone-home {display:grid!important;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:10px;background:#eeeaf8;color:#4d4086;text-decoration:none;font-size:24px;}
 :is(.wurdle-title-lockup,.texttwirl-title-lockup){flex:1;min-width:0;gap:0;}
 :is(.wurdle-title-icon,.texttwirl-title-icon,.wurdle-kicker,.texttwirl-kicker){display:none;}
 :is(.wurdle-title-lockup,.texttwirl-title-lockup) :is(h1,h2){font-size:16px;letter-spacing:-.4px;margin:0;}
 :is(.wurdle-scoreboard,.texttwirl-scoreboard){width:auto;flex:0 0 auto;gap:4px;padding:0;overflow:visible;align-items:center;}
 :is(.wurdle-stat,.texttwirl-stat):has(#wins,#losses,#streak){display:none;}
 :is(.wurdle-stat,.texttwirl-stat){min-width:40px;min-height:44px;padding:3px 5px;border:0;background:transparent;}
 :is(.wurdle-stat-time,.texttwirl-stat-time){min-width:48px;}
 :is(.wurdle-stat,.texttwirl-stat) span {font-size:9px;}
 :is(.wurdle-stat,.texttwirl-stat) strong {font-size:16px;}
 :is(.wurdle-icon-button,.texttwirl-icon-button){width:44px;min-width:44px;height:44px;min-height:44px;}
 :is(.wurdle-game-footer,.texttwirl-game-footer){display:none;}
 :is(.wurdle-play-area,.texttwirl-play-area){flex:1 1 0;min-height:0;overflow:hidden;padding:8px;display:flex;flex-direction:column;}
 .wurdle-board-viewport {display:block;flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:4px 4px 12px;scroll-padding:8px;}
 .wurdle-body #game{gap:5px;outline:0;padding:0;}
 .wurdle-body #game .word{gap:5px;}
 .wurdle-body #game .letter{width:min(48px,calc((100% - (var(--wurdle-word-length) - 1)*5px)/var(--wurdle-word-length)));height:auto;aspect-ratio:1;min-width:0;max-height:48px;font-size:clamp(16px,4vw,22px);border-radius:6px;}
 .wurdle-body #game .is-current .letter{border-color:#9484d0;}
 .wurdle-body #keyboard{flex:0 0 auto;margin:0;padding:6px 0 4px;border-top:1px solid #e4dfed;background:#f6f6fb;}
 .wurdle-body .keyboard{width:100%;}
 .wurdle-body .keyboard__row{height:52px;margin:6px 0;gap:3px;}
 .wurdle-body .keyboard__row>*{padding:0;min-width:0;font-size:16px;}
 .wurdle-body .keyboard__row>.key--word{flex:1.5;font-size:12px;}
 .wurdle-body #tinyGrids{margin-top:8px;}
 :is(.wurdle-body,.texttwirl-body) .alert{font-size:13px;padding:8px;margin:7px 0;}
 :is(.wurdle-body,.texttwirl-body) .modal :is(input,select,textarea){font-size:16px;}
 :is(.wurdle-body,.texttwirl-body) .modal button{min-height:44px;}
 :is(.wurdle-body,.texttwirl-body) .modal .btn-close{min-width:44px;min-height:44px;box-sizing:border-box;background-size:14px;}
 .texttwirl-body #game{display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:auto;outline:0;padding:0;}
 .texttwirl-found-words{flex:1 0 auto;min-height:0;padding:10px;}
 .texttwirl-body .stupid-wrapper{overflow:visible;}
 .texttwirl-body .blanks-container{min-width:0;max-height:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px;padding:0;}
 .texttwirl-body .word-blank{gap:2px;}
 .texttwirl-body .letter-blank{width:clamp(19px,5.2vw,25px);height:25px;flex:0 1 25px;font-size:12px;}
 .texttwirl-section-label{margin-bottom:8px;}
 .texttwirl-body #multiplayerScoreboard{margin:8px 0;}
 .word-phone-dock{display:block;position:sticky;bottom:0;flex:0 0 auto;order:10;background:#f6f6fb;padding:7px 0 0;margin-top:auto;z-index:5;}
 .texttwirl-letter-stage{padding:9px 4px;margin:0 0 7px;border-radius:12px;}
 .texttwirl-body .input-tt{min-height:0;margin-bottom:9px;}
 .texttwirl-body .bank-tt{min-height:0;}
 .texttwirl-body .letter-input,.texttwirl-body .letter-bank{width:min(52px,calc((100vw - 56px)/6));height:48px;max-height:48px;flex:0 1 52px;min-width:0;font-size:20px;border-radius:8px;}
 .texttwirl-letter-stage .texttwirl-section-label{display:none;}
 .texttwirl-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0;}
 .texttwirl-body .ttbutton{min-width:0;min-height:44px;height:44px;margin:0;padding:0 5px;font-size:13px;border-radius:9px;}
 #twistButton{order:1} .texttwirl-controls>[data-key="8"]{order:2} #enterButton{order:3} #lastButton{order:4} #clearButton{order:5} .texttwirl-controls>.word-phone-only:last-child{order:6}
 .texttwirl-body .alerts{margin:0;}.texttwirl-actions:has(#playAgain[style*="block"]){position:sticky;top:0;z-index:6;background:#f6f6fb;padding:7px;}
 .texttwirl-play-again,.wurdle-play-again{min-height:44px;}
 /* Wordweave keeps the live pool beside its chain; team/chat opens separately. */
 .wordweave-body:has(.ww-game-shell.is-playing)>.app-navbar {display:none!important;}
 .wordweave-body:has(.ww-game-shell.is-playing){height:100dvh;min-height:0;overflow:hidden;}
 .ww-game-shell.is-playing{position:fixed;inset:0;display:flex;flex-direction:column;width:auto;margin:0;padding:8px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));padding-top:max(8px,env(safe-area-inset-top));}
 .ww-game-shell.is-playing>.ww-heading{flex:0 0 auto;gap:6px;margin:0 0 7px;}
 .ww-game-shell.is-playing .ww-brand{gap:6px;}.ww-game-shell.is-playing .ww-brand h1{font-size:16px;}
 .ww-game-shell.is-playing .ww-heading-actions{gap:5px;}.ww-game-shell.is-playing .ww-heading-actions .ww-button{min-height:44px;font-size:12px;padding:8px;}
 .ww-game-shell.is-playing .ww-heading-actions .ww-icon-button{min-width:44px;height:44px;}
 .ww-game-shell.is-playing>.ww-feedback{margin:0;font-size:12px;}
 .ww-game-shell.is-playing>.ww-play-layout{display:flex;flex:1 1 0;min-height:0;}
 .ww-game-shell.is-playing .ww-main-column{display:flex;flex-direction:column;flex:1 1 0;min-height:0;}
 .ww-game-shell.is-playing .ww-board-panel{display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:auto;padding:10px;border-radius:14px;}
 .ww-game-shell.is-playing .ww-board-heading{flex:0 0 auto;gap:8px;margin-bottom:7px;}
 .ww-game-shell.is-playing .ww-board-heading h2{font-size:15px;min-width:0;overflow-wrap:anywhere;}
 .ww-game-shell.is-playing .ww-progress{gap:10px;}.ww-game-shell.is-playing .ww-progress strong{font-size:19px;}.ww-game-shell.is-playing .ww-progress span{font-size:9px;}
 .ww-game-shell.is-playing .ww-chain-heading{min-height:28px;gap:8px;margin-bottom:5px;}
 #ww-latest{min-height:44px;padding:6px 9px;font-size:12px;}
 .ww-game-shell.is-playing #ww-backtrack-instruction{font-size:10px;}
 .ww-game-shell.is-playing #ww-chain{display:flex;flex-wrap:nowrap;flex:0 0 auto;overflow-x:auto;overscroll-behavior-x:contain;gap:6px;margin:0;padding:4px 0 8px;min-height:64px;}
 .ww-game-shell.is-playing .ww-chain-card{flex:0 0 auto;min-width:78px;min-height:48px;max-width:150px;padding:7px 9px;font-size:13px;}.ww-game-shell.is-playing .ww-chain-card small{max-width:130px;white-space:normal;}
 .ww-game-shell.is-playing .ww-branch-status{font-size:12px;line-height:1.4;margin:5px 0;padding:0;}
 .ww-game-shell.is-playing #ww-selection{font-size:11px;margin:0 0 5px;}
 .ww-game-shell.is-playing .ww-pool-section{flex:1 1 0;min-height:100px;overflow:auto;overscroll-behavior:contain;margin:4px 0;padding:0 0 6px;}
 .ww-game-shell.is-playing .ww-pool-heading{position:sticky;top:0;z-index:2;background:#fffdf9;padding:5px 0;margin-bottom:6px;gap:6px;}
 .ww-game-shell.is-playing .ww-pool-heading h3{font-size:14px;}.ww-game-shell.is-playing .ww-after{font-size:11px;}.ww-game-shell.is-playing .ww-after strong{font-size:14px;}.ww-game-shell.is-playing .ww-vote-clock{font-size:11px;}
 .ww-game-shell.is-playing #ww-vote-rule{font-size:11px;line-height:1.4;margin-bottom:8px;}
 .ww-game-shell.is-playing .ww-rack{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;}
 .ww-game-shell.is-playing .ww-card{min-height:64px;padding:9px 5px;}.ww-game-shell.is-playing .ww-card strong{font-size:16px;letter-spacing:0;}.ww-game-shell.is-playing .ww-card small{font-size:9px;}.ww-game-shell.is-playing .ww-voters{font-size:10px;overflow-wrap:anywhere;}
 .ww-game-shell.is-playing .ww-pool-legend{font-size:10px;gap:8px;}
 .ww-game-shell.is-playing .ww-controls{flex:0 0 auto;gap:7px;margin:0;padding-top:7px;border-top:1px solid #e4dfed;}.ww-game-shell.is-playing .ww-controls button{flex:1;min-height:44px;padding:8px 5px;font-size:12px;}
 .ww-game-shell.is-playing .ww-sidebar{display:none;}
 #ww-phone-team .ww-sidebar{display:grid;gap:12px;}#ww-phone-team .ww-panel{padding:14px;}
 #ww-phone-team :is(input,select,textarea),.ww-shell :is(input,select,textarea){font-size:16px;}
 .ww-shell .ww-icon-button{min-width:44px;min-height:44px;}.ww-shell :is(summary,.ww-kick){min-height:44px;}.ww-shell .ww-kick{min-width:44px;}
 .ww-game-shell.is-playing .ww-request .ww-button{min-height:44px;}
 .ww-dialog{max-height:85dvh;overflow:auto;padding:18px;}
}
@media(pointer:coarse) and (min-width:600px) and (max-width:1100px) and (max-height:600px){
 .wurdle-play-area{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,42%);gap:12px;padding:8px;}
 .wurdle-body #keyboard{align-self:center;border:0;padding:0;}.wurdle-body .keyboard__row{height:clamp(44px,calc((100dvh - 88px)/3),64px);}
 .texttwirl-body #game{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,42%);grid-template-rows:minmax(0,1fr);gap:12px;overflow:hidden;}
 .texttwirl-found-words{grid-column:1;grid-row:1;overflow:auto;}.word-phone-dock{grid-column:2;grid-row:1;position:static;align-self:center;padding:0;}.texttwirl-body #multiplayerScoreboard{grid-column:1;grid-row:1;align-self:end;max-height:90px;overflow:auto;z-index:2;}.texttwirl-body .alerts{position:absolute;left:10px;bottom:10px;max-width:45%;z-index:6;}.texttwirl-actions{grid-column:1;grid-row:1;align-self:start;z-index:6;}
 .texttwirl-body .letter-bank,.texttwirl-body .letter-input{height:44px;}
 .ww-game-shell.is-playing .ww-board-panel{display:grid;grid-template-columns:minmax(210px,.9fr) minmax(0,1.3fr);grid-template-rows:auto auto auto 1fr auto auto;gap:4px 14px;overflow:auto;}
 .ww-game-shell.is-playing .ww-board-heading{grid-column:1;grid-row:1;}.ww-game-shell.is-playing .ww-chain-heading{grid-column:1;grid-row:2;}.ww-game-shell.is-playing #ww-chain{grid-column:1;grid-row:3;}.ww-game-shell.is-playing .ww-branch-status{grid-column:1;grid-row:4;}.ww-game-shell.is-playing #ww-selection{grid-column:1;grid-row:5;}
 .ww-game-shell.is-playing .ww-pool-section{grid-column:2;grid-row:1/6;min-height:0;}.ww-game-shell.is-playing .ww-controls{grid-column:2;grid-row:6;}.ww-game-shell.is-playing .ww-requests{grid-column:1;grid-row:6;}.ww-game-shell.is-playing .ww-hint-result{grid-column:1/-1;}
}
@media(pointer:coarse) and (max-width:380px){.ww-game-shell.is-playing .ww-brand h1{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}}
@media(prefers-reduced-motion:reduce){.word-phone-held{transform:none;}}
@media(pointer:coarse) and (max-width:1100px){
 .wurdle-body .keyboard__row--letters-2{width:100%;}
 .texttwirl-body #game{overflow:hidden;}
 .texttwirl-found-words{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;}
 .texttwirl-body #multiplayerScoreboard{flex:0 0 auto;max-height:90px;overflow:auto;}
 .word-phone-dock{position:static;}
 .texttwirl-controls>[data-key="8"]{order:2!important;}
 .texttwirl-controls>.word-phone-more{order:6;}
}
@media(pointer:coarse) and (max-width:1100px){
 .wurdle-board-viewport{display:flex;flex-direction:column;}
 .wurdle-body #game{flex:0 0 auto;margin-block:auto;}
 .wurdle-body #game .letter{width:var(--word-phone-tile,48px);height:var(--word-phone-tile,48px);max-width:none;max-height:none;flex:0 0 var(--word-phone-tile,48px);padding:0;font-size:clamp(14px,calc(var(--word-phone-tile,48px)*.4),24px);}
 .ww-game-shell.is-playing>.ww-play-layout{align-items:stretch;}
 .ww-game-shell.is-playing>.ww-play-layout>.ww-main-column{height:100%;}
 .ww-game-shell.is-playing .ww-mark{width:44px;height:44px;min-width:44px;font-size:34px;}
}
@media(pointer:coarse) and (max-width:1100px){
 .ww-game-shell.is-playing .ww-heading-actions #ww-finish{min-height:44px;}
}
@media(pointer:coarse) and (max-width:1100px){
 .ww-game-shell.is-playing #ww-chain .ww-chain-card{min-width:78px;min-height:54px;padding:7px 9px;}
 .ww-game-shell.is-playing #ww-chain .ww-chain-card>small{display:block;font-size:10px;line-height:1.3;}
}
@media(pointer:coarse) and (max-width:1100px){
 :is(.wurdle-body,.texttwirl-body) #instructionsModal .word-phone-only{min-height:44px;justify-content:center;margin-top:12px;padding:10px 14px;border-radius:10px;background:#eee8f8;}
}
.ww-route-view{display:contents;}
@media(pointer:coarse) and (min-width:600px) and (max-width:1100px) and (max-height:600px){
 .ww-game-shell.is-playing .ww-board-panel{grid-template-rows:minmax(0,1fr) auto;}
 .ww-game-shell.is-playing .ww-route-view{display:block;grid-column:1;grid-row:1;min-height:0;overflow:auto;overscroll-behavior:contain;}
 .ww-game-shell.is-playing .ww-pool-section{grid-column:2;grid-row:1;}
 .ww-game-shell.is-playing .ww-controls{grid-column:2;grid-row:2;}
 .ww-game-shell.is-playing .ww-requests{grid-column:1;grid-row:2;}
 .ww-game-shell.is-playing .ww-requests:empty{display:none;}
}
.word-phone-sheet>header{position:sticky;top:-18px;background:#fffdf9;z-index:5;padding-bottom:8px;}
.word-phone-sheet .player-chat{position:relative!important;inset:auto!important;width:100%!important;max-width:none;}
@media(pointer:coarse) and (max-width:1100px){
 :is(.wurdle-body,.texttwirl-body):not(.modal-open) .word-phone-room-chat{display:none!important;}
 #word-phone-chat .word-phone-room-chat{display:block!important;}
 .word-phone-chat-button{min-width:44px;min-height:44px;padding:6px;border:1px solid #d9d1ef;border-radius:10px;background:#eee8f8;font:650 12px system-ui;color:#513a86;}
 .word-phone-sheet :is(input,select,textarea){font-size:16px;}
 .word-phone-sheet .pc-log{max-height:32dvh;}
}
.word-phone-sheet .player-chat :is(input,select,textarea){font-size:16px!important;}
#word-phone-chat .player-chat button,#ww-phone-team .player-chat button{min-height:44px;min-width:44px;}
@media(pointer:coarse) and (max-width:1100px){:is(.wurdle-body,.texttwirl-body) .modal :is(input,select,textarea){font-size:16px!important;}}
@media(pointer:coarse) and (max-width:1100px){
 .ww-game-shell.is-playing :is(.ww-main-column,.ww-board-panel,.ww-route-view,#ww-chain,#ww-hand-panel){min-width:0;max-width:100%;}
 .ww-game-shell.is-playing #ww-chain{width:100%;}
}
#word-phone-chat .player-chat,#ww-phone-team .player-chat{position:static!important;inset:auto!important;width:100%!important;max-height:none;}
/* Leave room for the iPhone home indicator in short landscape viewports. */
@media(pointer:coarse) and (min-width:600px) and (max-width:1100px) and (max-height:600px){
 .wurdle-body .keyboard__row{height:clamp(44px,calc((100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 96px)/3),64px);}
 .texttwirl-letter-stage{padding:5px 4px;margin-bottom:4px;}
 .texttwirl-body .input-tt{margin-bottom:6px;}
}
