/* ============================================================
   Checkers — DARK theme (chess.com/play-style app shell)
   built on ShashkiPlay brand tokens
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Open+Sans:wght@400;600;700&family=IBM+Plex+Sans:wght@400;500&display=swap");

:root {
  --bg: #0e151d;
  --bg-2: #101b26;
  --panel: #18242f;
  --panel-2: #1f2e3b;
  --panel-3: #26384a;
  --inset: #13202b;
  --border: #283a4b;
  --border-2: #33495d;

  --text: #e9f0f7;
  --text-2: #9fb1c2;
  --text-3: #6f8294;

  --blue: #2e63d6;
  --blue-shadow: #1f47a6;
  --blue-link: #74a4ef;
  --red: #f83548;
  --red-shadow: #c2293a;
  --yellow: #f9cd11;
  --yellow-shadow: #d6ae0d;
  --green: #7bb33a;
  --green-deep: #5f891a;
  --star: #f5b400;

  --board-brown: #b08968;
  --board-cream: #ede0d4;
  --board-label: #e4ba9c;
  --frame: #7c5f48;
  --piece-black: #233d4d;
  --piece-black-in: #0f2330;
  --piece-white: #f6f9ff;
  --piece-white-in: #cdd8e6;

  --r-input: 8px;
  --r-btn: 9px;
  --r-card: 14px;
  --r-pill: 999px;
  --r-board: 9px;

  --font-head: "Manrope", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;
  --font-fine: "IBM Plex Sans", system-ui, sans-serif;

  --nav-w: 212px;
  --console-w: 374px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
.tnum {
  font-variant-numeric: tabular-nums;
}

/* ============ APP SHELL ============ */
.app {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--console-w);
  height: 100dvh;
}

/* ---------------- LEFT NAV ---------------- */
.nav {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 18px;
}
.brand .mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #efe3d4;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px #e2d3bf, 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  flex: 0 0 auto;
}
.brand .disc {
  position: relative;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #1c4266;
  display: grid;
  place-items: center;
}
.brand .disc::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #3a6690;
}
.brand .cr {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 12px;
  color: #f9cd11;
}
.brand .cr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.brand .wm {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.015em;
}
.brand .wm b {
  color: var(--blue-link);
  font-weight: 800;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 12px;
  border-radius: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-2);
  position: relative;
  cursor: pointer;
}
.nav-item .ico {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: inherit;
}
.nav-item:hover {
  background: var(--panel);
  color: var(--text);
}
.nav-item.nav-disabled {
  cursor: default;
  color: var(--text-3);
}
.nav-item.nav-disabled:hover {
  background: transparent;
  color: var(--text-3);
}
.nav-soon {
  margin-left: auto;
  font-family: var(--font-head);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid #6f829442;
  border-radius: 999px;
  padding: 3px 6px;
}
.nav-item.active {
  background: var(--panel);
  color: #fff;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--blue);
}
.nav-item .chev {
  margin-left: auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.6;
}

/* variant submenu in nav */
.nav-group {
  position: relative;
}
.nav-sub {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 4px 8px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.nav-group.open .nav-sub {
  display: flex;
}
.nav-group.open .nav-item .chev {
  transform: rotate(180deg);
}
.nav-sub-h {
  display: none;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 10px 4px;
}
.nav-sub a,
.nav-sub-disabled {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-3);
  padding: 7px 10px;
  border-radius: 7px;
  white-space: nowrap;
}
.nav-sub a:hover {
  color: var(--text);
  background: var(--panel);
}
.nav-sub a.on {
  color: var(--text);
  background: var(--panel-2);
}
.nav-sub-disabled {
  color: var(--text-3);
  opacity: 0.4;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-sub-disabled .soon {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--panel-2);
  border-radius: 4px;
  padding: 2px 5px;
  opacity: 1;
}

