/* Shared by every route and language; portrait/desktop rules stay in their original stylesheets. */
@media (orientation:landscape) and (max-height:600px) and (max-width:1366px){
  html{--landscape-board:min( calc(100dvh - 170px), calc(100vw - 270px), 440px)}
  body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
  .topbar,.landing-topbar,.friends-topbar,.time-topbar,.rating-topbar,.tactics-topbar,.improve-topbar{gap:8px!important;min-height:40px!important}
  .brand .crown,.brand>p,.logo .crown,.logo>p{display:none!important}
  .topbar .brand h1,.topbar .brand .brand-name{font-size:24px!important;letter-spacing:2px!important}
  .theme-panel,.chessvola-global-settings__panel,.game-end-box,.delete-account-dialog,.feedback-card{
    max-height:calc(100dvh - 20px)!important;overflow-y:auto!important;overscroll-behavior:contain;
  }
  .chessora-chat-panel{max-height:calc(100dvh - 20px)!important;bottom:10px!important}

  /* Home: the title no longer competes with the board and the menu for height. */
  html:not([class]) .app{
    height:100dvh;min-height:0;grid-template-columns:minmax(0,.85fr) minmax(0,1.35fr);
    grid-template-rows:auto minmax(0,1fr) auto;gap:6px 20px;
    padding:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left));
  }
  html:not([class]) .topbar{grid-column:1 / -1;grid-row:1}
  html:not([class]) .hero{
    grid-column:1;grid-row:2;grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto minmax(0,1fr);gap:6px;overflow:hidden;
  }
  html:not([class]) .brand{grid-column:1;grid-row:1;transform:none;max-width:100%}
  html:not([class]) .brand .brand-name{font-size:clamp(20px,3.6vw,36px);letter-spacing:2px;line-height:1.1}
  html:not([class]) .brand .home-hero-title{font-size:10px;letter-spacing:1px}
  html:not([class]) .board-shell{grid-column:1;grid-row:2;width:min(46dvh,30vw,220px);height:auto;max-width:100%;min-height:0;transform:none;aspect-ratio:1}
  html:not([class]) .stats{display:none}
  html:not([class]) .menu{grid-column:2;grid-row:2;width:100%;align-self:center;gap:6px}
  html:not([class]) .menu-btn{min-height:44px;padding:5px 8px;font-size:clamp(12px,1.6vw,16px);gap:7px}
  html:not([class]) .menu-icon{width:28px;height:28px;font-size:17px}
  html:not([class]) .legal-footer{grid-column:1 / -1;grid-row:3}

  /* Forms: keep the header visible, scroll the central form when height is limited. */
  html.setup-online .page{height:100dvh;padding:8px 12px;gap:8px}
  html.setup-online .stage{align-items:flex-start;overflow-y:auto;overscroll-behavior:contain}
  html.setup-online .card{margin:auto;width:min(760px,100%);padding:14px}
  html.setup-online .title{font-size:22px}
  html.setup-online .subtitle{margin:5px 0 10px}
  html.setup-online .time-option label{min-height:44px}
  html.setup-online .rating-note{margin-top:10px;padding:8px}
  html.setup-online .continue{min-height:44px;margin-top:10px}
  html.setup-computer .page{height:100dvh;min-height:0;padding:8px;align-items:center}
  html.setup-computer .dialog{width:min(840px,100%);max-height:calc(100dvh - 16px);overflow-y:auto}
  html.setup-computer .dialog-head{height:auto;min-height:44px;flex-shrink:0}
  html.setup-computer .dialog-head :is(h1,h2){font-size:22px}
  html.setup-computer .content{padding:12px;gap:8px}
  html.setup-computer .back-board .board-shell{width:min(60dvh,400px)}
  html:is(.auth-register,.auth-friend,.game-friend) .page{
    height:100dvh;min-height:0;display:block;overflow-y:auto;padding:8px 12px;overscroll-behavior:contain;
  }
  html:is(.auth-register,.auth-friend,.game-friend) .topbar{width:100%}
  html:is(.auth-register,.auth-friend,.game-friend) .hero{margin:12px auto 0}
  html:is(.auth-register,.auth-friend,.game-friend) .hero-icon{width:42px;height:42px;font-size:25px;margin-bottom:5px}
  html:is(.auth-register,.auth-friend,.game-friend) .hero h2{font-size:24px}
  html:is(.auth-register,.auth-friend) .card{margin-top:12px;padding:16px;width:min(760px,100%)}
  html.game-friend .friend-card{margin-top:12px;padding:14px}
  html.game-friend .options{grid-template-columns:repeat(2,minmax(0,1fr))}

  /* Profile: scroll the entire card so account actions cannot squeeze out the dashboard. */
  html.profile-page .page{padding:8px 12px;gap:8px}
  html.profile-page .profile-card{display:block!important;overflow-y:auto!important;min-height:0;overscroll-behavior:contain}
  html.profile-page .profile-head{margin-bottom:10px}
  html.profile-page .profile-summary-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);margin-bottom:10px}
  html.profile-page .profile-dashboard,html.profile-page .profile-card.public-view .profile-dashboard{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;gap:10px;
  }
  html.profile-page .profile-column{display:block;overflow:visible}
  html.profile-page .history-section{grid-column:1 / -1}
  html.profile-page .profile-card.public-view .history-section{height:auto}
  html.profile-page .actions{margin-top:10px}

  /* Online / computer games: board fits the available height; controls scroll alongside it. */
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .app{
    width:100%!important;height:100dvh!important;min-height:0!important;padding:44px 10px 6px!important;
    display:grid!important;grid-template-rows:44px minmax(0,1fr)!important;gap:5px!important;align-items:stretch!important;
    overflow:hidden!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .home-button{position:fixed!important;top:6px!important;left:max(10px,env(safe-area-inset-left))!important;min-height:32px!important;padding:6px 10px!important;font-size:12px!important;z-index:10}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .top{
    width:100%!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
    grid-template-rows:44px!important;height:44px!important;gap:8px!important;position:static!important;margin:0!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .language-mobile{display:block!important;position:fixed!important;top:6px!important;right:max(10px,env(safe-area-inset-right))!important;left:auto!important;transform:none!important;margin:0!important;z-index:10}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .language-mobile select{height:32px!important;min-height:32px!important;max-width:140px!important;font-size:12px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .logo{grid-column:2!important;grid-row:1!important;position:static!important;transform:none!important;margin:0!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .logo h1{font-size:22px!important;letter-spacing:2px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .player{
    grid-column:1!important;grid-row:1!important;position:static!important;transform:none!important;
    width:100%!important;min-width:0!important;min-height:40px!important;height:44px!important;padding:4px 6px!important;gap:6px!important;margin:0!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .player.right{grid-column:3!important;grid-row:1!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .avatar{width:30px!important;height:30px!important;flex:0 0 30px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .pinfo{min-width:0!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .name{font-size:12px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .rating{font-size:10px!important;margin-top:2px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .timer{font-size:18px!important;min-width:62px!important;padding:3px 6px!important;margin-left:auto!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout){
    position:relative!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(180px,230px)!important;
    grid-template-rows:minmax(0,1fr)!important;width:100%!important;height:100%!important;min-height:0!important;
    margin:0!important;padding:0!important;gap:10px!important;align-items:start!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .history-sidebar{display:none!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .game{
    grid-column:1!important;grid-row:1!important;position:relative!important;left:auto!important;top:auto!important;
    transform:none!important;width:calc(var(--landscape-board) + 10px)!important;max-width:100%!important;
    height:auto!important;min-height:0!important;margin:0 auto!important;padding:4px!important;
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:12px auto 12px 22px 20px!important;gap:0!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .board{
    grid-column:1!important;grid-row:2!important;width:var(--landscape-board)!important;height:var(--landscape-board)!important;
    min-width:0!important;max-width:100%!important;margin:0 auto!important;aspect-ratio:1!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .captured-strip{position:static!important;width:100%!important;height:12px!important;min-height:0!important;padding:0!important;margin:0!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .captured-top{grid-row:1!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .captured-bottom{grid-row:3!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .captured-piece{width:12px!important;height:12px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .status{grid-row:4!important;position:static!important;height:22px!important;min-height:0!important;width:100%!important;max-width:100%!important;padding:2px 4px!important;flex-wrap:nowrap!important;gap:4px!important;margin:0!important;font-size:10px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .move-timer{position:static!important;transform:none!important;margin:0!important;font-size:10px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .move-timer-value{font-size:12px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .control-sidebar{
    grid-column:2!important;grid-row:1!important;display:block!important;position:static!important;left:auto!important;right:auto!important;top:auto!important;
    width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important;
    margin:0!important;padding:8px!important;overflow-y:auto!important;overscroll-behavior:contain;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .control-sidebar .controls{display:grid!important;gap:6px!important;margin:8px 0!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .control-sidebar .controls .btn{width:100%!important;min-height:38px!important;padding:6px!important;font-size:12px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .mobile-history-bar{display:flex!important;position:static!important;grid-column:1!important;grid-row:5!important;max-width:100%!important;height:20px!important;min-height:0!important;overflow-x:auto!important;margin:0!important;font-size:10px!important}

  /* Puzzles and replay use the same height budget as the playing board. */
  html.puzzles-page .app{height:100dvh;padding:8px 12px;display:grid;grid-template-rows:auto minmax(0,1fr);gap:8px;overflow:hidden}
  html.puzzles-page .puzzle-layout{height:100%;min-height:0;margin:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(210px,.9fr);gap:12px;align-items:start}
  html.puzzles-page .board-shell{width:min(calc(100dvh - 70px),100%);min-width:0;margin:auto;padding:4px;aspect-ratio:1}
  html.puzzles-page .puzzle-panel{width:100%;height:100%;min-height:0;margin:0;padding:12px;overflow-y:auto;overscroll-behavior:contain}
  html.puzzles-page .topbar{grid-template-columns:auto minmax(0,1fr) auto}
  html.puzzles-page .topbar-actions{width:auto;gap:5px}
  html.game-replay .page{height:100dvh;min-height:0;padding:8px 12px;display:grid;grid-template-rows:auto minmax(0,1fr);gap:8px;overflow:hidden}
  html.game-replay .shell{margin:0;min-height:0;height:100%;display:grid;grid-template-columns:minmax(0,1fr) 210px;gap:10px;overflow-y:auto}
  html.game-replay .game-column{display:block;height:auto;overflow:visible;grid-column:1;grid-row:1 / span 2;width:min(calc(100dvh - 150px),100%);margin:0 auto;order:0}
  html.game-replay .player-card{height:34px;min-height:34px;padding:3px 6px;gap:6px}
  html.game-replay .avatar{width:28px;height:28px;flex-basis:28px}
  html.game-replay .player-name{font-size:11px}
  html.game-replay .player-rating{font-size:9px;margin-top:2px}
  html.game-replay .board-wrap{display:block;height:auto;aspect-ratio:1;padding:3px;margin-top:4px!important}
  html.game-replay .board{width:100%!important;height:auto!important;aspect-ratio:1}
  html.game-replay .control{height:32px!important}
  html.game-replay .controls{margin-top:5px;gap:5px}
  html.game-replay .control{min-height:32px;font-size:16px}
  html.game-replay .history-panel,html.game-replay .info-panel{grid-column:2;order:0;height:auto;max-height:none}
  html.game-replay .moves{max-height:120px}

  /* Leaderboards and legal text retain their internal scrolling. */
  html.ratings-world .topbar{min-height:44px;padding:5px 12px}
  html.ratings-world .brand-copy>h1{font-size:21px}
  html.ratings-world .ratings-ua-seo-intro{margin-bottom:5px}
  html.ratings-world .ratings-ua-seo-intro h1{font-size:18px}
  html.ratings-puzzles .app{padding:8px 12px}
  html.ratings-puzzles .leaderboard{margin-top:10px;padding:12px}
  html:is(.legal-standard,.legal-deletion) .page{padding:8px 12px;gap:6px}
  html:is(.legal-standard,.legal-deletion) .card{padding:16px}
  html:is(.legal-standard,.legal-deletion) .brand{font-size:24px}
  .landing-hero,.friends-hero,.time-hero,.rating-hero,.tactics-hero,.improve-hero{padding-top:18px!important;padding-bottom:18px!important}
  .improve-icon{width:44px!important;height:44px!important;font-size:26px!important;margin-bottom:10px!important}
  .landing-hero h1,.friends-hero h1,.time-hero h1,.rating-hero h1,.tactics-hero h1,.improve-hero h1{font-size:clamp(26px,4vw,38px)!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .game .turn{font-size:9px!important;min-width:0!important;max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .game .move-timer{min-width:0!important;padding:0!important;gap:2px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .game .move-timer-label{display:none!important}
  .chessvola-consent{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:10px!important;bottom:8px!important;max-height:45dvh;overflow-y:auto}
  .chessvola-consent__title{font-size:14px!important;margin:0!important}
  .chessvola-consent__text{grid-column:1;font-size:12px!important}
  .chessvola-consent__actions{grid-column:2;grid-row:1 / span 2;align-content:center;align-items:center;max-width:220px;margin:0!important}
  body:has(>main.card .outcome){padding:12px}
  body>main.card:has(.outcome) .brand{padding:12px 18px}
  body>main.card:has(.outcome) .main{padding:8px 18px 16px}
  body>main.card:has(.outcome) .match{margin:12px 0;padding:10px}
  body>main.card:has(.outcome) .outcome{font-size:28px}
  body>main.card:has(.outcome) .cta{margin-top:12px}

}

/* Landscape playing surface: board uses the full left column; all information is on the right. */
@media (orientation:landscape) and (max-height:600px) and (max-width:1366px){
  html:is(.game-online,.game-computer){--landscape-board:min(calc(100dvh - 90px),calc(55vw - 20px),510px)}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .app{
    padding:8px 10px 6px!important;
    grid-template-columns:calc(var(--landscape-board) + 10px) minmax(0,1fr)!important;
    grid-template-rows:36px 28px 44px 44px minmax(0,1fr)!important;
    gap:5px 14px!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.top,.online-layout,.computer-layout){display:contents!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .logo{grid-column:2!important;grid-row:2!important;align-self:center!important;justify-self:center!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .player{grid-column:2!important;grid-row:3!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .player.right{grid-column:2!important;grid-row:4!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .game{
    grid-column:1!important;grid-row:1 / -1!important;
    align-self:start!important;justify-self:start!important;max-height:none!important;margin:0!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .control-sidebar{
    grid-column:2!important;grid-row:5!important;align-self:stretch!important;height:100%!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .home-button{
    left:calc(var(--landscape-board) + 34px + env(safe-area-inset-left))!important;top:8px!important;
  }
}

@media (orientation:landscape) and (max-height:600px) and (max-width:1366px){
  html:is(.game-online,.game-computer){--landscape-board:min(calc(100dvh - 50px),calc(55vw - 20px),550px)}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .app{
    grid-template-rows:36px 28px 44px 44px 22px 20px minmax(0,1fr)!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .game{
    grid-template-rows:12px auto 12px!important;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .control-sidebar{grid-row:7!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .game :is(.status,.mobile-history-bar){
    position:fixed!important;
    left:calc(var(--landscape-board) + 34px + env(safe-area-inset-left))!important;
    right:max(10px,env(safe-area-inset-right))!important;
    width:calc(100% - var(--landscape-board) - 44px - env(safe-area-inset-left) - env(safe-area-inset-right))!important;
    max-width:none!important;margin:0!important;z-index:2;
  }
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .game .status{top:180px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .game .mobile-history-bar{top:207px!important}
}

@media (orientation:landscape) and (max-height:600px) and (max-width:1366px){
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .app{grid-template-rows:36px 44px 44px 22px 20px minmax(0,1fr)!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .logo{grid-row:1!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .logo h1{font-size:18px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .player{grid-row:2!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .player.right{grid-row:3!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .control-sidebar{grid-row:6!important;padding:4px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .game .status{top:147px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) :is(.online-layout,.computer-layout) .game .mobile-history-bar{top:174px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .control-sidebar .controls{margin:4px 0!important;gap:4px!important}
  html:is(.game-online,.game-computer) body:is(.online-mode,.computer-mode) .control-sidebar .controls .btn{height:34px!important;min-height:34px!important}
  html.game-computer body.computer-mode .computer-stats-panel{padding:4px}
  html.game-computer body.computer-mode .computer-stats-title{margin-bottom:3px;font-size:9px}
  html.game-computer body.computer-mode .computer-stat-item{padding:3px 2px}
}

/* Friend-game setup: fixed header and summary, with scrolling inside the form card. */
@media (orientation:landscape) and (max-height:600px) and (max-width:1366px){
  html.game-friend,html.game-friend body{height:100%;min-height:0!important;overflow:hidden!important}
  html.game-friend .page{
    height:100dvh!important;min-height:0!important;
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto auto minmax(0,1fr)!important;
    gap:6px!important;padding:8px 12px!important;overflow:hidden!important;
  }
  html.game-friend .topbar{grid-row:1;width:100%!important}
  html.game-friend .userbar{grid-row:2;width:100%!important;min-height:44px!important;padding:5px 10px!important;margin:0!important}
  html.game-friend .userbar .avatar{width:32px!important;height:32px!important;flex-basis:32px!important}
  html.game-friend .userbar .username{font-size:16px!important}
  html.game-friend .userbar .rating{font-size:12px!important}
  html.game-friend .hero{
    grid-row:3;width:100%!important;margin:0!important;padding:4px!important;
    display:grid!important;grid-template-columns:40px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;column-gap:8px!important;text-align:left!important;
  }
  html.game-friend .hero-icon{grid-column:1;grid-row:1 / span 2;width:36px!important;height:36px!important;margin:0!important;font-size:22px!important}
  html.game-friend .hero h2{grid-column:2;grid-row:1;font-size:22px!important;margin:0!important}
  html.game-friend .hero p{grid-column:2;grid-row:2;max-width:none!important;margin:3px 0 0!important;padding:0!important;font-size:12px!important;line-height:1.3!important}
  html.game-friend .friend-card{
    grid-row:4;width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important;
    margin:0!important;padding:12px!important;display:block!important;
    overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;scrollbar-width:thin;
  }
  html.game-friend .options{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  html.game-friend .option{min-width:0!important;min-height:0!important;padding:12px!important}
  html.game-friend .option-icon{width:36px!important;height:36px!important;font-size:24px!important;margin-bottom:6px!important}
  html.game-friend .option h3{font-size:20px!important;margin:6px 0!important}
  html.game-friend .option p{font-size:12px!important;line-height:1.4!important}
  html.game-friend :is(.code-input,.action,.go-game-btn){min-height:44px!important}
}

/* Landscape leaderboard: independently scrolling players on the left, summary on the right. */
@media (orientation:landscape) and (max-height:600px) and (max-width:1366px){
  html.ratings-world .app{
    width:100%!important;height:100dvh!important;min-height:0!important;
    grid-template-columns:minmax(0,1.55fr) minmax(0,1fr)!important;
    grid-template-rows:44px minmax(0,1fr) auto auto!important;
    gap:6px 10px!important;padding:8px 10px!important;overflow:hidden!important;
  }
  html.ratings-world .topbar{grid-column:2;grid-row:1;min-width:0;min-height:44px!important;padding:3px 6px!important;grid-template-columns:32px minmax(0,1fr) auto!important;gap:5px!important;border-radius:10px}
  html.ratings-world .brand{gap:5px!important}
  html.ratings-world .brand-mark{display:none}
  html.ratings-world .topbar .brand-copy .brand-name{font-size:18px!important;letter-spacing:1px!important}
  html.ratings-world .brand-copy :is(h1,.ratings-page-label,.ratings-ua-page-label){font-size:13px!important;margin:0!important}
  html.ratings-world .back{width:30px!important;height:30px!important}
  html.ratings-world .chessvola-global-settings-button{width:32px!important;height:32px!important;font-size:18px!important}
  html.ratings-world .overview{grid-column:2;grid-row:2;min-width:0;min-height:0;padding:6px!important;overflow-y:auto;overscroll-behavior:contain}
  html.ratings-world :is(.ratings-seo-intro,.ratings-ua-seo-intro){width:100%;margin-bottom:8px}
  html.ratings-world :is(.ratings-seo-intro,.ratings-ua-seo-intro) h1{font-size:18px!important;line-height:1.2}
  html.ratings-world :is(.ratings-seo-intro,.ratings-ua-seo-intro) p{font-size:11px!important;line-height:1.4}
  html.ratings-world .scope{width:100%;margin-bottom:8px}
  html.ratings-world .scope button{min-height:38px;font-size:12px}
  html.ratings-world .profile-card{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html.ratings-world .profile-main{grid-column:1 / -1;padding:8px!important;min-width:0}
  html.ratings-world .profile-avatar{width:32px!important;height:32px!important}
  html.ratings-world .elo{font-size:24px!important}
  html.ratings-world .metric{padding:6px 3px!important}
  html.ratings-world .small-label{font-size:9px!important;letter-spacing:0}
  html.ratings-world .metric strong{font-size:18px!important}
  html.ratings-world .ratings-panel{display:contents!important}
  html.ratings-world .panel-title{grid-column:2;grid-row:3;min-width:0;padding:6px!important;display:block!important;border-radius:8px}
  html.ratings-world .panel-title h2{font-size:14px!important}
  html.ratings-world .updated{display:block;font-size:10px!important;white-space:normal}
  html.ratings-world .table-head{grid-column:1;grid-row:1;min-height:44px;border-radius:10px 10px 0 0}
  html.ratings-world .leader-scroll{
    grid-column:1;grid-row:2 / -1;height:100%;min-height:0;min-width:0;
    overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;border:1px solid var(--line);border-radius:0 0 10px 10px;
  }
  html.ratings-world .rating-row{grid-template-columns:30px minmax(0,1fr) 50px 48px 48px!important}
  html.ratings-world .rating-row>div{padding:6px 4px!important}
  html.ratings-world .table-head{font-size:9px!important;letter-spacing:0}
  html.ratings-world .table-head>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  html.ratings-world .leader-scroll .rating-row{min-height:46px;font-size:12px}
  html.ratings-world .leader-scroll .player{gap:6px}
  html.ratings-world .leader-scroll .avatar{width:30px;height:30px}
  html.ratings-world .current-user{grid-column:2;grid-row:4;grid-template-columns:28px minmax(0,1fr) 45px 38px 38px!important;font-size:11px}
}
