/* PN v1.2.27 — isolated mobile layout. Desktop rules remain unchanged. */
.sidebar-close{display:none}
.topbar-actions{display:contents}

@media (max-width:900px){
  :root{--mobile-gutter:14px;--mobile-radius:12px;--sidebar:286px}

  html,body{width:100%;max-width:100%;overflow-x:hidden}
  body{font-size:15px;-webkit-text-size-adjust:100%}
  body.menu-open{overflow:hidden}
  img,svg,video{max-width:100%}
  .site-shell,.page-shell,.content,.topbar,.site-footer{width:100%;max-width:100%;min-width:0}
  .page-shell{margin-left:0!important}

  /* Off-canvas navigation */
  .sidebar{
    inset:0 auto 0 0!important;width:min(86vw,320px)!important;max-width:320px;
    padding:18px 14px calc(18px + env(safe-area-inset-bottom));
    transform:translate3d(-104%,0,0)!important;transition:transform .22s ease!important;
    z-index:100!important;box-shadow:24px 0 70px rgba(0,0,0,.58);overscroll-behavior:contain
  }
  body.menu-open .sidebar{transform:translate3d(0,0,0)!important}
  .sidebar-close{display:grid;place-items:center;position:absolute;right:12px;top:12px;z-index:2;width:40px;height:40px;min-height:0;padding:0;border:1px solid #3a3533;border-radius:10px;background:#171719;color:#fff;font-size:26px;line-height:1}
  .site-brand{padding:0 48px 14px 4px;margin-bottom:13px}
  .site-brand img{height:62px;object-position:left center}
  .side-nav{gap:12px}.nav-group{gap:3px}.nav-label{font-size:10px}.nav-item{min-height:43px;font-size:14px}
  .mobile-overlay{display:block!important;z-index:90!important;backdrop-filter:blur(3px)}

  /* Three compact, predictable header rows */
  .topbar{
    position:sticky!important;top:0!important;z-index:80!important;height:auto!important;min-height:0!important;
    display:grid!important;grid-template-columns:44px minmax(0,1fr)!important;grid-template-rows:42px 40px 44px!important;
    align-items:center!important;gap:7px 9px!important;padding:9px var(--mobile-gutter) 10px!important;
    background:rgba(8,8,9,.97)!important;border-bottom:1px solid #2b2927;backdrop-filter:blur(16px)
  }
  .menu-toggle{display:grid!important;grid-column:1!important;grid-row:1!important;width:42px;height:42px;min-height:0;padding:0!important;place-items:center;border-radius:8px!important}
  .top-seasons{grid-column:2!important;grid-row:1!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px!important;width:100%;justify-self:stretch!important}
  .top-seasons .season-pill{min-width:0!important;height:42px;display:grid;place-items:center;padding:0 4px!important;border-radius:8px;font-size:11px}
  .topbar-actions{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;min-width:0}
  .topbar-actions>a{grid-column:auto!important;grid-row:auto!important;width:100%!important;min-width:0!important;height:40px!important;min-height:0!important;padding:0 5px!important;gap:5px!important;border-radius:8px!important;justify-content:center!important;font-size:10px!important;line-height:1.05;text-align:center;white-space:normal!important}
  .topbar-actions>a svg{display:none!important}.topbar-actions>a span{font-size:10px!important}
  .global-search{grid-column:1/-1!important;grid-row:3!important;position:relative!important;width:100%!important;max-width:none!important;height:44px!important;margin:0!important;padding:0 12px!important;border-radius:9px!important}
  .global-search input{min-width:0;font-size:16px!important}.global-search kbd{display:none!important}
  .search-suggestions{position:absolute!important;left:0!important;right:0!important;top:calc(100% + 6px)!important;max-height:55vh!important}

  /* Universal page rhythm */
  .content{margin:0!important;padding:18px var(--mobile-gutter) 46px!important}
  .pagehead{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:9px!important;margin:3px 0 16px!important;padding-left:12px!important;border-left-width:3px!important}
  .pagehead h1{max-width:100%;margin:3px 0 4px!important;font-size:clamp(28px,9vw,38px)!important;line-height:1!important;overflow-wrap:anywhere}
  .pagehead p{font-size:13px!important;line-height:1.45}.pagehead>.btn{width:100%;text-align:center}
  .card,.panel{border-radius:var(--mobile-radius)!important}.card{padding:15px;margin-bottom:11px}.panel{padding:15px}
  .card h2,.panel h2{font-size:17px;line-height:1.25}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .stat{min-height:112px;padding:14px}.stat b{font-size:28px}.stat span{font-size:12px}
  .site-footer{padding:20px var(--mobile-gutter) calc(24px + env(safe-area-inset-bottom))!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:11px!important;font-size:10px!important}
  .footer-instagram{font-size:17px!important;gap:9px!important}.footer-instagram svg{width:28px!important;height:28px!important}

  /* Touch-friendly filters */
  .filters,.rating-filter-panel,.monthly-controls{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;padding:12px!important;border-radius:12px!important}
  .filters>*:not(script),.filters label,.filter-field,.player-search-box{width:100%!important;min-width:0!important;max-width:none!important}
  .filters input,.filters select,.filters button,.filter-field input,.filter-field select,.filter-submit,.monthly-controls button{width:100%!important;min-width:0!important;height:46px!important;font-size:16px!important}
  .filter-field>span{font-size:10px}.monthly-threshold{padding:6px 2px 2px}.monthly-threshold-head{align-items:flex-start;gap:8px}.monthly-threshold-head small{font-size:10px;line-height:1.3}
  input[type="range"]{min-height:34px}

  /* Tables remain legible and swipe horizontally instead of being crushed. */
  .tablewrap,.season-table-wrap,.players-table-wrap,.current-rating-table,.profile-history-desktop{width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;margin-left:0!important;margin-right:0!important;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;touch-action:pan-x pan-y;scrollbar-width:thin}
  .tablewrap:after,.season-table-wrap:after{content:"Проведите по таблице влево →";position:sticky;left:12px;display:block;width:max-content;padding:8px 0 10px;color:#716d76;font-size:9px;letter-spacing:.03em}
  .tablewrap table{width:max-content!important;min-width:660px!important;table-layout:auto!important}
  table th,table td{padding:11px 10px!important;font-size:12px!important;white-space:nowrap}
  table th{font-size:10px!important}
  .ranking .rank-player{min-width:150px}.player-avatar.xs{width:31px;height:31px}.player-avatar.tiny{width:25px;height:25px}
  .anomaly-block table{min-width:930px!important}.anomaly-block>h2{position:sticky;left:0;max-width:calc(100vw - 58px);padding:14px 14px 4px!important;white-space:normal}.anomaly-note{position:sticky;left:0;width:calc(100vw - 58px);padding:0 14px 10px!important;white-space:normal}

  /* Home */
  .dashboard-hero{display:grid!important;grid-template-columns:1fr!important;gap:12px!important;padding:11px!important;margin-bottom:11px!important;min-height:0!important;border-radius:14px!important}
  .hero-avatar-wall{order:1;width:100%!important;min-height:0!important;padding:12px 8px!important;border-radius:10px!important;aspect-ratio:1/1}
  .hero-avatar-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;grid-template-rows:repeat(6,minmax(0,1fr))!important;gap:5px!important}
  .player-avatar.hero{width:min(12vw,58px)!important;height:min(12vw,58px)!important}
  .hero-visual{order:2;width:100%!important;min-height:345px!important}
  .hero-emblem{left:50%!important;right:auto!important;top:-18px!important;width:390px!important;height:350px!important;transform:translateX(-50%) scale(.76)!important;transform-origin:center top!important}
  .hero-win-pair{left:0!important;right:0!important;bottom:0!important;width:100%!important;transform:none!important;gap:7px!important}
  .hero-win-pair .hero-card{padding:10px 7px!important}.hero-win-pair .hero-card b{font-size:22px!important}.hero-win-pair .hero-card span{font-size:9px!important}
  .metric-strip{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;border-radius:12px!important}
  .metric-strip article{min-width:0;min-height:86px;padding:12px!important;border-right:1px solid #2d2b29!important;border-bottom:1px solid #2d2b29!important}.metric-strip article:nth-child(2n){border-right:0!important}.metric-strip article:nth-last-child(-n+2){border-bottom:0!important}
  .metric-icon{width:36px;height:36px;flex-basis:36px}.metric-strip b{font-size:17px}.metric-strip small{font-size:10px}
  .dashboard-grid{display:block!important}.dashboard-grid>.panel{margin-bottom:10px!important}
  .panel-head{align-items:flex-start;gap:10px}.panel-head h2{font-size:18px}.panel-head>a{text-align:right;white-space:nowrap}
  .leaders-panel .leader-row{grid-template-columns:25px 46px minmax(0,1fr) 64px!important;gap:7px!important;min-height:70px!important;padding:10px 1px!important}
  .leaders-panel .leader-row .player-avatar.sm{width:42px;height:42px}.leaders-panel .leader-name b{font-size:13px}.leaders-panel .leader-value{min-width:0!important}.leaders-panel .leader-value b{font-size:17px}
  .pu-list>a{grid-template-columns:24px minmax(0,1fr) auto;gap:7px}.pu-list strong{font-size:18px}
  .recent-games{grid-template-columns:1fr!important}.recent-game{grid-template-columns:32px minmax(0,1fr) auto!important;gap:7px!important}.recent-game:nth-child(2){border-top:1px solid #292725!important}
  .quick-panel .quick-grid{grid-template-columns:1fr 1fr!important;gap:7px!important}.quick-panel .quick-grid>a{min-height:82px!important;padding:10px!important}

  /* Club overview and record cards */
  .club-stats-page:before{position:fixed;background-size:120vw;opacity:.028}.club-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .club-stat{min-height:180px!important;padding:15px!important}.club-stat .stat-value{font-size:31px;margin:5px 0 13px}.club-stat h2{font-size:13px}.club-stat p{font-size:10px}
  .notes-grid{grid-template-columns:1fr!important;gap:9px!important}.notes-grid .card{min-height:0!important;padding:16px}

  /* Ratings */
  .rating-explainer{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:start}.rating-explainer p{margin:0;min-width:0}
  .current-rating-summary,.final-rating-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .current-rating-summary>div,.final-rating-summary>div{min-height:94px!important;padding:13px!important}.current-rating-summary b,.final-rating-summary b{font-size:18px!important;overflow-wrap:anywhere}.current-rating-summary small,.final-rating-summary small{font-size:9px!important}
  .current-rating-table table{min-width:560px!important}
  .season-table-wrap{position:relative!important}
  .season-table.season-table-dynamic{width:max-content!important;min-width:920px!important;table-layout:auto!important}
  .season-table.season-table-dynamic th,.season-table.season-table-dynamic td{width:auto!important;min-width:62px!important;padding:10px 8px!important;font-size:11px!important;letter-spacing:0!important}
  .season-table.season-table-dynamic th:first-child,.season-table.season-table-dynamic td:first-child{position:sticky!important;left:0!important;z-index:3;min-width:48px!important;background:#0e0f13!important}
  .season-table.season-table-dynamic th:nth-child(2),.season-table.season-table-dynamic td:nth-child(2){position:sticky!important;left:48px!important;z-index:3;min-width:155px!important;max-width:155px;background:#111319!important;box-shadow:7px 0 14px rgba(0,0,0,.32)}
  .season-table.season-table-dynamic .player-avatar{display:inline-flex!important}.season-table.season-table-dynamic .medal-icon{display:inline-flex!important;transform:none!important}.season-table.season-table-dynamic .rank-player b{font-size:11px!important}

  /* Annual awards */
  .annual-watermark,.current-rating-watermark{position:fixed!important;width:130vw!important;top:24vh!important;opacity:.024!important}
  .annual-grid{grid-template-columns:1fr!important;gap:9px!important}.award-card{padding:15px!important}.annual-grid .award-card h2{font-size:16px!important;margin-bottom:8px}
  .podium li{display:grid!important;grid-template-columns:minmax(0,1fr);gap:5px!important;padding:10px 0!important;font-size:12px!important}
  .podium li>span{width:100%;text-align:left!important;white-space:normal!important}.podium-person{display:flex!important;align-items:center;min-width:0}.podium-person .inline-avatar-link{min-width:0}.annual-page .podium-person .inline-avatar-link b{white-space:normal!important;overflow-wrap:anywhere}
  .award-card.wide{grid-column:auto!important}.award-card.wide .podium{display:block!important}

  /* Player profile */
  .profile-top-grid{grid-template-columns:1fr!important;gap:10px!important}
  .profile-overview-card,.profile-overview-card.has-profile-art{width:100%!important;min-height:500px!important;aspect-ratio:4/5!important;border-radius:15px!important}
  .profile-overview-card.has-profile-art .profile-overview-heading{left:16px!important;top:17px!important;max-width:56%!important}.profile-overview-heading h1{font-size:clamp(29px,10vw,43px)!important;line-height:.95!important}.profile-overview-heading p{font-size:16px!important}
  .profile-overview-summary{margin-top:9px!important;gap:2px!important;font-size:12px!important}.profile-overview-summary b{font-size:17px!important;color:#fff!important}
  .profile-art-stage{inset:7% -9% 25% 24%!important}.profile-art-stage.art-wide{inset:12% -13% 25% 14%!important}.profile-art-stage.art-tall{inset:5% -5% 25% 38%!important}
  .profile-art-stage.profile-art-heshka{inset:3% -13% 25% 19%!important}.profile-art-stage.profile-art-ander{inset:2% -9% 25% 32%!important}.profile-art-stage.profile-art-g0ga{inset:6% -11% 25% 18%!important}
  .profile-overview-card.profile-player-shahmatist09 .profile-overview-heading{max-width:82%!important}.profile-overview-card.profile-player-shahmatist09 .profile-overview-heading h1{font-size:clamp(25px,8.2vw,33px)!important;white-space:nowrap!important}
  .profile-overview-stats{left:9px!important;right:9px!important;bottom:9px!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:7px!important}.profile-overview-stats>div{padding:8px!important}.profile-overview-stats b{font-size:16px!important}.profile-overview-stats span{font-size:8px!important}
  .profile-ratings-main{padding:14px!important}.profile-ratings-main .split-ratings{grid-template-columns:1fr!important;gap:16px!important}.profile-ratings-main .rating-column a{min-height:43px!important;font-size:12px!important}.profile-ratings-main .rating-column b{font-size:13px!important}
  .profile-history-desktop{display:none!important}.profile-history-mobile{display:flex!important}.profile-history-head{padding:15px 13px 9px!important}

  /* Games list and individual game */
  .game-player-links{min-width:430px!important;display:flex!important;flex-wrap:wrap!important;gap:5px!important}.game-player-links a{font-size:10px!important;padding:4px 6px!important}
  .games-page>.tablewrap{overflow:visible!important;padding:0!important;background:transparent!important;border:0!important}.games-page>.tablewrap:after{display:none!important}.games-page table{display:block!important;width:100%!important;min-width:0!important}.games-page thead{display:none!important}.games-page tbody{display:grid!important;grid-template-columns:1fr!important;gap:9px!important}.games-page tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 10px;padding:13px;border:1px solid #2d2b29;border-radius:12px;background:#111112}.games-page td{display:block!important;min-width:0;padding:0!important;border:0!important;font-size:11px!important;white-space:normal!important}.games-page td:first-child a{font-size:18px;font-weight:900;color:#fff}.games-page td:nth-child(2){text-align:right;color:#8f8990}.games-page td:nth-child(3):before{content:"Результат · ";color:#716d76}.games-page td:nth-child(4){text-align:right}.games-page td:nth-child(4):before{content:"Ведущий · ";color:#716d76}.games-page td:last-child{grid-column:1/-1;padding-top:9px!important;border-top:1px solid #292725!important}.games-page .game-player-links{min-width:0!important;gap:5px!important}.games-page .game-player-links a{max-width:100%}
  .game-pagehead h1{font-size:32px!important}.game-detail-grid{grid-template-columns:1fr!important;gap:8px!important;min-height:0!important}
  .game-player-card{min-height:0!important;height:auto!important;padding:12px!important;gap:9px!important;border-radius:12px!important}.game-player-card .seat{width:34px!important;height:34px!important;flex-basis:34px!important;font-size:13px!important}.game-player-title{display:flex!important}.game-player-title h3{font-size:13px!important;margin:0!important;white-space:normal!important}.game-player-identity{gap:8px!important}.game-player-identity .player-avatar.sm{width:40px;height:40px}.game-player-title .role{font-size:8px!important}.game-player-card .score{font-size:22px!important}.game-player-card .micro{font-size:10px!important}.game-score-details summary{font-size:11px!important}.game-score-details .scores li{font-size:10px!important}
  .game-events-grid{grid-template-columns:1fr!important}

  /* Pair pages, Sheriff vs Don, Honor board */
  .duel-column-head{display:none!important}.duel-row{grid-template-columns:24px minmax(0,1fr) 52px minmax(0,1fr)!important;gap:6px!important;padding:11px 7px!important}.duel-player{grid-template-columns:38px minmax(0,1fr)!important;gap:7px!important}.duel-player.don-side{grid-template-columns:minmax(0,1fr) 38px!important}.duel-player .player-avatar.sm{width:36px!important;height:36px!important}.duel-player b{font-size:10px!important}.duel-player small{font-size:8px!important;white-space:normal}.duel-score{min-height:47px!important}.duel-score b{font-size:15px!important}
  .honor-layout{grid-template-columns:1fr!important;gap:10px!important}.honor-message{min-height:0!important;padding:17px!important}.honor-message h2{font-size:28px!important}.honor-message-lead p{font-size:13px!important;line-height:1.6}.support-tier-grid{grid-template-columns:1fr!important;gap:8px!important;margin:18px 0 12px}.support-tier{padding:15px}.elite-explainer{flex-direction:column!important}.honor-board-panel{position:static!important;padding:14px!important}.honor-board-list li{grid-template-columns:29px minmax(0,1fr) auto!important}.honor-board-list a b{white-space:normal!important}.honor-board-list small{font-size:8px}
}

@media (max-width:420px){
  :root{--mobile-gutter:10px}
  .topbar{grid-template-columns:42px minmax(0,1fr)!important;padding-inline:10px!important}
  .topbar-actions>a span{font-size:9px!important}
  .content{padding-top:15px!important}
  .cards{grid-template-columns:1fr!important}
  .club-stats-grid{grid-template-columns:1fr 1fr!important}
  .profile-overview-card,.profile-overview-card.has-profile-art{min-height:475px!important}
  .profile-overview-card.has-profile-art .profile-overview-heading{max-width:59%!important}.profile-overview-heading h1{font-size:clamp(27px,9.5vw,37px)!important}
  .hero-visual{min-height:325px!important}.hero-emblem{transform:translateX(-50%) scale(.69)!important}
  .player-avatar.hero{width:min(12vw,50px)!important;height:min(12vw,50px)!important}
  .quick-panel .quick-grid{grid-template-columns:1fr!important}
  .current-rating-summary,.final-rating-summary{grid-template-columns:1fr 1fr!important}
  .duel-row{grid-template-columns:20px minmax(0,1fr) 46px minmax(0,1fr)!important;gap:4px!important;padding-inline:5px!important}.duel-rank{font-size:9px}.duel-player{grid-template-columns:31px minmax(0,1fr)!important;gap:5px!important}.duel-player.don-side{grid-template-columns:minmax(0,1fr) 31px!important}.duel-player .player-avatar.sm{width:30px!important;height:30px!important}
}

@media (prefers-reduced-motion:reduce){
  .sidebar{transition:none!important}
}
