/* Section: css/pages.css — Page navigation and shared page behavior */



:root{
  --z-topbar-h: 40px;
  --z-ad-side-w: 200px;
  --z-page-max: 1400px;
  --z-title-sand: #d7b16b;
  --z-home-left-w: clamp(120px, 12vw, 200px);
  --z-home-ad-col-w: clamp(90px, 10vw, 140px);
}

html.dark{
  --z-title-sand: #6b552c;
}




body.z-page-body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body.z-has-topbar{
  padding-top: var(--z-topbar-h);
}




.z-topbar{
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--z-topbar-h);
  background: var(--panel);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 9999;
}


.z-topbar img{
  width: 20px;
  height: 20px;
  display: block;
}

.z-topbar-inner{
  max-width: var(--z-page-max);
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.z-topbar-nav{
  justify-self: start;
  min-width: 0;
}

.z-topbar-lang{
  justify-self: end;
  min-width: 0;
  position: relative;
}

.z-topbar-title{
  justify-self: center;
  width: clamp(260px, 34vw, 520px);
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--panel) 0%,
    var(--z-title-sand) 24%,
    var(--z-title-sand) 76%,
    var(--panel) 100%
  );
  border: 1px solid var(--border);
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-topbar-title-link{
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.2px;
}




.z-nav{
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.z-nav::-webkit-scrollbar{
  display: none;
}

.z-nav a{
  font-size: 12px;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  white-space: nowrap;
}

.z-nav a:hover{
  border-color: var(--border);
}

.z-nav a.active{
  border-color: var(--border);
  background: rgba(0,0,0,0.06);
}

html.dark .z-nav a.active{
  background: rgba(255,255,255,0.06);
}




.z-lang-select{
  display: inline-block;
  font-size: 12px;
  padding: 4px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}




.z-nav-toggle{
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.z-nav-toggle:focus-visible{
  outline: 2px solid var(--border);
  outline-offset: 2px;
}

.z-hamburger{
  width: 16px;
  height: 12px;
  display: block;
  position: relative;
}

.z-hamburger::before,
.z-hamburger::after,
.z-hamburger span{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  opacity: 0.95;
}

.z-hamburger::before{ top: 0; }
.z-hamburger span{ top: 5px; }
.z-hamburger::after{ bottom: 0; }

@media (max-width: 768px){
  .z-topbar-inner{
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .z-topbar-title{
    width: clamp(150px, 44vw, 240px);
  }

  .z-topbar-nav{
    position: relative;
    justify-self: start;
  }

  .z-nav-toggle{
    display: inline-flex;
  }

  .z-nav{
    display: none;
    position: absolute;
    top: calc(var(--z-topbar-h) + 2px);
    inset-inline-start: 0;
    min-width: 220px;
    max-width: 86vw;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 10000;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100dvh - var(--z-topbar-h) - 20px);
    overflow: auto;
  }

  .z-topbar.is-nav-open .z-nav{
    display: flex;
  }

  .z-nav a{
    width: 100%;
    padding: 10px 10px;
    border-radius: 12px;
    font-size: 13px;
  }
}


@media (max-width: 640px){
  .z-nav{
    overflow-x: hidden;
  }

  .z-nav a{
    white-space: normal;
  }
}




.z-ad-slot{
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
  padding: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

html.dark .z-ad-slot{
  background: rgba(255,255,255,0.04);
}




.z-ad-sidebar{
  position: fixed;
  top: var(--z-topbar-h);
  right: 0;
  width: var(--z-ad-side-w);
  height: calc(100dvh - var(--z-topbar-h));
  padding: 12px;
  box-sizing: border-box;
  overflow: auto;
}

.z-page.with-right-ad{
  max-width: var(--z-page-max);
  margin: 0 auto;
  padding: 14px 12px 12px 12px;
  padding-right: calc(var(--z-ad-side-w) + 12px);
  box-sizing: border-box;
}

html[dir="ltr"] .z-ad-sidebar{
  left: 0;
  right: auto;
}

html[dir="ltr"] .z-page.with-right-ad{
  padding-left: calc(var(--z-ad-side-w) + 12px);
  padding-right: 12px;
}

html[dir="ltr"] .z-ad-bottom-wrap,
html[dir="ltr"] .z-footer-wrap{
  padding-left: calc(var(--z-ad-side-w) + 12px);
  padding-right: 12px;
}




.z-card{
  font-size: 13px;
background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  padding: 16px;
}

.z-card h1{
  margin: 0 0 8px 0;
  font-size: 18px;
  line-height: 1.25;
}

.z-card h2{
  margin: 14px 0 6px 0;
  font-size: 14px;
  line-height: 1.3;
}



.z-card h3{
  margin: 12px 0 6px 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}
.z-card p,
.z-card li{
  line-height: 1.45;
}

.z-card p{
  margin: 8px 0;
}

.z-card ul,
.z-card ol{
  margin: 8px 0;
  padding-inline-start: 20px;
}

.muted{
  color: var(--muted);
}




.z-ad-mid{
  width: 320px;
  max-width: 100%;
  margin: 14px 0 14px auto;
}

html[dir="rtl"] .z-ad-mid{
  margin: 14px auto 14px 0;
}




.z-cta{
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.z-cta a{
  text-decoration: none;
}


.z-cta a:not(.btn){
  display: inline-block;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--btn);
  border: 2px solid var(--btn-border);
  color: var(--btn-text);
  font-weight: 900;
  font-size: 13px;
}




.z-cta a.z-cta-play{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.z-cta a.z-cta-play img{
  width: 18px;
  height: 18px;
}




.z-ad-bottom-wrap{
  max-width: var(--z-page-max);
  margin: 0 auto;
  padding: 10px 12px 0 12px;
  padding-right: calc(var(--z-ad-side-w) + 12px);
  box-sizing: border-box;
}

.z-ad-bottom{
  border-radius: 14px;
}

.z-footer-wrap{
  max-width: var(--z-page-max);
  margin: 0 auto;
  padding: 8px 12px 14px 12px;
  padding-right: calc(var(--z-ad-side-w) + 12px);
  box-sizing: border-box;
}

.z-footer{
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}




@media (max-width: 768px){
  .z-ad-sidebar{
    position: static;
    width: auto;
    height: auto;
  }

  .z-page.with-right-ad,
  .z-ad-bottom-wrap,
  .z-footer-wrap{
    padding-right: clamp(10px, 2vw, 12px);
    padding-left: clamp(10px, 2vw, 12px);
  }


  html[dir="ltr"] .z-page.with-right-ad,
  html[dir="ltr"] .z-ad-bottom-wrap,
  html[dir="ltr"] .z-footer-wrap{
    padding-left: clamp(10px, 2vw, 12px);
    padding-right: clamp(10px, 2vw, 12px);
  }

  
  .z-card{
    padding: 16px clamp(14px, 2.8vw, 16px);
  }
}




body.z-home-page{
  overflow: hidden;
}

body.z-home-page .app{
  height: calc(100dvh - var(--z-topbar-h));
  gap: 4px !important;
}

body.z-home-page .z-home-leftcol{
  display: none;
}

body.z-home-page .z-home-ad-title{
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}


body.z-home-page .z-home-ad-mobile-1,
body.z-home-page .z-home-ad-mobile-2{
  display: none;
}





@media (max-width: 768px){
  .z-home-ad-in-side{
    display: none;
  }
}

@media (max-width: 768px){
  body.z-home-page .app{
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--z-topbar-h));
    min-height: calc(100dvh - var(--z-topbar-h));
    gap: 8px !important;
  }

  body.z-home-page .board-wrap{
    flex: 0 0 auto;
    margin-bottom: 0;
  }

  body.z-home-page .side{
    flex: 1 1 auto;
    height: auto;
    overflow-y: auto;
  }

  body.z-home-page .z-home-leftcol{
    display: none !important;
  }
}







@media (max-width: 640px){
  body.z-home-page{
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  
  body.z-home-page.z-has-topbar{
    padding-top: 0 !important;
  }

  body.z-home-page .z-topbar{
    position: relative !important;
    inset: auto !important;
    height: auto !important;
z-index: 9999 !important;     
  }

  body.z-home-page .z-topbar-inner{
    height: auto !important;
    padding: 6px 8px !important;
    width: 100%;
    max-width: 100vw;
    overflow: visible !important;
  }

  body.z-home-page .z-topbar-title{
    width: 100% !important;
    max-width: 100% !important;
  }

  
  body.z-home-page .z-topbar-nav .z-nav{
    top: 100% !important;
  }

  
  body.z-home-page .app{
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    gap: 6px !important;
    width: 100%;
    max-width: 100%;
  }

  body.z-home-page .board-wrap,
  body.z-home-page .side{
    width: 100%;
    max-width: 100%;
  }

  
  body.z-home-page .side{
    overflow: visible !important;
    flex: 0 0 auto !important;
    gap: 6px !important;
    padding: 8px !important;
    max-width: 100%;
  }

  
  body.z-home-page .status-row{
    padding: 4px 8px !important;
    min-height: 40px;
  }

  body.z-home-page .timer-row{
    padding: 6px 8px !important;
  }

  body.z-home-page .btn-grid{
    margin-top: 6px !important;
    gap: 6px !important;
  }
}

body.z-home-page .side{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

body.z-home-page .side > *{
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}




@media (max-width: 768px){
  body.z-home-page .z-home-leftcol,
  body.z-home-page .z-ad-sidebar,
  body.z-home-page .z-ad-mid-wrap,
  body.z-home-page .z-ad-bottom-wrap,
  body.z-home-page .z-ad-slot{
    display: none !important;
  }

  body.z-home-page .z-home-ad-title,
  body.z-home-page .z-home-ad-mobile-2{
    display: block !important;
  }

  body.z-home-page .z-home-ad-in-side,
  body.z-home-page .z-home-ad-mobile-1{
    display: none !important;
  }

  body.z-home-page .z-home-ad-title,
  body.z-home-page .z-home-ad-mobile-2{
    margin: 0 !important;
  }
}
body.z-home-page .board-wrap{
  padding: 2px !important;
}







body.z-home-page .z-ad-sidebar{
  display: none !important;
}

body.z-home-page .z-home-leftcol,
body.z-home-page .z-home-ad-title,
body.z-home-page .z-home-ad-in-side,
body.z-home-page .z-home-ad-mobile-1,
body.z-home-page .z-home-ad-mobile-2,
body.z-home-page .z-ad-mid-wrap,
body.z-home-page .z-ad-mid,
body.z-home-page .z-ad-bottom-wrap,
body.z-home-page .z-ad-bottom,
body.z-home-page .z-ad-slot{
  display: none !important;
}

body.z-info-page .z-ad-mid-wrap,
body.z-info-page .z-ad-mid,
body.z-info-page .z-ad-bottom-wrap,
body.z-info-page .z-ad-bottom{
  display: none !important;
}

body.z-info-page .z-ad-slot{
  display: none !important;
}

body.z-info-page .z-ad-sidebar .z-ad-slot{
  display: block !important;
}





.z-section-sep{
  border: 0;
  height: 1px;
  background: var(--border);
  opacity: 0.8;
  margin: 14px 0;
}





.z-ad-sidebar{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.z-ad-slot.z-ad-note{
  flex: 1 1 auto;
  min-height: 100%;
  position: relative;
  overflow: hidden;

  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.14);
  border-inline-start: 6px solid var(--accent);

  font-size: clamp(16px, calc(0.8vw + 12px), 20px);
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: 0.15px;

  text-align: center;
  text-justify: inter-word;
  text-align-last: start;

  background:
    radial-gradient(140% 90% at 20% 10%, rgba(255,255,255,0.85), rgba(255,255,255,0) 55%),
    radial-gradient(140% 90% at 80% 90%, rgba(0,0,0,0.09), rgba(0,0,0,0) 55%),
    repeating-linear-gradient(135deg,
      rgba(0,0,0,0.045) 0 7px,
      rgba(0,0,0,0.02) 7px 14px),
    var(--panel);

  box-shadow:
    0 14px 24px rgba(0,0,0,0.22),
    0 2px 0 rgba(255,255,255,0.65) inset,
    0 -12px 20px rgba(0,0,0,0.10) inset;

  color: var(--text);

  text-shadow:
    0 1px 0 rgba(255,255,255,0.75),
    0 6px 14px rgba(0,0,0,0.25);
}

html.dark .z-ad-slot.z-ad-note{
  border-color: rgba(255,255,255,0.16);

  background:
    radial-gradient(140% 90% at 20% 10%, rgba(255,255,255,0.14), rgba(255,255,255,0) 55%),
    radial-gradient(140% 90% at 80% 90%, rgba(0,0,0,0.46), rgba(0,0,0,0) 55%),
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.08) 0 7px,
      rgba(255,255,255,0.04) 7px 14px),
    var(--panel);

  box-shadow:
    0 18px 30px rgba(0,0,0,0.55),
    0 1px 0 rgba(255,255,255,0.10) inset,
    0 -14px 24px rgba(0,0,0,0.45) inset;

  text-shadow:
    0 1px 0 rgba(0,0,0,0.60),
    0 0 12px rgba(0,0,0,0.35);
}


.z-topbar-right{
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.z-topbar-account{
  position: relative;
}


.z-lang-btn{
  display: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.z-lang-btn img{
  width: 18px;
  height: 18px;
}

.z-lang-menu{
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 160px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 10000;
}
.z-lang-item{
  width: 100%;
  display: block;
  padding: 7px 8px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: start;
  font-size: 12px;
  line-height: 1.2;
}
.z-lang-item:hover{
  background: rgba(255,255,255,.06);
}
.z-lang-item.is-active{
  background: rgba(255,255,255,.10);
}



.z-ico{ width: 18px; height: 18px; display: block; }

.z-acc-desktop{ display: block; }
.z-acc-mobile{
  display: none;
  align-items: center;
  gap: 8px;
}

.z-ico-btn{
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  color: var(--text);
}
.z-ico-btn img{
  width: 18px;
  height: 18px;
}
.z-ico-btn.danger{
  border-color: rgba(255, 90, 90, 0.6);
}


.z-acc-menu-btn{
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-size: 12px;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.z-acc-menu-btn:hover{
  border-color: var(--border) !important;
  background: rgba(0,0,0,0.06) !important;
}
html.dark .z-acc-menu-btn:hover{
  background: rgba(255,255,255,0.06) !important;
}
.z-acc-menu-btn .z-acc-ico{ margin-inline-end: 6px; }
.z-acc-menu-btn .z-acc-text{
  display: inline;
}
.z-acc-menu{
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 180px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 10000;
}
.z-acc-item{
  width: 100%;
  display: block;
  padding: 7px 8px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  text-align: start;
  font-size: 12px;
  line-height: 1.2;
}
.z-acc-item:hover{
  background: rgba(255,255,255,.06);
}
.z-acc-item.danger{
  color: #f66;
}
@media (min-width: 561px){
  .z-acc-menu-btn .z-acc-ico{ display:none; }
  .z-acc-menu-btn .z-acc-text{ display:inline; }
}

@media (max-width: 560px){
  .z-acc-menu-btn .z-acc-text{ display:none; }
  .z-lang-select{ display:none; }
  .z-lang-btn{ display: inline-flex; }

  .z-acc-desktop{ display:none; }
  .z-acc-mobile{ display: inline-flex; }
}




body.z-spectator .ai-state,
body.z-spectator .timer-row,
body.z-spectator .btn-grid,
body.z-spectator #btnEndKill,
body.z-spectator #btnOnline{
  display: none !important;
}


body.z-spectator #btnEndOnline,
body.z-spectator #btnSync,
body.z-spectator #pvpVoiceBar{
  display: none !important;
}
body.z-spectator #specBar{
  display: flex !important;
}



.spec-voice-btn {
  display: none;
  position: fixed;
  inset-inline-end: 16px;
  inset-block-end: 16px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
  cursor: pointer;
  z-index: 50;
  align-items: center;
  justify-content: center;
}
.spec-voice-btn::before {
  content: attr(data-ico);
  font-size: 22px;
  line-height: 1;
}
.z-spectator .spec-voice-btn {
  display: inline-flex;
}






.z-page{
  padding: 14px 12px 24px;
  box-sizing: border-box;
}

.z-page-inner{
  max-width: 980px;
  margin: 0 auto;
}

@media (max-width: 620px){
  .z-page{ padding: 12px 10px 18px; }
}



body.z-page-body.z-info-page{
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.z-page-body.z-info-page main.z-page{ flex: 1 0 auto; }
body.z-page-body.z-info-page .z-footer-wrap{ margin-top: auto; }



body.z-page-body.z-info-page main.z-page.z-vcenter{
  display: flex;
  flex-direction: column;
}
body.z-page-body.z-info-page main.z-page.z-vcenter > .z-page-inner{
  margin-block: auto;
}


.z-topbar .z-lang-btn{
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.z-topbar .z-lang-btn:focus-visible{
  outline: 2px solid var(--border);
  outline-offset: 2px;
}
.z-topbar .z-lang-menu{
  position: absolute;
  top: calc(var(--z-topbar-h) + 6px);
  inset-inline-end: 0;
  min-width: 160px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  z-index: 10000;
}
.z-topbar .z-lang-menu[hidden]{ display: none; }
.z-topbar .z-lang-menu .z-lang-item{
  width: 100%;
  text-align: start;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.z-topbar .z-lang-menu .z-lang-item:hover{
  background: rgba(0,0,0,0.05);
}
html.dark .z-topbar .z-lang-menu .z-lang-item:hover{
  background: rgba(255,255,255,0.06);
}

@media (max-width: 640px){
  .z-topbar #topLangSel{ display: none; }
  .z-topbar .z-lang-btn{ display: inline-flex; }
}






.z-dashboard .z-dashboard-inner{
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.2vw, 16px);
}

.z-dashboard .z-page-head,
.z-dashboard .z-page-title{
  text-align: center;
}
.z-dashboard .z-page-title{ margin: 0; }

.z-dash-msg{
  display: none;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.z-dash-msg.ok{ border-color: rgba(0, 160, 80, 0.55); }
.z-dash-msg.error{ border-color: rgba(220, 60, 60, 0.55); }

.z-dash-stats-row{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2.2vw, 14px);
  align-items: stretch;
}

.z-dash-stat{
  text-align: center;
  padding: 14px;
}

.z-dash-stat-label{
  font-size: 13px;
  font-weight: 800;
  opacity: 0.9;
  margin-bottom: 8px;
}


.z-dash-stat-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.z-dash-leaderboard-btn {
  min-width: unset !important;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.z-dash-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.z-dash-actions-row .btn,
.z-dash-actions-row .z-dash-play-btn {
  min-width: 210px;
}

.z-dash-stat-value{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.2px;
}


/* Leaderboard modal (dashboard) */
.z-leaderboard-loading {
  text-align: center;
  padding: 10px 4px;
}

.z-leaderboard-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.z-leaderboard-list {
  max-height: min(60vh, 520px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.12);
}

.z-leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.z-leaderboard-row:last-child {
  border-bottom: none;
}

.z-leaderboard-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.z-leaderboard-rank {
  width: 2.2em;
  text-align: right;
  opacity: 0.75;
  flex: 0 0 auto;
}

.z-leaderboard-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.z-leaderboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-leaderboard-points {
  font-weight: 700;
  opacity: 0.95;
}

.z-leaderboard-empty {
  text-align: center;
  padding: 14px 10px;
  opacity: 0.8;
}

.z-dash-split{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 2.2vw, 14px);
  align-items: start;
}

.z-dash-detail{
  padding: 14px;
}

.z-dash-table-wrap{ overflow: auto; }

.z-dash-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.z-dash-table th,
.z-dash-table td{
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
}

.z-dash-table th{
  text-align: start;
  font-weight: 800;
  opacity: 0.95;
}

.z-dash-table td{
  text-align: end;
  font-weight: 900;
}

.z-dash-actions-card{
  padding: 14px;
}

.z-dash-actions{
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1.8vw, 12px);
  justify-content: center;
  align-items: center;
}

.z-dash-actions .btn{
  min-width: 210px;
}

.z-dash-play{
  display: flex;
  justify-content: center;
}

.z-dash-play-btn{
  min-width: 240px;
  justify-content: center;
}


.z-icon-picker{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.z-icon-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding: 4px;
}

.z-icon-item{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  padding: 12px 10px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
}

.z-icon-item img{
  width: 38px;
  height: 38px;
}

.z-icon-item.active{
  border-color: rgba(0, 160, 80, 0.65);
}

@media (max-width: 820px){
  .z-dash-stats-row{ grid-template-columns: 1fr; }
  .z-dash-actions .btn{ width: 100%; min-width: 0; }
  .z-dash-play-btn{ width: 100%; }
}






.z-mode-page .z-page-title,
.z-mode-page .z-mode-subtitle{
  text-align: center;
}
.z-mode-page .z-page-title{ margin: 0; }






.z-lobby-page .z-lobby-inner{
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.2vw, 16px);
}

.z-lobby-head{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.z-lobby-head .z-lobby-back{
  justify-self: start;
}

.z-lobby-head-center{
  text-align: center;
  min-width: 0;
}

.z-lobby-head-center .z-page-title{
  margin: 0;
  text-align: center;
}

.z-lobby-subtitle{
  margin: 6px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

.z-lobby-cols{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 2.2vw, 14px);
  align-items: start;
}

.z-lobby-bottom{
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.z-lobby-bottom .z-lobby-back{
  justify-self: auto;
}

.z-lobby-panel{
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  background:
    radial-gradient(80% 120% at 20% 0%, rgba(215,177,107,0.22), rgba(215,177,107,0.00) 60%),
    radial-gradient(70% 110% at 90% 30%, rgba(255,255,255,0.08), rgba(255,255,255,0.00) 55%),
    var(--panel);
}

.z-lobby-h2{
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.z-empty{
  padding: 12px;
  text-align: center;
  font-size: 13px;
  opacity: 0.78;
}

.z-lobby-list.rooms{
  display: flex;
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  justify-content: center;
}

.z-lobby-list.rooms::-webkit-scrollbar{ height: 8px; }

.z-lobby-list.players{
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  align-items: center;
  padding-inline: 2px;
}

.z-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.04);
  border-radius: 16px;
  box-shadow: var(--shadow);
  box-sizing: border-box;
}
html.dark .z-row{ background: rgba(255,255,255,0.04); }

.z-lobby-list.rooms .z-row{
  min-width: 250px;
  max-width: 340px;
}

.z-lobby-list.players .z-row{
  width: min(520px, 100%);
}

.z-row-main{ min-width: 0; flex: 1 1 auto; }

.z-row-title{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.z-avatar{
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  flex: 0 0 auto;
}

.z-row-sub{ font-size: 12px; opacity: 0.86; margin-top: 2px; display:flex; align-items:center; gap: 8px; flex-wrap: wrap; }

.z-mini-ico{ width: 14px; height: 14px; display:inline-block; vertical-align: middle; }
.z-side{ display:inline-flex; align-items:center; gap: 6px; }
.z-vs{ opacity: 0.7; }

.z-row-actions{ display: flex; gap: 6px; flex: 0 0 auto; align-items:center; }
.z-row-actions .btn{ white-space: nowrap; display:inline-flex; align-items:center; gap: 8px; }

@media (max-width: 900px){
  .z-lobby-cols{ grid-template-columns: 1fr; }
  .z-lobby-list.players{ max-height: 360px; }
}




@media (max-width: 600px){
  .z-dash-split{ grid-template-columns: 1fr; }
}
body.mode-pvp #btnEndLocalMatch{display:none!important}
@media (max-width:768px){.side>#btnEndLocalMatch{order:3!important}}


/* Lobby: public leaderboard button */
.z-lobby-actions-row{
  display:flex;
  justify-content:center;
  margin: 10px 0 14px;
}

/* Leaderboard: wins-losses small line */
.z-leaderboard-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap: 2px;
}
.z-leaderboard-wl{
  font-size: 12px;
  opacity: .8;
}
