/* ========================================================================== PAGES.CSS ========================================================================== */
/* ========================================================================== PAGE TOKENS, LAYOUT & INFO SIDEBAR ========================================================================== */
:root {
  --z-topbar-h: 40px; --z-info-side-w: 200px;
  --z-page-max: 1400px; --z-title-sand: #d7b16b;
  --z-home-left-w: clamp(120px, 12vw, 200px);
  --z-mode-card-fixed-w: clamp(280px, 30vw, 360px);
  --z-mode-card-fixed-h: clamp(200px, 32vh, 280px);
  --z-lobby-card-fixed-w: clamp(300px, 32vw, 520px);
}
html.dark { --z-title-sand: #6b552c; }
body.z-page-body { margin: 0; }
body.z-has-topbar { padding-top: var(--z-topbar-h); }
html[dir="ltr"] .z-page.with-info-sidebar, html[dir="ltr"] .z-footer-wrap {
  padding-left: calc(var(--z-info-side-w) + 12px); padding-right: 12px;
}
.z-info-card {
  padding: 10px; text-align: center;
  color: var(--muted); border: 1px dashed var(--border-strong);
  border-radius: 18px; background: rgba(255,255,255,0.44);
  font-size: var(--fs-body);
}
html.dark .z-info-card { background: rgba(19,29,50,0.38); }
.z-info-sidebar {
  position: fixed; top: var(--z-topbar-h);
  right: 0; width: var(--z-info-side-w);
  height: calc(100dvh - var(--z-topbar-h)); padding: 12px;
  box-sizing: border-box; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  gap: 10px;
}
html[dir="ltr"] .z-info-sidebar { left: 0; right: auto; }

.z-page-richtext {
  white-space: normal;
  line-height: 1.82;
  display: grid;
  gap: 18px;
  color: var(--text);
  text-align: start;
}
.z-page-richtext section {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(248,250,252,0.92));
  box-shadow: var(--shadow-sm);
}
html.dark .z-page-richtext section {
  background: linear-gradient(180deg, rgba(19,29,50,0.90), rgba(15,23,42,0.96));
  border-color: rgba(148,163,184,0.18);
}
.z-page-richtext h2,
.z-page-richtext h3 {
  margin: 0 0 10px;
  color: var(--text-strong);
  line-height: 1.35;
}
.z-page-richtext p {
  margin: 0;
  line-height: 1.85;
}
.z-page-richtext p + p,
.z-page-richtext ul + p,
.z-page-richtext ol + p,
.z-page-richtext p + ul,
.z-page-richtext p + ol,
.z-page-richtext ul + ul,
.z-page-richtext ol + ol { margin-top: 10px; }
.z-page-richtext ol,
.z-page-richtext ul {
  margin: 0;
  padding-inline-start: 1.2rem;
  display: grid;
  gap: 8px;
}
.z-page-richtext li { line-height: 1.75; }
.z-page-richtext li > p { margin-top: 8px; }
.z-page-richtext strong { color: var(--text-strong); }
.z-page-richtext a,
.z-contact-intro a { color: #1e3a8a; font-weight: 800; }
.z-nav a { color: #1e3a8a; font-weight: 800; }
.z-nav a.active { color: #1e3a8a; }
.z-contact-intro {
  margin: 0 0 8px;
  line-height: 1.85;
  color: var(--text);
}

.muted { color: var(--muted); }
.z-info-card.z-info-note {
  flex: 1 1 auto; min-height: 0;
  position: relative; overflow: hidden;
  padding: 14px 12px; border: 1px solid rgba(0,0,0,0.14);
  border-inline-start: 6px solid var(--accent); font-size: var(--fs-body);
  font-weight: 900; line-height: 1.55;
  letter-spacing: 0.15px; text-align: center;
  text-justify: inter-word; text-align-last: start;
  color: var(--text); border-inline-start-width: 4px;
  border-inline-start-color: var(--accent); border-radius: 24px;
  background: radial-gradient(120% 100% at 20% 0%, rgba(37,99,235,0.14), rgba(37,99,235,0) 55%), linear-gradient(180deg, rgba(255,255,255,0.86), rgba(248,250,252,0.92));
  box-shadow: var(--shadow); text-shadow: none;
}
html.dark .z-info-card.z-info-note {
  border-color: rgba(255,255,255,0.16);
  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);
  background: radial-gradient(120% 100% at 20% 0%, rgba(96,165,250,0.16), rgba(96,165,250,0) 55%), linear-gradient(180deg, rgba(19,29,50,0.96), rgba(17,24,39,0.96));
}
.z-page-inner { max-width: 980px; margin: 0 auto; }
body.z-page-body .z-clear { height: 0; margin: 0; padding: 0; clear: both; }
/* ========================================================================== TOPBAR, NAVIGATION & ACCOUNT MENUS ========================================================================== */
html.dark .z-nav a.active { background: rgba(96, 165, 250, 0.16); }
html.dark .z-topbar { background: rgba(15, 23, 42, 0.82); }
html.dark .z-topbar-title {
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(6,182,212,0.20));
  border-color: rgba(96,165,250,0.20); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.z-topbar {
  position: fixed; inset: 0 0 auto 0;
  height: var(--z-topbar-h); z-index: 9999;
  background: rgba(255, 255, 255, 0.78); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(18px);
}
.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;
  padding: 0 8px; padding-inline: 6px;
  gap: 6px;
}
.z-topbar-nav { justify-self: start; min-width: 0; }
.z-topbar-lang { justify-self: end; min-width: 0; position: relative; display: flex; align-items: center; }
.z-topbar-title {
  justify-self: center; display: flex;
  align-items: center; justify-content: center;
  padding: 0 12px; box-sizing: border-box;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; width: clamp(180px, 24vw, 320px);
  height: 30px; padding-inline: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(14,165,233,0.16));
  border: 1px solid rgba(37,99,235,0.16); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.z-topbar-title-link {
  color: var(--text); text-decoration: none;
  font-weight: 900; letter-spacing: 0.2px;
  font-size: var(--fs-body);
}
.z-nav {
  display: flex; align-items: center;
  flex-wrap: nowrap; overflow-x: auto;
  overscroll-behavior-x: contain; scrollbar-width: none;
  gap: 4px;
}

.z-nav a {
  line-height: 1; border: 1px solid transparent;
  white-space: nowrap; padding: 6px 8px;
  color: var(--muted); font-weight: 800;
  text-decoration: underline; text-decoration-thickness: 1.3px;
  text-underline-offset: 3px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
  font-size: var(--fs-body); border-radius: 12px;
}
.z-nav a.active { background: rgba(37, 99, 235, 0.12); border-color: rgba(37, 99, 235, 0.16); color: var(--text-strong); }
.z-nav a:hover, .z-acc-menu-btn:hover, .z-acc-item:hover {
  background: rgba(37, 99, 235, 0.08) !important; border-color: rgba(37, 99, 235, 0.16) !important;
}
html.dark .z-nav a:hover, html.dark .z-acc-menu-btn:hover, html.dark .z-acc-item:hover {
  background: rgba(96,165,250,0.12) !important; border-color: rgba(96,165,250,0.22) !important;
}
.z-lang-select {
  display: inline-block; padding: 4px 7px;
  color: var(--text); font-size: var(--fs-body);
  border-radius: 12px;
}
.z-nav-toggle {
  display: none; width: 32px;
  height: 32px; padding: 0;
  align-items: center; justify-content: center;
  cursor: pointer; border-radius: 12px;
}
.z-hamburger { width: 16px; height: 12px; display: block; position: relative; }
.z-hamburger::before {
  content: ""; position: absolute;
  left: 0; right: 0;
  height: 2px; background: var(--text);
  border-radius: 2px; opacity: 0.95;
  top: 0;
}
.z-hamburger::after {
  content: ""; position: absolute;
  left: 0; right: 0;
  height: 2px; background: var(--text);
  border-radius: 2px; opacity: 0.95;
  bottom: 0;
}
.z-hamburger span {
  content: ""; position: absolute;
  left: 0; right: 0;
  height: 2px; background: var(--text);
  border-radius: 2px; opacity: 0.95;
  top: 5px;
}
.z-topbar-right { justify-self: end; display: flex; align-items: center; gap: 8px; }
.z-topbar-account { position: relative; }
.z-nav-toggle:focus-visible {
  outline: 2px solid var(--border);
  outline-offset: 2px;
}
.z-topbar .z-lang-select {
  display: inline-block;
  min-width: 120px;
  height: 32px;
  padding: 4px 10px;
  border-radius: 12px;
}
.z-acc-desktop { display: block; }
.z-acc-menu-btn {
  background: transparent !important; border: 1px solid transparent !important;
  box-shadow: none !important; color: var(--text) !important;
  line-height: 1; padding: 5px 7px;
  font-weight: 600; font-size: var(--fs-body);
  border-radius: 12px; border-color: var(--border);
}
.z-acc-menu-btn .z-acc-ico { display: none; margin-inline-end: 0; }
.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;
  padding: 6px; z-index: 10000;
  border: 1px solid var(--border); border-radius: 18px;
}
.z-acc-item {
  width: 100%; display: block;
  padding: 7px 8px; border: 0;
  background: transparent; color: var(--text);
  text-decoration: none; cursor: pointer;
  text-align: start; line-height: 1.2;
  font-size: var(--fs-body); border-radius: 14px;
}
.z-acc-item.danger { color: #f66; }
/* ========================================================================== SHARED CARDS, TYPOGRAPHY & CTA ========================================================================== */
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 > .z-page-inner { margin-block: auto; }
body.z-page-body .z-contact-form-embed iframe {
  width: 100%; min-width: 0;
  max-width: 100%; border: 0;
  display: block; overflow: auto;
  height: min(85dvh, 900px);
}

.z-card { padding: 20px; font-size: var(--fs-body); border: 1px solid var(--border); border-radius: 24px; }
.z-card h1 { margin: 0 0 8px; }
.z-card h2 { margin: 14px 0 6px; color: var(--text-strong); }
.z-card h3 { margin: 12px 0 6px; color: var(--text-strong); }
.z-card p { line-height: 1.45; margin: 8px 0; color: var(--text); }
.z-card li { line-height: 1.45; color: var(--text); }
.z-card ul, .z-card ol { margin: 8px 0; padding-inline-start: 20px; }
.z-contact-form-embed {
  width: 100%; max-width: 100%;
  margin: 0 auto 0 0; padding: 0 !important;
  overflow-x: hidden;
}
body.z-contact-page .z-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
body.z-contact-page .z-card > h2 {
  margin-top: 0;
}
body.z-contact-page .z-contact-intro {
  margin: 0;
}
body.z-contact-page .z-contact-form-embed {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0;
}
body.z-contact-page .z-contact-form-embed iframe {
  height: clamp(420px, calc(100dvh - 220px), 900px);
  min-height: 420px;
  vertical-align: top;
}
/* ========================================================================== HOME PAGE LAYOUT ========================================================================== */
body.z-home-page { overflow: hidden; }
body.z-home-page .app { height: calc(100dvh - var(--z-topbar-h)); gap: 4px !important; }
body.z-spectator .ai-level-box, body.z-spectator #onlinePresence, body.z-spectator .timer-row, body.z-spectator .btn-grid, body.z-spectator #btnEndKill, body.z-spectator #btnEndOnline, body.z-spectator #btnSync, body.z-spectator #pvpVoiceBar,
body.mode-pvp #btnEndLocalMatch,

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; }
body.z-home-page .board-wrap { padding: 2px !important; }

