@import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;700;800;900&display=swap");

:root {
  --dd-orange: #ff7a00;
  --dd-orange-2: #f3aa14;
  --dd-green: #2fad5c;
  --dd-brown: #493019;
  --dd-text: #332619;
  --dd-muted: #7b6857;
  --dd-card: rgba(255, 250, 240, .90);
  --dd-line: rgba(126, 77, 20, .16);
  --dd-shadow: 0 24px 55px rgba(153, 82, 0, .20);
  --dd-shell-width: min(1984px, calc(100% - 64px));
  --dd-shell-width-mobile: min(100% - 24px, 760px);
}

[hidden] {
  display: none !important;
}

[hidden] {
  display: none !important;
}

html.auth-pending body.public-mode #publicHero,
html.auth-pending body.public-mode #play,
html.auth-pending body.public-mode #lobbyGate,
html.auth-pending body.public-mode #marketingShowcase {
  visibility: hidden;
}

body.district-page,
body:not(.public-mode) {
  font-family: Inter, system-ui, sans-serif;
  color: var(--dd-text);
  padding-bottom: 78px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 85%, rgba(255,255,255,.75), transparent 18%),
    radial-gradient(circle at 82% 15%, rgba(255,255,255,.70), transparent 18%),
    linear-gradient(180deg, #ffe88f 0%, #ffc548 45%, #ff8b2a 100%);
  background-attachment: fixed, fixed, fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

body.district-page::before,
body:not(.public-mode)::before {
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.16) 0 13px, transparent 13px 26px);
  opacity: .35;
}

body.district-page::after,
body:not(.public-mode)::after {
  content: "";
  position: fixed;
  left: -180px;
  bottom: -70px;
  width: 520px;
  height: 520px;
  border: 18px solid rgba(255,255,255,.18);
  border-radius: 50%;
  box-shadow: inset 0 0 0 28px rgba(255,255,255,.08);
  opacity: .55;
  pointer-events: none;
}

body.district-page .shell,
body:not(.public-mode) .shell {
  width: var(--dd-shell-width);
  margin-left: auto;
  margin-right: auto;
}

body.district-page .topbar,
body:not(.public-mode) .topbar {
  position: relative;
  z-index: 1000;
  padding: 10px 0 0;
  background: transparent;
  backdrop-filter: none;
}

body.district-page .logo-row,
body:not(.public-mode) .logo-row {
  display: none;
}

body.district-page .nav,
body.district-page .nav-shell,
body.district-page .topbar-inner,
body:not(.public-mode) .nav-shell,
body:not(.public-mode) .topbar-inner {
  min-height: 92px;
  height: auto;
  background: rgba(255,250,235,.78);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.70);
  border-radius: 0 0 28px 28px;
  box-shadow: var(--dd-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  overflow: visible;
}

body.district-page .brand,
body:not(.public-mode) .brand {
  display: flex;
  position: static;
  width: 150px;
  height: 78px;
  flex: 0 0 auto;
  border-right: 1px solid var(--dd-line);
  padding-right: 18px;
  overflow: hidden;
  font-size: 0;
}

body.district-page .brand > span:not(.mark),
body:not(.public-mode) .brand > span:not(.mark) {
  display: none;
}

body.district-page .mark,
body:not(.public-mode) .mark {
  width: 122px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: transparent url("logo.png") center / contain no-repeat;
  border: 0;
  box-shadow: none;
}

body.district-page .mark::before,
body:not(.public-mode) .mark::before {
  content: none;
}

body.district-page .nav-links,
body.district-page .game-nav,
body:not(.public-mode) .nav-links,
body:not(.public-mode) .game-nav {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  flex: 1;
  flex-wrap: wrap;
}

body.district-page .top-actions,
body.district-page .nav-actions,
body:not(.public-mode) .top-actions,
body:not(.public-mode) .nav-actions {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  gap: 14px;
  flex-wrap: wrap;
}

body.district-page .nav-links a,
body.district-page .game-nav a,
body.district-page .nav-news-btn,
body.district-page .nav-help-btn,
body.district-page .pill,
body:not(.public-mode) .nav-links a,
body:not(.public-mode) .nav-news-btn,
body:not(.public-mode) .nav-help-btn,
body:not(.public-mode) .pill,
body.district-page .session-name,
body:not(.public-mode) .session-name {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 15px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.86);
  box-shadow: 0 12px 24px rgba(105,60,0,.12);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 900;
  color: #4b321c;
  text-decoration: none;
}

body.district-page .nav-links a.active,
body.district-page .game-nav a.active,
body:not(.public-mode) .nav-links a.active {
  color: var(--dd-orange);
}

.connection-state.warn {
  color: #8c5a00;
  background: #fff2bd;
}

.connection-state.bad {
  color: #fff;
  background: linear-gradient(180deg, #ff7575, #ff4f4f);
}

body.district-page .nav-news-btn,
body.district-page .nav-help-btn,
body:not(.public-mode) .nav-news-btn,
body:not(.public-mode) .nav-help-btn {
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.86);
}

.nav-icon {
  color: var(--dd-orange);
  font-weight: 900;
}

.new {
  background: #ff5360;
  color: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
}

body:not(.public-mode) .nav-news-btn > span:last-child {
  background: #ff5360;
  color: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
}

.profileMenu {
  position: relative;
  z-index: 1200;
}

.user {
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 15px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 12px 24px rgba(105,60,0,.12);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4b321c;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.user::after {
  content: none;
}

.mini-avatar,
.user .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff, #b8752b);
  border: 3px solid #fff;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.avatar.has-image,
.mini-avatar.has-image,
.user .avatar.has-image {
  background-color: #fff;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: transparent;
  overflow: hidden;
}

.avatar-upload {
  min-height: 76px;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--dd-line);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 10px 22px rgba(105,60,0,.08);
  font-weight: 900;
}

.avatar-upload input {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.avatar-upload small {
  display: block;
  margin-top: 3px;
  color: var(--dd-muted);
  font-size: 12px;
  line-height: 1.2;
}

.small {
  display: block;
  color: #d27800;
  font-size: 13px;
  line-height: 1.1;
}

.dropdown {
  position: absolute;
  z-index: 1300;
  top: 66px;
  right: 0;
  width: 220px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 18px;
  background: rgba(255,250,240,.97);
  box-shadow: 0 24px 55px rgba(88,45,0,.22);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: .18s ease;
}

.profileMenu:hover .dropdown,
.profileMenu:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a,
.dropdown button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: #4b321c;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.dropdown a:hover,
.dropdown button:hover {
  background: rgba(255,122,0,.10);
  color: #e66700;
}

.dropdown .danger {
  color: #f04c3f;
  border-top: 1px solid var(--dd-line);
  margin-top: 6px;
}

.mobileToggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hamburger {
  display: none;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(255,255,255,.90);
  box-shadow: 0 12px 24px rgba(105,60,0,.12);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  flex: 0 0 auto;
}

.hamburger span {
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: #d86900;
  display: block;
}

.mobileBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 7000;
  background: rgba(68,34,0,.28);
  backdrop-filter: blur(3px);
}

.mobileDrawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(88vw, 360px);
  height: 100dvh;
  z-index: 7100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px calc(32px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(255,251,240,.98), rgba(255,238,196,.96));
  border-right: 1px solid rgba(255,255,255,.80);
  box-shadow: 30px 0 70px rgba(104,54,0,.25);
  transform: translateX(-110%);
  transition: transform .26s ease;
}

.mobileToggle:checked ~ .mobileBackdrop {
  display: block;
}

.mobileToggle:checked ~ .mobileDrawer {
  transform: translateX(0);
}

.drawerTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.drawerLogo {
  width: 112px;
  height: 58px;
  border-radius: 0;
  background: transparent url("logo.png") center / contain no-repeat;
  border: 0;
  box-shadow: none;
}

.drawerClose {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #e66700;
  font-size: 32px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(105,60,0,.12);
  cursor: pointer;
}

