/* r96 Mobile Accessibility
   A final, narrow-screen layer for the current r95 shell. Desktop composition,
   gameplay rules, state, and networking are intentionally untouched. */

:root{
  --stq-mobile-tap:48px;
  --stq-mobile-gutter:max(12px,env(safe-area-inset-left));
}

/* Fail closed on desktop. Phone-only guidance must never participate in the
   desktop layout or accessibility tree, even while another screen covers it. */
.mobile-landscape-gate,
.mobile-court-pan-hint{display:none!important}

@media(pointer:coarse){
  :is(button,[role="button"],input,select,.card){-webkit-tap-highlight-color:rgba(222,174,82,.24)}
  :is(button,[role="button"],input,select){min-height:var(--stq-mobile-tap)}
  :is(button,[role="button"],.card){touch-action:manipulation}
  :is(button,[role="button"],.card):hover{transform:none}
}
body.touch-input-active #card-tooltip{display:none!important}

@media(max-width:900px){
  html,body{width:100%;max-width:100%;min-width:0;overflow-x:hidden}
  body{font-size:16px}
  .shell{width:100%;min-height:100svh;margin:0;padding:0}
  .screen:not(.hidden){width:100%;max-width:100%;min-height:100svh;box-sizing:border-box!important;overflow-x:hidden}
  :is(input,select,textarea){font-size:16px!important}
  :is(button,[role="button"],input,select){min-height:48px!important}
  :is(button,[role="button"]):focus-visible{outline:3px solid #ffe39a!important;outline-offset:3px!important}

  #notice{position:fixed;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));max-width:none;font-size:14px;line-height:1.35}
  .pwa-update-banner{left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));width:auto;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:12px}
  .pwa-update-banner span{min-width:0}.pwa-update-banner small{white-space:normal}.pwa-update-banner button{padding-inline:12px}

  /* First launch and handoff dialogs */
  #identity-screen:not(.hidden),#local-pass-screen:not(.hidden){padding:max(14px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));place-items:center;overflow-y:auto}
  #identity-screen .identity-card,#local-pass-screen .pass-card{width:100%;max-width:560px;padding:clamp(22px,7vw,34px);margin:auto}
  #identity-screen .identity-card h2,#local-pass-screen .pass-card h2{font-size:clamp(32px,10vw,44px);line-height:1}
  #identity-screen .identity-card p,#local-pass-screen .pass-card p{font-size:15px;line-height:1.5}
  #identity-screen .identity-card button,#local-pass-screen .pass-card button{width:100%}

  /* Main menu becomes a readable royal navigation sheet over the same art. */
  #entry-screen .v0732-home{min-height:100svh;height:auto;overflow-y:auto;background:#08040c}
  #entry-screen .v0732-bg{position:fixed;background-position:64% center!important}
  #entry-screen .v0732-sidebar{position:relative!important;inset:auto!important;width:min(100%,520px)!important;min-height:100svh;padding:max(22px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))!important;background:linear-gradient(90deg,rgba(8,3,12,.98),rgba(17,6,23,.93) 86%,rgba(17,6,23,.72))!important;overflow:visible!important}
  #entry-screen .v0732-brand{margin-bottom:16px}.v0732-brand h1{font-size:clamp(28px,9vw,42px)!important}
  #entry-screen .v0732-nav{gap:6px}
  #entry-screen .v0732-nav-row{width:100%;min-height:58px!important;padding:8px 10px!important;grid-template-columns:42px minmax(0,1fr) auto!important}
  #entry-screen .v0732-nav-row strong{font-size:15px!important}#entry-screen .v0732-nav-row small{font-size:12px!important;line-height:1.25}
  #entry-screen .v0732-icon{width:38px;height:38px}
  #entry-screen .v0732-flyout{position:fixed!important;z-index:100;left:max(10px,env(safe-area-inset-left))!important;right:max(10px,env(safe-area-inset-right))!important;top:auto!important;bottom:max(10px,env(safe-area-inset-bottom))!important;width:auto!important;max-height:calc(100dvh - 20px);padding:22px!important;overflow-y:auto;border-color:#e1b85e;box-shadow:0 -18px 70px #000!important}
  #entry-screen .v0732-flyout h2{font-size:30px}#entry-screen .v0732-flyout p{font-size:14px;line-height:1.45}
  #entry-screen .v0732-flyout-buttons{grid-template-columns:1fr!important}#entry-screen .v0732-flyout-buttons button{min-height:72px!important;padding:14px!important}
  #entry-screen .home-wardrobe-progress{min-width:52px}

  /* Chapter gallery uses a vertical illustrated list rather than four squeezed cards. */
  #campaign-chapter-screen:not(.hidden){display:block!important;width:auto!important;max-width:none!important;box-sizing:border-box!important;overflow-x:hidden!important;overflow-y:auto!important;padding:0 max(12px,env(safe-area-inset-right)) max(90px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))!important}
  #campaign-chapter-screen .campaign-gallery-environment{position:fixed}
  #campaign-chapter-screen .campaign-gallery-header{position:relative!important;inset:auto!important;min-height:0;height:auto!important;grid-template-columns:1fr!important;gap:10px;padding:max(18px,env(safe-area-inset-top)) 4px 16px!important}
  #campaign-chapter-screen .campaign-gallery-brand{min-width:0!important}#campaign-chapter-screen .campaign-gallery-brand span{font-size:13px}#campaign-chapter-screen .campaign-gallery-brand h2{margin:0!important;font-size:clamp(30px,10vw,40px)!important;line-height:.95!important;white-space:normal!important;overflow-wrap:anywhere}
  #campaign-chapter-screen .campaign-gallery-promise{display:none}
  #campaign-chapter-screen .campaign-gallery-standing{width:100%!important;min-width:0!important;justify-self:stretch!important;padding:8px 10px!important;gap:8px}.campaign-gallery-standing span{font-size:8px}.campaign-gallery-standing strong{font-size:15px}
  #campaign-chapter-screen .campaign-gallery-content{position:relative!important;inset:auto!important;left:auto!important;right:auto!important;top:auto!important;transform:none!important;width:100%!important;height:auto!important;min-height:0!important;overflow:visible!important}
  #campaign-chapter-screen .campaign-chapter-grid{height:auto!important;display:grid!important;grid-template-columns:1fr!important;gap:14px!important;padding:32px 0 12px!important}
  #campaign-chapter-screen .campaign-chapter-item{height:auto!important;min-height:250px}
  #campaign-chapter-screen .campaign-chapter-card{height:100%!important;min-height:250px;grid-template-columns:minmax(118px,38%) minmax(0,1fr)!important;grid-template-rows:1fr!important;text-align:left}
  #campaign-chapter-screen .campaign-chapter-art{min-height:250px}.campaign-chapter-copy{padding:18px 14px!important;align-content:center}.campaign-chapter-copy h3{font-size:23px!important}.campaign-chapter-copy p{font-size:12px!important;line-height:1.4!important;-webkit-line-clamp:4!important}
  #campaign-chapter-screen .campaign-chapter-number{top:12px!important;left:calc(38% + 14px)!important}.campaign-chapter-suit{top:-24px!important;left:calc(38% - 25px)!important}
  #campaign-chapter-screen .campaign-chapter-action{min-height:44px!important;height:auto!important}
  #campaign-chapter-screen .campaign-gallery-back{position:fixed!important;z-index:20;left:max(12px,env(safe-area-inset-left))!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:auto!important;min-height:50px!important;background:rgba(14,6,20,.96)!important;box-shadow:0 10px 30px #000!important}
  #campaign-chapter-screen .campaign-gallery-motto{display:none}

  /* Encounter view: preserve every section and establish a useful reading order. */
  #campaign-screen:not(.hidden){display:block!important;overflow-y:auto!important;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important}
  #campaign-screen .campaign-shell{width:100%!important;height:auto!important;min-height:calc(100svh - 20px)!important;margin:0!important;padding:10px!important;overflow:visible!important}
  #campaign-screen .campaign-header{height:auto!important;min-height:0!important;display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:10px!important;padding:4px 2px 12px!important}
  #campaign-screen #campaign-back{grid-column:1;min-width:48px;width:48px;padding:0;font-size:0}#campaign-screen #campaign-back::before{content:"←";font-size:24px}
  #campaign-screen .campaign-heading{grid-column:2;text-align:left}.campaign-heading h2{font-size:clamp(26px,8vw,38px)!important}.campaign-heading>span,.campaign-heading>p{font-size:10px!important}
  #campaign-screen .campaign-renown{grid-column:1/-1;display:grid!important;grid-template-columns:1fr 1fr!important;padding:8px 10px!important}
  #campaign-screen .campaign-content{height:auto!important;display:flex!important;flex-direction:column!important;gap:12px!important;padding:0!important;overflow:visible!important}
  #campaign-screen .campaign-rival-panel{order:1;width:100%!important;min-height:0!important;padding:12px!important;overflow:visible!important}
  #campaign-screen .campaign-map-panel{order:2;width:100%!important;min-height:0!important;padding:12px!important;overflow:visible!important}
  #campaign-screen .campaign-progression-panel{order:3;width:100%!important;min-height:0!important;padding:0!important;display:grid!important;grid-template-rows:auto auto auto!important;gap:10px!important;overflow:visible!important}
  #campaign-screen .campaign-rival-scroll,#campaign-screen .campaign-progress-pane{overflow:visible!important;max-height:none!important}
  #campaign-screen .campaign-rival-hero{grid-template-columns:110px minmax(0,1fr)!important;gap:12px!important}.campaign-portrait-frame{width:110px!important;height:150px!important}.campaign-rival-copy h3{font-size:29px!important}.campaign-rival-copy p{font-size:13px!important;line-height:1.4!important}
  #campaign-screen .campaign-rival-actions{position:sticky!important;bottom:max(6px,env(safe-area-inset-bottom));z-index:4;padding-top:10px;background:linear-gradient(transparent,#09050e 28%)}
  #campaign-screen .campaign-rival-actions button{min-height:54px!important;font-size:15px!important}
  #campaign-screen .campaign-encounters{display:grid!important;grid-template-rows:none!important;gap:8px!important}.campaign-encounter{min-height:74px!important}.campaign-encounter-copy strong{font-size:15px!important}.campaign-encounter-copy small{font-size:11px!important}
  #campaign-screen .campaign-progress-tabs{display:flex!important;overflow-x:auto!important;scroll-snap-type:x proximity}.campaign-progress-tabs button{flex:1 0 112px;min-height:48px!important;scroll-snap-align:start}

  /* Career, Settings, and Wardrobe read as native game pages on phones. */
  #records-screen:not(.hidden),#settings-screen:not(.hidden),#wardrobe-screen:not(.hidden){display:block!important;overflow-y:auto!important;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important}
  #records-screen>.records-card,#settings-screen>.settings-card,#wardrobe-screen>.wardrobe-shell{width:100%!important;max-width:100%!important;height:auto!important;min-height:calc(100svh - 24px)!important;max-height:none!important;margin:0!important;box-sizing:border-box;overflow-y:visible!important;overflow-x:hidden!important}
  #records-screen>.records-card{display:flex!important;flex-direction:column!important}
  #records-screen .records-heading-v0732,#settings-screen .settings-heading{height:auto!important;min-height:84px!important;padding:17px 15px!important;gap:10px;align-items:flex-start!important}
  #records-screen .records-heading-v0732{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:auto auto!important;min-height:0!important}
  #records-screen .records-brand-v0732{min-width:0!important}
  #records-screen .records-brand-v0732 strong{font-size:0!important}
  #records-screen .records-brand-v0732 strong::before{content:"♛  HALL OF THE COURT"!important;font-size:10px!important}
  #records-screen .records-brand-v0732 span{font-size:clamp(18px,5.4vw,23px)!important;line-height:1.08!important;white-space:normal!important;overflow-wrap:anywhere}
  #settings-screen .settings-brand-v0733 span{font-size:clamp(28px,9vw,38px)!important}
  #records-screen .records-heading-v0732 button,#settings-screen .settings-heading button{min-width:48px;min-height:48px!important;padding-inline:12px}
  #records-screen #records-back,#settings-screen #settings-back{height:auto!important;min-height:48px!important}
  #records-screen #records-back{position:static!important;inset:auto!important;grid-row:1!important;justify-self:end!important}
  #records-screen .records-brand-v0732{grid-row:2!important;width:100%!important}
  #records-screen .records-intro{margin:14px 14px 4px!important;font-size:14px;line-height:1.45}
  #records-screen .records-career-overview{display:block!important;padding:10px 14px!important;overflow:visible!important}.records-profile-showcase{min-height:250px!important;margin-bottom:12px}
  #records-screen .record-headline,#records-screen .records-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;padding:10px 14px!important}.record-headline>div,.records-stat-card{min-height:100px!important;padding:12px!important}.record-headline strong,.records-stat-card strong{font-size:32px!important}
  #records-screen .record-secondary-groups{padding:0 14px!important}.record-secondary-group .record-stat{min-height:64px!important}.record-secondary-group .record-stat span{font-size:11px!important}
  #records-screen .stats-section-heading{margin:4px 14px 0!important}.records-list{margin:0 14px 18px!important;overflow:visible!important}.record-row{grid-template-columns:1fr auto!important;gap:8px!important;min-height:0!important;padding:12px!important}.record-opponent{grid-column:1/-1}.record-result,.record-rounds{justify-items:start!important;text-align:left!important}

  #settings-screen>.settings-card{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:auto auto auto auto!important}
  #settings-screen .settings-tabs{position:sticky;top:0;z-index:5;display:flex!important;grid-row:2!important;gap:6px!important;padding:8px!important;overflow-x:auto!important;scroll-snap-type:x proximity;background:rgba(8,4,12,.97)!important}.settings-tabs button{flex:0 0 auto;min-width:132px!important;scroll-snap-align:start}
  #settings-screen .settings-pane{grid-column:1!important;grid-row:3!important;padding:12px!important;overflow:visible!important}.settings-pane h3{font-size:25px}.settings-pane>p{font-size:14px;line-height:1.45}
  #settings-screen .setting-row{min-height:0!important;display:grid!important;grid-template-columns:1fr!important;gap:12px!important;padding:14px!important}.setting-row>div>strong{font-size:17px!important}.setting-row>div>span{font-size:13px!important}.setting-row :is(input[type="range"],select,button){width:100%;min-width:0}
  #settings-screen .settings-footer{grid-column:1!important;grid-row:4!important;display:grid!important;grid-template-columns:1fr!important;gap:8px!important;padding:12px!important}.settings-footer button{width:100%}

  #wardrobe-screen :is(.wardrobe-header,.wardrobe-profile,.wardrobe-layout,.wardrobe-collection,.wardrobe-collection-heading,.wardrobe-collection-tools,.wardrobe-grid,.wardrobe-preview){width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box}
  #wardrobe-screen .wardrobe-header{grid-template-columns:minmax(0,1fr) auto!important;padding:16px!important;gap:10px!important}.wardrobe-header h2{font-size:clamp(30px,9vw,40px)!important}.wardrobe-header p{overflow-wrap:anywhere}.wardrobe-profile{grid-column:1/-1!important;grid-row:2!important}
  #wardrobe-screen .wardrobe-layout{display:flex!important;flex-direction:column!important;overflow-x:hidden!important;overflow-y:visible!important}.wardrobe-categories{position:sticky;top:0;z-index:6;flex:0 0 auto;width:100%!important;max-width:100%!important;padding:8px!important;overflow-x:auto!important;background:rgba(8,4,12,.97)!important;scroll-snap-type:x proximity}.wardrobe-categories button{min-width:155px!important;min-height:54px!important;scroll-snap-align:start}
  #wardrobe-screen .wardrobe-collection{min-height:0!important;padding:14px!important;overflow:visible!important}.wardrobe-collection-heading{align-items:stretch!important;flex-direction:column}.wardrobe-collection-tools{width:100%;max-width:none!important;display:grid!important;grid-template-columns:1fr!important}.wardrobe-search{width:100%!important}.wardrobe-filter-tabs{display:flex;overflow-x:auto}.wardrobe-filter-tabs button{flex:0 0 auto;min-height:44px!important}
  #wardrobe-screen .wardrobe-grid{grid-template-columns:1fr!important;max-height:68svh!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-color:#a94fc2 #18091f;scrollbar-width:auto}.wardrobe-item{min-height:96px!important}.wardrobe-preview{padding:14px!important;overflow:visible!important}.wardrobe-stage{min-height:320px!important}

  /* Setup, party, lobby and result surfaces. */
  #match-setup-screen:not(.hidden),#lobby-screen:not(.hidden){display:block!important;overflow-y:auto!important;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important}
  #match-setup-screen>.match-setup-card{width:100%!important;height:auto!important;min-height:calc(100svh - 24px)!important;max-height:none!important;padding:14px!important;overflow:visible!important}#match-setup-screen .setup-header{position:static!important;inset:auto!important;width:100%!important;min-height:0!important;display:grid!important;grid-template-columns:1fr!important;align-items:flex-start!important;gap:10px;margin:0 0 10px!important;padding:0!important}#match-setup-screen .setup-header>div{grid-row:2;min-width:0}#match-setup-screen .setup-header #setup-back{position:static!important;inset:auto!important;grid-row:1;justify-self:end}#match-setup-screen .setup-header h2{font-size:clamp(29px,9vw,40px)!important}.match-style-picker,.setup-team,.online-setup-panel,.private-lobby-card{padding:14px!important}.setup-team-grid,.private-courts{grid-template-columns:1fr!important}.setup-versus,.private-versus{min-height:32px!important}.party-settings-summary{grid-template-columns:1fr!important}#match-setup-screen.private-online-screen>.match-setup-card{display:flex!important;flex-direction:column!important}#match-setup-screen.private-online-screen .setup-header{position:static!important;inset:auto!important;flex:0 0 auto!important;width:auto!important;margin:12px 12px 0!important;display:flex!important;justify-content:flex-end!important}#match-setup-screen.private-online-screen>.match-setup-card>.match-style-picker{position:static!important;inset:auto!important;flex:0 0 auto!important;margin:10px 14px 14px!important;grid-template-columns:1fr!important}#match-setup-screen.private-online-screen #online-setup-area{height:auto!important;flex:1 0 auto!important;overflow:visible!important}#match-setup-screen.private-online-screen .private-match-shell{height:auto!important;grid-template-rows:auto auto!important}#match-setup-screen.private-online-screen .private-match-titlebar{padding:18px 14px!important}.private-match-body{padding:14px!important}.private-intent-tabs{width:100%;display:grid!important;grid-template-columns:1fr 1fr!important}.private-intent-tabs button{width:100%;min-height:50px!important}.party-create-row,.party-join-row,.party-code-line,.party-ready-actions{grid-template-columns:1fr!important;gap:10px!important}.party-code-line strong{font-size:26px!important;overflow-wrap:anywhere}.party-code-line button,.party-ready-actions button{width:100%}
  #lobby-screen .lobby-heading{padding:16px!important}.lobby-heading h2{font-size:30px}.roster{grid-template-columns:1fr!important}.lobby-player{min-height:64px}.lobby-actions,#host-controls{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;padding:12px!important}.lobby-actions button,#host-controls button{width:100%}

  /* The live Court is landscape-first on phones. In portrait this fixed gate
     blocks the already-created match beneath the rival presentation, so taps
     can never fall through while the player rotates the device. */
  @media (orientation:portrait) and (pointer:coarse){
    #game-screen:not(.hidden) .mobile-landscape-gate{
      position:fixed;z-index:5000;inset:0;display:grid!important;grid-template-rows:auto auto auto;align-content:center;justify-items:center;gap:12px;
      padding:max(28px,env(safe-area-inset-top)) max(22px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(22px,env(safe-area-inset-left));
      background:radial-gradient(circle at 50% 36%,rgba(112,42,132,.34),transparent 38%),rgba(5,2,8,.985);
      color:#f5dfab;text-align:center;pointer-events:auto;touch-action:none;overscroll-behavior:none;
    }
    #game-screen:not(.hidden) .mobile-landscape-gate::before{content:"";position:absolute;inset:22% 9%;z-index:-1;border:1px solid #d8ad57;border-radius:12px;background:linear-gradient(155deg,#2d1038,#0b0610 72%);box-shadow:0 25px 75px #000,inset 0 0 32px rgba(155,73,177,.23)}
    .mobile-landscape-gate img{width:62px;height:62px;border-radius:14px;box-shadow:0 0 24px rgba(201,116,221,.28)}
    .mobile-landscape-gate strong{max-width:330px;font:700 21px/1.2 Georgia,serif;letter-spacing:.06em}
    .mobile-landscape-gate span{max-width:310px;color:#cdbed0;font:15px/1.45 system-ui,sans-serif}
  }

  :is(.match-menu-overlay,.history-overlay,.resolution-overlay,.victory-overlay,.campaign-result-overlay){padding:max(10px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;overflow-y:auto!important}
  :is(.match-menu-card,.history-card,.victory-card,.campaign-result-card){width:100%!important;max-width:620px!important;height:auto!important;max-height:none!important;margin:auto 0!important;padding:16px!important;overflow:visible!important}
  #victory-panel .victory-card{display:flex!important;flex-direction:column!important}.victory-hero{min-height:0!important;padding:28px 18px!important;border-right:0!important}.victory-overview{padding:20px 14px!important}.victory-stats,.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.victory-actions,.campaign-result-actions{grid-template-columns:1fr!important}.victory-actions button,.campaign-result-actions button{min-height:52px!important}

  /* Academy keeps the real Court, with the coach before it and a panning table
     rather than shrinking all labels below a readable size. */
  #tutorial-screen:not(.hidden){display:block!important;overflow-y:auto!important;padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important}
  #tutorial-screen .guided-tutorial-shell{width:100%!important;max-width:100%!important;min-width:0!important;height:auto!important;min-height:calc(100svh - 16px)!important;box-sizing:border-box;overflow-x:hidden!important;overflow-y:visible!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto auto!important}
  #tutorial-screen .guided-tutorial-header{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:auto auto!important;padding:12px!important}#tutorial-screen .guided-brand{grid-column:1;grid-row:1;min-width:0!important}#tutorial-screen .guided-brand small{display:none!important}#tutorial-screen .guided-brand strong{font-size:15px!important}#tutorial-screen #tutorial-exit-top{grid-column:2;grid-row:1;width:auto!important;min-width:58px!important;padding-inline:10px!important;font-size:0!important}#tutorial-screen #tutorial-exit-top::before{content:"Exit";font-size:13px}#tutorial-screen .guided-progress-wrap{grid-column:1/-1;grid-row:2;width:100%!important}.guided-progress-label{font-size:11px!important}
  #tutorial-screen :is(.guided-tutorial-header,.guided-tutorial-body,.tutorial-coach,.guided-board,.guided-tutorial-controls){width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box}
  #tutorial-screen .guided-tutorial-body{display:flex!important;flex-direction:column!important;padding:8px!important;overflow-x:hidden!important;overflow-y:visible!important}.tutorial-coach{order:1!important;flex:0 0 auto!important;width:100%!important;max-height:none!important;padding:16px!important}.tutorial-coach h2{font-size:27px!important}.tutorial-coach>p{font-size:14px!important}.tutorial-task-card{font-size:13px!important}
  #tutorial-screen .guided-board{order:2!important;flex:0 0 100%!important;width:100%!important;height:min(70svh,620px)!important;min-height:480px!important;overflow:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-color:#a94fc2 #18091f;scrollbar-width:auto}
  #tutorial-screen .tutorial-court-surface{position:relative!important;inset:auto!important;width:960px!important;min-width:960px!important;height:540px!important;--u:.68px!important}.tutorial-production-board{position:absolute!important}
  #tutorial-screen .guided-tutorial-controls{position:sticky;bottom:0;z-index:8;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;padding:10px!important;background:rgba(8,4,12,.98)!important}.guided-tutorial-controls button{width:100%;min-height:50px!important}

  /* Mobile pre-game preserves both face assignments and the real two-sided coin. */
  #pre-game-screen:not(.hidden){min-height:100dvh;padding:max(16px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))!important}.pre-game-stage{width:100%!important;max-width:620px!important}.pre-game-versus{grid-template-columns:minmax(0,1fr) minmax(90px,30vw) minmax(0,1fr)!important;gap:6px!important}.pre-game-name{font-size:clamp(17px,5vw,25px)!important;overflow-wrap:anywhere}.royal-coin{width:min(30vw,150px)!important;height:min(30vw,150px)!important}
  #pre-game-screen .royal-initiative-intro{width:100%!important;max-width:100%!important;padding-inline:max(8px,env(safe-area-inset-left))!important;box-sizing:border-box}
  #pre-game-screen .initiative-faceoff{width:100%!important;max-width:620px!important;grid-template-columns:minmax(0,1fr) minmax(96px,28vw) minmax(0,1fr)!important;gap:4px!important;padding-inline:2px;box-sizing:border-box}
  #pre-game-screen .initiative-team{min-width:0!important;gap:8px!important}.initiative-names{min-width:0}.initiative-names span{max-width:100%;font-size:clamp(13px,3.7vw,18px)!important;line-height:1.15!important;white-space:normal!important;overflow-wrap:anywhere}.initiative-assignment-face{width:clamp(42px,12vw,60px)!important}.initiative-team>strong{letter-spacing:.12em!important}
  #pre-game-screen .royal-coin-stage{height:clamp(112px,30vw,150px)!important}.royal-initiative-coin{width:clamp(104px,27vw,142px)!important}

  /* The live Court is a readable, pannable game surface on mobile. The former
     viewport scale reduced cards to roughly 22px wide in portrait. Keeping a
     stable table scale preserves card art, labels and 48px interactions while
     touch panning exposes the opponent, Path, hand and Court without overlap. */
  #game-screen.selection-board-active{
    --u:.92px!important;
    width:100vw!important;height:100dvh!important;overflow:hidden!important;
    background-size:1320px 720px!important;background-position:center!important;
  }
  #game-screen.selection-board-active #planning-view{
    position:absolute!important;inset:0!important;width:100vw!important;height:100dvh!important;
    overflow:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
    touch-action:pan-x pan-y;scrollbar-color:#b85bce #18091f;scrollbar-width:auto;
  }
  #game-screen.selection-board-active #planning-view>.mobile-court-pan-hint{display:flex!important}
  #game-screen.selection-board-active .solo-selection-board{
    left:24px!important;top:150px!important;
    width:calc(var(--u)*1148)!important;height:calc(var(--u)*618)!important;
  }
  #game-screen.selection-board-active>.game-topbar{
    position:absolute!important;top:max(8px,env(safe-area-inset-top))!important;right:max(8px,env(safe-area-inset-right))!important;
    width:auto!important;height:52px!important;gap:6px!important;
  }
  #game-screen.selection-board-active>.game-topbar .top-actions{gap:6px!important}
  #game-screen.selection-board-active>.game-topbar button{
    width:auto!important;height:48px!important;min-width:48px!important;min-height:48px!important;
    padding:8px 12px!important;font-size:13px!important;
  }
  #game-screen.selection-board-active .mobile-court-pan-hint{
    position:sticky;left:max(8px,env(safe-area-inset-left));top:62px;z-index:45;
    width:max-content;max-width:230px;min-height:42px;margin:8px;padding:0 13px;
    align-items:center;border:1px solid #b9904c;border-radius:999px;
    background:rgba(15,7,20,.94);box-shadow:0 5px 18px #000a;
    color:#f4dfaa;font:700 12px/1.2 system-ui,sans-serif;letter-spacing:.04em;
    pointer-events:none;
  }
  #game-screen.selection-board-active .mobile-court-pan-hint::before{content:"↔";margin-right:8px;font-size:18px;color:#d57be3}
  #game-screen.selection-board-active .selection-controls button,
  #game-screen.selection-board-active #solo-resolution-controls button{min-height:48px!important;height:48px!important;font-size:12px!important}
  #game-screen.selection-board-active #solo-selection-board .card{touch-action:manipulation}
  #game-screen.selection-board-active #card-tooltip.card-inspection{display:none!important}
  #game-screen.selection-board-active #solo-selection-board .card:hover{transform:none!important}
  #game-screen.selection-board-active #solo-selection-board .card:focus-visible,
  #game-screen.selection-board-active #solo-selection-board .card.selected-in-hand{transform:translateY(-10px)!important}
}