/* ========================================================================== SPECTATOR VISIBILITY ========================================================================== */

body.z-spectator #specBar { display: grid !important; }
/* ========================================================================== DASHBOARD & ACCOUNT PANELS ========================================================================== */
html.dark .z-dash-profile-card { background: linear-gradient(180deg, rgba(19,29,50,0.94), rgba(17,24,39,0.96)); }
html.dark .z-dash-summary-table th, html.dark .z-dash-details-table thead th, html.dark .z-dash-details-table tbody th {
  background: rgba(96, 165, 250, 0.12);
}
.z-dashboard .z-page-title { text-align: center; margin: 0; }
.z-dashboard { padding-bottom: 12px; }
.z-dashboard .z-page-inner { max-width: min(1160px, 100%); }
.z-dashboard .z-dashboard-inner { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
.z-dashboard .z-dash-main-block { display: grid; grid-template-columns: 1fr; gap: 12px; min-height: 0; }
.z-dashboard .z-page-head { text-align: center; }
.z-dash-summary-table-rank {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(37, 99, 235, 0.6);
  border-radius: 10px;
  background: var(--panel-weak);
  font: inherit;
  line-height: 1.15;
  font-weight: 900;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.z-dash-summary-table-rank:hover,
.z-dash-summary-table-rank:focus-visible {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  outline: none;
}
.z-dash-msg {
  display: none; padding: 8px 10px;
  font-size: var(--fs-body); border: 1px solid var(--border);
  border-radius: 24px;
}
.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-upper-row {
  display: grid; grid-template-columns: minmax(300px, 35%) minmax(0, 1fr);
  gap: 12px; align-items: stretch;
  min-height: 0;
}
.z-dash-side-panel { min-height: 0; }
.z-dash-side-top {
  display: grid; grid-template-columns: 1fr;
  gap: 12px; align-items: stretch;
  align-content: start;
}
.z-dash-profile-card {
  box-sizing: border-box; display: flex;
  direction: ltr;
  flex-direction: row; align-items: center;
  justify-content: center; gap: 12px;
  text-align: start; border: none;
  padding: 0; border-radius: 24px;
  min-height: 104px;
}
.z-dash-profile-text {
  order: 1;
  min-width: 0;
  flex: 0 1 auto;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-weight: 900;
  direction: rtl;
  text-align: right;
}
.z-dash-profile-label,
.z-dash-profile-sep {
  color: var(--text-strong);
  font-size: var(--fs-body);
  font-weight: 900;
  white-space: nowrap;
}

.z-dash-summary, .z-dash-details {
  box-sizing: border-box; display: flex;
  align-items: center; justify-content: center;
  padding: 14px; border: 1px solid var(--border);
  border-radius: 24px;
}
.z-dash-actions-panel {
  box-sizing: border-box; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  align-items: stretch; padding: 14px;
  border: 1px solid var(--border); border-radius: 24px;
}
.z-dash-summary-table, .z-dash-details-table {
  align-self: center; margin-block: auto;
  width: 100%; border-collapse: collapse;
  table-layout: fixed;
}
.z-dash-profile-icon {
  order: 2;
  display: block;
  object-fit: contain;
  width: auto;
  height: 100%;
  flex: 0 0 auto;
  min-width: 72px;
  max-width: min(40%, 140px);
  max-height: none;
  align-self: stretch;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.z-dash-profile-name {
  line-height: 1.2; word-break: break-word;
  font-size: var(--fs-body); font-weight: 900;
  color: var(--text-strong);
  min-width: 0;
}

.z-dash-summary-table th {
  border: 1px solid var(--border); padding: 8px 6px;
  text-align: center; vertical-align: middle;
  line-height: 1.2; border-color: var(--border);
  font-weight: 900; background: rgba(37, 99, 235, 0.08);
  color: var(--text-strong); font-size: var(--fs-body);
}
.z-dash-summary-table td, .z-dash-details-table th, .z-dash-details-table td {
  border: 1px solid var(--border); padding: 8px 6px;
  text-align: center; vertical-align: middle;
  line-height: 1.2; border-color: var(--border);
  font-size: var(--fs-body);
}
.z-dash-details-table thead th {
  font-weight: 900; background: rgba(37, 99, 235, 0.08);
  color: var(--text-strong); padding-top: 12px;
  padding-bottom: 12px;
}
.z-dash-details-table tbody th {
  font-weight: 900; background: rgba(37, 99, 235, 0.08);
  color: var(--text-strong); white-space: nowrap;
  padding-top: 12px; padding-bottom: 12px;
}
.z-dash-details-table col.z-dash-match-col { width: 32%; }
.z-dash-details-table tbody td { padding-top: 12px; padding-bottom: 12px; }
.z-dash-actions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-column: 1 / -1; gap: 10px; }
.z-dash-actions-tail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-column: 1 / span 2; gap: 10px; }
.z-dash-actions-grid .btn, .z-dash-actions-tail .btn {
  width: 100%; min-height: 0;
  padding: 8px 10px; font-size: var(--fs-body);
  line-height: 1.2; white-space: normal;
}
.z-dash-play-btn.btn {
  width: 100%; min-height: 0;
  padding: 8px 10px; line-height: 1.2;
  white-space: normal; font-size: var(--fs-body);
}
.z-dash-play-btn { grid-column: 3; justify-content: center; text-decoration: none; }
.z-dash-play-btn .btn-ico { width: 15px; height: 15px; }
#btnDashLogout.btn,
#btnDashLogout.btn span,
#btnDashLogout.btn strong {
  color: #fff !important;
}
#btnDashLogout.btn {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  border-color: rgba(248, 113, 113, 0.28) !important;
}
#btnDashLogout.btn:hover, #btnDashLogout.btn:focus-visible {
  background: #b71c1c; border-color: #b71c1c;
  color: #fff !important; filter: brightness(1.03);
}
.z-icon-picker,
.z-leaderboard-wrap {
  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); }