.drawerProfile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--dd-line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: 0 10px 22px rgba(105,60,0,.08);
  font-weight: 900;
}

.drawerProfile span:not(.mini-avatar) {
  display: block;
  color: #d27800;
  font-size: 13px;
}

.drawerLink,
.drawerCoffee,
.drawerLogout {
  min-height: 52px;
  text-decoration: none;
  border-radius: 16px;
  padding: 0 17px;
  font-weight: 900;
  color: #4b321c;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 10px 20px rgba(105,60,0,.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawerLink.active {
  color: var(--dd-orange);
  background: #fff;
}

.drawerLink em {
  font-style: normal;
  background: #35bd61;
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.drawerLink em.red {
  background: #ff5360;
}

.drawerCoffee {
  margin-top: auto;
  justify-content: center;
  background: linear-gradient(135deg, #ffbd55, #ff7e21);
  color: #fff;
}

.drawerLogout {
  background: linear-gradient(135deg, #ff746f, #f04c3f);
  color: #fff;
  justify-content: center;
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 76px;
  z-index: 9000;
  width: min(360px, calc(100vw - 28px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.88), transparent 42%),
    linear-gradient(135deg, rgba(255,250,238,.98), rgba(255,228,174,.96));
  box-shadow: 0 22px 50px rgba(88,45,0,.24), inset 0 -4px 0 rgba(228,178,71,.34);
  color: var(--dd-text);
  text-align: left;
  font: inherit;
  font-weight: 900;
  animation: toastIn .22s ease-out;
}

.toast strong {
  color: #d75d00;
  font-size: 14px;
}

.toast span {
  color: var(--dd-muted);
  font-size: 13px;
  line-height: 1.25;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.news-message {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(126,77,20,.12);
  box-shadow: inset 0 -4px 0 rgba(228,178,71,.30);
  font-weight: 800;
}

body.district-page .lobby-badge,
body:not(.public-mode) .lobby-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #35bd61;
  color: #fff;
  border-radius: 999px;
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}

.lobby-badge.invite-blink,
#drawerLobbyCount.invite-blink {
  animation: invitePulse 1s ease-in-out infinite;
}

@keyframes invitePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(53,189,97,.36); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 7px rgba(53,189,97,0); }
}

.lobby-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

body.district-page .layout:has(.lobby-tools) {
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
}

body.district-page .layout:has(.lobby-tools) > section {
  display: grid;
  gap: 18px;
}

.lobby-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  margin: 0 0 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(126,77,20,.10);
  box-shadow: inset 0 -4px 0 rgba(228,178,71,.22);
}

.lobby-tab {
  min-height: 44px;
  min-width: 150px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--dd-brown);
  font-weight: 900;
  cursor: pointer;
}

.lobby-tab.active {
  background: linear-gradient(135deg, #ffb546, #ff7a00);
  color: #fff;
  box-shadow: 0 8px 18px rgba(225,105,0,.20);
}

body.district-page .layout:has(.lobby-tools) .hero {
  min-height: 248px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-content: center;
  padding: 30px 36px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.82), rgba(255,248,225,.68)),
    radial-gradient(circle at 86% 48%, rgba(255,122,0,.18), transparent 22%);
}

body.district-page .layout:has(.lobby-tools) .hero h1 {
  max-width: 780px;
  font-size: clamp(48px, 5vw, 76px);
}

.lobby-kicker {
  justify-self: start;
  background: linear-gradient(135deg, #ffb06b, #ff8a3a);
  color: #fff;
}

.lobby-hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  align-content: center;
}

.lobby-hero-stats > div {
  min-height: 86px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(126,77,20,.12);
  box-shadow: 0 14px 28px rgba(105,60,0,.11);
}

.lobby-hero-stats span {
  display: block;
  color: #b76010;
  font-size: 13px;
  font-weight: 900;
}

.lobby-hero-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--dd-orange);
  font-size: 34px;
  line-height: 1;
}

body.district-page .layout:has(.lobby-tools) .panel:not(.hero) {
  padding: 26px;
}

body.district-page .lobby-tools {
  grid-template-columns: minmax(240px, 1fr) 150px 150px auto;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.64);
}

body.district-page .lobby-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 116px;
  border-radius: 26px;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 92% 30%, rgba(255,122,0,.14), transparent 26%),
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,247,225,.74));
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: 0 14px 28px rgba(105,60,0,.12), inset 0 -5px 0 rgba(228,178,71,.40);
  transition: transform .16s ease, box-shadow .16s ease;
}

.lobby-card-main h3 {
  margin: 0;
  color: var(--dd-text);
  font-size: 22px;
  line-height: 1.05;
}

.lobby-card-sub {
  margin-top: 4px;
  color: var(--dd-muted);
  font-size: 13px;
  font-weight: 800;
}

.lobby-card-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.lobby-card-actions .btn {
  min-width: 118px;
}

.tag.lock {
  background: #fff0c9;
  color: #b76010;
}

.tag.invite {
  background: #e8ffdf;
  color: #23914b;
}

body.district-page .lobby-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(105,60,0,.16), inset 0 -5px 0 rgba(228,178,71,.46);
}

body.district-page .layout:has(.lobby-tools) .chat-panel {
  min-height: 640px;
  position: sticky;
  top: 120px;
}

body.district-page .layout:has(.lobby-tools) .messages {
  min-height: 455px;
}

.lobby-host-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  border: 3px solid #fff;
  background: #fff url("images/dart-avatar.png") center / cover no-repeat;
  box-shadow: 0 10px 18px rgba(105,60,0,.14);
}

body.district-page .panel,
body.district-page .modal,
body.district-page .settings-modal,
body.district-page .leave-modal,
body.district-page .lobby-card,
body.district-page .message,
body.district-page .empty,
body:not(.public-mode) .panel,
body:not(.public-mode) .modal,
body:not(.public-mode) .lobby-card,
body:not(.public-mode) .empty {
  background: var(--dd-card);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 26px;
  box-shadow: var(--dd-shadow);
  backdrop-filter: blur(15px);
}

body.district-page .modal-backdrop,
body.district-page .settings-overlay,
body.district-page .leave-overlay,
body:not(.public-mode) .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12500;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(69,34,0,.44);
  backdrop-filter: blur(8px);
}

body.district-page .settings-modal,
body.district-page #settingsForm.modal,
body:not(.public-mode) #settingsForm.modal {
  width: min(640px, 100%);
  padding: 22px;
  display: grid;
  gap: 14px;
}

body.district-page .bug-modal-backdrop,
body.district-page .moderation-modal-backdrop,
body.district-page .help-modal-backdrop {
  z-index: 12500 !important;
}

body.district-page .modal-head,
body:not(.public-mode) .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

body.district-page .modal-actions,
body:not(.public-mode) .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body.district-page .check-row,
body:not(.public-mode) .check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  background: #fff;
  border-radius: 18px;
  padding: 0 14px;
  box-shadow: 0 5px 0 #edc05f;
  font-weight: 900;
}

body.district-page .check-row input[type="checkbox"],
body:not(.public-mode) .check-row input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  margin-left: auto;
  accent-color: #58d348;
}

body.district-page .volume-row input[type="range"],
body:not(.public-mode) .volume-row input[type="range"] {
  width: min(220px, 45%);
  min-height: 24px;
  border: 0;
  padding: 0;
  accent-color: #58d348;
}

body.district-page .language-row,
body:not(.public-mode) .language-row {
  justify-content: flex-start;
}

body.district-page .language-row select,
body:not(.public-mode) .language-row select {
  width: min(240px, 58%);
  margin-left: auto;
  min-height: 46px;
  box-shadow: none;
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.72);
}

.settings-tab {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #6f5842;
  font-weight: 900;
  cursor: pointer;
}