/* mobile chrome — hidden on desktop/tablet */
.mtop {
  display: none;
}
.brand-m {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-m .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #efe3d4;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px #e2d3bf;
  flex: 0 0 auto;
}
.brand-m .disc {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1c4266;
  display: grid;
  place-items: center;
}
.brand-m .disc::after {
  content: "";
  position: absolute;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2.5px solid #3a6690;
}
.brand-m .cr {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 11px;
  color: #f9cd11;
}
.brand-m .cr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.brand-m .wm {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.015em;
}
.brand-m .wm b {
  color: var(--blue-link);
}
.burger {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--text);
}
.burger:hover {
  background: var(--panel);
}
.nav-backdrop {
  display: none;
}

.nav-spacer {
  flex: 1;
}
.nav-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.nav-foot .auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}
.nav-user:hover {
  border-color: var(--border-2);
  background: var(--panel-2);
}
.nav-user.active {
  border-color: rgba(46, 99, 161, 0.5);
  background: rgba(46, 99, 161, 0.16);
}
.nav-user .nu-av {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex: 0 0 auto;
  border: 1px solid var(--border-2);
  background: linear-gradient(160deg, #f6f9ff, #cdd8e6);
  display: grid;
  place-items: center;
  color: #1d3850;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  background-size: cover;
  background-position: center;
}
.nav-user .nu-av::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg-2);
}
.nav-user .nu-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.nav-user .nu-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-user .nu-rt {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-user .nu-gear {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex: 0 0 auto;
}
.nav-user:hover .nu-gear {
  color: var(--text-2);
}
.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  color: var(--text);
}
.profile-pill:hover {
  background: var(--panel-3);
  border-color: #43596d;
}
.profile-pill .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  background-size: cover;
  background-position: center;
}
.profile-pill .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 13.5px;
  color: #fff;
}
.profile-pill .sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.1;
}
.nav-lang {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-3);
  padding: 6px 10px;
  border-radius: 8px;
  text-align: left;
}
.nav-lang:hover {
  color: var(--text-2);
  background: var(--panel);
}
.nav-lang .chev {
  margin-left: auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.6;
}
.nav-lang-group.open .nav-lang .chev {
  transform: rotate(180deg);
}
.nav-lang-sub {
  max-height: none;
  overflow: visible;
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  white-space: nowrap;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--r-btn);
  padding: 11px 18px;
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.12s ease,
    background 0.12s ease;
}
.btn:active {
  transform: translateY(2px);
}
.btn-red {
  background: var(--red);
  color: #fff;
  box-shadow: 0 3px 0 0 var(--red-shadow);
}
.btn-red:active {
  box-shadow: 0 1px 0 0 var(--red-shadow);
}
.btn-blue {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 3px 0 0 var(--blue-shadow);
}
.btn-blue:active {
  box-shadow: 0 1px 0 0 var(--blue-shadow);
}
.btn-yellow {
  background: var(--yellow);
  color: #1a1300;
  box-shadow: 0 3px 0 0 var(--yellow-shadow);
}
.btn-yellow:active {
  box-shadow: 0 1px 0 0 var(--yellow-shadow);
}
.btn-red:hover,
.btn-blue:hover {
  filter: brightness(1.07);
}
.btn-yellow:hover {
  filter: brightness(1.04);
}
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border-2);
  color: var(--text-2);
}
.btn-ghost:hover {
  border-color: #43596d;
  color: var(--text);
  background: var(--panel);
}
.btn-lg {
  font-size: 17px;
  padding: 15px 22px;
}
.btn-sm {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 7px;
}
.btn-block {
  width: 100%;
}

