/* Portrait layout uses real CSS sizes instead of scaling the desktop window.
   Card rules, artwork, interactions and capture animations stay shared. */
.tavern-host.mobile:not(.closed){overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;background:#032317;padding:0 0 env(safe-area-inset-bottom)}
.tavern-host.mobile .tt-shade{display:none}
.tavern.mobile{position:relative;inset:auto;width:100%;height:auto;min-height:100dvh;transform:none;padding:env(safe-area-inset-top) 0 max(20px,env(safe-area-inset-bottom));background-color:#032317;background-image:linear-gradient(to bottom,transparent 120px,#032317 680px),url('/img/tavern/mobile/table-portrait-v1.webp');background-position:center top;background-size:100% 100%,100% auto;background-repeat:no-repeat;box-shadow:none;font-size:16px;line-height:1.4}
.tavern.mobile::after{inset:0;border-width:12px;border-image-width:12px}
.tavern.mobile{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);-webkit-text-size-adjust:100%;text-size-adjust:100%}
.mobile.reading-page::before{display:none}
.mobile .tt-header{position:relative;inset:auto;height:68px;cursor:default;touch-action:auto}
.mobile .tt-wordmark{width:calc(100% - 114px);max-width:340px;height:64px;left:10px;top:0;object-fit:contain;object-position:left center}
.mobile .tt-close{left:auto;right:calc(10px + env(safe-area-inset-right));top:calc(env(safe-area-inset-top) + 10px);width:40px;height:44px;font-size:26px;min-height:44px;padding:0}
.mobile .tt-mobile-menu{position:absolute;right:calc(56px + env(safe-area-inset-right));top:calc(env(safe-area-inset-top) + 10px);height:44px;width:54px;padding:0 2px 3px;font-size:14px;z-index:31}
.mobile .tt-tabs{position:relative;inset:auto;display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 16px 18px;height:auto}
.mobile .tt-tabs.is-open{display:grid}
.mobile .tt-tabs .tt-button,.mobile .tt-audio-toggle{position:relative;inset:auto;width:100%;height:44px;min-height:44px;--control-height:44px;background:none;font-size:15px;padding:0 6px 3px}
.mobile .tt-button{font-size:16px;min-height:44px;--control-height:44px;padding:0 12px 3px;touch-action:manipulation}
.mobile .tt-control-label{line-height:1.2}
.mobile .tt-choices{gap:8px;margin:0}
.mobile .tt-choices .tt-button{font-size:15px;min-height:44px;padding:0 7px 3px}
.mobile .tt-field{font-size:13px}
.mobile .tt-field input,.mobile .tt-select select{font-size:16px;min-height:44px;height:44px}
.mobile .tt-select{height:44px;--control-height:44px}
.mobile .tt-select::after{top:10px}
.mobile .tt-muted,.mobile .tt-warning{font-size:13px;line-height:1.45}
.mobile h2{font-size:23px;line-height:1.2}
.mobile h3{font-size:18px}
.mobile .tt-reading{position:relative;inset:auto;width:auto;height:auto;min-height:0;margin:0 14px;padding:16px 12px 24px}
.mobile .tt-reading::before{display:none}
.mobile .tt-sync-note{position:relative;inset:auto;white-space:normal;margin:20px 22px 0;padding:8px 10px;font-size:11px;line-height:1.4}
.mobile .tt-play{position:relative;inset:auto;display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:5px 8px;padding:8px 16px}
.mobile .tt-score-panel{display:contents}
.mobile .tt-score-panel h2{height:auto;font-size:22px;grid-column:1;grid-row:1;text-align:left;place-items:start;align-self:end}
.mobile .tt-match-summary{position:static;width:auto;height:auto;grid-column:1;grid-row:2;text-align:left;white-space:pre-line;font-size:12px;line-height:1.4}
.mobile .tt-scores{position:static;grid-column:2;grid-row:1 / 3;gap:6px;align-self:center}
.mobile .tt-score-tile{width:53px;height:56px;padding:4px 2px}
.mobile .tt-score-tile span{font-size:9px;text-align:center}
.mobile .tt-score-tile strong{font-size:26px;line-height:29px;text-align:center}
.mobile .tt-score-caption,.mobile .tt-history-title{display:none}
.mobile .tt-lead{position:static;grid-column:1 / -1;grid-row:3;text-align:left;font-size:11px;white-space:normal;margin:3px 0}
.mobile .tt-opponent{position:static;grid-column:1 / -1;grid-row:4;width:auto;text-align:left;display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;padding:2px 0 6px}
.mobile .tt-opponent h3{font-size:13px;max-height:none;flex:1}
.mobile .tt-opponent>.tt-muted{display:none}
.mobile .tt-other-hand{gap:4px;flex-wrap:nowrap}
.mobile .tt-other-hand .tt-card{width:25px;height:25px}
.mobile .tt-other-hand.revealed{width:100%;overflow-x:auto;gap:20px;padding:14px 10px;scrollbar-width:thin}
.mobile .tt-other-hand.revealed .tt-card{width:80px;height:80px;flex:0 0 80px}
.mobile .tt-other-hand.revealed .tt-edge{display:grid}
.mobile .tt-selected-tip{display:none}
.mobile .tt-result-points{font-size:15px;margin:0!important}
.mobile .tt-board,.mobile .tt-lesson-board{position:relative;inset:auto;width:calc(100% - 12px);height:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,auto);gap:18px;margin:8px auto 14px;grid-column:1 / -1;grid-row:5}
.mobile .tt-board .tt-card,.mobile .tt-board .tt-cell,.mobile .tt-lesson-board .tt-card,.mobile .tt-lesson-board .tt-cell{width:100%;height:auto;aspect-ratio:1}
.mobile .tt-card{--edge-size:clamp(18px,6.5vw,26px)}
.mobile .tt-edge{width:var(--edge-size);height:var(--edge-size)}
.mobile .edge-0{left:calc(50% - var(--edge-size)/2);top:calc(var(--edge-size)*-.35)}
.mobile .edge-1{top:calc(50% - var(--edge-size)/2);right:calc(var(--edge-size)*-.35)}
.mobile .edge-2{left:calc(50% - var(--edge-size)/2);bottom:calc(var(--edge-size)*-.35)}
.mobile .edge-3{top:calc(50% - var(--edge-size)/2);left:calc(var(--edge-size)*-.35)}
.mobile .tt-card-name{font-size:8px;height:14px;bottom:12px;line-height:14px;left:3px;right:3px}
.mobile .owner-1 .tt-card-name,.mobile .owner-2 .tt-card-name{bottom:22px}
.mobile .tt-owner{font-size:8px;height:12px;line-height:12px;bottom:11px;left:3px;right:3px}
.mobile .tt-ability{width:18px;height:18px;left:5px;top:5px}
.mobile .tt-ability i{inset:3px}
.mobile .tt-board .tt-card-name,.mobile .tt-lesson-board .tt-card-name{display:none}
.mobile .tt-board .tt-owner,.mobile .tt-lesson-board .tt-owner{bottom:17px;height:11px;line-height:11px;font-size:8px;left:5px;right:5px}
.mobile .tt-your-hand{position:relative;inset:auto;width:auto;height:auto;grid-column:1 / -1;grid-row:6;min-width:0;background:#00191080;border:1px solid #a5803860;border-radius:10px;padding:8px 0 0}
.mobile .tt-hand-label{position:static;width:auto;height:auto;margin:0 10px;background:none;text-align:left;font-size:16px;line-height:1.5}
.mobile .tt-hand-help{font-size:11px;color:#c5ccb2;margin:0 10px 2px}
.mobile .tt-hand{position:static;display:flex;justify-content:flex-start;align-items:center;gap:20px;overflow-x:auto;overscroll-behavior-x:contain;padding:14px 14px 18px;scrollbar-width:thin;scrollbar-color:#bb9850 #08281a;min-height:120px}
.mobile .tt-hand .tt-card{width:94px;height:94px;flex:0 0 94px}
.mobile .tt-card[data-draggable=true]{touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.mobile .tt-hand .tt-card.selected{z-index:5;filter:drop-shadow(0 0 5px #ffe07c);transform:translateY(-3px)}
.mobile .tt-history{position:static;grid-column:1 / -1;grid-row:7;grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:5px;max-height:none}
.mobile .tt-history .empty{display:none}
.mobile .tt-history>div{text-align:center}
.mobile .tt-history span{font-size:10px}
.mobile .tt-history strong{font-size:14px}
.mobile .tt-table-actions{position:static;grid-column:1 / -1;grid-row:9;flex-direction:row;flex-wrap:wrap;gap:8px}
.mobile .tt-table-actions .tt-button{flex:1;height:44px;font-size:16px;background:none;margin:0}
.mobile .tt-clock{position:static;grid-column:1 / -1;grid-row:8;text-align:center;font-size:13px}
.mobile .tt-setup{display:flex;flex-direction:column;gap:18px}
.mobile .tt-setup>.tt-board,.mobile .tt-setup>.tt-opponent{display:none}
.mobile .tt-solo-options{position:static;inset:auto;width:auto;height:auto;text-align:center;padding:12px 6px}
.mobile .tt-solo-options h2{font-size:23px;height:auto;margin:0 0 8px}
.mobile .tt-solo-options p{font-size:14px;line-height:1.4;margin:8px 0 14px}
.mobile .tt-solo-options>.tt-button{height:44px;margin-top:10px}
.mobile .tt-game-options{display:flex;flex-direction:column;gap:12px}
.mobile .tt-game-options>*{position:relative!important;inset:auto!important;width:100%!important;height:auto!important;margin:0!important}
.mobile .tt-game-options>.tt-button{min-height:46px;font-size:16px}
.mobile .tt-game-options .tt-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.mobile .tt-game-options .tt-choices .tt-button{width:100%;height:44px;font-size:16px}
.mobile .tt-game-options>.tt-start{margin-top:8px!important}
.mobile .tt-friendly{font-size:16px;padding:14px 12px 24px}
.mobile .tt-friendly>p{font-size:14px;margin:16px 0}
.mobile .tt-friendly-layout{display:flex;flex-direction:column;gap:24px}
.mobile .tt-friendly-options{width:100%;gap:18px}
.mobile .tt-friendly-options .tt-choices{flex-wrap:wrap;gap:8px}
.mobile .tt-friendly-options .tt-choices .tt-button{flex:1 1 30%;height:44px;--control-height:44px;font-size:14px;padding:0 6px 3px}
.mobile .tt-rule h3{font-size:18px}
.mobile .tt-rule .tt-muted{font-size:13px;min-height:0}
.mobile .tt-friendly-pool{width:100%;min-height:0;border:0;border-top:1px solid #b6995055;padding:20px 0 0}
.mobile .tt-pool-cards{padding:24px 4px;gap:20px;max-width:260px;margin:auto}
.mobile .tt-friendly-create{flex-direction:column;align-items:stretch;margin-top:24px;padding-top:20px;gap:12px}
.mobile .tt-friendly-create>.tt-button{width:100%;height:46px}
.mobile .tt-share-link{flex-wrap:wrap;max-width:100%}
.mobile .tt-share-link input{flex:1 1 100%;font-size:16px;min-width:0}
.mobile .tt-share-link .tt-button{width:100%}
.mobile .tt-join form{max-width:none;margin:24px 0}
.mobile .tt-reading-heading{flex-direction:column;align-items:stretch;gap:12px;margin-bottom:16px}
.mobile .tt-reading-heading h2,.mobile .tt-collection-page .tt-reading-heading h2{font-size:22px}
.mobile .tt-collection-page .tt-reading-heading .tt-field{width:100%;flex-direction:column;align-items:stretch;gap:4px}
.mobile .tt-collection-page .tt-reading-heading input{width:100%}
.mobile .tt-library-layout,.mobile .tt-deck-page .tt-library-layout{position:static;inset:auto;width:auto;display:flex;flex-direction:column;height:auto;gap:18px;margin-top:20px;min-width:0}
.mobile .tt-draft-rail,.mobile .tt-catalogue{min-width:0}
.mobile .tt-deck-detail{font-size:13px;line-height:1.4;margin:10px 0 20px;min-height:40px;color:#d5d8bd}
.mobile .tt-deck-detail strong,.mobile .tt-deck-detail span{display:block}
.mobile .tt-deck-detail strong{color:#f5dda2;font-weight:400}
.mobile .tt-deck-page .tt-catalogue{overflow:visible;max-height:none;padding:0}
.mobile .tt-collection-page .tt-album,.mobile .tt-deck-page .tt-album{position:static;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px 20px;margin:10px 0;padding:10px 4px}
.mobile .tt-collection-page .tt-album .tt-card,.mobile .tt-deck-page .tt-album .tt-card{width:100%;height:auto;aspect-ratio:1}
.mobile .tt-album .tt-card-name{bottom:14px;font-size:8px}
.mobile .tt-collection-status{font-size:8px;line-height:10px;bottom:4px;right:5px}
.mobile .tt-selected-cards{flex-direction:row;gap:22px;overflow-x:auto;padding:14px 12px 22px;scrollbar-width:thin;scrollbar-color:#bb9850 #08281a}
.mobile .tt-draft-row{display:block;width:80px;height:80px;flex:0 0 80px}
.mobile .tt-draft-row .tt-card,.mobile .tt-draft-row .tt-empty-card{width:80px;height:80px}
.mobile .tt-draft-row>div:last-child,.mobile .tt-draft-row>.tt-muted{display:none}
.mobile .tt-deck-controls{position:static;display:grid;grid-template-columns:1fr 1fr;height:auto;gap:12px;margin-top:20px;align-items:end}
.mobile .tt-deck-controls .tt-field>span{position:static;font-size:13px}
.mobile .tt-deck-controls>.tt-select,.mobile .tt-deck-controls>.tt-field{width:auto;grid-column:1 / -1}
.mobile .tt-deck-controls .tt-button{font-size:15px;min-width:0}
.mobile .tt-deck-error{position:static;grid-column:1 / -1;font-size:13px}
.mobile .tt-imports{position:static;max-height:none;margin:20px 0;font-size:14px}
.mobile .tt-pagination,.mobile .tt-collection-page .tt-pagination{position:static;inset:auto;display:flex;width:auto;margin-top:24px;gap:8px;font-size:13px}
.mobile .tt-pagination .tt-button{width:auto;flex:1;font-size:14px}
.mobile .tt-collection-page .tt-inspector{display:none}
.mobile .tt-collection-page.show-card-detail{z-index:50}
.mobile .tt-collection-page.show-card-detail .tt-inspector{display:block;position:fixed;inset:12px 12px auto;width:auto;max-height:calc(100dvh - 24px);overflow:auto;background:#042719fa;border:1px solid #b59347;border-radius:12px;padding:28px 25px 18px;z-index:60}
.mobile .tt-collector-card{width:100%;max-width:334px;height:auto;aspect-ratio:334/486;margin:0 auto 26px}
.mobile .tt-collector-painting{left:5.99%;top:3.91%;width:88.02%;height:55.56%}
.mobile .tt-collector-name{top:59.67%;left:8.38%;width:83.23%;height:6.58%;font-size:16px!important}
.mobile .tt-collector-words{top:69.34%;left:9.58%;width:80.84%;height:18.72%;font-size:13px}
.mobile .tt-collector-words p:first-child{margin-bottom:10px}
.mobile .tt-collector-set{top:92.39%;left:8.38%;width:83.23%;height:auto;font-size:9px}
.mobile .tt-collector-card .tt-edge{width:36px;height:36px}
.mobile .tt-collector-card .edge-0{top:-14px;left:calc(50% - 18px)}
.mobile .tt-collector-card .edge-1{top:45.47%;left:auto;right:-14px}
.mobile .tt-collector-card .edge-2{top:auto;bottom:-14px;left:calc(50% - 18px)}
.mobile .tt-collector-card .edge-3{top:45.47%;left:-14px}
.mobile .tt-collector-card .tt-ability{width:28px;height:28px;left:9.58%;top:6.58%}
.mobile .tt-inspector>.tt-button{width:100%;margin-top:16px}
.mobile .tt-inspector>.tt-muted{font-size:13px}
.mobile .tt-guild-columns{display:flex;flex-direction:column;height:auto;margin-top:14px;gap:20px;flex:none}
.mobile .tt-guild-columns .tt-panel{min-height:0;overflow:visible;padding:14px 6px}
.mobile .tt-people{max-height:280px;flex:auto}
.mobile .tt-person{min-height:44px;font-size:16px}
.mobile .tt-guild-columns p{font-size:14px}
.mobile .tt-guild-rules-options{overflow:visible;flex:none}
.mobile .tt-invitations{max-height:320px;flex:auto}
.mobile .tt-guild-actions{padding-top:16px}
.mobile .tt-notification-link{font-size:14px;min-height:44px;display:grid;place-items:center}
.mobile .tt-row{flex-wrap:wrap;gap:12px}
.mobile .tt-row>.tt-select{width:100%}
.mobile .tt-ladder-scroll{height:auto;max-height:440px;overflow:auto;margin:20px 0}
.mobile .tt-ladder{min-width:520px;font-size:14px}
.mobile .tt-lesson-copy,.mobile .tt-lesson-right{position:static;inset:auto;width:auto;height:auto;padding:0;margin-top:20px}
.mobile .tt-lesson-copy>p{font-size:15px;margin-bottom:16px}
.mobile .tt-lesson-copy>.tt-card{width:110px;height:110px;margin:24px auto}
.mobile .tt-lesson-actions{position:static;gap:8px;flex-wrap:wrap;margin:20px 0}
.mobile .tt-lesson-actions .tt-button{flex:1}
.mobile .tt-lesson-copy>.tt-button{position:relative;inset:auto;width:100%;margin-top:12px}
.mobile .tt-lesson-right .tt-muted{font-size:13px}
.mobile .tt-audio-panel,.mobile .tt-card-tip{position:fixed;inset:14px 14px auto;width:auto;max-height:calc(100dvh - 28px);overflow-y:auto;z-index:70;background:#06231efa;padding:18px 12px}
.mobile .tt-audio-panel .tt-button{flex-shrink:0}
.mobile .tt-card-tip>.tt-card{width:180px;height:180px;margin:12px auto 24px}
.mobile .tt-card-tip h3{font-size:20px}
.mobile .tt-card-tip p{font-size:16px}
.mobile .tt-card-tip .tt-button{width:100%}
.mobile .tt-error{position:fixed;inset:auto 12px max(12px,env(safe-area-inset-bottom));font-size:14px;z-index:80;flex-wrap:wrap}
.mobile .tt-invite-notice{position:static;font-size:13px;margin:12px 24px}
.tavern.mobile .tt-mobile-menu{font-size:14px;padding:0 2px 3px}
.tavern.mobile .tt-close{font-size:24px;padding:0}
@media (min-width:600px){
  .mobile .tt-play{max-width:580px;margin:0 auto}
  .mobile .tt-reading{max-width:650px;margin:0 auto}
  .mobile .tt-tabs{max-width:650px;margin:0 auto 14px}
  .mobile .tt-wordmark{left:20px}
  .mobile .tt-collection-page.show-card-detail .tt-inspector{max-width:390px;left:calc(50% - 195px);right:auto}
}
@media (min-width:560px) and (max-width:960px) and (max-height:560px){
  .tavern.mobile{background-image:linear-gradient(to bottom,transparent,#032317 64px),var(--tt-art-TableWood);background-size:100% 100%,100% auto}
  .mobile .tt-header{height:56px}
  .mobile .tt-wordmark{height:52px}
  .mobile .tt-play:not(.tt-setup){max-width:800px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 22px;padding:8px 24px}
  .mobile .tt-play:not(.tt-setup) .tt-board{grid-column:1;grid-row:1 / 9;width:calc(100% - 14px);max-width:294px;align-self:start;margin:10px auto}
  .mobile .tt-score-panel h2{grid-column:2;grid-row:1;max-width:calc(100% - 106px);font-size:20px}
  .mobile .tt-match-summary{grid-column:2;grid-row:2;max-width:calc(100% - 106px);font-size:11px}
  .mobile .tt-scores{position:absolute;left:auto;right:24px;top:8px;width:100px}
  .mobile .tt-score-tile{width:47px;height:50px}
  .mobile .tt-score-tile strong{font-size:23px;line-height:26px}
  .mobile .tt-lead{grid-column:2;grid-row:3;font-size:10px}
  .mobile .tt-opponent{grid-column:2;grid-row:4;padding:0}
  .mobile .tt-opponent h3{font-size:11px}
  .mobile .tt-other-hand .tt-card{width:20px;height:20px}
  .mobile .tt-your-hand{grid-column:2;grid-row:5}
  .mobile .tt-hand-label{font-size:14px}
  .mobile .tt-hand-help{font-size:10px}
  .mobile .tt-hand{min-height:108px;padding:14px 10px;gap:18px}
  .mobile .tt-hand .tt-card{width:80px;height:80px;flex-basis:80px}
  .mobile .tt-card{--edge-size:22px}
  .mobile .tt-table-actions{grid-column:2;grid-row:6}
  .mobile .tt-history{grid-column:2;grid-row:7}
  .mobile .tt-clock{grid-column:2;grid-row:8}
}

/* Match arena: a viewport-sized board and a complete, stable five-card rack.
   Secondary UI belongs in sheets; it never takes space away from a turn. */
.tavern-host.mobile.arena-open:not(.closed){height:100dvh;padding:0;overflow:hidden}
.tavern-host.mobile.arena-open:not(.closed)>.tavern{display:flex}
.tavern.mobile.arena-open{height:100dvh;min-height:0;flex-direction:column;padding-top:env(safe-area-inset-top);padding-bottom:max(8px,env(safe-area-inset-bottom));overflow:hidden;background-image:linear-gradient(#03231715,#032317e8 80px),url('/img/tavern/mobile/table-portrait-v1.webp')}
.mobile.arena-open .tt-header{height:48px;flex:0 0 48px}
.mobile.arena-open .tt-wordmark{left:14px;top:2px;height:43px;width:200px;max-width:calc(100% - 94px)}
.mobile.arena-open .tt-mobile-menu{right:14px;top:calc(env(safe-area-inset-top) + 2px);width:64px;height:44px}
.mobile.arena-open>.tt-close,.mobile.arena-open>.tt-sync-note,.mobile.arena-open>.tt-invite-notice{display:none}
.mobile .tt-arena{--rack-card:min(calc((100vw - 90px) / 3),12dvh,104px);display:grid;grid-template-rows:62px minmax(0,1fr) auto;gap:4px;min-height:0;min-width:0;flex:1;padding:0 14px 4px}
.mobile .tt-arena-status{appearance:none;width:100%;padding:4px 0 7px;border:0;border-bottom:1px solid #b3934b66;background:none;color:#f5dea4;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;font-family:var(--tt-font);cursor:pointer;touch-action:manipulation}
.mobile .tt-turn{display:flex;flex-direction:column;gap:3px;min-width:0}
.mobile .tt-turn>strong{font:20px/1.15 Georgia,serif;color:#ffda79}
.mobile .tt-turn>span{font-size:12px;color:#c3cbb4}
.mobile .tt-arena-scores{display:flex;gap:6px;flex-shrink:0}
.mobile .tt-arena-score{display:flex;align-items:center;gap:6px;min-width:59px;padding:8px 9px;border:1px solid #aa843f;border-radius:6px;background:#04233d;box-shadow:inset 0 0 10px #0008}
.mobile .tt-arena-score.side-2{background:#3d1809}
.mobile .tt-arena-score>span{font:600 9px/1 system-ui,sans-serif;color:#7fcdff}
.mobile .tt-arena-score.side-2>span{color:#ffb56b}
.mobile .tt-arena-score>strong{font:25px/1 Georgia,serif;color:#fff0bc}
.mobile .tt-arena-board-space{container-type:size;min-width:0;min-height:0;display:grid;place-items:center}
.mobile .tt-arena .tt-board{position:relative;inset:auto;grid-column:auto;grid-row:auto;width:min(calc(100cqw - 18px),calc(100cqh - 18px),390px);height:auto;aspect-ratio:1;grid-template-rows:repeat(3,minmax(0,1fr));gap:20px;margin:0}
.mobile .tt-arena .tt-card{--edge-size:clamp(20px,6vw,26px)}
.mobile .tt-arena .tt-board .tt-cell,.mobile .tt-arena .tt-board .tt-card{min-width:0;min-height:0;height:100%}
.mobile .tt-rack{padding:8px 8px 10px;border:1px solid #ac8a4159;border-radius:12px;background:linear-gradient(#041b16cc,#00100cdd);box-shadow:inset 0 1px 14px #0006;justify-self:center;width:100%;max-width:390px}
.mobile .tt-rack-heading{display:flex;gap:8px;align-items:baseline;padding:0 2px 12px;font-size:12px;color:#b7c7b2}
.mobile .tt-rack-heading>strong{font-size:14px;font-weight:400;color:#f4da98}
.mobile .tt-rack-heading .tt-clock{position:static;inset:auto;margin-left:auto;font:11px/1.2 system-ui,sans-serif;color:#f2c26d}
.mobile .tt-rack-cards{display:grid;grid-template-columns:repeat(3,var(--rack-card));grid-template-rows:repeat(2,var(--rack-card));gap:20px 12px;justify-content:space-between;padding:0 5px}
.mobile .tt-rack-cards>.tt-card{width:var(--rack-card);height:var(--rack-card);--edge-size:clamp(18px,5.5vw,24px);touch-action:manipulation}
.mobile .tt-rack-cards>.tt-card[data-draggable=true]{touch-action:none}
.mobile .tt-rack .tt-owner{display:none}
.mobile .tt-rack .tt-card-name{bottom:13px;font-size:clamp(7px,2.2vw,9px);height:12px;line-height:12px;left:3px;right:3px;padding:0 2px}
.mobile .tt-rack .tt-card.selected{transform:translateY(-3px);filter:drop-shadow(0 0 5px #ffe288)}
.mobile .tt-rack .tt-card.selected::after{content:'✓';position:absolute;right:4px;top:4px;border:1px solid #d1ad57;border-radius:50%;background:#0c2e24;color:#ffe092;width:19px;height:19px;font:700 13px/18px system-ui;text-align:center;z-index:6;pointer-events:none}
.mobile .tt-rack-used{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:1px dashed #afae8540;border-radius:6px;color:#8eab938c;font-size:10px}
.mobile .tt-rack-used>span:first-child{font:16px/1 system-ui}
.mobile .tt-rack-context{min-width:0;display:flex;align-items:stretch;justify-content:center}
.mobile .tt-rack-inspect,.mobile .tt-rack-instruction{display:flex;flex-direction:column;justify-content:center;gap:6px;width:100%;padding:4px;text-align:center;font:12px/1.25 var(--tt-font);color:#c8d2bc}
.mobile .tt-rack-inspect{appearance:none;border:1px solid #ad914966;border-radius:6px;background:#0b3028;color:#f6dfa0;cursor:pointer;touch-action:manipulation}
.mobile .tt-rack-inspect>strong,.mobile .tt-rack-instruction>strong{font-weight:400;font-size:13px}
.mobile .tt-rack-inspect>span{font:10px/1.2 system-ui,sans-serif;color:#bed5ca}
.mobile .tt-rack .tt-rack-action{align-self:center;width:100%;padding:8px 6px;font-size:14px;line-height:1.2;min-height:48px}
/* Every phone menu is an overlay. Opening one cannot push the board offscreen. */
.mobile .tt-sheet-shade{position:fixed;inset:0;z-index:65;background:#000b;backdrop-filter:blur(3px);display:flex;align-items:flex-end;justify-content:center;padding:env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left)}
.mobile .tt-sheet{width:100%;max-width:520px;max-height:90dvh;display:flex;flex-direction:column;min-height:0;padding:18px 18px max(18px,env(safe-area-inset-bottom));border:1px solid #b18b43;border-bottom:0;border-radius:18px 18px 0 0;background:linear-gradient(#062c23f5,#021e17),var(--tt-art-TableWood);box-shadow:0 -8px 40px #0009}
.mobile .tt-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-shrink:0;margin-bottom:12px;border-bottom:1px solid #c29d4e66;padding-bottom:12px}
.mobile .tt-sheet-heading h2{font-size:22px}
.mobile .tt-sheet-heading .tt-sheet-close{width:75px;min-height:44px;font-size:15px}
.mobile .tt-sheet-body{overflow:auto;overscroll-behavior:contain;min-height:0;display:flex;flex-direction:column;gap:16px;font-size:15px;padding:2px 2px 8px}
.mobile .tt-sheet-body>.tt-tabs{position:static;display:grid;grid-template-columns:1fr 1fr;width:100%;height:auto;margin:0;gap:12px}
.mobile .tt-sheet-body .tt-tabs .tt-button{min-height:48px}
.mobile .tt-tray-cards{display:grid;grid-template-columns:repeat(3,1fr);justify-items:center;gap:24px 14px;margin:10px}
.mobile .tt-tray-cards .tt-card{width:80px;height:80px}
.mobile .tt-tray-history{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}
.mobile .tt-tray-history li{display:flex;justify-content:space-between;border-bottom:1px solid #b3974a44;padding-bottom:8px}
.mobile .tt-arena button:focus-visible,.mobile .tt-sheet button:focus-visible{outline:2px solid #ffe29a;outline-offset:3px}
@media (max-height:640px) and (max-width:560px){
  .mobile .tt-arena{--rack-card:min(calc((100vw - 90px) / 3),11dvh,80px);grid-template-rows:56px minmax(0,1fr) auto;gap:2px;padding:0 12px 2px}
  .mobile.arena-open .tt-header{height:44px;flex-basis:44px}
  .mobile.arena-open .tt-wordmark{height:38px}
  .mobile .tt-turn>strong{font-size:17px}
  .mobile .tt-turn>span{font-size:11px}
  .mobile .tt-arena-score{min-width:53px;padding:7px;gap:5px}
  .mobile .tt-arena-score>strong{font-size:23px}
  .mobile .tt-rack{padding:6px 8px 9px}
  .mobile .tt-rack-heading{padding-bottom:10px;font-size:11px}
  .mobile .tt-rack-cards{gap:16px 12px;justify-content:space-around}
  .mobile .tt-rack-inspect>strong,.mobile .tt-rack-instruction>strong{font-size:11px}
  .mobile .tt-rack-instruction{font-size:10px;gap:4px;padding:0}
  .mobile .tt-rack .tt-card-name{display:none}
}
@media (min-width:560px) and (max-width:960px) and (max-height:560px){
  .mobile.arena-open .tt-header{height:40px;flex-basis:40px}
  .mobile.arena-open .tt-wordmark{height:36px;top:0}
  .mobile.arena-open .tt-mobile-menu{top:env(safe-area-inset-top);height:40px;min-height:40px}
  .mobile .tt-arena{--rack-card:min(calc((100dvh - 164px) / 2),calc((100vw - 170px - env(safe-area-inset-left) - env(safe-area-inset-right)) / 6),100px);grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:54px minmax(0,1fr);gap:6px 20px;padding:0 18px 2px;max-width:880px;width:100%;align-self:center}
  .mobile .tt-arena-status{grid-column:2;grid-row:1}
  .mobile .tt-turn>strong{font-size:17px}
  .mobile .tt-turn>span{font-size:11px}
  .mobile .tt-arena-board-space{grid-column:1;grid-row:1 / 3}
  .mobile .tt-arena .tt-board{width:min(calc(100cqw - 18px),calc(100cqh - 18px),390px);gap:20px}
  .mobile .tt-rack{grid-column:2;grid-row:2;align-self:center;padding:6px 8px 8px;max-width:390px}
  .mobile .tt-rack-heading{padding-bottom:10px}
  .mobile .tt-rack-cards{gap:16px 12px}
  .mobile .tt-arena-score{min-width:52px;padding:6px;gap:5px}
  .mobile .tt-arena-score>strong{font-size:23px}
  .mobile .tt-sheet-shade{align-items:stretch;justify-content:flex-end}
  .mobile .tt-sheet{max-width:420px;max-height:100%;border-radius:14px 0 0 14px;border-right:0;border-bottom:1px solid #b18b43;padding-top:12px}
}

.mobile .tt-tray-inspector{text-align:center;padding:4px 6px 18px}
.mobile .tt-tray-inspector>.tt-card{width:180px;height:180px;margin:14px auto 28px;--edge-size:30px}
.mobile .tt-tray-inspector h3{font-size:19px;margin-bottom:10px}
.mobile .tt-tray-inspector p{font-size:16px;color:#d2dbbf}
.mobile .tt-setup .tt-hand{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px 20px;overflow:visible;padding:18px}
.mobile .tt-setup .tt-hand .tt-card{width:100%;height:auto;aspect-ratio:1}
.mobile .tt-setup .tt-hand .tt-owner{display:none}
.mobile .tt-setup .tt-hand .tt-card-name{bottom:14px}