.settings-tab.active {
  background: linear-gradient(135deg, #ffb546, #ff7a00);
  color: #fff;
  box-shadow: 0 8px 18px rgba(225, 105, 0, .20);
}

.board-color-row input[type="color"] {
  width: 46px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.delete-account-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(126,77,20,.10);
  box-shadow: inset 0 -4px 0 rgba(255,88,82,.18);
}

.delete-account-panel h3 {
  margin: 0;
  color: #e05f00;
}

.delete-account-panel p {
  margin: 3px 0 0;
  color: var(--dd-muted);
  font-weight: 800;
}

.delete-account-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.delete-account-actions input {
  min-width: 0;
}

.bug-modal textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 3px solid #f1c763;
  border-radius: 18px;
  padding: 14px;
  color: var(--dd-brown);
  font: inherit;
  font-weight: 700;
  outline: none;
}

.bug-modal textarea:focus {
  border-color: #35bd61;
  box-shadow: 0 0 0 4px rgba(53,189,97,.14);
}

body.district-page select,
body:not(.public-mode) select {
  width: 100%;
  min-height: 52px;
  appearance: none;
  -webkit-appearance: none;
  border: 3px solid #f1c763;
  border-radius: 18px;
  padding: 0 46px 0 14px;
  outline: none;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #673600 50%),
    linear-gradient(135deg, #673600 50%, transparent 50%),
    linear-gradient(135deg, #fff, #fff8e7);
  background-position:
    calc(100% - 21px) 50%,
    calc(100% - 15px) 50%,
    0 0;
  background-size: 7px 7px, 7px 7px, 100% 100%;
  background-repeat: no-repeat;
  color: var(--dd-brown);
  font-weight: 900;
  box-shadow: 0 6px 0 #edc05f, 0 14px 24px rgba(105,60,0,.08);
}

body.district-page select:focus,
body:not(.public-mode) select:focus {
  border-color: #35bd61;
  box-shadow: 0 6px 0 #2f9827, 0 0 0 4px rgba(53,189,97,.16);
}

body.district-page .layout:has(.lobby-tools) .lobby-card {
  background:
    radial-gradient(circle at 92% 30%, rgba(255,122,0,.14), transparent 26%),
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,247,225,.78));
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: 0 14px 28px rgba(105,60,0,.12), inset 0 -5px 0 rgba(228,178,71,.40);
}

body.district-page h1,
body.district-page h2,
body.district-page h3,
body:not(.public-mode) h1,
body:not(.public-mode) h2,
body:not(.public-mode) h3 {
  color: var(--dd-text);
  text-shadow: none;
  letter-spacing: 0;
}

body.district-page h2,
body:not(.public-mode) h2 {
  color: #d86a00;
  font-size: 22px;
}

body.district-page p,
body.district-page small,
body:not(.public-mode) p,
body:not(.public-mode) small {
  color: var(--dd-muted);
}

body.district-page .btn,
body:not(.public-mode) .btn {
  border-radius: 12px;
  border: 0;
  box-shadow: 0 14px 25px rgba(141,65,0,.18);
  text-transform: none;
}

body.district-page .btn:hover,
body:not(.public-mode) .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(141,65,0,.25);
}

body.district-page .btn.primary,
body.district-page .btn.green,
body:not(.public-mode) .btn.green {
  background: linear-gradient(135deg, #55c878, #23914b);
  color: #fff;
}

body.district-page .btn.orange,
body.district-page .btn.gold,
body:not(.public-mode) .btn.orange {
  background: linear-gradient(135deg, #f6b21d, #ef6f00);
  color: #fff;
}

body.district-page .btn.blue,
body:not(.public-mode) .btn.blue {
  background: linear-gradient(135deg, #46baf6, #237ad7);
  color: #fff;
}

body.district-page .btn.red,
body:not(.public-mode) .btn.red {
  background: linear-gradient(135deg, #ff746f, #f04c3f);
  color: #fff;
}

body.district-page .nav-actions #logoutBtn,
body:not(.public-mode) .nav-actions #logoutBtn,
body.district-page .top-actions #logoutBtn {
  min-height: 54px;
  padding: 0 28px;
  border-radius: 15px;
  background: linear-gradient(135deg, #ff746f, #f04c3f);
  color: #fff;
  box-shadow: 0 12px 24px rgba(190,60,52,.20);
}

body.district-page .nav-actions #leaveBtn,
body.district-page .top-actions #leaveBtn {
  min-height: 54px;
  padding: 0 28px;
  border-radius: 15px;
  background: linear-gradient(135deg, #ffb347, #ff7a00);
  color: #fff;
  box-shadow: 0 12px 24px rgba(190,95,0,.20);
}

body.district-page .nav-actions #settingsBtn,
body:not(.public-mode) .nav-actions #settingsBtn,
body.district-page .top-actions #settingsBtn {
  min-height: 54px;
  padding: 0 28px;
  border-radius: 15px;
  background: rgba(255,255,255,.72);
  color: #4b321c;
  box-shadow: 0 12px 24px rgba(105,60,0,.12);
}

body:not(.public-mode) .dashboard {
  grid-template-columns: 1.08fr .92fr;
  gap: 24px;
  padding-top: 46px;
  align-items: start;
}

body:not(.public-mode) .dashboard-hero {
  overflow: hidden;
  padding: 32px;
}

body:not(.public-mode) .label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 13px;
  padding: 0 16px;
  background: linear-gradient(135deg, #ffb06b, #ff8a3a);
  color: #fff;
  font-weight: 900;
}

body:not(.public-mode) .dashboard-title-row {
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 24px;
}

body:not(.public-mode) .dashboardIntro {
  min-width: 0;
}

body:not(.public-mode) .heroTitleLine {
  display: flex;
  align-items: center;
  gap: 18px;
}

body:not(.public-mode) .dashboard-hero h1 {
  font-size: 45px;
  line-height: 1.04;
  margin: 24px 0 16px;
  font-weight: 900;
  color: var(--dd-text);
}

body:not(.public-mode) .heroTitleLine h1 {
  margin-bottom: 14px;
}

body:not(.public-mode) .dashboard-hero h1 span {
  background: linear-gradient(90deg, #f5b400, #f07800);
  -webkit-background-clip: text;
  color: transparent;
  text-transform: uppercase;
}

.ocheMark {
  width: 158px;
  height: 118px;
  flex: 0 0 158px;
  align-self: center;
  background: transparent url("images/dartdashboard.png") center / contain no-repeat;
  filter: drop-shadow(0 18px 22px rgba(173, 82, 0, .20));
}

body:not(.public-mode) .dashboard-record {
  display: grid;
  grid-template-columns: 1fr;
  gap: 17px;
}

body:not(.public-mode) .record-card,
body:not(.public-mode) .stat,
body:not(.public-mode) .scoreStat,
body:not(.public-mode) .recent-match-row {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--dd-line);
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(87,50,0,.10);
}

body:not(.public-mode) .record-card {
  min-height: 118px;
  padding: 24px 26px;
  align-content: center;
}

body:not(.public-mode) .stat span,
body:not(.public-mode) .scoreStat span {
  color: #b76010;
  text-transform: none;
  font-size: 13px;
  font-weight: 900;
}

body:not(.public-mode) .record-card > span {
  color: #b76010;
  text-transform: none;
  font-size: 13px;
  font-weight: 900;
}

body:not(.public-mode) .record-card strong {
  display: block;
  margin-top: 10px;
  font-size: 38px;
  color: var(--dd-text);
}

body:not(.public-mode) .record-card strong span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
}

body:not(.public-mode) .record-card:nth-child(2) strong {
  color: var(--dd-orange);
  font-size: 42px;
}

body:not(.public-mode) .stat {
  min-height: 86px;
  padding: 18px 22px;
}

body:not(.public-mode) .stat strong,
body:not(.public-mode) .scoreStat strong {
  display: block;
  margin-top: 6px;
  color: #be5600;
  font-size: 22px;
}

.icon-stat::before {
  content: attr(data-icon);
  display: inline-block;
  margin-right: 12px;
  color: var(--dd-orange);
  font-size: 25px;
  line-height: 1;
  vertical-align: middle;
}

body:not(.public-mode) .dash-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

body:not(.public-mode) .score-panel {
  margin: 20px -32px -32px;
  padding: 24px 32px 28px;
  background: rgba(255,255,255,.42);
  border-top: 1px solid var(--dd-line);
}

body:not(.public-mode) .score-buckets {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.xp-card {
  overflow: hidden;
}

.xp-bar {
  width: 100%;
  height: 12px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(126,77,20,.14);
}

.xp-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f5b400, #ff7a00);
  transition: width .25s ease;
}

.xp-progress {
  display: block;
  margin-top: 8px;
  color: var(--dd-muted);
  font-weight: 800;
  font-size: 12px;
}

.recent-matches-panel {
  padding: 24px 28px;
  position: relative;
}

.dashboard-side {
  display: grid;
  gap: 22px;
  position: relative;
}

.dashboard-carousel-controls {
  position: absolute;
  top: 26px;
  right: 28px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,248,226,.84));
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 14px 30px rgba(105,60,0,.12);
}