@media(max-width:430px){
  #entry-screen .v0732-sidebar{width:100%!important}
  #campaign-chapter-screen .campaign-chapter-item,#campaign-chapter-screen .campaign-chapter-card{min-height:220px}
  #campaign-chapter-screen .campaign-chapter-card{grid-template-columns:112px minmax(0,1fr)!important}.campaign-chapter-art{min-height:220px!important}.campaign-chapter-number{left:126px!important}.campaign-chapter-suit{left:87px!important}
  #campaign-screen .campaign-rival-hero{grid-template-columns:88px minmax(0,1fr)!important}.campaign-portrait-frame{width:88px!important;height:126px!important}.campaign-rival-copy h3{font-size:25px!important}.campaign-rival-copy p{font-size:12px!important}
  #records-screen .record-headline,#records-screen .records-stat-grid{grid-template-columns:1fr 1fr!important}.record-headline>div,.records-stat-card{min-height:92px!important}.record-headline strong,.records-stat-card strong{font-size:28px!important}
  .victory-stats,.summary-grid{grid-template-columns:1fr!important}
  #tutorial-screen .guided-board{height:66svh!important;min-height:430px!important}
}

@media(max-height:500px) and (orientation:landscape) and (pointer:coarse){
  #entry-screen .v0732-sidebar{width:min(430px,58vw)!important;padding-block:10px!important}.v0732-brand{display:none}.v0732-nav-row{min-height:48px!important}.v0732-nav-row small{display:none!important}
  #identity-screen .identity-card{padding:16px 24px}.identity-crown{font-size:32px!important}
  #campaign-chapter-screen .campaign-gallery-header{padding-block:8px!important}.campaign-gallery-brand h2{font-size:30px!important}.campaign-gallery-content{padding-top:0!important}.campaign-chapter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;padding-top:28px!important}.campaign-chapter-item,.campaign-chapter-card{min-height:210px!important}
  #campaign-intro-panel.campaign-intro-overlay{z-index:1200!important;display:grid!important;place-items:center!important;padding:max(5px,env(safe-area-inset-top)) max(7px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left))!important;overflow:hidden!important;pointer-events:auto!important}
  #campaign-intro-panel.campaign-intro-overlay.hidden{display:none!important}
  #campaign-intro-panel .campaign-intro-card{width:min(100%,920px)!important;height:calc(100dvh - 10px)!important;max-height:100%!important;grid-template-columns:minmax(210px,38%) minmax(0,1fr)!important;overflow:hidden!important}
  #campaign-intro-panel .campaign-intro-art{height:100%!important;min-height:0!important}
  #campaign-intro-panel .campaign-intro-art img{object-position:50% 17%!important}
  #campaign-intro-panel .campaign-intro-art>span{left:14px!important;bottom:10px!important;font-size:31px!important}
  #campaign-intro-panel .campaign-intro-copy{height:100%!important;min-height:0!important;padding:15px 18px 12px!important;justify-content:flex-start!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;pointer-events:auto!important}
  #campaign-intro-panel .campaign-intro-copy .eyebrow{margin-bottom:3px!important;font-size:8px!important}
  #campaign-intro-panel .campaign-intro-copy h2{font-size:clamp(29px,7vw,42px)!important;line-height:.92!important}
  #campaign-intro-panel .campaign-intro-copy>strong{margin-top:3px!important;font-size:15px!important}
  #campaign-intro-panel .campaign-intro-copy blockquote{margin:9px 0!important;padding-left:10px!important;font-size:13px!important;line-height:1.3!important}
  #campaign-intro-panel .campaign-intro-challenge{padding:7px 9px!important}.campaign-intro-challenge strong{font-size:12px!important}.campaign-intro-challenge small{font-size:9px!important}
  #campaign-intro-panel .campaign-intro-stakes{margin:8px 0!important;gap:8px!important;font-size:7px!important}
  #campaign-intro-panel .campaign-intro-copy button{position:sticky!important;z-index:3;bottom:0;width:100%!important;min-width:0!important;min-height:46px!important;height:46px!important;margin-top:auto!important;box-shadow:0 -8px 18px #09050e!important;pointer-events:auto!important}
  /* A phone in landscape uses a fitted Court instead of the larger pannable
     tablet surface. The whole decision area remains visible at once. */
  #game-screen.selection-board-active{--u:.52px!important;background-size:100% 100%!important}
  #game-screen.selection-board-active #planning-view{overflow:hidden!important;touch-action:manipulation!important}
  #game-screen.selection-board-active #planning-view>.mobile-court-pan-hint{display:none!important}
  #game-screen.selection-board-active .solo-selection-board{left:50%!important;top:48px!important;transform:translateX(-50%)!important}
  #game-screen.selection-board-active>.game-topbar{top:3px!important;right:max(5px,env(safe-area-inset-right))!important;height:42px!important}
  #game-screen.selection-board-active>.game-topbar>:not(.top-actions){display:none!important}
  #game-screen.selection-board-active>.game-topbar .top-actions>:not(#main-menu-button){display:none!important}
  #game-screen.selection-board-active>.game-topbar #main-menu-button{width:44px!important;height:42px!important;min-width:44px!important;min-height:42px!important;padding:4px 9px!important}
  #game-screen.selection-board-active .selection-controls button,
  #game-screen.selection-board-active #solo-resolution-controls button{min-height:42px!important;height:42px!important;padding:3px 4px!important;font-size:8px!important;line-height:1.05!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
}