.modal.z-edit-icon-modal {
  width: min(1120px, 96vw) !important;
}
.modal.z-edit-icon-modal .modal-body {
  padding: 10px !important;
}
.modal.z-edit-icon-modal .z-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: min(68vh, 620px);
  overflow: auto;
  padding: 0;
}
.modal.z-edit-icon-modal .z-icon-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
}
.modal.z-edit-icon-modal .z-icon-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* ========================================================================== LEADERBOARD COMPONENTS ========================================================================== */
.z-leaderboard-loading { text-align: center; padding: 10px 4px; }
.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;
  box-shadow: var(--shadow-sm);
}
.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-leaderboard-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.z-leaderboard-wl { opacity: .8; font-size: var(--fs-body); color: var(--muted); }
/* ========================================================================== MODE SELECTION PAGE ========================================================================== */
html.dark .z-mode-card {
  background: radial-gradient(120% 120% at 0% 0%, rgba(96,165,250,0.18), rgba(96,165,250,0) 54%), radial-gradient(120% 120% at 100% 100%, rgba(34,211,238,0.12), rgba(34,211,238,0) 52%), linear-gradient(180deg, rgba(19,29,50,0.96), rgba(15,23,42,0.98));
  border-color: rgba(148,163,184,0.2);
}
html.dark .z-mode-card::after, html.dark .z-lobby-panel::after { background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0)); }
.z-mode-sub {
  margin: 6px 0 0; opacity: .85;
  text-align: center; font-size: var(--fs-body);
  color: var(--muted);
}
.z-mode-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, var(--z-mode-card-fixed-w)));
  grid-auto-rows: var(--z-mode-card-fixed-h);
  gap: clamp(10px, 2.2vw, 16px); margin: clamp(12px, 2.4vw, 20px) auto 0;
  max-width: none; justify-content: center;
  justify-items: stretch;
}
.z-mode-card {
  position: relative; display: flex;
  flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  min-height: var(--z-mode-card-fixed-h); max-height: var(--z-mode-card-fixed-h);
  padding: 14px 12px; box-sizing: border-box;
  overflow: hidden; color: var(--text);
  text-align: center; text-decoration: none;
  border: 1px solid var(--border); border-radius: 24px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.z-mode-card::before {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .16; pointer-events: none;
  filter: saturate(.9); content: none;
}
.z-mode-card.pvc::before, .z-mode-card.pvp::before { background-image: none; }
.z-mode-card > * { position: relative; z-index: 1; }
.z-mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(37, 99, 235, 0.24); }
.z-mode-ico {
  display: grid; place-items: center;
  flex: 0 0 auto; width: 72px;
  height: 72px; background: transparent;
  box-shadow: none; border: 1px solid var(--surface-stroke);
  border-radius: 18px;
}
.z-mode-ico img { width: 40px; height: 40px; }
.z-mode-text {
  min-width: 0; width: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.z-mode-text h2 { margin: 0; color: var(--text-strong); }
.z-mode-text p { margin: 0; opacity: .85; line-height: 1.5; font-size: var(--fs-body); }
.z-mode-page, .z-lobby-page { min-height: calc(100dvh - var(--z-topbar-h)); display: flex; }
.z-mode-page > .z-page-inner {
  width: 100%; min-height: calc(100dvh - var(--z-topbar-h) - 24px);
  display: flex; flex-direction: column;
  justify-content: center;
}
.z-mode-back-row { width: 100%; display: flex; justify-content: center; margin-top: 18px; }
/* ========================================================================== LOBBY PAGE ========================================================================== */
html.dark .z-row {
  background: linear-gradient(180deg, rgba(30,41,59,0.98), rgba(15,23,42,0.98));
  border-color: rgba(191, 208, 232, 0.36); box-shadow: 0 12px 28px rgba(0,0,0,0.36);
}
.z-mode-page .z-page-title, .z-lobby-head-center .z-page-title { margin: 0; text-align: center; }
.z-mode-card::after, .z-lobby-panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.20), rgba(255,255,255,0));
}
html.dark .z-lobby-panel {

  background: radial-gradient(120% 100% at 0% 0%, rgba(96,165,250,0.18), rgba(96,165,250,0) 54%), radial-gradient(120% 100% at 100% 100%, rgba(34,211,238,0.12), rgba(34,211,238,0) 50%), linear-gradient(180deg, rgba(19,29,50,0.98), rgba(15,23,42,0.98));
}
.z-lobby-page > .z-page-inner {
  width: 100%; min-height: calc(100dvh - var(--z-topbar-h) - 24px);
}
.z-lobby-page .z-lobby-inner {
  width: 100%; min-height: calc(100dvh - var(--z-topbar-h) - 24px);
  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-subtitle { margin: 6px 0 0; opacity: 0.85; font-size: var(--fs-body); color: var(--muted); }
.z-lobby-cols {
  display: grid; grid-template-columns: repeat(2, minmax(0, var(--z-lobby-card-fixed-w)));
  gap: clamp(10px, 2.2vw, 14px); align-items: stretch;
  justify-content: center; height: calc((100dvh - var(--z-topbar-h) - 140px) * 0.96);
}
.z-lobby-bottom {
  display: flex; justify-content: center;
  align-items: center; gap: 10px;
  flex-wrap: wrap; padding-top: 4px;
}
.z-lobby-bottom .z-lobby-back { justify-self: auto; }
.z-lobby-panel {
  position: relative; display: flex;
  flex-direction: column; min-height: 0;
  width: var(--z-lobby-card-fixed-w); min-width: var(--z-lobby-card-fixed-w);
  max-width: var(--z-lobby-card-fixed-w); height: 100%;
  padding: 14px; box-sizing: border-box;
  overflow: hidden; justify-self: center;
  border: 1px solid var(--border); border-radius: 24px;
}
.z-lobby-h2 { margin: 0 0 10px; text-align: center; color: var(--text-strong); }
.z-lobby-list.rooms {
  display: flex; flex-direction: column;
  gap: 10px; overflow-y: auto; overflow-x: hidden;
  padding: 0 2px 6px; justify-content: flex-start;
  align-items: stretch;
  flex: 1 1 auto; min-height: 0;
}
.z-lobby-list.rooms::-webkit-scrollbar { width: 8px; }
.z-lobby-list.players {
  display: flex; flex-direction: column;
  gap: 10px; flex: 1 1 auto;
  min-height: 0; overflow-y: auto;
  align-items: center; padding-inline: 2px;
}
.z-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  padding: 7px 12px; box-sizing: border-box;
  border: 1.5px solid var(--surface-stroke-strong); border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.98));
  box-shadow: 0 10px 28px rgba(15,23,42,0.08);
}
.z-lobby-list.rooms .z-row { width: 100%; min-width: 0; max-width: none; }
.z-lobby-list.players .z-row { width: min(520px, 100%); }
.z-room-row { flex-wrap: nowrap; }
.z-room-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-room-title span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-row-main { min-width: 0; flex: 1 1 auto; }
.z-row-title {
  line-height: 1.2; display: flex;
  align-items: center; gap: 8px;
  font-size: var(--fs-body); font-weight: 800;
  color: var(--text-strong);
}
.z-avatar {
  width: 22px; height: 22px;
  border-radius: 8px; border: 1px solid var(--border);
  flex: 0 0 auto; background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: rgba(148,163,184,0.36);
}
.z-row-sub {
  opacity: 0.86; margin-top: 1px;
  display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap;
  font-size: var(--fs-body); color: var(--muted);
}
.z-mini-ico { width: 14px; height: 14px; display: inline-block; vertical-align: middle; }
.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; }

