/* Birbs · retro-minimal desktop lobby */
:root {
  color-scheme: light;
  --desktop-bg: #008684;
  --desktop-deep: #006f6d;
  --ink: #050505;
  --muted: #424242;
  --paper: #ffffff;
  --win-face: #c8c8c8;
  --win-face-2: #d9d6ce;
  --win-light: #ffffff;
  --win-mid: #808080;
  --win-dark: #383838;
  --win-black: #000000;
  --blue: #000080;
  --blue-2: #1084d0;
  --yellow: #ffd100;
  --yellow-soft: #fff39a;
  --ok: #008000;
  --danger: #800000;
  --font-ui: Tahoma, "MS Sans Serif", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Courier New", Fixedsys, Terminal, Consolas, monospace;
  --bevel-out: inset -2px -2px 0 var(--win-dark), inset 2px 2px 0 var(--win-light), inset -3px -3px 0 var(--win-mid), inset 3px 3px 0 #eeeeee;
  --bevel-in: inset 2px 2px 0 var(--win-dark), inset -2px -2px 0 var(--win-light), inset 3px 3px 0 var(--win-mid), inset -3px -3px 0 #eeeeee;
  --bevel-button: inset -1px -1px 0 var(--win-black), inset 1px 1px 0 var(--win-light), inset -2px -2px 0 var(--win-mid), inset 2px 2px 0 #eeeeee;
  --bevel-button-down: inset 1px 1px 0 var(--win-black), inset -1px -1px 0 var(--win-light), inset 2px 2px 0 var(--win-mid);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
  overscroll-behavior: none;
}

body {
  width: 100%;
  max-width: 100vw;
  min-height: 100svh;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.045) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% -10%, rgba(255,255,255,.12), transparent 36rem),
    var(--desktop-bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  image-rendering: pixelated;
}