/* Short landscape viewports need every menu destination to remain operable.
   Fit the mode list first; retain a contained nav scroller only for locales or
   accessibility zoom that still exceed this compact shell. */
@media(max-height:620px) and (orientation:landscape){
  #entry-screen .v0732-sidebar{padding:10px 14px 8px!important;overflow:hidden!important}
  #entry-screen .v0732-brand{display:none!important}
  #entry-screen .v0732-nav{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:2px}
  #entry-screen .v0732-nav-row{height:42px!important;min-height:42px!important;padding:4px 7px!important;grid-template-columns:30px minmax(0,1fr) 12px!important}
  #entry-screen .v0732-nav-row strong{font-size:13px!important;line-height:1.05!important}
  #entry-screen .v0732-nav-row small{display:none!important}
  #entry-screen .v0732-icon{width:26px;height:26px;font-size:16px!important}
  #entry-screen .v0732-chevron{font-size:17px!important}
  #entry-screen .v0732-version{flex:0 0 auto;margin-top:5px;padding-top:3px;font-size:8px!important}
}

@media(min-height:421px) and (max-height:500px) and (orientation:landscape) and (pointer:coarse){
  #game-screen.selection-board-active{--u:.58px!important}
  #game-screen.selection-board-active .solo-selection-board{top:52px!important}
}