/* ========================================================================== FOOTER ========================================================================== */
.z-footer-wrap {
  max-width: var(--z-page-max); margin: 0 auto;
  padding: 8px 12px 14px 12px; padding-right: calc(var(--z-info-side-w) + 12px);
  box-sizing: border-box;
}
.z-footer {
  text-align: center; color: var(--muted);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  font-size: var(--fs-footer);
  unicode-bidi: plaintext;
}
html.dark .z-footer {
  background: rgba(15,23,42,0.88);
}
/* ========================================================================== MISCELLANEOUS PAGE STYLES ========================================================================== */
.z-page.with-info-sidebar {
  max-width: var(--z-page-max); margin: 0 auto;
  padding: 14px 12px 12px 12px; padding-right: calc(var(--z-info-side-w) + 12px);
  box-sizing: border-box;
}
.z-page { padding: 14px 12px 24px; box-sizing: border-box; }
.z-ico { width: 18px; height: 18px; display: block; }
.z-side { display: inline-flex; align-items: center; gap: 6px; }
.z-vs { opacity: 0.7; }

body.z-info-page .z-info-sidebar .z-info-card { display: block !important; }
.z-empty {
  padding: 12px; text-align: center;
  opacity: 0.78; font-size: var(--fs-body);
  color: var(--muted);
}