.carousel-arrow {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffbd55, #ff7e21);
  color: #fff;
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.carousel-tabs {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.carousel-tabs span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(154,90,0,.24);
}

.carousel-tabs span.active {
  width: 28px;
  background: #ff7a00;
}

body[data-dashboard-slide="0"] .recent-matches-panel,
body[data-dashboard-slide="1"] .chart-panel {
  display: none;
}

body:not(.public-mode) .chart-panel {
  padding: 32px;
  position: relative;
}

.chartHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  min-height: 86px;
  padding-right: 352px;
}

.select,
.view {
  border: 0;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,250,236,.90));
  color: #d75d00;
  padding: 14px 18px;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(105,60,0,.10), inset 0 -4px 0 rgba(228,178,71,.18);
}

.chartHead .select,
.recent-matches-panel .view {
  position: absolute;
  top: 26px;
  right: 202px;
  display: inline-grid;
  align-content: center;
  justify-content: center;
  min-width: 132px;
  min-height: 58px;
  text-align: left;
}

.recent-matches-panel .view {
  min-width: 116px;
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease, box-shadow .12s ease;
}

.recent-matches-panel .view:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(105,60,0,.14), inset 0 -4px 0 rgba(228,178,71,.22);
}

body:not(.public-mode) .chart-wrap {
  min-height: 244px;
  margin-top: 20px;
  position: relative;
  overflow: visible;
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,255,255,.98), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(255,195,87,.16), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,246,218,.82));
  padding: 20px;
  border: 1px solid rgba(255,255,255,.74);
  box-shadow: inset 0 -7px 0 rgba(228,178,71,.30), 0 22px 44px rgba(105,60,0,.12);
}

body:not(.public-mode) .chart-wrap::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.28) 0 1px, transparent 1px) 0 0 / 20% 100%,
    linear-gradient(0deg, rgba(126,77,20,.10) 0 1px, transparent 1px) 0 0 / 100% 25%;
  pointer-events: none;
}

body:not(.public-mode) .chart-wrap canvas {
  position: relative;
  z-index: 1;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 118px;
  transform: translate(-50%, calc(-100% - 16px));
  pointer-events: none;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: #4b321c;
  box-shadow: 0 14px 28px rgba(87,50,0,.18);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.chart-tooltip strong {
  display: block;
  color: var(--dd-orange);
  font-size: 18px;
  line-height: 1.05;
}

.select small {
  display: block;
  margin-top: 4px;
  color: var(--dd-muted);
  font-size: 11px;
  line-height: 1.1;
}

body:not(.public-mode) .chart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

body:not(.public-mode) .chart-actions .btn {
  position: relative;
  overflow: hidden;
  min-height: 84px;
  justify-content: flex-start;
  padding: 20px 26px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 900;
  text-align: left;
  box-shadow: 0 18px 34px rgba(105,60,0,.16), inset 0 -5px 0 rgba(105,60,0,.14);
}

body:not(.public-mode) .chart-actions .btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(255,255,255,.24), transparent 38%);
  opacity: .85;
  pointer-events: none;
}

body:not(.public-mode) .chart-actions .btn:hover {
  transform: translateY(-3px);
}

body:not(.public-mode) .chart-actions .btnIcon {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  margin-right: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.20);
  box-shadow: inset 0 -3px 0 rgba(105,60,0,.10);
}

.btnIcon {
  font-size: 28px;
  line-height: 1;
}

body:not(.public-mode) .chart-actions small {
  display: block;
  color: rgba(255,255,255,.92);
  font-weight: 800;
}

.matchHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding-right: 352px;
}

.recent-match-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.recent-match-row {
  display: grid;
  grid-template-columns: 28px 76px 1fr 86px 110px;
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  border-radius: 0;
  border-width: 0 0 1px;
  box-shadow: none;
  background: transparent;
  font-weight: 900;
}

.match-icon {
  font-size: 17px;
  line-height: 1;
}

body.district-page .hero {
  position: relative;
  overflow: hidden;
}

body.district-page .hero h1,
body.district-page .news-hero h1 {
  max-width: 860px;
  font-size: 45px;
  line-height: 1.04;
  color: var(--dd-text);
  text-shadow: none;
  letter-spacing: 0;
  margin: 24px 0 16px;
  font-weight: 900;
}

body.district-page .hero p,
body.district-page .news-hero p {
  max-width: 760px;
  margin-top: 12px;
  color: var(--dd-muted);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

body.district-page .hero h1 strong,
body.district-page .hero h1 span,
body.district-page .news-hero h1 strong,
body.district-page .news-hero h1 span {
  background: linear-gradient(90deg, #f5b400, #f07800);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: uppercase;
}

body.district-page .tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--dd-orange);
  box-shadow: 0 5px 0 #edc05f;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 14px;
}

body.game-page .panel-title .tag {
  justify-content: center;
  min-width: 82px;
  min-height: 30px;
  margin-bottom: 0;
  text-transform: none;
  line-height: 1;
}

body.game-page .tag.status-waiting,
body.game-page .tag.status-starting {
  background: #fff0ba;
  color: #94650d;
}

body.game-page .tag.status-playing {
  background: #e8ffdf;
  color: #23941b;
}

body.game-page .tag.status-finished {
  background: #ffe0df;
  color: #c53232;
}

body.district-page .hero::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 24px;
  width: 170px;
  height: 130px;
  background: transparent url("images/dartdashboard.png") center / contain no-repeat;
  opacity: .34;
  filter: drop-shadow(0 20px 28px rgba(173,82,0,.16));
  pointer-events: none;
}

body.district-page .ranking-list {
  gap: 12px;
}

body.district-page .ranking-card {
  position: relative;
  grid-template-columns: 66px minmax(250px, 1.15fr) repeat(7, minmax(82px, 1fr)) 148px;
  border: 1px solid rgba(255,255,255,.80);
  border-radius: 22px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 12px 26px rgba(105,60,0,.10), inset 0 -5px 0 rgba(228,178,71,.42);
  transition: transform .16s ease, box-shadow .16s ease;
}

.rank-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 18px 0 4px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.64);
}