@media(max-height:350px) and (orientation:landscape) and (pointer:coarse){
  #game-screen.selection-board-active{--u:.42px!important}
  #game-screen.selection-board-active .solo-selection-board{top:40px!important}
  #game-screen.selection-board-active>.game-topbar{height:36px!important}
  #game-screen.selection-board-active>.game-topbar #main-menu-button{height:36px!important;min-height:36px!important}
  #game-screen.selection-board-active .selection-controls button,
  #game-screen.selection-board-active #solo-resolution-controls button{min-height:36px!important;height:36px!important;font-size:7px!important}
}

@media(prefers-reduced-motion:reduce) and (max-width:900px){
  *{scroll-behavior:auto!important}
  #entry-screen .v0732-flyout,.campaign-chapter-card,.campaign-encounter,.wardrobe-item{transition:none!important}
}
body.reduce-motion :is(#entry-screen .v0732-flyout,.campaign-chapter-card,.campaign-encounter,.wardrobe-item){transition:none!important}

@media(forced-colors:active) and (max-width:900px){
  :is(button,[role="button"],input,select,.panel,.records-card,.settings-card,.wardrobe-shell){forced-color-adjust:auto;border:1px solid CanvasText!important}
  :is(button,[role="button"]):focus-visible{outline:3px solid Highlight!important}
}
