.top-actions .install-button{display:inline-flex;align-items:center;gap:6px;background:#d7bd72;color:#3e2b1f;border:2px solid #765039;box-shadow:2px 2px #38251b;font-weight:800}.is-installed [data-install-cafe]{display:none!important}
.panel-close{display:none;position:absolute;z-index:8;right:max(9px,env(safe-area-inset-right));top:8px;width:38px;height:38px;border-radius:4px;background:#f3dfb0;border:2px solid #806043;color:#4a3425;font-size:24px}
.rotate-overlay{position:fixed;z-index:800;inset:0;background:radial-gradient(circle at 50% 30%,#526b49,#1f281e 72%);color:#fff1cb;display:grid;place-items:center;padding:max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));text-align:center}.rotate-overlay[hidden]{display:none}.rotate-card{max-width:430px}.rotate-phone{width:76px;height:124px;border:5px solid #f1d79a;border-radius:10px;margin:0 auto 20px;position:relative;animation:turn-phone 1.8s ease-in-out infinite}.rotate-phone:after{content:"";position:absolute;left:30px;bottom:6px;width:9px;height:9px;border-radius:50%;background:#f1d79a}.rotate-card h1{font-size:25px;margin:8px}.rotate-card p{font-size:14px;line-height:1.55;color:#e2d2ab}.rotate-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.rotate-actions button{min-height:46px;background:#efd189;border:2px solid #6d4b34;color:#39281d;font-weight:800}
.offline-banner,.update-banner{position:fixed;z-index:900;left:50%;top:max(62px,calc(env(safe-area-inset-top) + 10px));transform:translateX(-50%);max-width:min(520px,calc(100vw - 24px));background:#fff0c7;border:3px solid #815b39;box-shadow:5px 5px #2f2118;padding:10px 13px;color:#3d2c20;display:flex;align-items:center;gap:12px}.offline-banner[hidden],.update-banner[hidden]{display:none}.offline-banner p,.update-banner p{margin:0;font-size:12px;line-height:1.35}.offline-banner button,.update-banner button{white-space:nowrap;min-height:38px;background:#708454;color:#fff6d8;border:2px solid #455b3b;font-weight:800}.update-status{display:block;color:#9b452f}.update-status[hidden]{display:none}
.install-modal form{max-width:560px}.install-icon{width:88px;height:88px;image-rendering:pixelated}.install-warning{background:#fff0c7;border:2px solid #c99953;padding:10px}.install-wallet{display:grid;gap:6px;margin:12px 0}.install-wallet code{word-break:break-all;background:#2f251e;color:#ffe7a7;padding:10px;border-radius:4px}.wallet-recovery{background:#fff0c7;border:2px solid #c99953;padding:10px;margin:12px 0}.wallet-recovery[hidden]{display:none}
@keyframes turn-phone{0%,25%{transform:rotate(0)}60%,100%{transform:rotate(90deg)}}
@media(prefers-reduced-motion:reduce){.rotate-phone{animation:none;transform:rotate(90deg)}}
@media(max-width:900px) and (orientation:landscape){
  body{overflow:hidden;padding:0}.topbar{height:48px;min-height:48px;padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}.brand small,.ticker{display:none}.brand h1{font-size:17px}.top-actions{gap:5px}.top-actions button{min-width:38px;min-height:36px}.install-button span{display:none}
  .cafe-shell{position:fixed;inset:48px 0 0;height:auto!important;max-width:none!important;padding:0!important;margin:0!important;display:block!important}.world-card{position:absolute!important;inset:0!important;width:auto!important;height:auto!important;border:0!important;border-radius:0!important}.canvas-frame,.canvas-frame canvas{height:100%!important;max-height:none!important}.canvas-frame canvas{width:100%!important;object-fit:cover}.world-note,.world-clock{display:none}
  .side-panel{position:fixed!important;z-index:45!important;right:0!important;left:auto!important;top:48px!important;bottom:0!important;width:min(360px,44vw)!important;height:auto!important;max-height:none!important;min-height:0!important;border-left:3px solid #765039!important;border-radius:0!important;box-shadow:-5px 0 #2f2118!important;padding-left:64px!important}.panel-tabs{position:fixed!important;z-index:49!important;left:max(0px,env(safe-area-inset-left));top:48px!important;bottom:0!important;width:64px!important;height:auto!important;display:flex!important;flex-direction:column!important;grid-template-columns:none!important;background:#3e3025!important;padding:5px!important;gap:5px!important}.panel-tabs button{min-width:54px!important;min-height:48px!important;padding:5px 2px!important;font-size:8px!important}.panel-tabs button span{font-size:20px!important}.panel-view{height:100%!important;overflow:auto!important;padding:50px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) 12px!important}.panel-close{display:block}.landscape-panel-closed .side-panel{width:64px!important;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important}.landscape-panel-closed .panel-view,.landscape-panel-closed .panel-close{display:none!important}
  .interact-button{position:fixed!important;z-index:55!important;left:auto!important;right:max(12px,env(safe-area-inset-right))!important;bottom:max(14px,env(safe-area-inset-bottom))!important;width:auto!important;min-width:104px!important;transform:none!important}.dpad{position:fixed!important;z-index:42!important;left:max(76px,calc(env(safe-area-inset-left) + 76px))!important;right:auto!important;bottom:max(10px,env(safe-area-inset-bottom))!important}
  .play-mode .world-card{display:none!important}.play-mode .side-panel{left:0!important;width:100%!important;padding-left:68px!important;display:block!important}.play-mode .panel-view{padding-top:12px!important}.play-mode .panel-tabs{display:flex!important}.play-mode .panel-close{display:none!important}.play-mode .game-page-heading{padding-right:8px}.play-mode .mini-game-picker{max-width:560px}.play-mode .mini-lobby{min-height:170px;padding:14px}.play-mode .mini-playing{min-height:calc(100vh - 70px)}
  .brawl-mode .side-panel{display:none!important}.brawl-mode .world-card{display:block!important}.brawl-mode #brawl-controls{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom)}
}
@media(max-width:900px) and (orientation:landscape){
  .play-mode .cards-view.active.in-card-round .game-page-heading{margin-bottom:4px}
  .play-mode .cards-view.active.in-card-round .game-page-heading>div:first-child{display:none}
  .play-mode .cards-view.active.in-card-round .card-header-actions{width:100%;justify-content:space-between;gap:3px}
  .play-mode .cards-view.active.in-card-round .card-header-actions button{min-height:36px;min-width:0;padding:4px 6px;font-size:10px;white-space:nowrap}
  .cards-view.in-card-round .tl-hand,.cards-view.in-card-round .color-arena+.hand-area .hand{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;gap:5px;min-height:70px;height:76px;padding:10px 4px 4px;scrollbar-width:thin;touch-action:pan-x}
  .cards-view.in-card-round .tl-hand .tl-card{width:44px;height:61px;min-height:0;max-height:none;flex:0 0 44px}
  .cards-view.in-card-round .color-arena+.hand-area .hand .playing-card{width:46px;height:64px;max-height:none;aspect-ratio:auto;flex:0 0 46px}
  .cards-view.in-card-round #pk-game .classic-actions{padding-top:4px;padding-bottom:max(5px,env(safe-area-inset-bottom))}
  .cards-view.in-card-round #pk-game .classic-actions>p{margin-bottom:3px;font-size:10px;line-height:1.2}
  .cards-view.in-card-round #pk-controls{display:flex;align-items:stretch;gap:4px;min-width:0}
  .cards-view.in-card-round #pk-controls .classic-buttons{flex:1;min-width:0;max-width:none;width:auto;gap:3px}
  .cards-view.in-card-round #pk-controls .classic-buttons button{min-height:44px;padding:2px;font-size:9px;line-height:1.1}
  .cards-view.in-card-round #pk-controls .poker-raise-control{display:flex;flex:0 0 154px;min-width:0;min-height:44px;margin:0;gap:3px}
  .cards-view.in-card-round #pk-controls .poker-raise-control input{width:61px;min-width:0;min-height:44px;padding:2px;font-size:14px}
  .cards-view.in-card-round #pk-controls .poker-raise-control button{flex:1;min-width:0;min-height:44px;padding:2px;font-size:9px}
  .cards-view.in-card-round #pk-controls .poker-raise-control label,.cards-view.in-card-round #pk-controls .poker-raise-control small{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  /* Keep the selected game and its controls in the viewport on short phones. */
  .play-mode .games-view.active{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:6px max(10px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) 10px!important}
  .games-view.has-mini-game .game-page-heading{display:none}
  .games-view .game-page-heading{flex:none;margin-bottom:5px}
  .games-view .game-page-heading h2{font-size:15px;margin:0}
  .games-view .game-page-heading small{display:none}
  .games-view .mini-game-picker{flex:none;width:100%;max-width:none;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;margin:0 0 6px}
  .games-view .mini-game-picker button{min-width:0;min-height:49px;grid-template-columns:1fr;gap:0;padding:3px 2px;box-shadow:none}
  .games-view .mini-game-picker button>span{font-size:18px;line-height:1}
  .games-view .mini-game-picker button>b{font-size:10px;line-height:1.12;overflow-wrap:anywhere}
  .games-view .mini-game-picker button>small{display:none}
  .games-view #mini-game-stage{flex:1;min-height:0;width:100%;max-width:none;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
  .games-view .mini-welcome,.games-view .mini-lobby{min-height:100%;padding:7px 12px}
  .games-view .mini-welcome>span{font-size:28px}
  .games-view .mini-lobby h3,.games-view .mini-welcome h3{font-size:16px;margin:2px 0}
  .games-view .mini-lobby p,.games-view .mini-welcome p{font-size:11px;line-height:1.25;margin:3px 0}
  .games-view .mini-lobby label{margin:3px;font-size:11px}
  .games-view .mini-lobby select{min-height:32px}
  .games-view .mini-lobby .primary{min-height:38px;padding:5px 12px}
  .games-view .mini-invite{margin:3px auto;padding:3px 7px;font-size:10px}
  .games-view .mini-invite button{min-height:32px;padding:4px 8px}
  .games-view .mini-playing{min-height:100%!important;padding:6px 8px;box-shadow:none}
  .games-view .mini-playing .mini-invite,.games-view .mini-playing .mini-rules{display:none}
  .games-view .mini-scorebar{padding-bottom:3px}
  .games-view .mini-scorebar h3{font-size:14px}
  .games-view .mini-scorebar>b{padding:3px 6px;font-size:10px}
  .games-view .mini-turn{display:none}
  .games-view .mini-players{gap:4px;padding:2px}
  .games-view .mini-player{display:flex;align-items:center;justify-content:space-between;gap:4px;min-width:85px;padding:3px 5px}
  .games-view .mini-player b,.games-view .mini-player span{font-size:10px}
  .games-view .mini-board{margin:5px auto}
  .games-view .rps-choices{gap:6px;margin:4px auto}
  .games-view .rps-choices button{width:min(26%,100px);min-height:62px;gap:1px;padding:3px}
  .games-view .rps-choices span{font-size:24px}
  .games-view .rps-choices b{font-size:10px}
  .games-view .quiz-question{font-size:13px;line-height:1.25;margin-bottom:5px}
  .games-view .quiz-board .rps-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-width:420px}
  .games-view .quiz-board .rps-choices button{width:100%;min-height:43px;display:flex;align-items:center;justify-content:flex-start;gap:6px;padding:4px 7px;text-align:left}
  .games-view .quiz-board .rps-choices span{font-size:13px}
  .games-view .memory-board{grid-template-columns:repeat(6,minmax(0,1fr));max-width:390px;gap:5px}
  .games-view .memory-tile{font-size:20px}
}
@media(max-width:900px) and (orientation:portrait){body.portrait-blocked{overflow:hidden;max-width:100vw}.portrait-blocked .topbar{overflow:hidden}.portrait-blocked .online-pill,.portrait-blocked .top-actions [data-install-cafe]{display:none!important}.portrait-blocked dialog[open]:not(#wallet-dialog):not(#install-dialog){display:none}body.portrait-blocked>*:not(.rotate-overlay):not(dialog){pointer-events:none}.rotate-overlay{pointer-events:auto}}

/* Keep install/update surfaces in the same slate-blue palette as the café. */
.top-actions .install-button{background:#d7b76b;color:#243242;border-color:#405b6b;box-shadow:2px 2px #1b2a35}
.panel-close{background:#e1ebf0;border-color:#607b8b;color:#243242}
.offline-banner,.update-banner{background:#e6eff4;border-color:#5c7d90;box-shadow:5px 5px #1d2b35;color:#243242}
.offline-banner button,.update-banner button{background:#668fae;color:#f4f8fa;border-color:#3d6075}
.install-warning,.wallet-recovery{background:#e6eff4;border-color:#9bb5c3}
.install-wallet code{background:#253540;color:#e4eff4}
.install-modal .install-status{margin:8px 0;padding:10px 12px;background:#dce9f0;border-left:4px solid #567f99;color:#243d50;font-weight:800;font-size:13px;line-height:1.45}
.install-modal #install-platform-copy{line-height:1.55;font-size:13px;color:#405c6c}
.install-actions{display:grid;gap:8px;margin:12px 0 18px}.install-actions button{width:100%;min-height:46px}.install-wallet-actions button{min-height:42px}
.install-actions #install-apk{display:block;min-height:46px;padding:12px 16px;border:2px solid #1c2c37;color:#fff8e7;text-align:center;text-decoration:none;font-weight:900;box-shadow:3px 3px 0 #1c2c37}.install-actions #install-apk[hidden]{display:none}
@media(max-width:480px){.install-modal{padding:18px}.install-icon{width:64px;height:64px}.install-wallet-actions{flex-wrap:wrap}.install-wallet-actions button{flex:1 1 130px}}
@media(display-mode:standalone){[data-install-cafe]{display:none!important}}
/* Keep the triple-memory pictures readable on the compact landscape board. */
.games-view .memory-tile{font-size:28px!important}.games-view .memory-tile.revealed,.games-view .memory-tile.matched{font-size:28px!important}