.player-link,
.friend-name {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.player-link:hover,
.friend-name:hover strong {
  color: var(--dd-orange);
}

.rank-action {
  justify-self: end;
  width: 148px;
  display: flex;
  justify-content: flex-end;
}

.rank-action .btn,
.friend-actions .btn {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.friend-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(47,173,92,.14);
  color: #23914b;
  font-weight: 900;
  font-size: 13px;
}

.language-flag,
.chat-flag {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  font-size: 16px;
  line-height: 1;
}

.flag-badge {
  width: 28px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 28px;
  border-radius: 5px;
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 2px 5px rgba(72,40,0,.18);
  overflow: hidden;
  vertical-align: middle;
}

.flag-en {
  background:
    linear-gradient(90deg, transparent 0 42%, #cf142b 42% 58%, transparent 58%),
    linear-gradient(transparent 0 38%, #cf142b 38% 62%, transparent 62%),
    #fff;
}

.flag-nl { background: linear-gradient(#ae1c28 0 33%, #fff 33% 66%, #21468b 66%); }
.flag-de { background: linear-gradient(#000 0 33%, #dd0000 33% 66%, #ffce00 66%); }
.flag-fr { background: linear-gradient(90deg, #0055a4 0 33%, #fff 33% 66%, #ef4135 66%); }
.flag-es { background: linear-gradient(#aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%); }

.friend-chip.pending {
  background: rgba(255,122,0,.14);
  color: #d75d00;
}

.modal-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255,255,255,.48);
  border: 1px solid rgba(126,77,20,.10);
}

.modal-tab {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--dd-muted);
  font-weight: 900;
  cursor: pointer;
}

.modal-tab.active {
  background: linear-gradient(135deg, #ffbd55, #ff7e21);
  color: #fff;
  box-shadow: 0 10px 20px rgba(141,65,0,.18);
}

.tab-panel {
  display: grid;
  gap: 12px;
}

.tab-panel[hidden] {
  display: none !important;
}

.help-shell {
  display: grid;
  gap: 22px;
  padding-top: 22px;
}

.help-shell .news-hero {
  min-height: 270px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 34px 40px;
}

.help-shell .hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
}

.help-shell .stat-card {
  min-height: 92px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(126,77,20,.12);
  box-shadow: inset 0 -5px 0 rgba(228,178,71,.34);
}

.help-shell .stat-card span {
  display: block;
  color: #9a5a00;
  font-size: 13px;
  font-weight: 900;
}

.help-shell .stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--dd-orange);
  font-size: 28px;
  line-height: 1;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.help-grid article {
  min-height: 170px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(126,77,20,.12);
  box-shadow: 0 12px 24px rgba(105,60,0,.10), inset 0 -4px 0 rgba(228,178,71,.25);
}

.help-grid h2 {
  margin: 0 0 8px;
  color: #e05f00;
}

.help-grid p {
  margin: 0;
  color: var(--dd-muted);
  font-weight: 800;
}

.friends-panel {
  margin-top: 0;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.friend-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

body.district-page .friends-hero {
  min-height: 270px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: rgba(255, 244, 209, .92);
  border: 3px solid rgba(255, 255, 255, .78);
  border-radius: 30px;
  box-shadow: var(--dd-shadow);
}

body.district-page .friends-hero h1 {
  max-width: 820px;
  font-size: clamp(42px, 5vw, 66px);
  line-height: .92;
  margin: 0;
}

body.district-page .friends-hero p {
  max-width: 760px;
  margin-top: 12px;
  font-size: 17px;
}

body.district-page .friends-hero .hero-stats {
  position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  min-width: min(430px, 100%);
}

body.district-page .friends-hero .stat-card {
  min-width: 128px;
  min-height: 82px;
  padding: 14px;
  background: #fffdf6;
  border-radius: 22px;
  box-shadow: 0 6px 0 #edc05f;
}

body.district-page .friends-hero .stat-card span {
  display: block;
  color: #9a5a00;
  font-size: 13px;
  font-weight: 800;
}

body.district-page .friends-hero .stat-card strong {
  display: block;
  margin-top: 5px;
  color: var(--dd-orange);
  font-size: 28px;
  line-height: 1;
}

.friend-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  min-height: 78px;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(126,77,20,.12);
  box-shadow: 0 12px 24px rgba(105,60,0,.10);
}

.help-modal {
  width: min(720px, 100%);
}

.help-accordion {
  display: grid;
  gap: 10px;
}

.help-topic {
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(126,77,20,.10);
  box-shadow: inset 0 -5px 0 rgba(228,178,71,.25);
  overflow: hidden;
}

.help-topic summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  color: #d75d00;
  font-weight: 950;
  cursor: pointer;
}

.help-topic summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff5ce;
  color: #9a5a00;
}

.help-topic[open] summary::after {
  content: "-";
}

.help-topic p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--dd-muted);
  font-weight: 800;
  line-height: 1.45;
}

.friend-row .rank-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.friend-name small {
  display: block;
  margin-top: 2px;
}

.friend-actions {
  grid-column: auto;
  justify-self: end;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.friend-empty {
  min-height: 54px;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.player-modal-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-modal-head .rank-avatar {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  aspect-ratio: 1;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

.player-modal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.player-modal-stats > div {
  min-height: 82px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(126,77,20,.12);
  box-shadow: inset 0 -4px 0 rgba(228,178,71,.34);
}

.player-modal-stats span {
  color: #b76010;
  font-size: 12px;
  font-weight: 900;
}

.player-modal-stats strong {
  color: #d75d00;
  font-size: 24px;
  font-weight: 900;
}

body.district-page .ranking-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(105,60,0,.15), inset 0 -5px 0 rgba(228,178,71,.50);
}

.rank-player {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.rank-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 3px solid #fff;
  border-radius: 16px;
  background: #fff url("images/dart-avatar.png") center / cover no-repeat;
  box-shadow: 0 10px 18px rgba(105,60,0,.14);
}

.avatar-online-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #b9aa98;
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(105,60,0,.16);
}

.avatar-status.is-online .avatar-online-dot {
  background: #35bd61;
  box-shadow: 0 0 0 4px rgba(53,189,97,.16), 0 4px 10px rgba(105,60,0,.16);
}

body.district-page .rank-meta {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.friend-name strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.online-pill {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(185,170,152,.18);
  color: #8c7863;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.online-pill i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.online-pill.is-online {
  background: rgba(53,189,97,.16);
  color: #23914b;
}

body.district-page .rank-one {
  background: linear-gradient(135deg, rgba(255,255,255,.90), rgba(255,238,174,.82));
}

body.district-page .rank-one::after {
  content: "Top player";
  position: absolute;
  right: 18px;
  top: -12px;
  border-radius: 999px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #ffbd55, #ff7e21);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(153,82,0,.18);
}

.recent-match-row:first-child {
  border-radius: 14px 14px 0 0;
}

.recent-match-row:last-child {
  border-bottom: 0;
  border-radius: 0 0 14px 14px;
}

.match-pill {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  text-transform: uppercase;
}

.match-pill.won {
  background: #dff6dd;
  color: #2fa855;
}

.match-pill.lost {
  background: #ffe0df;
  color: #ff4d4d;
}

.match-avg {
  color: #ef6f00;
}

.match-date {
  color: var(--dd-muted);
  font-size: 12px;
}

.coffee {
  margin-top: 18px;
  padding: 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--dd-card);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 26px;
  box-shadow: var(--dd-shadow);
  backdrop-filter: blur(15px);
}

.grow-share-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: 6px;
  padding: 26px 30px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 95% 28%, rgba(255,255,255,.92), transparent 24%),
    linear-gradient(135deg, rgba(255,250,232,.96), rgba(255,228,191,.88));
}

.grow-share-panel::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -34px;
  width: 210px;
  height: 150px;
  background: url("images/dartdashboard.png") center / contain no-repeat;
  opacity: .18;
  pointer-events: none;
}

.grow-share-panel > div {
  position: relative;
  z-index: 1;
}

.grow-share-panel > div:first-child {
  display: grid;
  gap: 4px;
  padding-left: 74px;
}

.grow-share-panel > div:first-child::before {
  content: "DD";
  position: absolute;
  left: 0;
  top: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff9de, #ff9c2f);
  color: #fff;
  font-size: 25px;
  font-weight: 950;
  box-shadow: 0 12px 22px rgba(105,60,0,.12), inset 0 -4px 0 rgba(190,92,0,.16);
}

.grow-share-panel h2 {
  color: #d86a00;
}

.grow-share-actions {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.grow-share-actions .btn {
  min-width: 138px;
  min-height: 52px;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(105,60,0,.10), inset 0 -4px 0 rgba(105,60,0,.10);
}

.grow-share-actions .btn:nth-child(2) {
  background: linear-gradient(180deg, #fff7d4, #ffe08c);
  color: #6e3b08;
}

.grow-share-actions .btn:nth-child(3) {
  background: linear-gradient(180deg, #55d985, #2aa65e);
  color: #fff;
}

.training-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
  margin: 8px 0 16px;
}

.training-choice {
  position: relative;
  min-height: 170px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(126,77,20,.10);
  box-shadow: inset 0 -5px 0 rgba(228,178,71,.28), 0 12px 24px rgba(105,60,0,.10);
  text-align: center;
  cursor: pointer;
}

.training-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.training-choice img {
  width: min(132px, 72%);
  height: 124px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(105,60,0,.18));
}

.training-choice strong,
.training-choice span {
  display: none;
}

.training-choice strong {
  color: #d86a00;
  font-size: 22px;
  font-weight: 950;
}

.training-choice span {
  color: var(--dd-muted);
  font-weight: 800;
  line-height: 1.35;
}

.training-picker-modal .bot-training-fields,
.training-picker-modal > .modal-actions {
  display: none;
}

.training-detail-modal {
  width: min(680px, 100%);
}

.training-detail-summary {
  min-height: 72px;
  display: grid;
  align-content: center;
  padding: 18px 20px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 16%, rgba(255,196,82,.28), transparent 36%),
    rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.72);
  color: var(--dd-muted);
  font-weight: 900;
  line-height: 1.35;
  box-shadow: inset 0 -5px 0 rgba(228,178,71,.22), 0 12px 24px rgba(105,60,0,.08);
}