.z-start-play-wrap {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.94) 28%, rgba(255,255,255,0.98));
  z-index: 1;
}
html.dark .z-start-play-wrap {
  background: linear-gradient(180deg, rgba(15,23,42,0), rgba(15,23,42,0.92) 28%, rgba(15,23,42,0.98));
}
.z-start-play-wrap .z-start-play-btn,
.z-mobile-text-start .z-start-play-btn { width: 100%; justify-content: center; text-decoration: none; }

.z-dashboard-page .z-acc-btn { color: #fff !important; }

.z-dash-summary-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.z-dash-summary-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.66);
  box-shadow: var(--shadow-sm);
}
html.dark .z-dash-summary-card { background: rgba(19,29,50,0.74); }
.z-dash-summary-label { font-size: var(--fs-body); font-weight: 800; line-height: 1.25; color: var(--muted); }
.z-dash-summary-value { font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 900; line-height: 1; }
.z-dash-summary-card.is-action { cursor: pointer; }
.z-dash-summary-card.is-action:hover,
.z-dash-summary-card.is-action:focus-visible {
  border-color: rgba(37,99,235,0.48);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.14), var(--shadow-sm);
  outline: none;
}

.z-icon-grid {
  max-height: none;
  overflow: visible;
}
.modal.z-edit-icon-modal {
  width: min(1120px, 96vw) !important;
  height: min(88vh, 880px);
  max-height: 88vh;
}
.modal.z-edit-icon-modal .modal-body {
  padding: 10px !important;
  overflow-y: auto;
}
.modal.z-edit-icon-modal .z-icon-grid {
  max-height: none;
  overflow: visible;
}