/* ---------------- CENTER STAGE ---------------- */
.stage {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 22px;
  gap: 11px;
  position: relative;
  overflow: hidden;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    820px 360px at 50% -120px,
    rgba(46, 99, 161, 0.22),
    transparent 70%
  );
}
.board-col {
  position: relative;
  z-index: 1;
  width: min(100%, calc(100dvh - 132px));
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lobby-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  min-height: min(100%, 760px);
  height: 100%;
}
.lobby-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.lobby-feed-card,
.lobby-chat-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.lobby-feed-card {
  flex: 1;
}
.lobby-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 7px;
  min-height: 0;
  overflow-y: auto;
}
.lobby-empty {
  display: grid;
  place-items: center;
  min-height: 74px;
  padding: 14px;
  text-align: center;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
}
.room-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 12px 11px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.room-row.has-side {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.room-row.has-close {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.room-row.has-side.has-close {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.room-row:focus-visible {
  outline: 2px solid rgba(116, 164, 239, 0.75);
  outline-offset: 2px;
}
.room-av,
.chat-av {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex: 0 0 auto;
  border: 1px solid var(--border-2);
  background: linear-gradient(160deg, #f6f9ff, #cdd8e6);
  display: grid;
  place-items: center;
  color: #1d3850;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  background-size: cover;
  background-position: center;
}
.room-row:hover {
  background: var(--panel-2);
  border-color: rgba(116, 164, 239, 0.18);
}
.room-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.room-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.25;
}
.room-meta {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.35;
}
.room-side {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #dff0c6;
  background: rgba(95, 137, 26, 0.16);
  border: 1px solid rgba(95, 137, 26, 0.45);
  border-radius: 999px;
  padding: 5px 8px;
}
.room-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 12px;
  color: var(--blue-link);
  border: 1px solid rgba(116, 164, 239, 0.5);
  border-radius: 7px;
  padding: 6px 10px;
  line-height: 1;
  background: transparent;
}
.room-cta .loader {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: animloader 1s linear infinite;
  flex: 0 0 auto;
}
@keyframes animloader {
  0% {
    box-shadow: -18px 0 #fff inset;
  }
  100% {
    box-shadow: 12px 0 #fff inset;
  }
}
.room-row:hover .room-cta {
  border-color: var(--blue-link);
  color: #dbe9ff;
}
.room-row.own {
  cursor: default;
}
.room-row.own .room-cta {
  color: var(--text-3);
  border-color: var(--border-2);
}
.room-close {
display: inline-flex;
  gap: 5px;
  justify-self: end;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  color: #ef6b5f;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgb(239 108 95 / 38%);
  border-radius: 7px;
  padding: 1px 10px;
  align-items: center;
}
.room-close-ico {
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
}
.room-close-label {
  transform: translateY(1px);
}
.room-close:hover,
.room-close:focus-visible {
  color: #ffb2ad;
  outline: none;
}
.lobby-chat-card .chat-b {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 13px 14px;
  overflow-y: auto;
}
.lobby-chat-card .msg .who {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--blue-link);
}
.lobby-chat-card .msg .who.you {
  color: var(--green);
}
.lobby-chat-card .msg .who.sys {
  color: var(--text-3);
}
.lobby-chat-card .msg .tx {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.45;
  margin-top: 1px;
}
.lobby-chat-card .chat-foot {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-top: 1px solid var(--border);
}
.lobby-chat-card .chat-foot textarea {
  flex: 1;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 20px;
  color: var(--text);
  outline: none;
  resize: none;
  overflow-y: auto;
}
.lobby-chat-card .chat-foot textarea::placeholder {
  color: var(--text-3);
}
.lobby-chat-card .chat-foot textarea:focus {
  border-color: var(--border-2);
}
.lobby-chat-card .send {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  align-self: flex-start;
}
.lobby-chat-card .send:hover {
  filter: brightness(1.08);
}
.players {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-head);
  min-height: 36px;
}
.pl {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pl .av {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex: 0 0 auto;
  border: 1px solid var(--border-2);
}
.pl .av.w {
  background: linear-gradient(160deg, #f6f9ff, #cdd8e6);
}
.pl .av.b {
  background: linear-gradient(160deg, #33536a, #1a3140);
}
.pl .nm {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.pl .rt {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-3);
}
.clock {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 11px;
  letter-spacing: 0.02em;
}
.clock.run {
  color: #fff;
  background: var(--panel-3);
  border-color: var(--border-2);
}
.clock.me.run {
  color: #dff0c6;
  background: rgba(95, 137, 26, 0.22);
  border-color: var(--green-deep);
}

.board-wrap {
  position: relative;
  width: 100%;
}
.board {
  display: grid;
  grid-template-columns: repeat(var(--n, 8), 1fr);
  border: none;
  border-radius: var(--r-board);
  background: var(--board-cream);
  overflow: hidden;
  box-shadow: 0 20px 44px -14px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}
.sq {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}
.sq.dark {
  background: var(--board-brown);
}
.sq.light {
  background: var(--board-cream);
}
.sq .coord {
  position: absolute;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 10px;
  color: rgba(60, 42, 28, 0.5);
}
.sq .coord.file {
  right: 3px;
  bottom: 2px;
}
.sq .coord.rank {
  left: 3px;
  top: 2px;
}
.sq.move {
  cursor: pointer;
}
.sq.move::before {
  content: "";
  width: 32%;
  height: 32%;
  border-radius: 50%;
  background: rgba(20, 30, 40, 0.32);
}
.sq.move:hover::before {
  background: rgba(95, 137, 26, 0.55);
}
.sq.sel {
  box-shadow: inset 0 0 0 4px rgba(95, 137, 26, 0.85);
}
.sq.must-capture {
  box-shadow: inset 0 0 0 3px rgba(248, 53, 72, 0.7);
}
.pc {
  position: relative;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.45);
}
.pc::after {
  content: "";
  width: 62%;
  height: 62%;
  border-radius: 50%;
  border: 3px solid currentColor;
  opacity: 0.55;
}
.pc.black {
  background: var(--piece-black);
  color: var(--piece-black-in);
}
.pc.white {
  background: var(--piece-white);
  color: var(--piece-white-in);
  cursor: pointer;
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.pc.white:hover {
  filter: brightness(1.05);
}
.board-cap {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

/* ---------------- RIGHT CONSOLE ---------------- */
.console {
  background: var(--bg-2);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.console-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.console-h .auth {
  display: flex;
  gap: 8px;
}
.card {
  background: var(--panel);
  border-radius: var(--r-card);
}
.card-h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}
.card-h .ttl {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}
.card-b {
  padding: 15px;
}

.ng {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.field-l {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 7px;
}

/* select */
.select {
  position: relative;
}
.select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--panel-2);
  border-radius: var(--r-input);
  padding: 11px 13px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
}
.select-btn:hover {
  border-color: #41586d;
}
.select-btn .sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  color: var(--text-3);
}
.select-btn .caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-3);
}
.menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.7);
  padding: 6px;
  display: none;
}
.menu.open {
  display: block;
}
.menu-it {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.menu-it:hover,
.menu-it.on {
  background: var(--panel-2);
}
.menu-it .nm {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.menu-it .mini {
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--text-3);
}
.menu-it .tick {
  color: var(--green);
  font-weight: 800;
  opacity: 0;
}
.menu-it.on .tick {
  opacity: 1;
}

/* segmented control */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  background: var(--inset);
  border-radius: var(--r-input);
  padding: 3px;
}
.seg button {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text-2);
  padding: 9px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  flex-wrap: wrap;
  line-height: 1.15;
}
.seg button .ico {
  width: 16px;
  height: 16px;
}
.seg button.on {
  background: var(--panel-3);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

/* time control sliders */
.time-grid {
  position: relative;
}
.tc-toggle {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--inset);
  border-radius: var(--r-input);
  padding: 12px;
  text-align: left;
  color: var(--text);
}
.tc-toggle:hover {
  background: var(--panel-2);
}
.tc-toggle .caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-3);
  flex: 0 0 auto;
}
.tc-toggle[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}
.tc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}
.tc-value {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  line-height: 1;
  min-width: 0;
}
.tc-cat {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgb(31 46 59);
  border-radius: 999px;
  padding: 5px 9px;
  margin-left: auto;
  flex: 0 0 auto;
}
.tc-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  flex-direction: column;
  gap: 13px;
  background: var(--inset);
  border: 1px solid var(--border-2);
  border-radius: var(--r-input);
  padding: 12px;
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.7);
}
.tc-panel.open {
  display: flex;
}
.tc-slider {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tc-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.tc-label b {
  font-size: 18px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.tc-slider input[type="range"] {
  width: 100%;
  height: 26px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.tc-slider input[type="range"]:focus {
  outline: none;
}
.tc-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--green) 0%,
    var(--green) var(--fill, 0%),
    rgba(123, 179, 58, 0.24) var(--fill, 0%),
    rgba(123, 179, 58, 0.24) 100%
  );
}
.tc-slider input[type="range"]::-moz-range-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(123, 179, 58, 0.24);
}
.tc-slider input[type="range"]::-moz-range-progress {
  height: 9px;
  border-radius: 999px;
  background: var(--green);
}
.tc-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 27px;
  height: 27px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--green);
  border: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.tc-slider input[type="range"]::-moz-range-thumb {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--green);
  border: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.tc-slider input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(123, 179, 58, 0.24), 0 3px 8px rgba(0, 0, 0, 0.35);
}
.tc-slider input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(123, 179, 58, 0.24), 0 3px 8px rgba(0, 0, 0, 0.35);
}