body.modal-open { overflow: hidden; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
button, input, summary { font: inherit; }
button { touch-action: manipulation; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

.scene { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.grain {
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: radial-gradient(rgba(255,255,255,.35) .6px, transparent .8px);
  background-size: 5px 5px;
}

.shell {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 16px;
  align-content: start;
  justify-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

.mobile-nav {
  position: relative;
  z-index: 8;
  display: none;
  width: min(680px, calc(100vw - 16px));
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.site-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(680px, calc(100vw - 16px));
  margin: 0 auto 8px;
  padding: 5px 7px;
  background: #ffffe1;
  color: #000;
  box-shadow: var(--bevel-out);
  border: 1px solid #808080;
  font: 900 12px / 1.25 var(--font-ui);
  text-shadow: none;
}
.site-alert[hidden] { display: none !important; }
.site-alert strong {
  display: inline-block;
  padding: 2px 5px;
  background: var(--blue);
  color: #fff;
  box-shadow: var(--bevel-button);
  white-space: nowrap;
}
.site-alert span { min-width: 0; }
.site-alert-close {
  appearance: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 20px;
  border: 0;
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-button);
  font: 900 14px / 1 var(--font-ui);
  cursor: pointer;
}
.site-alert-close:active { transform: translate(1px, 1px); }

.mobile-brand {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  padding: 0 2px;
  color: #f2f2f2;
  font: 900 22px / .9 var(--font-ui);
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    1px 1px 0 #fff,
    2px 2px 0 #707070,
    3px 3px 0 #303030,
    4px 4px 0 rgba(0,0,0,.35);
}

.mobile-menu-toggle {
  appearance: none;
  position: relative;
  display: none;
  min-width: 42px;
  min-height: 34px;
  padding: 4px 10px;
  border: 0;
  color: #000;
  background: var(--win-face);
  box-shadow: var(--bevel-button);
  cursor: pointer;
  font: 900 18px / 1 var(--font-ui);
  text-shadow: none;
  transition: transform 120ms ease-out;
}

.mobile-menu-toggle:active,
.mobile-menu-toggle[aria-expanded="true"] {
  transform: translate(1px, 1px);
  box-shadow: var(--bevel-button-down);
}

.mobile-menu-toggle:focus-visible {
  outline: 1px dotted #fff;
  outline-offset: 3px;
}

.mobile-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  width: min(244px, calc(100vw - 16px));
  padding: 4px;
  background: var(--win-face);
  box-shadow: var(--bevel-out), 4px 5px 0 rgba(0,0,0,.32);
  color: #000;
  text-shadow: none;
}

.mobile-menu::before {
  content: "Desktop";
  display: block;
  margin-bottom: 3px;
  padding: 3px 5px;
  color: #fff;
  background: var(--blue);
  font: 900 11px / 1 var(--font-mono);
}

.mobile-menu-item {
  appearance: none;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 4px 6px;
  border: 0;
  color: #000;
  background: transparent;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  font: 900 12px / 1.1 var(--font-mono);
  transition: transform 120ms ease-out;
}

.mobile-menu-item:hover,
.mobile-menu-item:focus-visible {
  color: #fff;
  background: var(--blue);
  outline: 0;
}

.mobile-menu-item:visited { color: #000; }
.mobile-menu-item:hover:visited,
.mobile-menu-item:focus-visible:visited { color: #fff; }

.mobile-menu-item:active {
  transform: translate(1px, 1px);
}

.mobile-menu-item span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu-icon {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  filter: none;
}

.mobile-menu-item .doc-icon {
  width: 24px;
  height: 30px;
  justify-self: center;
  background-size: auto;
  box-shadow: 1px 1px 0 rgba(0,0,0,.42), inset -1px -1px 0 #d0d0d0, inset 1px 1px 0 #fff;
}

.hero {
  width: min(760px, calc(100vw - 20px));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

.desktop-icons {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 116px;
}

.desktop-shortcut {
  appearance: none;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  width: 116px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #fff;
  text-decoration: none;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
  cursor: pointer;
  font: 900 11px / 1.08 var(--font-mono);
}

.desktop-shortcut:focus-visible {
  outline: 1px dotted #fff;
  outline-offset: 2px;
}

.desktop-label {
  max-width: 108px;
  padding: 2px 4px;
  box-decoration-break: clone;
}

.desktop-shortcut:hover .desktop-label,
.desktop-shortcut:focus-visible .desktop-label {
  color: #fff;
  background: rgba(0,0,128,.82);
}

.desktop-shortcut:visited { color: #fff; }

.desktop-icon {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.42));
}

.history-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 28px;
  height: 28px;
  background:
    linear-gradient(#000 0 0) 13px 6px / 2px 9px no-repeat,
    linear-gradient(#000 0 0) 13px 14px / 8px 2px no-repeat,
    linear-gradient(#0a75b8 0 0) 7px 10px / 3px 3px no-repeat,
    linear-gradient(#0a75b8 0 0) 5px 13px / 3px 3px no-repeat,
    linear-gradient(#0a75b8 0 0) 7px 16px / 3px 3px no-repeat,
    linear-gradient(#0a75b8 0 0) 10px 18px / 3px 3px no-repeat,
    #fff2aa;
  border: 1px solid #000;
  border-radius: 50%;
  box-shadow: inset -2px -2px 0 #b8860b, inset 2px 2px 0 #fff, 0 0 0 2px #c0c0c0;
}
.history-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  width: 10px;
  height: 10px;
  background: #0a75b8;
  clip-path: polygon(0 50%, 70% 0, 70% 32%, 100% 32%, 100% 68%, 70% 68%, 70% 100%);
}

.computer-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 30px;
  height: 22px;
  background:
    linear-gradient(#002b5f, #0a75b8) 5px 5px / 20px 11px no-repeat,
    #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #fff;
}
.computer-icon::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 27px;
  width: 14px;
  height: 7px;
  background: #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
}
.profile-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 30px;
  height: 30px;
  background:
    linear-gradient(#000 0 0) 9px 13px / 2px 2px no-repeat,
    linear-gradient(#000 0 0) 14px 13px / 2px 2px no-repeat,
    linear-gradient(#000 0 0) 11px 17px / 4px 1px no-repeat,
    radial-gradient(circle at 12px 14px, #ffd2a0 0 6px, #6b3f1f 6px 7px, transparent 7px),
    linear-gradient(#2d6dcb 0 0) 6px 21px / 12px 5px no-repeat,
    linear-gradient(#000080 0 0) 4px 4px / 22px 4px no-repeat,
    linear-gradient(#000 0 0) 20px 11px / 6px 2px no-repeat,
    linear-gradient(#808080 0 0) 20px 16px / 7px 2px no-repeat,
    linear-gradient(#008000 0 0) 23px 22px / 4px 4px no-repeat,
    linear-gradient(#f8f8f8 0 0) 4px 4px / 22px 22px no-repeat,
    #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #fff;
}
.profile-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 4px;
  width: 22px;
  height: 4px;
  background: rgba(0,0,0,.28);
  border-radius: 50%;
  filter: blur(.2px);
}

.private-room-icon::before,
.private-room-window-icon {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 28px;
  height: 28px;
  background:
    linear-gradient(#000 0 0) 12px 7px / 4px 2px no-repeat,
    linear-gradient(#000 0 0) 11px 9px / 2px 8px no-repeat,
    linear-gradient(#000 0 0) 15px 9px / 2px 8px no-repeat,
    linear-gradient(#000 0 0) 10px 15px / 8px 2px no-repeat,
    linear-gradient(#ffd100 0 0) 8px 15px / 12px 9px no-repeat,
    linear-gradient(#7fc7ff 0 0) 3px 3px / 22px 22px no-repeat,
    var(--win-face);
  border: 1px solid #000;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #fff;
}
.private-room-icon::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 20px;
  width: 9px;
  height: 5px;
  background: #ffd100;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 rgba(0,0,0,.25);
}
.private-room-window-icon {
  position: relative;
  display: inline-block;
  left: auto;
  top: auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background:
    linear-gradient(#000 0 0) 7px 4px / 2px 1px no-repeat,
    linear-gradient(#000 0 0) 6px 5px / 1px 5px no-repeat,
    linear-gradient(#000 0 0) 9px 5px / 1px 5px no-repeat,
    linear-gradient(#000 0 0) 5px 9px / 6px 1px no-repeat,
    linear-gradient(#ffd100 0 0) 4px 9px / 8px 5px no-repeat,
    linear-gradient(#7fc7ff 0 0) 2px 2px / 12px 12px no-repeat,
    var(--win-face);
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
}

.stats-icon::before,
.stats-window-icon {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 28px;
  height: 28px;
  background:
    linear-gradient(#fff 0 0) 8px 22px / 2px 2px no-repeat,
    linear-gradient(#fff 0 0) 11px 19px / 2px 2px no-repeat,
    linear-gradient(#fff 0 0) 14px 18px / 2px 2px no-repeat,
    linear-gradient(#fff 0 0) 17px 14px / 2px 2px no-repeat,
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255,255,255,.18) 4px 5px) 4px 9px / 20px 15px no-repeat,
    linear-gradient(#081c2f 0 0) 4px 9px / 20px 15px no-repeat,
    linear-gradient(#000080 0 0) 4px 4px / 20px 3px no-repeat,
    var(--win-face);
  border: 1px solid #000;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #fff;
}
.stats-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  bottom: 8px;
  width: 4px;
  height: 10px;
  background: var(--ok);
  box-shadow:
    6px -5px 0 var(--yellow),
    12px -2px 0 var(--blue-2),
    18px -9px 0 var(--danger);
}
.stats-window-icon {
  position: relative;
  display: inline-block;
  left: auto;
  top: auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background:
    linear-gradient(#fff 0 0) 6px 12px / 1px 1px no-repeat,
    linear-gradient(#fff 0 0) 8px 10px / 1px 1px no-repeat,
    linear-gradient(#fff 0 0) 10px 8px / 1px 1px no-repeat,
    linear-gradient(#081c2f 0 0) 3px 5px / 10px 9px no-repeat,
    linear-gradient(#000080 0 0) 3px 3px / 10px 2px no-repeat,
    var(--win-face);
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
}
.stats-window-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 3px;
  width: 2px;
  height: 5px;
  background: var(--ok);
  box-shadow: 4px -2px 0 var(--yellow), 8px 0 0 var(--blue-2);
}

.leaderboard-icon::before,
.leaderboard-window-icon {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 30px;
  height: 29px;
  background:
    linear-gradient(#000 0 0) 15px 19px / 2px 5px no-repeat,
    linear-gradient(#ffd100 0 0) 12px 15px / 8px 11px no-repeat,
    linear-gradient(#d9d6ce 0 0) 4px 20px / 8px 6px no-repeat,
    linear-gradient(#c87533 0 0) 20px 22px / 8px 4px no-repeat,
    linear-gradient(#ffd100 0 0) 13px 4px / 7px 6px no-repeat,
    linear-gradient(#b8860b 0 0) 14px 10px / 5px 4px no-repeat,
    linear-gradient(#7fc7ff 0 0) 3px 3px / 24px 23px no-repeat,
    #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #fff;
}
.leaderboard-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 7px;
  width: 16px;
  height: 7px;
  background:
    linear-gradient(#ffd100 0 0) 0 1px / 4px 3px no-repeat,
    linear-gradient(#ffd100 0 0) 12px 1px / 4px 3px no-repeat;
}
.leaderboard-window-icon {
  position: relative;
  display: inline-block;
  left: auto;
  top: auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background:
    linear-gradient(#000 0 0) 7px 10px / 1px 3px no-repeat,
    linear-gradient(#ffd100 0 0) 6px 8px / 4px 5px no-repeat,
    linear-gradient(#d9d6ce 0 0) 2px 11px / 4px 3px no-repeat,
    linear-gradient(#c87533 0 0) 10px 12px / 4px 2px no-repeat,
    linear-gradient(#ffd100 0 0) 6px 2px / 4px 4px no-repeat,
    linear-gradient(#b8860b 0 0) 7px 6px / 2px 2px no-repeat,
    linear-gradient(#7fc7ff 0 0) 1px 1px / 13px 13px no-repeat,
    var(--win-face);
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
}
.leaderboard-window-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 8px;
  height: 3px;
  background:
    linear-gradient(#ffd100 0 0) 0 1px / 2px 1px no-repeat,
    linear-gradient(#ffd100 0 0) 6px 1px / 2px 1px no-repeat;
}

.tournament-icon::before,
.tournament-window-icon {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 28px;
  height: 29px;
  background:
    linear-gradient(#7a4a00 0 0) 12px 21px / 5px 4px no-repeat,
    linear-gradient(#ffd100 0 0) 8px 24px / 13px 3px no-repeat,
    linear-gradient(#ffd100 0 0) 10px 11px / 10px 11px no-repeat,
    linear-gradient(#fff6a6 0 0) 12px 8px / 6px 4px no-repeat,
    linear-gradient(#b8860b 0 0) 6px 12px / 4px 7px no-repeat,
    linear-gradient(#b8860b 0 0) 20px 12px / 4px 7px no-repeat,
    linear-gradient(#000080 0 0) 3px 4px / 22px 22px no-repeat,
    var(--win-face);
  border: 1px solid #000;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #fff;
}
.tournament-icon::after {
  content: "★";
  position: absolute;
  left: 13px;
  top: 8px;
  color: #7a4a00;
  font: 900 8px / 1 var(--font-mono);
  text-shadow: 1px 0 0 #fff6a6;
}
.tournament-window-icon {
  position: relative;
  display: inline-block;
  left: auto;
  top: auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background:
    linear-gradient(#7a4a00 0 0) 7px 11px / 2px 2px no-repeat,
    linear-gradient(#ffd100 0 0) 5px 13px / 6px 1px no-repeat,
    linear-gradient(#ffd100 0 0) 5px 5px / 6px 7px no-repeat,
    linear-gradient(#b8860b 0 0) 2px 6px / 3px 4px no-repeat,
    linear-gradient(#b8860b 0 0) 11px 6px / 3px 4px no-repeat,
    linear-gradient(#000080 0 0) 1px 1px / 13px 13px no-repeat,
    var(--win-face);
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
}
.tournament-window-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 2px;
  height: 2px;
  background: #7a4a00;
  box-shadow: 1px 0 0 #fff6a6;
}

.x-icon {
  display: grid;
  place-items: center;
  color: #fff;
  background: #050505;
  border: 1px solid #000;
  box-shadow:
    inset -2px -2px 0 #1a1a1a,
    inset 2px 2px 0 #707070,
    2px 2px 0 rgba(0,0,0,.42);
}
.x-icon svg {
  display: block;
  width: 70%;
  height: 70%;
  fill: currentColor;
}
.desktop-icon.x-icon {
  width: 38px;
  height: 38px;
}
.mobile-menu-icon.x-icon {
  width: 30px;
  height: 30px;
  justify-self: center;
}
.telegram-icon {
  display: grid;
  place-items: center;
  color: #fff;
  background: #28a8e9;
  border: 1px solid #000;
  box-shadow:
    inset -2px -2px 0 #0b6f9c,
    inset 2px 2px 0 #b7efff,
    2px 2px 0 rgba(0,0,0,.42);
}
.telegram-icon svg {
  display: block;
  width: 72%;
  height: 72%;
  fill: currentColor;
  transform: translate(-1px, 1px);
}
.desktop-icon.telegram-icon {
  width: 38px;
  height: 38px;
}
.mobile-menu-icon.telegram-icon {
  width: 30px;
  height: 30px;
  justify-self: center;
}
.social-copy {
  display: none;
  position: absolute;
  left: 108px;
  top: 9px;
  z-index: 4;
  width: max-content;
  max-width: 188px;
  padding: 5px 6px;
  color: #000;
  background: #ffffe1;
  border: 1px solid #808080;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
  text-shadow: none;
  pointer-events: none;
  font: 900 10px / 1.25 var(--font-mono);
}
.social-x-shortcut:hover .social-copy,
.social-x-shortcut:focus-visible .social-copy,
.social-telegram-shortcut:hover .social-copy,
.social-telegram-shortcut:focus-visible .social-copy,
.tournament-shortcut:hover .social-copy,
.tournament-shortcut:focus-visible .social-copy {
  display: block;
}

.bin-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 20px;
  height: 25px;
  background:
    repeating-linear-gradient(90deg, transparent 0 4px, rgba(0,0,0,.25) 4px 5px),
    #d8d8d8;
  border: 1px solid #000;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #fff;
}
.bin-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 5px;
  width: 26px;
  height: 6px;
  background: #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
}

.brand-lockup {
  grid-column: 2;
  display: grid;
  place-items: center;
  min-width: 0;
  padding-top: 2px;
}

.doc-icon {
  position: relative;
  display: block;
  width: 34px;
  height: 42px;
  background:
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(0,0,0,.28) 7px 8px),
    #fff;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 rgba(0,0,0,.42), inset -2px -2px 0 #d0d0d0, inset 2px 2px 0 #fff;
}
.doc-icon::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #dcdcdc 0 49%, #808080 50% 54%, #fff 55% 100%);
  border-left: 1px solid #000;
  border-bottom: 1px solid #000;
}
.doc-copy {
  display: block;
  width: 132px;
  margin-top: 2px;
  padding: 5px 6px;
  background: #ffffe1;
  color: #000;
  border: 1px solid #808080;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
  text-shadow: none;
  font: 900 10px / 1.25 var(--font-mono);
  text-transform: none;
}

.race-info-shortcut .doc-copy {
  display: none;
  position: absolute;
  left: 108px;
  top: 16px;
  width: 188px;
  z-index: 4;
  pointer-events: none;
}

.race-info-shortcut:hover .doc-copy,
.race-info-shortcut:focus-visible .doc-copy {
  display: block;
}

.brand-icon,
.win-icon {
  display: inline-block;
  background:
    linear-gradient(#ffd100 0 0) 9px 8px / 18px 14px no-repeat,
    linear-gradient(#d62411 0 0) 5px 12px / 8px 6px no-repeat,
    linear-gradient(#000 0 0) 23px 11px / 3px 3px no-repeat,
    linear-gradient(#10d275 0 0) 10px 22px / 14px 5px no-repeat,
    #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #fff;
}

.brand-icon { width: 34px; height: 34px; margin-top: 2px; }
.win-icon { width: 16px; height: 16px; background-size: 9px 7px, 5px 4px, 2px 2px, 8px 3px, auto; background-position: 4px 3px, 2px 6px, 12px 5px, 5px 11px, 0 0; }
.profile-window-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background:
    linear-gradient(#000 0 0) 5px 7px / 1px 1px no-repeat,
    linear-gradient(#000 0 0) 8px 7px / 1px 1px no-repeat,
    radial-gradient(circle at 7px 8px, #ffd2a0 0 3px, #6b3f1f 3px 4px, transparent 4px),
    linear-gradient(#2d6dcb 0 0) 4px 12px / 6px 2px no-repeat,
    linear-gradient(#000080 0 0) 2px 2px / 12px 2px no-repeat,
    linear-gradient(#000 0 0) 11px 6px / 3px 1px no-repeat,
    linear-gradient(#808080 0 0) 11px 9px / 3px 1px no-repeat,
    linear-gradient(#008000 0 0) 12px 12px / 2px 2px no-repeat,
    linear-gradient(#f8f8f8 0 0) 2px 2px / 12px 12px no-repeat,
    #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
}

h1 {
  margin: 0;
  color: #f2f2f2;
  font: 900 clamp(42px, 9vw, 88px) / .86 var(--font-ui);
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    1px 1px 0 #fff,
    3px 3px 0 #707070,
    5px 5px 0 #303030,
    7px 7px 0 rgba(0,0,0,.35);
}

.lede {
  margin: 0;
  overflow-wrap: anywhere;
}

.wallet-step-group {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  margin-top: 8px;
}

.wallet-step-group[hidden] { display: none !important; }

.wallet-step-number {
  display: none;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #fff;
  background: var(--blue);
  font: 900 11px / 1 var(--font-mono);
  text-shadow: none;
  flex: 0 0 auto;
}

.wallet-cta {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-button);
  font: 900 12px / 1 var(--font-mono);
  cursor: pointer;
  text-align: center;
  text-shadow: none;
  width: auto;
  min-width: 128px;
}

.wallet-cta span { font: inherit; text-transform: none; }
.wallet-cta small { display: none; }
.wallet-label { white-space: nowrap; }
.wallet-cta:not(:disabled):hover,
.wallet-cta:not(:disabled):focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.wallet-cta:not(:disabled):active { transform: translate(1px, 1px); }
.wallet-cta:disabled { background: var(--win-face); color: var(--win-mid); text-shadow: 1px 1px 0 var(--win-light); cursor: default; }

.launcher {
  width: min(680px, calc(100vw - 20px));
  background: var(--win-face);
  box-shadow: var(--bevel-out), 4px 4px 0 rgba(0,0,0,.48);
}

.panel { border: 0; background: transparent; }

.win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  margin: 3px 3px 0;
  padding: 3px 4px;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  color: #fff;
  font: 900 13px / 1 var(--font-ui);
}

.win-title,
.win-controls { display: flex; align-items: center; gap: 6px; min-width: 0; }
.win-title { overflow: hidden; white-space: nowrap; }
.win-controls { flex: 0 0 auto; gap: 3px; }

.win-control,
.sound-toggle {
  appearance: none;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border: 0;
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-button);
  font: 900 11px / 1 var(--font-ui);
}
.sound-toggle { min-width: 48px; cursor: pointer; }
.sound-toggle[aria-pressed="false"] { color: #404040; text-decoration: line-through; }
.win-control.close { font-size: 15px; }

/* Menu Bar Styles */
.win-menubar {
  display: flex;
  background: var(--win-face);
  border-bottom: 1px solid var(--win-mid);
  padding: 3px 8px;
  gap: 12px;
  margin: 0 3px;
}
.win-menuitem {
  position: relative;
  color: #000;
  font: 900 12px / 1.2 var(--font-ui);
  padding: 2px 6px;
  cursor: pointer;
  user-select: none;
  outline: none;
}
.win-menuitem:hover,
.win-menuitem:focus-within {
  background: var(--blue);
  color: #fff;
}
.win-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: var(--win-face);
  border: 1px solid var(--win-mid);
  box-shadow: var(--bevel-out), 2px 2px 4px rgba(0,0,0,0.3);
  min-width: 150px;
  padding: 2px;
}
.win-menuitem:hover .win-menu-dropdown,
.win-menuitem:focus-within .win-menu-dropdown {
  display: block;
}
.win-menu-dropdown-item {
  color: #000;
  font: 900 12px / 1.3 var(--font-ui);
  padding: 4px 8px;
  text-align: left;
}
.win-menu-dropdown-item:hover {
  background: var(--blue);
  color: #fff;
}

.flow-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas:
    "profile profile"
    "choose players"
    "join players"
    "status status"
    "log log";
  gap: 12px;
  padding: 12px;
}

.status-msg-row {
  grid-area: status;
  background: var(--win-face);
  box-shadow: var(--bevel-in);
  border: 1px solid var(--win-mid);
  padding: 6px 8px;
  font: 900 12px / 1.3 var(--font-ui);
  color: #000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-height: 28px;
  height: auto;
}
.status-msg-row:has(.message:empty):has(.payment-state:empty) {
  display: none;
}
.status-msg-row .message,
.status-msg-row .payment-state {
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #000;
  box-shadow: none;
  font: 900 12px / 1.3 var(--font-ui);
  overflow-wrap: normal;
}
.status-msg-row .message.countdown {
  display: block;
  padding: 7px 9px;
  background: #ffffe1;
  color: #000;
  box-shadow: var(--bevel-in);
  font: 900 clamp(17px, 4.4vw, 22px) / 1.05 var(--font-mono);
  letter-spacing: 0;
}
.status-msg-row .message.countdown::before {
  content: "TIMER ";
  display: inline-block;
  margin-right: 6px;
  padding: 2px 5px;
  background: var(--blue);
  color: #fff;
  font: 900 11px / 1 var(--font-ui);
  box-shadow: var(--bevel-button);
  vertical-align: 2px;
}
.status-msg-row .payment-state { color: #202020; font-weight: 700; }
.status-msg-row .message:empty,
.status-msg-row .payment-state:empty { display: none; }
.status-msg-row .message.error,
.status-msg-row .payment-state[data-state="error"] { color: var(--danger); }
.status-msg-row .message.warn,
.status-msg-row .payment-state[data-state="sent"],
.status-msg-row .payment-state[data-state="confirmed"],
.status-msg-row .payment-state[data-state="needs-register"],
.status-msg-row .payment-state[data-state="refunded"] { color: #7a4a00; }
.status-msg-row .message.ok,
.status-msg-row .payment-state[data-state="registered"] { color: var(--ok); }

.profile-card,
.step-card,
.players-card {
  min-width: 0;
  background: transparent;
  border: 2px solid;
  border-color: var(--win-mid) var(--win-light) var(--win-light) var(--win-mid); /* etched border */
  box-shadow: none;
  position: relative;
  padding: 18px 10px 10px 10px;
  margin-top: 8px;
}

.profile-card { grid-area: profile; }
.choose-card { grid-area: choose; display: grid; gap: 8px; }
.join-card { grid-area: join; display: grid; gap: 8px; align-content: start; }
.players-card { grid-area: players; display: grid; grid-template-rows: auto 1fr; background: transparent; }


.step-head,
.profile-head,
.roster-head {
  position: absolute;
  top: -8px;
  left: 8px;
  background: var(--win-face);
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  white-space: nowrap;
}

.profile-label,
.step-title,
.roster-head .label .label {
  color: #000;
  font: 900 13px / 1 var(--font-mono);
  text-transform: uppercase;
  background: transparent;
}

.step-number {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--blue);
  color: #fff;
  font: 900 11px / 1 var(--font-mono);
  margin-right: 2px;
}

.profile-card .wallet {
  position: absolute;
  top: -8px;
  right: 8px;
  background: var(--win-face);
  padding: 0 4px;
  font: 900 11px / 1 var(--font-mono);
  color: var(--win-mid);
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.profile-birb,
.roster-icon {
  width: 28px;
  height: 28px;
  background-image: url("/birb.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.profile-birb[data-color-index="0"], .roster-icon[data-color-index="0"] { filter: none; }
.profile-birb[data-color-index="1"], .roster-icon[data-color-index="1"] { filter: brightness(0.5) saturate(1.2); }
.profile-birb[data-color-index="2"], .roster-icon[data-color-index="2"] { filter: hue-rotate(25deg) saturate(1.2); }
.profile-birb[data-color-index="3"], .roster-icon[data-color-index="3"] { filter: hue-rotate(45deg) saturate(1.5) brightness(1.2); }
.profile-birb[data-color-index="4"], .roster-icon[data-color-index="4"] { filter: hue-rotate(330deg) saturate(1.3); }
.profile-birb[data-color-index="5"], .roster-icon[data-color-index="5"] { filter: hue-rotate(320deg) saturate(1.8); }
.profile-birb[data-color-index="6"], .roster-icon[data-color-index="6"] { filter: hue-rotate(290deg); }
.profile-birb[data-color-index="7"], .roster-icon[data-color-index="7"] { filter: hue-rotate(285deg) brightness(0.6); }
.profile-birb[data-color-index="8"], .roster-icon[data-color-index="8"] { filter: hue-rotate(210deg) saturate(0.5); }
.profile-birb[data-color-index="9"], .roster-icon[data-color-index="9"] { filter: hue-rotate(195deg); }
.profile-birb[data-color-index="10"], .roster-icon[data-color-index="10"] { filter: hue-rotate(65deg) saturate(1.5) brightness(1.2); }
.profile-birb[data-color-index="11"], .roster-icon[data-color-index="11"] { filter: hue-rotate(130deg) saturate(1.5); }
.profile-birb[data-color-index="12"], .roster-icon[data-color-index="12"] { filter: hue-rotate(180deg) brightness(0.8); }
.profile-birb[data-color-index="13"], .roster-icon[data-color-index="13"] { filter: hue-rotate(220deg) brightness(0.4); }
.profile-birb[data-color-index="14"], .roster-icon[data-color-index="14"] { filter: saturate(0) brightness(1.8); }
.profile-birb[data-color-index="15"], .roster-icon[data-color-index="15"] { filter: saturate(0) brightness(0.2); }

.name-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.name-field span,
.label {
  color: #000;
  font: 900 11px / 1.15 var(--font-ui);
  text-transform: uppercase;
}

.name-field input {
  width: 140px;
  height: 22px;
  min-height: 22px;
  padding: 2px 6px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #000;
  box-shadow: var(--bevel-in);
  outline: none;
  font: 900 12px / 1 var(--font-mono);
}
.name-field input::placeholder { color: #808080; }
.name-field input:focus { outline: 1px dotted #000; outline-offset: -5px; }

.color-menu { position: relative; width: 110px; }
.color-menu summary {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  height: 22px;
  min-height: 22px;
  padding: 2px 6px;
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-button);
  font: 900 11px / 1 var(--font-ui);
}
.color-menu[open] summary { box-shadow: var(--bevel-button-down); }
.color-dot {
  width: 12px;
  height: 12px;
  border: 1px solid #000;
  background: var(--birb-color, #ffd100);
}
.color-picker {
  position: absolute;
  z-index: 105;
  right: 0;
  top: calc(100% + 4px);
  display: grid;
  grid-template-columns: repeat(4, 28px);
  gap: 4px;
  padding: 6px;
  background: var(--win-face);
  box-shadow: var(--bevel-out), 4px 4px 0 rgba(0,0,0,.45);
}
.color-swatch {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.25) 0 22%, transparent 22% 100%), var(--swatch);
  box-shadow: var(--bevel-button);
  cursor: pointer;
}
.color-swatch[aria-checked="true"] { box-shadow: var(--bevel-button-down), 0 0 0 2px var(--blue); outline: 1px dotted #fff; outline-offset: -6px; }
.color-swatch:hover,
.color-swatch:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }

.server-pill,
.value {
  min-width: 0;
  color: #000;
  font: 900 12px / 1.2 var(--font-mono);
  white-space: nowrap;
}
.server-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 4px 6px;
  background: #ffffe1;
  border: 1px solid #808080;
  color: #000;
  font: 700 11px / 1.2 var(--font-ui);
}
.server-settings { position: relative; }
.server-settings summary {
  min-width: 32px;
  padding: 1px 4px;
  background: var(--win-face);
  box-shadow: var(--bevel-button);
  color: #000;
  font: 900 11px / 1.2 var(--font-mono);
  text-align: center;
}
.server-settings[open] summary { box-shadow: var(--bevel-button-down); }
.region-list {
  position: absolute;
  z-index: 6;
  right: 0;
  top: calc(100% + 4px);
  display: grid;
  gap: 3px;
  width: min(220px, calc(100vw - 36px));
  padding: 5px;
  background: var(--win-face);
  box-shadow: var(--bevel-out), 3px 3px 0 rgba(0,0,0,.42);
}
.region-placeholder {
  display: block;
  padding: 7px 8px;
  background: #ffffe1;
  border: 1px solid #808080;
  color: #000;
  font: 900 12px / 1.25 var(--font-ui);
}
.region-button {
  appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 6px;
  border: 0;
  border-radius: 0;
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-button);
  text-align: left;
  cursor: pointer;
}
.region-button[aria-pressed="true"] { background: var(--blue); color: #fff; box-shadow: var(--bevel-button-down); }
.region-button:disabled { opacity: .75; cursor: default; }
.region-name { font: 900 12px / 1.1 var(--font-ui); }
.region-ping { font: 900 11px / 1.1 var(--font-mono); }
.region-button[data-state="error"] .region-ping { color: var(--danger); }
.region-button[aria-pressed="true"][data-state="error"] .region-ping { color: #ffb0b0; }
.region-button .region-ping { white-space: nowrap; }
.region-button[data-state="ok"] .region-ping { color: #004f00; }
.region-button[aria-pressed="true"][data-state="ok"] .region-ping { color: #fff; }

.pool-currency-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 4px 0 5px;
}
.pool-currency-btn {
  appearance: none;
  min-height: 26px;
  border: 0;
  border-radius: 0;
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-button);
  font: 900 12px / 1 var(--font-mono);
  cursor: pointer;
}
.pool-currency-btn[aria-selected="true"] {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--bevel-button-down);
}
.pool-currency-btn:disabled {
  opacity: .75;
  cursor: default;
}

.lobby-list {
  display: grid;
  gap: 1px;
  background: #fff;
  border: 1px solid var(--win-mid);
  box-shadow: var(--bevel-in);
  max-height: 132px;
  height: 132px;
  overflow-y: auto;
  padding: 1px;
}
.lobby-row {
  appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  justify-content: stretch;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 6px;
  border: 0;
  background: #fff;
  color: #000;
  font: 900 12px / 1 var(--font-mono);
  cursor: pointer;
  width: 100%;
}
.lobby-row:nth-child(even) { background: #f9f9f9; }
.lobby-row[aria-current="true"] { background: var(--blue); color: #fff; }
.lobby-row[data-round-status="live"] .lobby-main,
.lobby-row[data-round-status="payout_pending"] .lobby-main { color: #7a0000; }
.lobby-row[aria-current="true"][data-round-status="live"] .lobby-main,
.lobby-row[aria-current="true"][data-round-status="payout_pending"] .lobby-main { color: #fff; }
.lobby-row[aria-disabled="false"]:hover { background: var(--blue); color: #fff; }
.lobby-row[aria-disabled="true"] { color: #808080; cursor: not-allowed; }
.lobby-row[aria-disabled="true"][data-round-status="live"] { color: #6f1515; background: #fff0f0; }
.lobby-row[aria-disabled="true"][data-round-status="live"] .lobby-state { color: #7a0000; }
.lobby-row[aria-current="true"][aria-disabled="true"] { background: var(--blue); color: #fff; opacity: .8; }
.lobby-main {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
  font: 900 12px / 1 var(--font-mono);
}
.lobby-entry-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lobby-usd { flex: 0 0 auto; color: #004f00; font: 900 10px / 1 var(--font-mono); }
.lobby-row[aria-current="true"] .lobby-usd,
.lobby-row[aria-disabled="false"]:hover .lobby-usd { color: #fff; }
.lobby-state { font: 900 11px / 1 var(--font-mono); white-space: nowrap; }
.lobby-action-btn {
  appearance: none;
  min-width: 58px;
  height: 20px;
  padding: 0 7px;
  border: 0;
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-button);
  font: 900 10px / 1 var(--font-mono);
  cursor: pointer;
}
.lobby-action-btn[data-kind="spectate"] {
  background: #ffffe1;
  color: #7a0000;
}
.lobby-action-btn:hover,
.lobby-action-btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.lobby-action-btn:active { transform: translate(1px, 1px); }
.lobby-row[aria-current="true"] .lobby-action-btn { box-shadow: var(--bevel-button); }

.selected-lobby {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.selected-lobby > div {
  min-width: 0;
  padding: 4px 6px;
  background: var(--win-face);
  box-shadow: var(--bevel-in);
}
.selected-lobby strong {
  display: block;
  margin-top: 2px;
  color: #000;
  font: 900 clamp(10px, 1.7vw, 12px) / 1.12 var(--font-mono);
  overflow-wrap: anywhere;
  white-space: normal;
}
#pot-value {
  letter-spacing: -.02em;
}
.timer-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 4px 8px;
  background: #ffffe1 !important;
  border: 1px solid #808080;
}
.timer-card[data-state="countdown"] {
  background: #fff7a8 !important;
  border-color: #000;
}
.timer-card strong {
  margin-top: 0;
  color: #000;
  font: 900 clamp(22px, 5.5vw, 32px) / .9 var(--font-mono);
  text-align: right;
  overflow: visible;
}
.timer-card small {
  grid-column: 1 / -1;
  color: #202020;
  font: 900 10px / 1.25 var(--font-ui);
}
.treasury-row { display: none; }


.market-panel {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--win-mid);
  box-shadow: var(--bevel-in);
}
.market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.market-head strong {
  padding: 2px 6px;
  background: var(--blue);
  color: #fff;
  font: 900 10px / 1 var(--font-mono);
  box-shadow: var(--bevel-button);
  text-transform: uppercase;
}
.market-summary,
.market-status {
  margin: 0;
  color: #202020;
  font: 900 11px / 1.25 var(--font-ui);
}
.market-status { color: #7a4a00; min-height: 14px; }
.market-outcomes,
.market-tiers {
  display: grid;
  gap: 4px;
}
.market-outcomes { max-height: 138px; overflow-y: auto; padding: 1px; background: #fff; }
.market-outcome,
.market-tier,
.market-bet-btn {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-button);
  cursor: pointer;
}
.market-outcome {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 6px;
  text-align: left;
}
.market-outcome[data-selected="true"] { background: var(--blue); color: #fff; box-shadow: var(--bevel-button-down); }
.market-outcome:disabled { opacity: .68; cursor: default; }
.market-outcome-copy { min-width: 0; display: grid; gap: 2px; }
.market-outcome-copy strong,
.market-outcome-copy small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-outcome-copy strong { font: 900 12px / 1 var(--font-mono); }
.market-outcome-copy small { font: 900 10px / 1 var(--font-ui); color: inherit; opacity: .84; }
.market-tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.market-tier { min-height: 24px; padding: 3px 4px; font: 900 10px / 1 var(--font-mono); }
.market-tier[aria-checked="true"] { background: #ffffe1; box-shadow: var(--bevel-button-down); }
.market-bet-btn { width: 100%; min-height: 28px; font: 900 12px / 1 var(--font-mono); background: #ffd100; }
.market-bet-btn:disabled,
.market-tier:disabled { opacity: .62; cursor: default; }
.market-empty { padding: 7px; color: #505050; font: 900 11px / 1.2 var(--font-ui); }

.actions {
  position: relative;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}
.btn,
.modal-actions .btn,
.game-bar .btn {
  position: relative;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-height: 24px;
  width: auto;
  min-width: 75px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-button);
  font: 900 12px / 1 var(--font-mono);
  letter-spacing: 0;
  cursor: pointer;
  overflow: visible;
}
.btn::after,
.modal-actions .btn::after { content: ""; }
.btn.accent {
  background: var(--win-face);
  color: #000;
  font-weight: 900;
  box-shadow:
    0 0 0 1px var(--win-black),
    inset -1px -1px 0 var(--win-black),
    inset 1px 1px 0 var(--win-light),
    inset -2px -2px 0 var(--win-mid),
    inset 2px 2px 0 #eeeeee;
}
.btn.accent:active {
  box-shadow:
    0 0 0 1px var(--win-black),
    inset 1px 1px 0 var(--win-black),
    inset -1px -1px 0 var(--win-light),
    inset 2px 2px 0 var(--win-mid);
}
#join-btn {
  height: 30px;
  min-height: 30px;
  font-size: 13px;
  min-width: 90px;
  padding: 0 16px;
}
.btn[data-tip]:hover::before,
.btn[data-tip]:focus-visible::before {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 5px);
  z-index: 110;
  width: max-content;
  max-width: min(230px, calc(100vw - 32px));
  padding: 5px 7px;
  background: #ffffe1;
  border: 1px solid #808080;
  color: #000;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
  font: 900 11px / 1.2 var(--font-ui);
  text-transform: none;
  pointer-events: none;
}
.btn.primary:not(:disabled) { background: #e7e7e7; }
.btn.ghost:not(:disabled) { background: var(--win-face); }
.btn.refund:not(:disabled) {
  background: #fff6a8;
  color: #7a0000;
  min-width: 100px;
}
.btn.refund:not(:disabled)::before {
  content: "↩";
  margin-right: 5px;
  color: #7a0000;
}
.btn:not(:disabled):hover,
.btn:not(:disabled):focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btn:not(:disabled):active { transform: translate(1px, 1px); }
.btn:disabled { background: var(--win-face); color: var(--win-mid); text-shadow: 1px 1px 0 var(--win-light); cursor: not-allowed; box-shadow: var(--bevel-button); }
.btn.small { min-height: 20px; width: auto; font-size: 11px; }


.roster-player {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 2px 4px;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.roster-name-btn {
  appearance: none;
  min-width: 0;
  padding: 2px 3px;
  border: 0;
  background: transparent;
  color: #000;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 900 12px / 1.1 var(--font-mono);
}
.roster-name-btn:hover,
.roster-name-btn:focus-visible {
  color: #fff;
  background: var(--blue);
  outline: 1px dotted #000;
  outline-offset: -3px;
}
.win-rate-badge {
  justify-self: end;
  min-width: 43px;
  padding: 2px 4px;
  color: #000;
  background: #ffffe1;
  box-shadow: var(--bevel-button-down);
  font: 900 10px / 1 var(--font-mono);
  text-align: center;
  white-space: nowrap;
}














/* Status Bar styles replaced custom message divs */
.win-statusbar {
  display: flex;
  background: var(--win-face);
  padding: 2px;
  gap: 2px;
  margin: 0 3px 3px;
  border-top: 1px solid var(--win-mid);
}
.win-statuspane {
  background: var(--win-face);
  box-shadow: var(--bevel-in);
  padding: 3px 6px;
  font: 900 11px / 1.2 var(--font-ui);
  color: #000;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-height: 22px;
}
.win-status-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.win-status-middle {
  width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.win-status-right {
  width: 90px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #505050;
}

.win-statusbar .message,
.win-statusbar .payment-state {
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #000;
  box-shadow: none;
  font: 900 11px / 1.2 var(--font-ui);
  overflow-wrap: normal;
}
.win-statusbar .payment-state { color: #202020; font-weight: 700; }
.win-statusbar .message:empty,
.win-statusbar .payment-state:empty { display: none; }
.win-statusbar .message.error,
.win-statusbar .payment-state[data-state="error"] { color: var(--danger); }
.win-statusbar .message.warn,
.win-statusbar .payment-state[data-state="sent"],
.win-statusbar .payment-state[data-state="confirmed"],
.win-statusbar .payment-state[data-state="needs-register"],
.win-statusbar .payment-state[data-state="refunded"] { color: #7a4a00; }
.win-statusbar .message.ok,
.win-statusbar .payment-state[data-state="registered"] { color: var(--ok); }
.mono { font-family: var(--font-mono); overflow-wrap: anywhere; }

.roster-head .value .value { margin: 0; font: 900 11px / 1 var(--font-mono); }
.roster-list {
  display: grid;
  align-content: start;
  gap: 0;
  min-height: 130px;
  height: 100%;
  margin: 0;
  padding: 1px;
  list-style: none;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--win-mid);
  box-shadow: var(--bevel-in);
}
.roster-list:empty::before {
  content: "";
  display: block;
  min-height: 14px;
}
.roster-player,
.roster-empty {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 2px 4px;
  color: #000;
  font: 900 12px / 1.15 var(--font-ui);
  list-style: none;
  list-style-type: none;
}
.roster-player:nth-child(even) { background: #f0f0f0; }
.roster-icon { display: block; width: 18px; height: 18px; }
.roster-name { min-width: 0; overflow: hidden; color: #000; text-overflow: ellipsis; white-space: nowrap; }
.roster-empty { grid-template-columns: 1fr; min-height: 0; padding: 0; color: transparent; }

.confirmations {
  grid-area: log;
  display: grid;
  gap: 0;
  max-height: 128px;
  overflow-y: auto;
  background: #fff;
  color: #000;
  border: 1px solid var(--win-mid);
  box-shadow: var(--bevel-in);
}
.confirmations:empty { display: none; }
.confirmations::before {
  content: "Event Log";
  position: sticky;
  top: 0;
  z-index: 1;
  display: block;
  padding: 4px 6px;
  background: var(--win-face);
  color: #000;
  border-bottom: 1px solid var(--win-mid);
  box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-mid);
  font: 900 11px / 1 var(--font-ui);
  text-transform: uppercase;
}
.confirmation {
  padding: 3px 6px;
  border-top: 1px dotted #808080;
  font: 900 11px / 1.25 var(--font-ui);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.confirmation strong {
  color: #000;
  font-weight: 900;
  white-space: nowrap;
}
.confirmation span,
.confirmation a {
  margin-top: 0;
  color: #303030;
  font-weight: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: right;
  font: inherit;
  display: inline-block;
}
.confirmation a {
  color: var(--blue);
  text-decoration: underline;
}

.version {
  justify-self: end;
  width: min(680px, calc(100vw - 20px));
  margin: -4px auto 0;
  color: #fff;
  font: 900 11px / 1 var(--font-mono);
  text-align: right;
  text-shadow: 1px 1px 0 #000;
}

.game-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--desktop-bg);
}
.game-panel[hidden] { display: none !important; }
.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 4px 5px;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  color: #fff;
  font: 900 12px / 1 var(--font-ui);
  box-shadow: var(--bevel-out);
}
.game-bar .btn { flex: 0 0 auto; min-width: 96px; width: auto; min-height: 22px; font-size: 12px; }
#game-frame {
  display: block;
  justify-self: center;
  align-self: center;
  width: min(100%, calc((100dvh - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 16 / 9));
  height: auto;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
  box-shadow: var(--bevel-in);
}
.rotate-phone-hint { display: none; }
.rotate-phone-popup { display: none; }
.rotate-phone-card {
  display: grid;
  gap: 6px;
  width: min(280px, calc(100vw - 44px));
  padding: 14px 16px;
  color: #fff;
  text-align: center;
  background: rgba(0, 0, 0, 0.82);
  box-shadow: var(--bevel-out), 4px 4px 0 rgba(0, 0, 0, 0.42);
}
.rotate-phone-card strong { font: 900 20px / 1 var(--font-ui); }
.rotate-phone-card span { font: 900 12px / 1.35 var(--font-ui); }
.game-wait-overlay {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 4;
  display: grid;
  gap: 8px;
  width: min(520px, calc(100vw - 24px));
  padding: 10px 12px 11px;
  color: #000;
  background: rgba(255, 255, 225, .96);
  border: 2px solid #000;
  box-shadow: var(--bevel-out), 5px 5px 0 rgba(0,0,0,.42);
  transform: translateX(-50%);
  pointer-events: none;
}
.game-wait-overlay[hidden] { display: none !important; }
.game-wait-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.game-wait-copy strong {
  font: 900 15px / 1 var(--font-ui);
  text-transform: uppercase;
}
.game-wait-copy span,
.game-wait-meta {
  font: 900 11px / 1.25 var(--font-mono);
}
.game-wait-track {
  position: relative;
  height: 14px;
  padding: 2px;
  background: #fff;
  border: 1px solid #000;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
  overflow: hidden;
}
.game-wait-track span {
  display: block;
  width: 16%;
  min-width: 22px;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #28a8e9);
  box-shadow: inset -1px -1px 0 rgba(0,0,0,.35), inset 1px 1px 0 rgba(255,255,255,.55);
  transition: width .24s ease;
}
.game-wait-overlay.is-pulse .game-wait-track span {
  background-image: repeating-linear-gradient(90deg, var(--blue) 0 10px, #28a8e9 10px 20px);
  animation: game-wait-stripes 1s steps(12) infinite;
}
@keyframes game-wait-stripes {
  from { background-position: 0 0; }
  to { background-position: 40px 0; }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(0,0,0,.35);
}
.modal-card {
  position: relative;
  width: min(560px, 100%);
  padding: 34px 12px 12px;
  color: #000;
  background: var(--win-face);
  box-shadow: var(--bevel-out), 4px 4px 0 rgba(0,0,0,.42);
}
.modal-card::before {
  content: "Race result";
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 7px;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  color: #fff;
  font: 900 12px / 1 var(--font-ui);
}
#about-modal .modal-card::before {
  content: "How to Play.txt";
}
#ping-modal .modal-card::before {
  content: "Connection check";
}
#wallet-modal .modal-card::before {
  content: "Connect wallet";
}
#join-notice-modal .modal-card::before {
  content: "Race entry";
}
#private-room-modal .modal-card::before,
#history-modal .modal-card::before,
#stats-modal .modal-card::before,
#leaderboard-modal .modal-card::before,
#tournament-modal .modal-card::before,
#profile-modal .modal-card::before {
  content: none !important;
  display: none !important;
}
#private-room-modal .private-room-modal-card > .win-titlebar,
#profile-modal .profile-modal-card > .win-titlebar,
#stats-modal .stats-modal-card > .win-titlebar,
#leaderboard-modal .leaderboard-modal-card > .win-titlebar,
#tournament-modal .tournament-modal-card > .win-titlebar,
#history-modal .history-modal-card > .win-titlebar {
  margin: 0 0 8px !important;
}
#profile-modal .profile-modal-card {
  padding: 3px;
}
#stats-modal .stats-modal-card,
#leaderboard-modal .leaderboard-modal-card,
#tournament-modal .tournament-modal-card {
  padding: 3px;
}
#profile-modal .history-toolbar,
#profile-modal .profile-stat-grid,
#profile-modal .profile-games-list {
  margin-left: 5px;
  margin-right: 5px;
}
#stats-modal .stats-toolbar,
#stats-modal .stats-board,
#stats-modal .stats-history-toolbar,
#stats-modal .stats-history-list,
#leaderboard-modal .leaderboard-toolbar,
#leaderboard-modal .leaderboard-board,
#tournament-modal .tournament-toolbar,
#tournament-modal .tournament-board {
  margin-left: 5px;
  margin-right: 5px;
}
.telegram-popup {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 9;
  width: min(336px, calc(100vw - 28px));
  padding: 3px;
  color: #000;
  background: var(--win-face);
  box-shadow: var(--bevel-out), 4px 4px 0 rgba(0,0,0,.42);
}
.telegram-popup[hidden] { display: none !important; }
.telegram-popup-titlebar { margin: 0 0 3px; }

.ca-icon {
  display: grid;
  place-items: center;
  color: #000;
  background: #fff;
  border: 2px solid #000;
  box-shadow: inset -4px -4px 0 #808080, inset 3px 3px 0 #fff, 3px 3px 0 rgba(0,0,0,.45);
  font: 1000 19px / .86 var(--font-mono);
  letter-spacing: -3px;
  border-radius: 0;
  text-shadow: 1px 0 0 #000;
}
.desktop-icon.ca-icon {
  width: 42px;
  height: 38px;
  justify-self: center;
}
.mobile-menu-icon.ca-icon {
  width: 30px;
  height: 28px;
  justify-self: center;
  font-size: 15px;
  letter-spacing: -2px;
}
.ca-shortcut:hover .ca-icon,
.ca-shortcut:focus-visible .ca-icon {
  transform: translate(-1px, -1px);
  box-shadow: inset -4px -4px 0 #808080, inset 3px 3px 0 #fff, 5px 5px 0 rgba(0,0,0,.45);
}
.ca-copy-toast {
  position: fixed;
  left: 16px;
  bottom: 42px;
  z-index: 80;
  padding: 7px 10px;
  color: #000;
  background: #ffffe1;
  border: 2px solid #000;
  box-shadow: var(--bevel-out), 3px 3px 0 rgba(0,0,0,.35);
  font: 900 12px / 1 var(--font-mono);
  text-transform: lowercase;
}
@media (max-width: 820px) {
  .ca-copy-toast {
    left: 50%;
    right: auto;
    bottom: auto;
    top: max(10px, env(safe-area-inset-top));
    transform: translateX(-50%);
  }
}

.telegram-window-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  color: #fff;
  background: #28a8e9;
  border: 1px solid #000;
  box-shadow: inset -1px -1px 0 #0b6f9c, inset 1px 1px 0 #b7efff;
}
.telegram-window-icon::before {
  content: "";
  width: 10px;
  height: 8px;
  background: #fff;
  clip-path: polygon(0 44%, 100% 0, 72% 100%, 47% 70%, 26% 92%, 31% 62%);
}
.telegram-popup-body {
  display: grid;
  gap: 7px;
  padding: 9px;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.telegram-popup-body strong {
  color: #000;
  font: 900 15px / 1.1 var(--font-ui);
}
.telegram-popup-body p {
  margin: 0;
  color: #202020;
  font: 900 12px / 1.35 var(--font-ui);
}
.telegram-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.telegram-popup-actions .btn {
  min-width: 94px;
  min-height: 26px;
  height: 26px;
  text-decoration: none;
}
.telegram-popup-close {
  appearance: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.result-toast {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 18;
  display: grid;
  gap: 4px;
  width: min(320px, calc(100vw - 28px));
  padding: 9px 11px;
  color: #000;
  background: var(--win-face);
  box-shadow: var(--bevel-out), 3px 3px 0 rgba(0,0,0,.42);
  pointer-events: none;
}
.result-toast strong {
  font: 900 13px / 1.1 var(--font-ui);
}
.result-toast span,
.result-toast a {
  color: #000;
  font: 900 11px / 1.25 var(--font-mono);
  overflow-wrap: anywhere;
}
.result-toast a { color: var(--blue); text-decoration: underline; }
.history-modal-card {
  width: min(760px, 100%);
  max-height: min(82vh, 720px);
  padding: 8px;
  overflow: hidden;
}
.history-close {
  appearance: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px;
  color: #000;
  background: var(--win-face);
  box-shadow: var(--bevel-in);
  font: 900 12px / 1 var(--font-ui);
}
.history-toolbar .btn {
  width: auto;
  min-width: 86px;
  min-height: 24px;
  font-size: 11px;
}
.history-list {
  display: grid;
  gap: 8px;
  max-height: min(62vh, 520px);
  margin-top: 8px;
  padding: 8px;
  overflow: auto;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.history-empty {
  color: #000;
  font: 900 12px / 1.4 var(--font-ui);
}
.history-game {
  display: grid;
  gap: 6px;
  padding: 8px;
  color: #000;
  background: var(--win-face);
  box-shadow: var(--bevel-out);
}
.history-game-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font: 900 13px / 1.15 var(--font-ui);
}
.history-game-meta,
.history-game-players,
.history-game a {
  color: #202020;
  font: 900 11px / 1.35 var(--font-mono);
  overflow-wrap: anywhere;
}
.history-game a { color: var(--blue); text-decoration: underline; }
.history-player-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.history-player-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: baseline;
}
.profile-modal-card .history-toolbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.profile-stat {
  min-width: 0;
  padding: 7px;
  color: #000;
  background: var(--win-face);
  box-shadow: var(--bevel-in);
}
.profile-stat span {
  display: block;
  color: #505050;
  font: 900 10px / 1.1 var(--font-ui);
  text-transform: uppercase;
}
.profile-stat strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 900 14px / 1.1 var(--font-mono);
}
.profile-games-list {
  max-height: min(42vh, 360px);
}
.stats-modal-card {
  width: min(760px, calc(100vw - 24px));
}
.stats-toolbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-board {
  display: grid;
  gap: 8px;
  max-height: min(40vh, 390px);
  margin-top: 8px;
  padding: 8px;
  overflow: auto;
  color: #000;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.stats-history-toolbar {
  margin-top: 8px;
}
.stats-history-list {
  max-height: min(20vh, 180px);
}
.stats-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr);
  gap: 8px;
}
.stats-total-panel,
.stats-latest-panel,
.stats-section {
  min-width: 0;
  background: var(--win-face);
  box-shadow: var(--bevel-out);
}
.stats-total-panel {
  display: grid;
  align-content: space-between;
  min-height: 136px;
  padding: 10px;
  color: #fff;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 8px),
    var(--blue);
}
.stats-total-panel span,
.stats-total-panel small {
  color: #fff;
  font: 900 11px / 1.25 var(--font-ui);
}
.stats-total-panel strong {
  display: block;
  margin: 8px 0 4px;
  font: 900 clamp(32px, 8vw, 56px) / .9 var(--font-mono);
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  text-shadow: 2px 2px 0 #000;
}
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.stats-kpi {
  min-width: 0;
  padding: 8px;
  background: var(--win-face);
  box-shadow: var(--bevel-in);
}
.stats-kpi span,
.stats-section-title span,
.stats-row small,
.stats-latest-panel span {
  display: block;
  color: #505050;
  font: 900 10px / 1.15 var(--font-ui);
  text-transform: uppercase;
}
.stats-kpi strong {
  display: block;
  margin-top: 5px;
  color: #000;
  font: 900 17px / 1 var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-section {
  display: grid;
  gap: 7px;
  padding: 8px;
}
.stats-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.stats-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px dotted #808080;
}
.stats-section-title strong,
.stats-latest-panel strong {
  color: #000;
  font: 900 13px / 1.15 var(--font-ui);
}
.stats-leaderboard {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stats-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 6px;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.stats-row-place {
  color: #fff;
  background: var(--blue);
  box-shadow: var(--bevel-button-down);
  font: 900 12px / 1.5 var(--font-mono);
  text-align: center;
}
.stats-row-main {
  min-width: 0;
}
.stats-row-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #000;
  font: 900 12px / 1.15 var(--font-ui);
}
.stats-row-value {
  color: #000;
  font: 900 12px / 1 var(--font-mono);
  white-space: nowrap;
}
.stats-pool-list {
  display: grid;
  gap: 6px;
}
.stats-pool-row {
  display: grid;
  grid-template-columns: 72px minmax(64px, 1fr) 94px;
  align-items: center;
  gap: 7px;
  color: #000;
  font: 900 11px / 1.2 var(--font-mono);
}
.stats-pool-row > span:first-child,
.stats-pool-row > span:last-child {
  white-space: nowrap;
}
.stats-pool-row > span:last-child {
  text-align: right;
}
.stats-meter {
  height: 14px;
  padding: 2px;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.stats-meter-fill {
  display: block;
  height: 100%;
  width: var(--meter, 0%);
  min-width: 2px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.32) 0 2px, transparent 2px 4px),
    var(--ok);
}
.stats-latest-panel {
  display: grid;
  gap: 6px;
  padding: 8px;
}
.stats-latest-panel p {
  margin: 0;
  color: #202020;
  font: 900 11px / 1.35 var(--font-mono);
  overflow-wrap: anywhere;
}
.stats-note {
  color: #303030;
  font: 900 10px / 1.3 var(--font-ui);
}
.leaderboard-modal-card,
.tournament-modal-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}
.tournament-modal-card { grid-template-rows: auto auto minmax(0, 1fr); }
#leaderboard-modal,
#tournament-modal {
  background: rgba(0,0,0,.52);
}
.leaderboard-toolbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-switcher {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: stretch;
  gap: 7px;
  margin-top: 8px;
}
.leaderboard-arrow {
  appearance: none;
  display: grid;
  place-items: center;
  min-height: 66px;
  border: 0;
  color: #000;
  background: var(--win-face);
  box-shadow: var(--bevel-button);
  font: 900 28px / 1 var(--font-ui);
  cursor: pointer;
}
.leaderboard-arrow:hover { filter: brightness(1.04); }
.leaderboard-arrow:active { transform: translate(1px, 1px); }
.leaderboard-arrow:disabled { opacity: .45; cursor: default; transform: none; }
.leaderboard-current {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 3px 8px;
  min-width: 0;
  padding: 8px;
  color: #000;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.leaderboard-current > span {
  grid-row: 1 / span 2;
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 46px;
  padding: 0 6px;
  color: #fff;
  background: var(--blue);
  box-shadow: var(--bevel-button-down);
  font: 900 12px / 1 var(--font-mono);
}
.leaderboard-current strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #000;
  font: 900 16px / 1 var(--font-ui);
}
.leaderboard-current small {
  color: #505050;
  font: 900 10px / 1.1 var(--font-ui);
  text-transform: uppercase;
}
.leaderboard-dots {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 8px;
}
.leaderboard-dot {
  appearance: none;
  width: 22px;
  height: 9px;
  border: 0;
  padding: 0;
  background: #c0c0c0;
  box-shadow: var(--bevel-button);
  cursor: pointer;
}
.leaderboard-dot.is-active {
  background: var(--blue);
  box-shadow: var(--bevel-button-down);
}
.leaderboard-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin-top: 8px;
  padding: 8px;
  overflow: auto;
  color: #000;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.leaderboard-section {
  align-content: start;
}
.leaderboard-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.leaderboard-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 31px;
  padding: 5px 6px;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.leaderboard-place {
  color: #fff;
  background: var(--blue);
  box-shadow: var(--bevel-button-down);
  font: 900 12px / 1.5 var(--font-mono);
  text-align: center;
}
.leaderboard-row:nth-child(1) .leaderboard-place { background: #9a6b00; }
.leaderboard-row:nth-child(2) .leaderboard-place { background: #606060; }
.leaderboard-row:nth-child(3) .leaderboard-place { background: #8a3f13; }
.leaderboard-row.is-loss .leaderboard-place { background: var(--danger); }
.leaderboard-main {
  min-width: 0;
}
.leaderboard-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #000;
  font: 900 12px / 1.15 var(--font-ui);
}
.leaderboard-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #505050;
  font: 900 10px / 1.15 var(--font-ui);
  text-transform: uppercase;
}
.leaderboard-value {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: #000;
  font: 900 12px / 1 var(--font-mono);
  white-space: nowrap;
  text-align: right;
}
.leaderboard-value strong { font: inherit; }
.leaderboard-value small {
  display: block;
  color: #505050;
  font: 900 9px / 1.05 var(--font-ui);
  text-transform: uppercase;
}
.leaderboard-row.is-profit .leaderboard-value strong { color: var(--ok); }
.leaderboard-row.is-tournament .leaderboard-place { background: #9a6b00; }
.leaderboard-row.is-tournament .leaderboard-value strong { color: #7a4a00; }
.leaderboard-row.is-negative .leaderboard-value strong,
.leaderboard-row.is-negative .leaderboard-value small,
.leaderboard-row.is-loss .leaderboard-value strong,
.leaderboard-row.is-loss .leaderboard-value small { color: var(--danger); }
.leaderboard-empty {
  padding: 6px;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.tournament-toolbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tournament-board {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin: 8px 5px 0;
  padding: 8px;
  overflow: auto;
  color: #000;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.tournament-hero {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(124px, auto);
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 2px, transparent 2px 8px),
    #fff7c4;
  box-shadow: var(--bevel-out);
}
.tournament-cup {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  background:
    linear-gradient(#7a4a00 0 0) 19px 31px / 6px 6px no-repeat,
    linear-gradient(#ffd100 0 0) 13px 37px / 18px 4px no-repeat,
    linear-gradient(#ffd100 0 0) 14px 13px / 16px 18px no-repeat,
    linear-gradient(#fff6a6 0 0) 18px 8px / 8px 6px no-repeat,
    linear-gradient(#b8860b 0 0) 6px 15px / 8px 12px no-repeat,
    linear-gradient(#b8860b 0 0) 30px 15px / 8px 12px no-repeat;
  border: 1px solid #000;
  box-shadow: inset -2px -2px 0 #b8860b, inset 2px 2px 0 #fff6a6, 2px 2px 0 rgba(0,0,0,.3);
}
.tournament-cup::after {
  content: "★";
  position: absolute;
  left: 18px;
  top: 12px;
  color: #7a4a00;
  font: 900 10px / 1 var(--font-mono);
}
.tournament-hero-copy,
.tournament-timer {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.tournament-hero-copy span,
.tournament-timer span,
.tournament-reward-slot span {
  color: #505050;
  font: 900 9px / 1 var(--font-ui);
  text-transform: uppercase;
}
.tournament-hero-copy strong {
  color: #000;
  font: 900 18px / 1 var(--font-ui);
}
.tournament-hero-copy p,
.tournament-timer small {
  margin: 0;
  color: #202020;
  font: 900 11px / 1.25 var(--font-mono);
  overflow-wrap: anywhere;
}
.tournament-timer {
  justify-items: end;
  padding: 7px;
  text-align: right;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.tournament-timer strong {
  color: #000080;
  font: 900 18px / 1 var(--font-mono);
}
.tournament-rewards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.tournament-reward-slot {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px;
  background: var(--win-face);
  box-shadow: var(--bevel-out);
}
.tournament-reward-slot strong,
.tournament-reward-slot small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tournament-reward-slot strong { color: #000; font: 900 12px / 1.1 var(--font-ui); }
.tournament-reward-slot small { color: #7a4a00; font: 900 10px / 1.1 var(--font-mono); }
.tournament-section { align-content: start; }

@media (max-width: 820px) {
  .leaderboard-modal-card,
  .tournament-modal-card { width: calc(100vw - 16px); }
  .leaderboard-toolbar span,
  .tournament-toolbar span { white-space: normal; overflow: visible; text-overflow: clip; }
  .leaderboard-switcher { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 5px; }
  .leaderboard-arrow { min-height: 62px; font-size: 24px; }
  .leaderboard-current { padding: 7px; }
  .leaderboard-current > span { min-width: 40px; }
  .leaderboard-current strong { font-size: 14px; }
  .leaderboard-current small { white-space: normal; overflow-wrap: anywhere; }
  .leaderboard-dots { grid-column: 1 / -1; gap: 5px; margin-top: 2px; }
  .leaderboard-dot { width: 26px; height: 10px; }
  .leaderboard-board,
  .tournament-board { grid-template-columns: minmax(0, 1fr); padding: 6px; }
  .tournament-hero { grid-template-columns: 36px minmax(0, 1fr); }
  .tournament-cup { width: 34px; height: 34px; background-size: auto; transform: scale(.82); transform-origin: top left; }
  .tournament-timer { grid-column: 1 / -1; justify-items: start; text-align: left; }
  .tournament-rewards { grid-template-columns: minmax(0, 1fr); }
  .leaderboard-row { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .leaderboard-main small { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  .leaderboard-value { grid-column: 2; justify-items: start; text-align: left; white-space: normal; }
}

.private-room-modal-card {
  width: min(520px, 100%);
  padding: 3px;
}
.private-room-modal-card.has-launcher {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}
.private-room-body {
  display: grid;
  gap: 9px;
  padding: 9px;
  color: #000;
  background: var(--win-face);
}
.private-room-modal-card.has-launcher .private-room-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.private-room-copy,
.private-room-status {
  margin: 0;
  color: #000;
  font: 900 12px / 1.35 var(--font-ui);
}
.private-room-status {
  padding: 7px 8px;
  background: #fff;
  box-shadow: var(--bevel-in);
  overflow-wrap: anywhere;
}
.private-room-field {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #000;
  font: 900 12px / 1 var(--font-ui);
}
.private-room-field input,
.private-room-link-row input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 0;
  padding: 5px 7px;
  color: #000;
  background: #fff;
  box-shadow: var(--bevel-in);
  font: 900 12px / 1 var(--font-mono);
}
.private-room-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.private-room-preset {
  min-height: 28px;
  padding-inline: 4px;
  font-size: 11px;
}
.private-room-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 7px;
  align-items: center;
}
.private-room-actions {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.private-room-launcher-wrap {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin-top: 2px;
}
.private-room-launcher-wrap[hidden] { display: none !important; }
.private-room-divider {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #000;
  font: 900 11px / 1 var(--font-mono);
  text-transform: uppercase;
}
.private-room-divider::before,
.private-room-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  min-width: 10px;
  background: var(--win-mid);
  box-shadow: 0 1px 0 var(--win-light);
}
.private-room-launcher-slot {
  min-width: 0;
  padding: 3px;
  background: #9a9a9a;
  box-shadow: var(--bevel-in);
}
.private-room-launcher-slot .launcher {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-shadow: none;
}
.private-room-launcher-slot .flow-shell {
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .8fr);
  gap: 8px;
  padding: 8px;
}
.private-room-launcher-slot .lobby-list {
  max-height: 132px;
}
.private-room-launcher-slot .players-card {
  min-height: 0;
}
@media (max-width: 820px) {
  .private-room-modal-card.has-launcher {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  .private-room-launcher-slot .flow-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "profile"
      "choose"
      "join"
      "players"
      "status"
      "log";
  }
}
@media (max-width: 520px) {
  .private-room-field,
  .private-room-link-row,
  .private-room-actions { grid-template-columns: minmax(0, 1fr); }
  .private-room-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.join-notice-card { width: min(440px, 100%); }
.join-notice-card h2 {
  margin: 0 0 8px;
  color: #000;
  font: 900 clamp(20px, 6vw, 28px) / 1.05 var(--font-ui);
}
.join-notice-warning {
  margin: 10px 0 0;
  padding: 8px;
  color: #000;
  background: #fff6a8;
  box-shadow: var(--bevel-in);
  font: 900 12px / 1.35 var(--font-ui);
}
.wallet-modal-card { width: min(380px, 100%); }
.wallet-modal-copy {
  margin: 0 0 10px;
  color: #000;
  font: 900 12px / 1.35 var(--font-ui);
}
.wallet-options {
  display: grid;
  gap: 7px;
  max-height: min(52vh, 330px);
  overflow: auto;
  padding: 4px;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.wallet-option {
  appearance: none;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 5px 8px;
  text-align: left;
  color: #000;
  background: var(--win-face);
  border: 0;
  box-shadow: var(--bevel-button);
  cursor: pointer;
  overflow: hidden;
}
.wallet-option:hover,
.wallet-option:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.wallet-option:active { transform: translate(1px, 1px); }
.wallet-option-icon {
  display: block;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 3px;
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--bevel-in);
  color: #000;
  font: 900 14px / 1 var(--font-ui);
  object-fit: contain;
  object-position: center;
  overflow: hidden;
}
.wallet-option span.wallet-option-icon {
  display: grid;
  place-items: center;
  padding: 0;
}
.wallet-option-copy { display: grid; gap: 2px; min-width: 0; }
.wallet-option-copy strong { font: 900 13px / 1.1 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-option-copy small { color: #404040; font: 900 10px / 1 var(--font-mono); }
.wallet-modal-close {
  appearance: none;
  position: absolute;
  top: 5px;
  right: 6px;
  z-index: 1;
  width: 16px;
  height: 14px;
  min-height: 0;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ping-details {
  margin: 10px 0 0;
  padding: 7px 8px;
  background: #fff;
  color: var(--danger);
  box-shadow: var(--bevel-in);
  overflow-wrap: anywhere;
  font: 900 12px / 1.35 var(--font-mono);
}
.modal-body { color: #000; }
.help-body {
  padding: 12px 8px 8px;
  background: var(--win-face);
}
.help-body h2 {
  margin: 0 0 6px;
  color: #000;
  font: 900 16px / 1.1 var(--font-ui);
}
.help-copy,
.help-subhead,
.help-note {
  margin: 0 0 8px;
  color: #000;
  font: 900 12px / 1.38 var(--font-ui);
}
.help-subhead { margin: 9px 0 5px; }
.help-list {
  margin: 0;
  padding-left: 20px;
  color: #000;
  font: 900 11px / 1.42 var(--font-ui);
}
.help-list li { margin: 0 0 5px; }
.help-list strong { font-family: var(--font-mono); }
.help-note {
  margin-top: 9px;
  padding: 6px 7px;
  background: #ffffe1;
  border: 1px solid #808080;
}
.help-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.modal-kicker { margin: 0 0 7px; color: #404040; font: 900 12px / 1.2 var(--font-ui); }
.modal-card h2 { margin: 0; color: #000; font: 900 clamp(22px, 8vw, 32px) / 1.05 var(--font-ui); }
.modal-card p:not(.modal-kicker) { color: #000; font-size: 13px; line-height: 1.4; }
.modal-card .help-body h2 { font: 900 16px / 1.1 var(--font-ui); }
.modal-card .help-copy,
.modal-card .help-subhead,
.modal-card .help-note { font: 900 12px / 1.38 var(--font-ui); }
.modal-card .help-list { font: 900 11px / 1.42 var(--font-ui); }
.tx-link { display: inline-block; max-width: 100%; color: var(--blue); font: 900 12px / 1.3 var(--font-mono); overflow-wrap: anywhere; text-decoration: underline; }
.result-leaderboard { margin: 12px 0; padding: 6px; max-height: min(42vh, 320px); overflow: auto; background: #fff; box-shadow: var(--bevel-in); }
.result-game-label { margin-bottom: 6px; font: 900 12px / 1.2 var(--font-ui); color: #000; }
.result-score-list { display: grid; gap: 6px; margin: 0; padding-left: 22px; }
.result-score-row { padding: 5px 6px; border-top: 1px dotted #808080; }
.result-score-main { color: #000; font: 900 13px / 1.2 var(--font-ui); }
.result-score-wallet,
.result-score-stats { margin-top: 2px; color: #303030; font: 900 11px / 1.25 var(--font-mono); overflow-wrap: anywhere; }
.modal-actions { display: grid; gap: 7px; width: min(260px, 100%); margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}


.players-card .roster-player {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 31px;
  gap: 7px;
  padding: 2px 4px;
}
.players-card .roster-name-btn {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 920px) {
  .flow-shell {
    grid-template-columns: minmax(0, 1fr) minmax(230px, .8fr);
    grid-template-areas:
      "profile profile"
      "choose join"
      "players players"
      "status status"
      "log log";
  }
  .hero { grid-template-columns: 1fr auto 1fr; }
  .players-card { grid-template-rows: auto auto; }
}

@media (max-width: 820px) {
  .shell {
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .mobile-nav {
    display: flex;
    position: sticky;
    top: max(6px, env(safe-area-inset-top));
  }
  .site-alert {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 5px 7px;
    font-size: 11px;
  }
  .site-alert strong {
    grid-column: 1 / -1;
    width: max-content;
    max-width: 100%;
  }
  .mobile-menu-toggle {
    display: inline-grid;
    place-items: center;
  }
  .desktop-icons { display: none; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 0;
    width: min(680px, calc(100vw - 16px));
    color: #000;
    text-shadow: none;
  }
  .brand-lockup { display: none; }
  .doc-copy { width: min(260px, 100%); }
  .wallet-step-group {
    grid-column: 1;
    width: 100%;
    justify-content: flex-start;
    gap: 7px;
    padding: 4px;
    background: var(--win-face);
    box-shadow: var(--bevel-out);
  }
  .wallet-step-number { flex: 0 0 18px; }
  .wallet-cta { flex: 1 1 auto; min-height: 32px; height: 32px; }
}

@media (max-width: 680px) {
  .shell {
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .mobile-nav {
    display: flex;
    position: sticky;
    top: max(6px, env(safe-area-inset-top));
  }
  .site-alert {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 5px 7px;
    font-size: 11px;
  }
  .site-alert strong {
    grid-column: 1 / -1;
    width: max-content;
    max-width: 100%;
  }
  .mobile-menu-toggle {
    display: inline-grid;
    place-items: center;
  }
  .desktop-icons { display: none; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 0;
    width: min(680px, calc(100vw - 16px));
    color: #000;
    text-shadow: none;
  }
  .brand-lockup { display: none; }
  .doc-copy { width: min(260px, 100%); }
  .wallet-step-group {
    grid-column: 1;
    width: 100%;
    justify-content: flex-start;
    gap: 7px;
    padding: 4px;
    background: var(--win-face);
    box-shadow: var(--bevel-out);
  }
  .wallet-step-number { flex: 0 0 18px; }
  .wallet-cta { flex: 1 1 auto; min-height: 32px; height: 32px; }
  .lede { font-size: 10px; }
  .flow-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "profile"
      "choose"
      "join"
      "players"
      "status"
      "log";
    gap: 8px;
    padding: 8px;
  }
  .step-title { font-size: 14px; }
  .profile-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .profile-card .wallet {
    position: static;
    display: block;
    margin: -5px 0 6px;
    padding: 0;
    background: transparent;
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
  }
  .profile-birb { width: 30px; height: 30px; }
  .name-field input { width: min(190px, calc(100vw - 92px)); height: 36px; min-height: 36px; font-size: 14px; }
  .color-menu { width: 100%; }
  .color-menu summary { grid-template-columns: 18px minmax(0, 1fr); height: 36px; min-height: 36px; font-size: 13px; }
  .color-picker { left: 0; right: auto; grid-template-columns: repeat(8, minmax(0, 1fr)); width: 100%; }
  .selected-lobby { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lobby-list { height: 168px; max-height: 168px; }
  .lobby-row { min-height: 32px; padding-block: 6px; }
  .lobby-main { font-size: 13px; }

  .profile-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-modal-card,
  .leaderboard-modal-card { width: calc(100vw - 16px); }
  .stats-toolbar span,
  .leaderboard-toolbar span { white-space: normal; overflow: visible; text-overflow: clip; }
  #stats-modal .stats-board { max-height: min(38dvh, 360px); padding: 6px; }
  #stats-modal .stats-history-list { max-height: min(22dvh, 220px); }
  .leaderboard-board { grid-template-columns: minmax(0, 1fr); padding: 6px; }
  .leaderboard-row { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .leaderboard-value { grid-column: 2; }
  .stats-hero,
  .stats-lower-grid { grid-template-columns: minmax(0, 1fr); }
  .stats-total-panel { min-height: 112px; }
  .stats-total-panel strong { font-size: clamp(30px, 13vw, 44px); }
  .stats-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-pool-row { grid-template-columns: 50px minmax(54px, 1fr) 74px; gap: 5px; font-size: 9px; }
  .stats-row { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .stats-row-value { grid-column: 2; }
  .telegram-popup {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
  }
  .telegram-popup-actions { justify-content: stretch; }
  .telegram-popup-actions .btn { flex: 1 1 120px; min-height: 38px; height: auto; }
  .history-game-head { display: grid; align-items: start; gap: 3px; }
  .history-player-list li { grid-template-columns: 32px minmax(0, 1fr); }
  .history-player-list li span:last-child { grid-column: 2; color: #505050; }
  .btn, .modal-actions .btn, .game-bar .btn { min-height: 38px; height: auto; padding-block: 7px; }
  .btn.accent { min-height: 40px; font-size: 13px; }
  .market-panel { padding: 7px; }
  .market-outcomes { max-height: 172px; }
  .market-outcome { min-height: 42px; }
  .market-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-tier, .market-bet-btn { min-height: 36px; }
  .game-wait-overlay {
    bottom: max(8px, env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
    padding: 8px 9px;
  }
  .game-wait-copy strong { font-size: 13px; }
  .game-wait-copy span,
  .game-wait-meta { font-size: 10px; }
  #join-btn { height: 40px; min-height: 40px; }
}

@media (max-width: 700px) and (orientation: portrait) {
  .game-panel {
    overflow: hidden;
  }
  .game-bar {
    position: relative;
    z-index: 2;
  }
  #game-frame {
    position: absolute;
    left: 50%;
    top: calc(50% + 16px);
    z-index: 1;
    width: min(
      calc((100vw - env(safe-area-inset-left) - env(safe-area-inset-right)) * 16 / 9),
      calc(100dvh - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom))
    );
    height: min(
      calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right)),
      calc((100dvh - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 9 / 16)
    );
    max-height: none;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
  }
  .rotate-phone-hint {
    display: none !important;
  }
  .rotate-phone-popup:not([hidden]) {
    display: grid;
    position: absolute;
    inset: 0;
    z-index: 3;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.24);
    pointer-events: none;
  }
  .game-panel.race-running .game-bar {
    position: absolute;
    top: max(6px, env(safe-area-inset-top));
    right: max(6px, env(safe-area-inset-right));
    left: auto;
    z-index: 4;
    min-height: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }
  .game-panel.race-running #game-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .game-panel.race-running .game-bar .btn {
    min-width: 72px;
    min-height: 24px;
    padding: 3px 6px;
    font-size: 10px;
    opacity: .78;
  }
  .game-panel.race-running #game-frame {
    top: 50%;
    width: min(
      calc((100vw - env(safe-area-inset-left) - env(safe-area-inset-right)) * 16 / 9),
      calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom))
    );
    height: min(
      calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right)),
      calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 9 / 16)
    );
  }
}

@media (max-width: 380px) {
  body { font-size: 13px; }
  h1 { font-size: clamp(34px, 16vw, 50px); }
  .win-titlebar { min-height: 26px; gap: 4px; padding: 3px; }
  .win-title { gap: 4px; font-size: 12px; }
  .sound-toggle { min-width: 42px; padding-inline: 3px; font-size: 9px; }
  .win-control { min-width: 17px; padding-inline: 2px; }
  .step-head { grid-template-columns: auto minmax(0, 1fr); }
  .step-head .server-pill,
  .step-head > .value { grid-column: 1 / -1; justify-self: start; }
  .step-head.compact { grid-template-columns: auto minmax(0, 1fr); }
  .wallet { grid-column: 1 / -1; justify-self: start; white-space: normal; }
  .selected-lobby { grid-template-columns: 1fr; }
}


/* 20260625 leaderboard/EasyA/maintenance polish */
.maintenance-notice {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  color: #000;
  background: #fff6a8;
  border: 1px solid #7a6400;
  box-shadow: var(--bevel-in);
  font: 900 11px / 1.25 var(--font-ui);
}
.maintenance-notice strong {
  font: 900 13px / 1 var(--font-mono);
  text-transform: uppercase;
}
.maintenance-notice span { color: #4c3a00; }
.lobby-row[data-maintenance="true"] {
  color: #3f3300;
  background: #fff6a8;
  cursor: not-allowed;
}
.lobby-row[data-maintenance="true"] .lobby-state {
  padding: 2px 5px;
  color: #000;
  background: #ffd84f;
  box-shadow: var(--bevel-button-down);
}
.lobby-row[aria-current="true"][data-maintenance="true"] {
  color: #000;
  background: #ffd84f;
}
#join-btn[disabled] { color: #4c3a00; }
#join-btn[disabled]:not([hidden]) { background: #fff6a8; }

@media (pointer: fine) and (min-width: 821px) {
  .draggable-window > .win-titlebar { cursor: grab; user-select: none; touch-action: none; }
  .draggable-window.is-window-dragging > .win-titlebar { cursor: grabbing; }
  .draggable-window.is-window-dragging { box-shadow: var(--bevel-out), 6px 6px 0 rgba(0,0,0,.55); }
}

.keycap-shortcut .desktop-label { margin-top: 1px; }
.keycap-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 36px;
  border: 1px solid #000;
  border-radius: 6px;
  color: #070707;
  background: #e7e2d7;
  text-shadow: none;
  box-shadow: inset -4px -4px 0 #8f897e, inset 3px 3px 0 #fff, 3px 3px 0 rgba(0,0,0,.48);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}
.keycap-icon span { font: 900 15px / 1 var(--font-mono); letter-spacing: 0; }
.easya-keycap-icon {
  background: #52ffa1;
  box-shadow: inset -4px -4px 0 #169655, inset 3px 3px 0 #caffdf, 3px 3px 0 rgba(0,0,0,.48);
}
.easya-keycap-icon img { display: block; width: 26px; height: 26px; object-fit: contain; }
.keycap-shortcut:hover .keycap-icon,
.keycap-shortcut:focus-visible .keycap-icon { transform: translate(-1px, -1px); }
.keycap-shortcut:active .keycap-icon,
.keycap-shortcut.is-pressed .keycap-icon,
.mobile-menu-item:active .keycap-icon,
.mobile-menu-item.is-pressed .keycap-icon {
  transform: translate(2px, 2px);
  box-shadow: inset 3px 3px 0 rgba(0,0,0,.38), inset -1px -1px 0 rgba(255,255,255,.72), 1px 1px 0 rgba(0,0,0,.4);
}
.ca-shortcut:hover .social-copy,
.ca-shortcut:focus-visible .social-copy,
.easya-shortcut:hover .social-copy,
.easya-shortcut:focus-visible .social-copy { display: block; }
.mobile-menu-icon.keycap-icon {
  width: 34px;
  height: 28px;
  justify-self: center;
  box-shadow: inset -3px -3px 0 #8f897e, inset 2px 2px 0 #fff, 2px 2px 0 rgba(0,0,0,.42);
}
.mobile-menu-icon.keycap-icon span { font-size: 12px; }
.mobile-menu-icon.easya-keycap-icon {
  box-shadow: inset -3px -3px 0 #169655, inset 2px 2px 0 #caffdf, 2px 2px 0 rgba(0,0,0,.42);
}
.mobile-menu-icon.easya-keycap-icon img { width: 20px; height: 20px; }

.leaderboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 31px;
  padding: 0;
  background: #fff;
  box-shadow: var(--bevel-in);
}
.leaderboard-row-button {
  appearance: none;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 31px;
  padding: 5px 6px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.leaderboard-row:not(.is-clickable) {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 5px 6px;
}
.leaderboard-row.is-clickable:hover,
.leaderboard-row.is-clickable:focus-within {
  background: #ffffe1;
  box-shadow: var(--bevel-button);
}
.leaderboard-row.is-clickable:active .leaderboard-row-button { transform: translate(1px, 1px); }
.leaderboard-row-button:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
@media (max-width: 820px) {
  .leaderboard-row:not(.is-clickable),
  .leaderboard-row-button { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .leaderboard-value { grid-column: 2; justify-items: start; text-align: left; }
}