.modal.z-leaderboard-modal .modal-body {
  overflow-y: auto;
}
.modal.z-leaderboard-modal .z-leaderboard-list {
  max-height: none;
  overflow: visible;
}


body.z-spectator #btnEndKill,
body.z-spectator #btnUndo,
body.z-spectator #btnSoufla,
body.z-spectator #btnSync,
body.z-spectator #btnEndOnline,
body.z-spectator #btnEndLocalMatch,
body.z-spectator #btnNew,
body.z-spectator #btnSave,
body.z-spectator #btnResume,
body.z-spectator #btnSpk,
body.z-spectator #btnMic {
  display: none !important;
}


/* ========================================================================== FIRST-PARTY CONTACT FORM ========================================================================== */
.z-contact-direct {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,0.58);
}
html.dark .z-contact-direct { background: rgba(15,23,42,0.58); border-color: rgba(148,163,184,0.18); }
.z-contact-email-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.z-contact-email-list a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 10px; border-radius: 999px;
  border: 1px solid rgba(37,99,235,0.18);
  background: rgba(37,99,235,0.08);
  color: #1e3a8a; font-weight: 900; text-decoration: none;
}
html.dark .z-contact-email-list a { color: #93c5fd; background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.22); }
.z-contact-form { display: grid; gap: 14px; margin-top: 12px; }
.z-form-row { display: grid; gap: 6px; }
.z-form-row label { font-weight: 900; color: var(--text-strong); }
.z-form-row input, .z-form-row textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border);
  border-radius: 16px; padding: 11px 12px; color: var(--text);
  background: rgba(255,255,255,0.86); font: inherit; line-height: 1.5; outline: none;
}
html.dark .z-form-row input, html.dark .z-form-row textarea { background: rgba(15,23,42,0.86); border-color: rgba(148,163,184,0.22); }
.z-form-row input:focus, .z-form-row textarea:focus { border-color: rgba(37,99,235,0.55); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.z-form-row textarea { resize: vertical; min-height: 160px; }
.z-hp-field { position: absolute !important; inline-size: 1px !important; block-size: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
.z-contact-privacy-note { color: var(--muted) !important; font-size: 0.95em; margin: 0 !important; }
.z-contact-status { min-height: 1.4em; font-weight: 900; border-radius: 14px; }
.z-contact-status.is-success { color: #15803d; }
.z-contact-status.is-error { color: #b91c1c; }
.z-contact-status.is-loading { color: var(--muted); }
.z-contact-submit { justify-self: start; min-width: 160px; }


/* ========================================================================== CONTACT PAGE REFINEMENTS ========================================================================== */
body.z-contact-page { overflow-y: auto; }
body.z-contact-page .z-card { overflow: visible; }
body.z-contact-page .z-contact-intro {
  margin: 10px 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  color: var(--text);
  line-height: 1.85;
}
html.dark body.z-contact-page .z-contact-intro {
  background: rgba(15,23,42,0.72);
  border-color: rgba(148,163,184,0.22);
}
body.z-contact-page .z-contact-direct h2,
body.z-contact-page .z-contact-form-title {
  margin: 0 0 8px;
  color: var(--text-strong);
}
body.z-contact-page .z-contact-direct p { margin: 0; line-height: 1.7; color: var(--text); }
body.z-contact-page .z-contact-form-title { margin-top: 18px; }
.z-form-row input, .z-form-row textarea {
  border: 2px solid rgba(100,116,139,0.45);
  background: #fffaf0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(15,23,42,0.04);
}
.z-form-row input::placeholder, .z-form-row textarea::placeholder { color: rgba(71,85,105,0.76); }
html.dark .z-form-row input, html.dark .z-form-row textarea {
  background: rgba(15,23,42,0.96);
  border-color: rgba(203,213,225,0.42);
}
html.dark .z-form-row input::placeholder, html.dark .z-form-row textarea::placeholder { color: rgba(203,213,225,0.72); }
.z-contact-email-list a { word-break: break-word; }
@media (max-width: 760px) {
  body.z-contact-page .z-page.with-info-sidebar {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }
  body.z-contact-page .z-contact-email-list { display: grid; grid-template-columns: 1fr; }
  body.z-contact-page .z-contact-email-list a { width: 100%; box-sizing: border-box; }
  body.z-contact-page .z-contact-submit { width: 100%; justify-self: stretch; }
  body.z-contact-page .z-form-row textarea { min-height: 150px; }
}
.z-info-note a,
.z-auth-seo-card a,
.z-page-richtext a {
  color: #1e3a8a;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
html.dark .z-info-note a,
html.dark .z-auth-seo-card a,
html.dark .z-page-richtext a { color: #93c5fd; }