.training-detail-modal .bot-training-fields {
  margin-top: 4px;
}

.training-detail-modal .modal-actions {
  margin-top: 8px;
}

.training-choice:has(input:checked) {
  background: linear-gradient(135deg, #ffbd55, #ff7e21);
  box-shadow: inset 0 -7px 0 rgba(175,84,0,.22), 0 18px 32px rgba(155,81,0,.18);
}

.training-choice:has(input:checked) strong,
.training-choice:has(input:checked) span {
  color: #fff;
}

.link-btn {
  border: 0;
  background: transparent;
  color: #d75d00;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
}

.coffeeLeft {
  display: flex;
  align-items: center;
  gap: 18px;
}

.coffeeIcon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff, #ffd18f);
  box-shadow: inset 0 1px rgba(255,255,255,.9), 0 12px 24px rgba(105,60,0,.12);
  font-size: 28px;
}

.coffee h3 {
  margin: 0 0 4px;
  color: var(--dd-text);
  font-size: 18px;
}

.coffee p {
  margin: 0;
}

.coffeeBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  background: linear-gradient(135deg, #ffbd55, #ff7e21);
  color: white;
  border-radius: 12px;
  padding: 17px 28px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(153,82,0,.20);
}

.district-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54px;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(255,244,220,.55);
  backdrop-filter: blur(8px);
  color: #a07442;
  font-weight: 900;
  letter-spacing: 8px;
  pointer-events: none;
}

body.district-page .layout {
  padding-top: 34px;
}

body.game-page {
  padding-bottom: 24px;
}

body.game-page .district-footer {
  display: none;
}

body.district-page .board-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgba(255,250,240,.82);
}

body.district-page .board-panel {
  padding: 22px;
  gap: 18px;
}

body.district-page .board-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(255, 244, 209, .34), rgba(255, 248, 226, .06) 46%, rgba(255, 244, 209, .24)),
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 50%, rgba(255,150,22,.06)),
    url("images/background.png") center / cover no-repeat;
}

body.district-page .board-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 78% 28%, rgba(255,255,255,.16), transparent 30%),
    rgba(255, 239, 190, .05);
  pointer-events: none;
}

body.district-page .board-panel > * {
  position: relative;
  z-index: 1;
}

body.district-page .match-head {
  border-radius: 20px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: 0 14px 28px rgba(105,60,0,.10), inset 0 -5px 0 rgba(228,178,71,.40);
}

body.district-page .stage {
  grid-template-columns: minmax(540px, 1fr) minmax(330px, 380px);
  align-items: center;
  gap: 24px;
}

body.district-page .board-area {
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
  justify-items: center;
  min-width: 0;
}

body.district-page .board-stack {
  width: 100%;
  justify-self: stretch;
}

body.district-page .board-wrap {
  width: min(640px, 100%);
}

body.district-page .dartboard {
  width: 100%;
  border-width: 24px;
  border-color: var(--board-ring-color, #7a3d0d);
  box-shadow: inset 0 0 0 8px rgba(43,26,16,.55), 0 24px 52px rgba(79,40,0,.24);
  overflow: visible;
}

body.district-page #turnHint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  max-width: min(560px, 100%);
  margin: 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 250, 240, .86);
  color: #5f4429;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 10px 24px rgba(69,34,0,.14), inset 0 -4px 0 rgba(237,192,95,.34);
}

body.district-page .throw-stats {
  align-self: stretch;
  align-content: start;
  justify-items: stretch;
  gap: 14px;
  padding: 22px 22px 24px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 80% 0%, rgba(255,255,255,.80), transparent 34%),
    rgba(255,244,216,.78);
  border: 1px solid rgba(255,255,255,.76);
  box-shadow: 0 18px 38px rgba(105,60,0,.12);
}

body.district-page .aim-console {
  --aim-size: 234px;
  grid-template-columns: 30px var(--aim-size);
  grid-template-rows: 1fr auto;
  gap: 18px 24px;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  justify-self: center;
  margin-bottom: 24px;
}

body.district-page .aim-console .aim-track.horizontal {
  width: var(--aim-size);
}

body.district-page .aim-console .aim-track.vertical {
  height: var(--aim-size);
}

body.district-page .btn.primary.round-stop,
body.district-page .round-stop {
  width: 166px;
  height: 166px;
  border-radius: 50%;
  font-size: 31px;
  letter-spacing: 0;
  color: #fff;
  background: radial-gradient(circle at 50% 28%, #ff9188 0 18%, #ff5d52 48%, #e62f29 100%);
  box-shadow: inset 0 -15px 0 rgba(116,21,17,.28), inset 0 6px 0 rgba(255,255,255,.28), 0 20px 38px rgba(180,40,24,.27), 0 0 0 11px rgba(255,255,255,.72);
  transition: transform .09s ease, box-shadow .09s ease, filter .09s ease;
  transform: translateY(0) scale(1);
  will-change: transform;
}

body.district-page .btn.primary.round-stop:not(:disabled):hover,
body.district-page .round-stop:not(:disabled):hover {
  filter: saturate(1.08) brightness(1.02);
  transform: translateY(0) scale(1);
}

body.district-page .btn.primary.round-stop:not(:disabled):active,
body.district-page .btn.primary.round-stop.is-pressed,
body.district-page .round-stop:not(:disabled):active,
body.district-page .round-stop.is-pressed {
  transform: translateY(9px) scale(.965);
  box-shadow: inset 0 9px 14px rgba(96,16,13,.34), inset 0 -4px 0 rgba(116,21,17,.20), 0 8px 14px rgba(180,40,24,.20), 0 0 0 11px rgba(255,255,255,.72);
}

body.district-page .throw-card,
body.district-page .checkout-card,
body.district-page .tile,
body.district-page .history-column,
body.district-page .history-row {
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(126,77,20,.10);
  box-shadow: 0 10px 22px rgba(105,60,0,.09), inset 0 -4px 0 rgba(228,178,71,.26);
}

body.district-page .throw-stats .throw-card,
body.district-page .throw-stats .checkout-card {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
}

body.district-page .throw-stats .throw-card span,
body.district-page .throw-stats .checkout-card span {
  margin: 0;
  color: #a45c00;
  font-size: 12px;
  letter-spacing: 0;
}

body.district-page .throw-stats .throw-card strong,
body.district-page .throw-stats .checkout-card strong {
  margin: 0;
  color: #2f2419;
  font-size: 24px;
  text-align: right;
}

body.district-page .throw-stats .checkout-card strong {
  color: #d86a00;
  font-size: 22px;
}

.share-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  box-shadow: inset 0 -4px 0 rgba(237,192,95,.42);
  text-align: center;
}