/* live games */
.lg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 7px;
  border-radius: 9px;
}
.lg-row:hover {
  background: var(--panel-2);
}
.lg-avatars {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.lg-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid var(--border-2);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.lg-avatars .lg-av + .lg-av {
  margin-left: -9px;
}
.lg-av.w {
  background-image: linear-gradient(160deg, #f6f9ff, #cdd8e6);
}
.lg-av.b {
  background-image: linear-gradient(160deg, #33536a, #1a3140);
}
.lg-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  line-height: 1.25;
}
.lg-meta {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-3);
}
.lg-watch {
  margin-left: auto;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  color: var(--blue-link);
}
.lg-row:hover .lg-watch {
  text-decoration: underline;
}
.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.chat-msg-row .msg {
  min-width: 0;
}
.live-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  color: var(--green);
}
.live-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(123, 179, 58, 0.6);
  animation: pulse 1.8s infinite;
}
.live-badge.dim {
  color: var(--text-3);
}
.live-badge.dim::before {
  background: var(--text-3);
  animation: none;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(123, 179, 58, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(123, 179, 58, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(123, 179, 58, 0);
  }
}

/* scrollbar */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-thumb {
  background: #26384a;
  border-radius: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ===== TABLET: collapse left nav to an icon rail ===== */
@media (max-width: 1100px) {
  :root {
    --nav-w: 72px;
    --console-w: 328px;
  }
  .nav {
    overflow: visible;
  }
  .nav-item span.lbl,
  .brand .wm,
  .nav-lang span {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 12px 0;
  }
  .nav-item .chev {
    display: none;
  }
  .brand {
    justify-content: center;
    padding: 6px 0 16px;
  }

  /* auth buttons become icon-only squares */
  .nav-foot .auth {
    align-items: center;
  }
  .nav-foot .btn {
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 11px;
    align-self: center;
  }
  .nav-foot .btn .lbl {
    display: none;
  }
  .nav-foot .btn .ico {
    margin: 0;
  }
  .nav-foot .profile-pill {
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
  }
  .nav-foot .profile-pill .avatar {
    width: 32px;
    height: 32px;
  }
  .nav-foot .profile-pill .name,
  .nav-foot .profile-pill .sub {
    display: none;
  }
  .nav-foot .nav-user {
    justify-content: center;
    padding: 0;
    width: 46px;
    height: 46px;
    align-self: center;
  }
  .nav-foot .nav-user .nu-info,
  .nav-foot .nav-user .nu-gear {
    display: none;
  }
  .nav-foot .nav-user .nu-av {
    width: 32px;
    height: 32px;
  }
  .nav-lang {
    justify-content: center;
    padding: 8px 0;
  }
  .nav-lang .chev {
    display: none;
  }

  /* Variants opens as a flyout popover to the right of the rail */
  .nav-group.open .nav-sub {
    display: flex;
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    z-index: 60;
    min-width: 212px;
    margin: 0;
    padding: 7px;
    border: 1px solid var(--border-2);
    border-left: 1px solid var(--border-2);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.7);
  }
  .nav-group.open .nav-sub-h {
    display: block;
  }
  .nav-group.open .nav-sub a {
    padding: 9px 10px;
  }

  .lobby-stage {
    grid-template-columns: 1fr;
  }
  .tc-value {
    font-size: 20px;
  }
  .tc-label {
    font-size: 12.5px;
  }
  .tc-label b {
    font-size: 17px;
  }
}

/* ===== MOBILE: compact rail ===== */
@media (max-width: 820px) {
  body {
    overflow: auto;
  }
  :root {
    --nav-w: 62px;
    --console-w: 320px;
  }
  .mtop,
  .nav-backdrop {
    display: none;
  }
  .app {
    grid-template-columns: var(--nav-w) minmax(0, 1fr) minmax(240px, 34vw);
    height: auto;
    min-height: 100dvh;
  }
  .nav {
    position: static;
    transform: none;
    box-shadow: none;
    overflow: visible;
    padding: 12px 8px;
  }
  .brand {
    justify-content: center;
    padding: 4px 0 14px;
  }
  .brand .mark {
    width: 34px;
    height: 34px;
  }
  .brand .disc {
    width: 24px;
    height: 24px;
  }
  .brand .disc::after {
    width: 19px;
    height: 19px;
    border-width: 2.5px;
  }
  .nav-item {
    justify-content: center;
    padding: 11px 0;
  }
  .nav-item span.lbl,
  .brand .wm,
  .nav-lang span,
  .nav-item .chev {
    display: none;
  }
  .nav-foot .auth {
    align-items: center;
  }
  .nav-foot .btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
    align-self: center;
  }
  .nav-foot .btn .lbl {
    display: none;
  }
  .nav-foot .btn .ico {
    margin: 0;
  }
  .nav-foot .profile-pill {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }
  .nav-foot .profile-pill .avatar {
    width: 30px;
    height: 30px;
  }
  .nav-foot .profile-pill .name,
  .nav-foot .profile-pill .sub {
    display: none;
  }
  .nav-foot .nav-user {
    justify-content: center;
    padding: 0;
    width: 42px;
    height: 42px;
    align-self: center;
  }
  .nav-foot .nav-user .nu-info,
  .nav-foot .nav-user .nu-gear {
    display: none;
  }
  .nav-foot .nav-user .nu-av {
    width: 30px;
    height: 30px;
  }
  .nav-lang {
    justify-content: center;
    padding: 8px 0;
  }
  .nav-lang .chev {
    display: none;
  }
  .nav-group.open .nav-sub {
    display: flex;
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    z-index: 60;
    min-width: 212px;
    margin: 0;
    padding: 7px;
    border: 1px solid var(--border-2);
    border-left: 1px solid var(--border-2);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.7);
  }
  .nav-group.open .nav-sub-h {
    display: block;
  }
  .nav-group.open .nav-sub a {
    padding: 9px 10px;
  }

  .console {
    border-left: 1px solid var(--border);
    border-top: none;
  }
  .stage {
    padding: 16px;
    overflow: visible;
  }
  .lobby-stage {
    grid-template-columns: 1fr;
  }
  .lobby-col {
    display: flex;
    flex-direction: column;
  }
  .room-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .room-side {
    display: none;
  }
  .room-cta {
    grid-column: 3;
  }
  .lobby-list {
    max-height: 280px;
  }
  .lobby-chat-card .chat-b {
    max-height: 320px;
  }
  .seg button {
    font-size: 13px;
    padding: 8px 6px;
  }
  .tc-head {
    align-items: stretch;
  }
  .tc-cat {
    margin-left: 0;
  }
  .tc-label {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-w: 56px;
  }
  .app {
    grid-template-columns: var(--nav-w) minmax(0, 1fr);
  }
  .stage {
    grid-column: 2;
  }
  .console {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .lobby-chat-card .chat-b {
    max-height: 260px;
  }
}

/* ── Lobby mode-selection cards ───────────────────────────────────── */
.mode-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 17, 23, 0.55);
  backdrop-filter: blur(2px);
}
.mode-cards {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 520px;
  width: 100%;
  padding: 0 12px;
}
.mode-card {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.mode-card-ico {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}
.mode-card-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.mode-card-desc {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.45;
  min-height: 36px;
}
.mode-or {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-3);
  padding: 0 14px;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .mode-cards {
    flex-direction: column;
    gap: 10px;
  }
  .mode-or {
    padding: 0;
  }
  .mode-card {
    width: 100%;
    padding: 20px 16px;
  }
}

/* menu-it disabled */
.menu-it.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