.share-card > span {
  color: #9a5600;
  font-size: 12px;
  font-weight: 900;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.share-actions .btn {
  min-height: 38px;
  padding: 0 10px;
  font-size: 12px;
}

body.district-page .chat-panel {
  background: rgba(255,250,240,.97);
}

body.district-page .chat-panel .messages {
  background: transparent !important;
  box-shadow: none !important;
}

body.district-page .chat-panel .message {
  background: rgba(255,255,255,.82) !important;
  border: 1px solid rgba(116, 70, 19, .08);
  border-radius: 18px;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body.district-page .timeline {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

body.district-page .timeline.training-timeline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(69,34,0,.46);
  backdrop-filter: blur(10px);
}

.result-modal {
  position: relative;
  width: min(680px, 100%);
  overflow: hidden;
  display: grid;
  gap: 16px;
  padding: 34px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 80% 0%, rgba(255,255,255,.86), transparent 32%),
    linear-gradient(135deg, rgba(255,250,238,.98), rgba(255,235,188,.96));
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: 0 32px 80px rgba(78,39,0,.30);
  text-align: center;
}

.result-burst {
  position: absolute;
  inset: auto -60px -110px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,122,0,.22), transparent 64%);
  animation: resultPulse 1.6s ease-in-out infinite;
}

.result-overlay.won .result-burst {
  background: radial-gradient(circle, rgba(47,173,92,.28), transparent 64%);
}

@keyframes resultPulse {
  50% { transform: scale(1.08); opacity: .72; }
}

.result-kicker {
  justify-self: center;
  border-radius: 999px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #ffbd55, #ff7e21);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.result-modal h2 {
  font-size: clamp(34px, 6vw, 58px);
  color: var(--dd-text);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.result-stats > div {
  min-height: 96px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(126,77,20,.12);
  box-shadow: inset 0 -5px 0 rgba(228,178,71,.34);
}

.result-stats span {
  color: #b76010;
  font-size: 12px;
  font-weight: 900;
}

.result-stats strong {
  color: #d75d00;
  font-size: 30px;
  font-weight: 900;
}

.result-stats .xp-loss {
  color: #f04c3f;
}

.result-stats .xp-gain {
  color: #2fa855;
}

.result-progress {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(126,77,20,.10);
}

.result-level-event {
  justify-self: center;
  margin-bottom: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5b400, #ff7a00, #58d348);
  color: #fff;
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: 0;
  box-shadow: 0 12px 22px rgba(255,122,0,.25);
  animation: levelPop .8s cubic-bezier(.2, 1.2, .3, 1) both;
}

.result-level-event.down {
  background: linear-gradient(135deg, #ff8c5a, #f04c3f);
}

@keyframes levelPop {
  0% { opacity: 0; transform: translateY(8px) scale(.82); }
  65% { opacity: 1; transform: translateY(-2px) scale(1.08); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.rematch-modal {
  width: min(520px, 100%);
}

.result-level-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  color: #b76010;
  font-weight: 900;
}

.result-level-row span:only-child,
.result-level-row span[hidden] + span[hidden] + span {
  margin-inline: auto;
}

.result-notice {
  justify-self: center;
  width: min(460px, 100%);
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #a45c00;
  font-weight: 900;
}

.result-bar {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(126,77,20,.14);
  box-shadow: inset 0 2px 4px rgba(78,39,0,.10);
}

.result-bar i,
.result-bar b {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.result-bar i {
  background: rgba(160,116,66,.28);
}

.result-bar b {
  width: 0%;
  background: linear-gradient(90deg, #f5b400, #ff7a00, #58d348);
  box-shadow: 0 0 18px rgba(255,122,0,.36);
  transition: width .9s cubic-bezier(.2,.8,.2,1);
}

@media (max-width: 1320px) {
  body.district-page .stage {
    grid-template-columns: minmax(430px, 1fr) minmax(300px, 320px);
  }

  body.district-page .board-wrap {
    width: min(520px, 100%);
  }

  body.district-page .aim-console {
    --aim-size: 220px;
  }

  body.district-page .round-stop {
    width: 150px;
    height: 150px;
    font-size: 28px;
  }
}

@media (max-width: 1100px) {
  body:not(.public-mode) .dashboard {
    grid-template-columns: 1fr;
  }

  body:not(.public-mode) .dash-grid,
  body:not(.public-mode) .score-buckets {
    grid-template-columns: repeat(2, 1fr);
  }

  body.district-page .stage {
    grid-template-columns: 1fr;
  }

  body.district-page .board-area {
    justify-content: center;
  }

  body.district-page .throw-stats {
    grid-template-columns: 1fr;
  }

  body.district-page .round-stop {
    grid-row: auto;
    align-self: center;
  }

  body.district-page .ranking-card {
    grid-template-columns: 64px minmax(220px, 1fr) repeat(3, minmax(90px, 1fr)) minmax(118px, auto);
  }

  .friends-grid {
    grid-template-columns: 1fr;
  }

  body.district-page .friends-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  body.district-page .friends-hero .hero-stats {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.district-page .layout:has(.lobby-tools) .hero {
    grid-template-columns: 1fr;
  }

  .lobby-hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .training-choice-grid,
  .grow-share-actions {
    grid-template-columns: 1fr;
  }

  .grow-share-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body.district-page .shell,
  body:not(.public-mode) .shell {
    width: var(--dd-shell-width-mobile);
  }

  body.district-page .nav,
  body.district-page .nav-shell,
  body.district-page .topbar-inner,
  body:not(.public-mode) .nav-shell,
  body:not(.public-mode) .topbar-inner {
    min-height: auto;
    border-radius: 22px;
    padding: 12px;
    position: sticky;
    top: 10px;
    z-index: 50;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px;
  }

  body.district-page .hamburger,
  body:not(.public-mode) .hamburger {
    display: flex;
    order: -2;
  }

  body.public-mode .hamburger {
    display: none;
  }

  body.district-page .nav-links,
  body.district-page .game-nav,
  body:not(.public-mode) .nav-links,
  body:not(.public-mode) .game-nav {
    display: none;
  }

  body.district-page .nav-actions #settingsBtn,
  body.district-page .nav-actions #logoutBtn,
  body.district-page .top-actions #settingsBtn,
  body.district-page .top-actions #logoutBtn,
  body:not(.public-mode) .nav-actions #settingsBtn,
  body:not(.public-mode) .nav-actions #logoutBtn {
    display: none !important;
  }

  body.district-page .brand,
  body:not(.public-mode) .brand {
    width: 118px;
    height: 56px;
    border-right: 0;
    padding-right: 0;
    flex: 0 0 auto;
    order: -1;
  }

  body.district-page .mark,
  body:not(.public-mode) .mark {
    width: 118px;
    height: 56px;
  }

  body.district-page .profileMenu,
  body:not(.public-mode) .profileMenu {
    margin-left: auto;
    flex: 0 0 auto;
  }

  body.district-page .nav-actions,
  body.district-page .top-actions,
  body:not(.public-mode) .nav-actions {
    flex: 0 0 auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  body.district-page .user,
  body:not(.public-mode) .user {
    min-height: 50px;
    padding: 0 12px;
  }

  body.district-page .user b,
  body:not(.public-mode) .user b {
    display: none;
  }

  body.district-page .district-footer,
  body:not(.public-mode) .district-footer {
    display: none !important;
  }

  .toast-stack {
    right: 12px;
    bottom: 12px;
  }

  body.district-page,
  body:not(.public-mode) {
    padding-bottom: 0;
  }

  body:not(.public-mode) .dashboard {
    padding-top: 18px;
  }

  body:not(.public-mode) .dashboard-title-row {
    grid-template-columns: 1fr;
  }

  body:not(.public-mode) .heroTitleLine {
    align-items: flex-start;
  }

  body:not(.public-mode) .dashboard-hero h1 {
    font-size: clamp(34px, 9vw, 46px);
  }

  .ocheMark {
    width: 116px;
    height: 86px;
    flex-basis: 116px;
  }

  .recent-match-row {
    grid-template-columns: 28px 66px 1fr;
  }

  .recent-match-row .match-avg,
  .recent-match-row .match-date {
    display: none;
  }

  body.district-page .ranking-card {
    grid-template-columns: 58px 1fr;
  }

  body.district-page .lobby-card {
    grid-template-columns: 1fr;
  }

  .lobby-card-actions {
    justify-items: stretch;
  }

  .rank-action {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .rank-action .btn,
  .rank-action .friend-chip {
    width: 100%;
    justify-content: center;
  }

  body.district-page .rank-player {
    gap: 10px;
  }

  .rank-avatar {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 14px;
  }

  body.district-page .throw-stats {
    grid-template-columns: 1fr;
  }

  body.district-page .round-stop {
    grid-row: auto;
    width: 120px;
    height: 120px;
  }

  .rank-tools,
  .lobby-hero-stats,
  body.district-page .friends-hero .hero-stats,
  .player-modal-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body.district-page .nav-links,
  body.district-page .game-nav,
  body:not(.public-mode) .nav-links {
    gap: 8px;
  }

  body.district-page .nav-links a,
  body.district-page .game-nav a,
  body:not(.public-mode) .nav-links a {
    min-height: 42px;
    padding: 0 12px;
    font-size: 12px;
  }

  body:not(.public-mode) .dash-grid,
  body:not(.public-mode) .score-buckets {
    grid-template-columns: 1fr 1fr;
  }

  body.district-page .aim-console {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  body.district-page .timeline {
    grid-template-columns: 1fr 1fr;
  }

  body:not(.public-mode) .dashboard-hero,
  body:not(.public-mode) .chart-panel,
  .recent-matches-panel {
    padding: 22px 18px;
  }

  .dashboard-carousel-controls {
    position: static;
    justify-self: end;
    margin-bottom: -10px;
  }

  .chartHead,
  .matchHead {
    min-height: 0;
    padding-right: 0;
  }

  .chartHead .select,
  .recent-matches-panel .view {
    position: static;
  }

  body:not(.public-mode) .heroTitleLine {
    display: block;
  }

  .ocheMark {
    display: none;
  }

  .coffee {
    margin-top: 14px;
    padding: 18px;
    display: grid;
    gap: 16px;
  }

  .coffeeLeft {
    align-items: center;
    gap: 12px;
  }

  .coffeeIcon {
    width: 46px;
    height: 46px;
    font-size: 22px;
  }

  .coffee h3 {
    font-size: 18px;
    line-height: 1.08;
  }

  .coffee p {
    font-size: 14px;
    line-height: 1.35;
  }

  .coffeeBtn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 15px 18px;
  }
}

body.district-page .hero h1,
body.district-page .friends-hero h1,
body.district-page .news-hero h1,
body.district-page .layout:has(.lobby-tools) .hero h1,
body:not(.public-mode) .dashboard-hero h1 {
  max-width: 860px;
  font-size: 45px;
  line-height: 1.04;
  margin: 24px 0 16px;
  color: var(--dd-text);
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: none;
}

body.district-page .hero h1 span,
body.district-page .hero h1 strong,
body.district-page .friends-hero h1 span,
body.district-page .friends-hero h1 strong,
body.district-page .news-hero h1 span,
body.district-page .news-hero h1 strong,
body:not(.public-mode) .dashboard-hero h1 span {
  background: linear-gradient(90deg, #f5b400, #f07800);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  body.district-page .hero h1,
  body.district-page .friends-hero h1,
  body.district-page .news-hero h1,
  body.district-page .layout:has(.lobby-tools) .hero h1,
  body:not(.public-mode) .dashboard-hero h1 {
    font-size: clamp(34px, 10vw, 45px);
  }
}

.emoji-chat-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px auto;
  align-items: center;
  gap: 8px;
}

.chat-title {
  align-items: flex-start;
}

.chat-language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  color: #8a4d00;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.chat-language-toggle input {
  width: 16px;
  min-height: 16px;
  accent-color: #35bd61;
}

.new-chat-btn {
  position: sticky;
  bottom: 8px;
  z-index: 2;
  justify-self: center;
  min-height: 34px;
  margin: -46px auto 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #2ca3ee;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(44, 163, 238, .22);
  cursor: pointer;
}

.emoji-wrap {
  position: relative;
  flex: 0 0 auto;
}

.emoji-toggle {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  background: #fff7d7;
  color: var(--dd-orange);
  border-radius: 14px;
  box-shadow: 0 5px 0 #edc05f;
}

.emoji-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(4, 38px);
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(99, 59, 19, .12);
  border-radius: 14px;
  background: rgba(255, 251, 241, .98);
  box-shadow: 0 18px 36px rgba(95, 51, 7, .18);
}

.emoji-panel[hidden] {
  display: none;
}

.emoji-panel button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(230, 166, 49, .35);
}

.emoji-panel button:hover {
  transform: translateY(-1px);
  background: #fff2be;
}

.chat-name {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--dd-orange);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.chat-name:hover {
  text-decoration: underline;
}

.search-hint {
  display: flex;
  align-items: center;
  min-height: 62px;
  padding: 0 18px;
  color: #8a6232;
  background: rgba(255,255,255,.78) !important;
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: inset 0 -4px 0 rgba(237,192,95,.36) !important;
}

.search-hint strong {
  color: #8a4d00;
}

.small-screen-warning {
  display: none;
}

@media (max-width: 780px), (max-height: 560px) {
  .small-screen-warning {
    display: block;
    position: static;
    width: 100%;
    margin: 0 0 12px;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 16px;
    background: rgba(255, 251, 241, .96);
    color: var(--dd-text);
    box-shadow: inset 0 -4px 0 rgba(228,178,71,.24), 0 10px 22px rgba(95, 51, 7, .10);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
    text-align: left;
  }
}

body:has(.help-shell) .topbar {
  padding-top: 10px;
}

@media (max-width: 900px) {
  body.district-page .layout:has(.lobby-tools) {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  body.district-page .layout:has(.lobby-tools) > section {
    width: 100%;
    order: 1;
  }

  body.district-page .layout:has(.lobby-tools) .chat-panel {
    width: 100%;
    min-height: 0;
    height: auto;
    max-height: none;
    order: 2;
    position: static;
    grid-template-rows: auto minmax(220px, 34vh) auto;
  }

  body.district-page .layout:has(.lobby-tools) .messages {
    min-height: 220px;
    max-height: 34vh;
  }

  body.district-page .lobby-tools {
    grid-template-columns: 1fr;
  }

  body.district-page .lobby-tools .btn,
  body.district-page .lobby-tools select,
  body.district-page .lobby-tools input {
    width: 100%;
  }

  body.district-page .lobby-tabs {
    display: grid;
    width: 100%;
  }

  body.district-page .lobby-tab {
    min-width: 0;
  }

  body.district-page .chat-title {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.district-page .emoji-chat-form {
    grid-template-columns: minmax(0, 1fr) 46px auto;
  }
}

@media (max-width: 520px) {
  body.district-page .panel-title {
    display: grid;
    gap: 12px;
  }

  body.district-page .emoji-chat-form {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  body.district-page .emoji-chat-form > .btn.blue {
    grid-column: 1 / -1;
    width: 100%;
  }

  body.district-page .layout:has(.lobby-tools) .hero {
    padding: 22px 18px;
  }

  body.district-page .layout:has(.lobby-tools) .panel:not(.hero) {
    padding: 20px 18px;
  }

  body.district-page .lobby-card {
    min-height: 0;
  }
}

