@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --bg: #050507;
  --bg-soft: #08080c;
  --panel: #0b0b10;
  --panel-2: #101017;
  --panel-3: #15151e;
  --line: #1e1e29;
  --line-soft: #171720;
  --text: #f2f2f7;
  --muted: #8b8b9c;
  --muted-2: #5e5e70;
  --accent: #b49cff;
  --accent-strong: #9d7bff;
  --accent-2: #6ee7ff;
  --good: #55e6a5;
  --bad: #ff5d6c;
  --warn: #fbbf24;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(157, 123, 255, 0.13), transparent 60%),
    radial-gradient(700px 450px at 95% 0%, rgba(110, 231, 255, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 20%, transparent 80%);
}

::selection {
  background: rgba(180, 156, 255, 0.35);
  color: #fff;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------- brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 15px;
  text-transform: uppercase;
  user-select: none;
}

.brand .orb {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background:
    radial-gradient(circle at 30% 25%, #fff 0 8%, transparent 9%),
    conic-gradient(from 210deg, #9d7bff, #6ee7ff, #9d7bff);
  box-shadow: 0 0 22px rgba(157, 123, 255, 0.5);
  animation: orb 9s linear infinite;
}

@keyframes orb {
  to {
    filter: hue-rotate(360deg);
  }
}

/* ---------------------------------------------------------------- auth */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.auth-shell::before {
  content: "";
  position: absolute;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 123, 255, 0.16), transparent 62%);
  filter: blur(10px);
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(18, 18, 26, 0.94), rgba(8, 8, 12, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

.auth-card .brand {
  margin-bottom: 8px;
}

.auth-title {
  font-size: 26px;
  margin: 20px 0 6px;
}

.auth-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin-bottom: 18px;
}

.auth-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  transition: 0.16s ease;
}

.auth-tabs button.active {
  background: var(--panel-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.7;
}

.auth-hint code {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ---------------------------------------------------------------- layout */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 76px;
  height: 100vh;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 22px 12px 18px;
  border-right: 1px solid var(--line-soft);
  background: rgba(6, 6, 9, 0.72);
  backdrop-filter: blur(22px) saturate(130%);
  overflow: hidden;
  transition: width 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sidebar:hover {
  width: 238px;
}

.sidebar .brand {
  padding: 0 8px 24px;
  justify-content: center;
}

.brand-text {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 0.22s ease, opacity 0.18s ease;
}

.sidebar:hover .brand-text {
  max-width: 120px;
  opacity: 1;
}

.side-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--muted-2);
  text-transform: uppercase;
  padding: 0 10px;
  margin-bottom: 8px;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.18s ease;
}

.sidebar:hover .side-label {
  opacity: 1;
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.tabs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: left;
  text-transform: none;
  transition: 0.16s ease;
}

.sidebar:hover .tabs button {
  justify-content: flex-start;
}

.tabs button > span {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 0.22s ease, opacity 0.18s ease;
}

.sidebar:hover .tabs button > span {
  max-width: 160px;
  opacity: 1;
}

.tabs button svg {
  width: 15px;
  height: 15px;
  flex: none;
  opacity: 0.7;
}

.tabs button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.tabs button.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(180, 156, 255, 0.14), rgba(180, 156, 255, 0.025));
  box-shadow: inset 0 0 0 1px rgba(180, 156, 255, 0.16);
}

.tabs button.active svg {
  opacity: 1;
  color: var(--accent);
}

.tabs button.active::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 10px var(--accent);
}

.tabs .dev-only {
  color: var(--accent);
}

.side-spacer {
  flex: 1;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
}

.side-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.sidebar:hover .side-row {
  flex-direction: row;
  align-items: center;
}

.live-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.live-toggle > span:last-child {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 0.22s ease, opacity 0.18s ease;
}

.sidebar:hover .live-toggle {
  justify-content: flex-start;
}

.sidebar:hover .live-toggle > span:last-child {
  max-width: 120px;
  opacity: 1;
}

.side-row .user-chip {
  flex: 1;
  justify-content: center;
  min-width: 0;
  padding: 0 4px;
}

.sidebar:hover .side-row .user-chip {
  justify-content: flex-start;
  padding: 0 12px 0 4px;
}

.user-chip .uname,
.user-chip .role {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 0.22s ease, opacity 0.18s ease;
}

.sidebar:hover .user-chip .uname {
  max-width: 100px;
  opacity: 1;
}

.sidebar:hover .user-chip .role {
  max-width: 40px;
  opacity: 1;
}

.live-toggle .sw {
  position: relative;
  width: 30px;
  height: 17px;
  flex: none;
  border-radius: 99px;
  background: #26262f;
  transition: 0.2s ease;
}

.live-toggle .sw::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #77778a;
  transition: 0.2s ease;
}

.live-toggle[aria-checked="true"] {
  color: var(--text);
  border-color: rgba(85, 230, 165, 0.3);
}

.live-toggle[aria-checked="true"] .sw {
  background: rgba(85, 230, 165, 0.22);
}

.live-toggle[aria-checked="true"] .sw::after {
  left: 16px;
  background: var(--good);
  box-shadow: 0 0 10px var(--good);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  transition: 0.16s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: #30303d;
  transform: translateY(-1px);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.user-chip .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, #2b2145, #1b2b38);
  color: var(--accent);
  border: 1px solid #34344a;
  font-family: var(--mono);
}

.user-chip .role {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

main {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 26px 26px 64px;
}

.panel {
  display: none;
  animation: fade 0.28s ease;
}

.panel.active {
  display: block;
}

.panel[data-panel="players"] {
  height: 100vh;
  height: 100dvh;
  position: relative;
}

body[data-tab="players"] main {
  padding: 0;
}

.panel[data-panel="players"].active {
  display: flex;
  flex-direction: column;
}

.panel[data-panel="players"] .billboard {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.panel[data-panel="players"] .board-footer {
  display: none;
}

.board-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
  pointer-events: auto;
}

.board-tool {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(12, 12, 18, 0.75);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: 0.15s ease;
}

.board-tool:hover {
  color: var(--text);
  border-color: #333342;
  background: var(--panel-3);
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--accent);
}

.page-title {
  font-size: clamp(28px, 3.4vw, 38px);
  letter-spacing: -0.035em;
}

.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.good {
  color: var(--good);
  border-color: rgba(85, 230, 165, 0.24);
  background: rgba(85, 230, 165, 0.07);
}

.badge.bad {
  color: var(--bad);
  border-color: rgba(255, 93, 108, 0.24);
  background: rgba(255, 93, 108, 0.07);
}

.badge.warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.07);
}

.badge.accent {
  color: var(--accent);
  border-color: rgba(180, 156, 255, 0.26);
  background: rgba(180, 156, 255, 0.08);
}

.badge.dev {
  color: #0a0a0f;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border: 0;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: #333342;
  transform: translateY(-1px);
  background: var(--panel-3);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: linear-gradient(135deg, #c5b1ff, #9d7bff 55%, #7dd9ff);
  border: 0;
  color: #0a0812;
  box-shadow: 0 8px 26px rgba(157, 123, 255, 0.25);
}

.btn.primary:hover {
  box-shadow: 0 12px 34px rgba(157, 123, 255, 0.35);
  filter: brightness(1.05);
}

.btn.danger {
  background: rgba(255, 93, 108, 0.12);
  border-color: rgba(255, 93, 108, 0.35);
  color: #ff9aa3;
}

.btn.danger:hover {
  background: rgba(255, 93, 108, 0.18);
}

.btn.success {
  background: rgba(85, 230, 165, 0.1);
  border-color: rgba(85, 230, 165, 0.3);
  color: var(--good);
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  height: 31px;
  padding: 0 11px;
  font-size: 11px;
  border-radius: 8px;
}

.btn.block {
  width: 100%;
}

.btn .kbd {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 4px;
}

/* ---------------------------------------------------------------- forms */
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > label,
.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field .hint {
  font-size: 11.5px;
  color: var(--muted-2);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a0a0f;
  color: var(--text);
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
  transition: 0.16s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(180, 156, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(180, 156, 255, 0.1);
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

/* ---------------------------------------------------------------- board */
.spectate-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(110, 231, 255, 0.28);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(110, 231, 255, 0.09), rgba(180, 156, 255, 0.06));
  font-size: 12.5px;
}

.billboard > .spectate-banner {
  position: absolute;
  top: 56px;
  left: 22px;
  right: 22px;
  z-index: 7;
  margin: 0;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.spectate-banner .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(110, 231, 255, 0.6);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(110, 231, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(110, 231, 255, 0);
  }
}

.spectate-banner .spacer {
  flex: 1;
}

.billboard {
  position: relative;
  min-height: max(560px, calc(100vh - 250px));
  border: 1px solid #23232d;
  border-radius: 22px;
  background:
    radial-gradient(1000px 400px at 50% -10%, rgba(180, 156, 255, 0.055), transparent 65%),
    #030304;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--shadow);
  overflow: hidden;
  touch-action: none;
}

.billboard::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.085) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, black, transparent 92%);
  pointer-events: none;
}

.billboard::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(180, 156, 255, 0.04), transparent 12%, transparent 88%, rgba(110, 231, 255, 0.04)),
    radial-gradient(600px 200px at 50% 110%, rgba(110, 231, 255, 0.05), transparent 70%);
  pointer-events: none;
}

.board-topline {
  position: absolute;
  top: 18px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 10;
  pointer-events: none;
}

.board-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.board-left .badge {
  height: 23px;
  font-size: 9px;
}

.board-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.board-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.board-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.14em;
}

.board-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 30px;
}

.board-empty .radar {
  position: relative;
  width: 74px;
  height: 74px;
  border: 1px solid #262633;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.board-empty .radar::before,
.board-empty .radar::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid #20202a;
  border-radius: 50%;
}

.board-empty .radar::after {
  inset: 26px;
  background: var(--accent);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent);
}

.board-empty h3 {
  font-size: 17px;
}

.board-empty p {
  color: var(--muted-2);
  font-size: 12.5px;
  max-width: 330px;
}

.board-empty .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  animation: blink 1.4s infinite;
  margin-right: 6px;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* player block */
.pblock {
  position: absolute;
  z-index: 4;
  width: 216px;
  border: 1px solid #262631;
  border-radius: 15px;
  background: linear-gradient(155deg, #111117 0%, #09090d 70%);
  padding: 14px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  will-change: transform, left, top;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
}

.pblock:hover {
  border-color: rgba(180, 156, 255, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(180, 156, 255, 0.08);
  transform: translateY(-2px);
}

.pblock.dragging {
  cursor: grabbing;
  z-index: 20;
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(180, 156, 255, 0.12);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.pblock.offline {
  opacity: 0.55;
}

.pblock .pb-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.pblock .avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: #cbbdff;
  background: linear-gradient(140deg, #241c3a, #142530);
  border: 1px solid #313147;
}

.pblock .pb-name {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.pblock .pb-state {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pblock .pb-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-2);
}

.pblock .pb-state.online i {
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}

.pblock .pb-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  padding-top: 10px;
  border-top: 1px solid #1b1b24;
}

.pblock .pb-stat {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
}

.pblock .pb-stat span {
  color: var(--muted-2);
}

.pblock .pb-stat b {
  font-weight: 500;
  color: #cfcfdc;
}

.pblock .pb-money {
  color: var(--good) !important;
}

.pblock .pb-raid {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 93, 108, 0.06);
  border: 1px solid rgba(255, 93, 108, 0.16);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #ff8d97;
  text-transform: uppercase;
}

.pblock .pb-raid b {
  color: #ffd0d4;
  font-weight: 500;
}

.pblock.expanded {
  width: 340px;
  z-index: 35;
  border-color: rgba(180, 156, 255, 0.5);
  background: linear-gradient(160deg, #14141c 0%, #09090d 75%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(180, 156, 255, 0.08);
  cursor: default;
}

.pblock.expanded .pb-expand {
  opacity: 1;
  transform: rotate(45deg);
  color: var(--accent);
  border-color: rgba(180, 156, 255, 0.4);
}

.pb-details {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #1b1b24;
}

.pblock.expanded .pb-details {
  display: grid;
  gap: 9px;
  animation: pb-open 0.18s ease;
}

@keyframes pb-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.pb-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}

.pb-extra span {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.pb-extra b {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cfcfdc;
  font-weight: 500;
  text-transform: none;
}

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

.pb-act {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d0d13;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: 0.15s ease;
}

.pb-act:hover {
  color: var(--text);
  border-color: #343445;
  background: var(--panel-3);
}

.pb-compose {
  display: flex;
  gap: 5px;
}

.pb-compose .input {
  height: 30px;
  padding: 5px 8px;
  font-size: 10.5px;
}

.pb-compose .btn {
  height: 30px;
  padding: 0 8px;
  font-size: 9px;
}

.pb-ban-form {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 93, 108, 0.2);
  border-radius: 9px;
  background: rgba(255, 93, 108, 0.04);
}

.pb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.pb-ban-form .select,
.pb-ban-form .input {
  height: 28px;
  padding: 4px 7px;
  font-size: 10px;
}

.pb-ban-form .select {
  padding-right: 22px;
  background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
}

.pb-ban-form .btn {
  height: 28px;
  font-size: 9.5px;
}

.pb-ban-current {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 93, 108, 0.2);
  border-radius: 9px;
  background: rgba(255, 93, 108, 0.05);
}

.pb-ban-current div {
  flex: 1;
  min-width: 0;
}

.pb-ban-current b {
  display: block;
  color: #ffb6bd;
  font-size: 10.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pb-ban-current span {
  display: block;
  margin-top: 2px;
  color: #c98a91;
  font-family: var(--mono);
  font-size: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pb-details > .btn.ghost {
  height: 26px;
  font-size: 9px;
}

.pblock.spectating {
  border-color: rgba(110, 231, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.15), 0 18px 40px rgba(0, 0, 0, 0.5);
}

.pblock .pb-flag {
  position: absolute;
  top: -7px;
  right: 36px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-2);
  color: #051318;
  text-transform: uppercase;
}

.pblock .pb-expand {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c0c12;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  transition: 0.15s ease;
}

.pblock:hover .pb-expand {
  opacity: 1;
}

.pblock .pb-expand:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--panel-3);
  transform: scale(1.05);
}

.board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 11px;
}

.board-footer .k {
  font-family: var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  margin-right: 4px;
}

/* ---------------------------------------------------------------- cards */
.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 17, 24, 0.85), rgba(10, 10, 15, 0.9));
  padding: 18px;
}

.card.pad-lg {
  padding: 22px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h3 {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-head .sub {
  color: var(--muted-2);
  font-size: 11.5px;
  margin-top: 3px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 14px 15px;
}

.stat .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.stat .v {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 5px;
  font-family: var(--mono);
}

.stat .v.accent {
  color: var(--accent);
}

.stat .v.good {
  color: var(--good);
}

/* ---------------------------------------------------------------- commands */
.cmd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 16px;
  align-items: start;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #08080c;
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: 0.15s ease;
}

.segmented button.active {
  background: var(--panel-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.segmented button.active.danger {
  color: #ff9aa3;
  background: rgba(255, 93, 108, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 93, 108, 0.25);
}

.cmd-preview {
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #060609;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-word;
}

.cmd-preview::before {
  content: "$";
  color: var(--accent);
}

.preset {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0b0b10;
  transition: 0.15s ease;
}

.preset:hover {
  border-color: #2e2e3c;
}

.preset .ico {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #14141c;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

.preset .t {
  flex: 1;
  min-width: 0;
}

.preset .t b {
  display: block;
  font-size: 12px;
  font-weight: 500;
}

.preset .t span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.preset-list {
  display: grid;
  gap: 8px;
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.rule-row:last-child {
  border-bottom: 0;
}

.rule-row .t b {
  font-size: 12.5px;
  font-weight: 500;
  display: block;
}

.rule-row .t span {
  color: var(--muted-2);
  font-size: 11px;
}

.switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 21px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #17171f;
  transition: 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #6b6b7c;
  transition: 0.18s ease;
}

.switch[aria-checked="true"] {
  background: rgba(85, 230, 165, 0.15);
  border-color: rgba(85, 230, 165, 0.4);
}

.switch[aria-checked="true"]::after {
  left: 20px;
  background: var(--good);
  box-shadow: 0 0 9px var(--good);
}

/* ---------------------------------------------------------------- raids */
.raid-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 93, 108, 0.2);
  border-radius: 22px;
  padding: 26px;
  background:
    radial-gradient(800px 260px at 85% -40%, rgba(255, 93, 108, 0.14), transparent 60%),
    linear-gradient(120deg, #0f0a0d, #0a0a0f);
  margin-bottom: 16px;
}

.raid-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: linear-gradient(90deg, transparent, black);
  pointer-events: none;
}

.raid-hero h2 {
  font-size: 26px;
  letter-spacing: -0.03em;
  max-width: 520px;
}

.raid-hero p {
  color: var(--muted);
  font-size: 12.5px;
  max-width: 520px;
  margin-top: 7px;
}

.raid-hero .btn {
  margin-top: 18px;
}

.raid-hero .tag {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: #ff9aa3;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.raid-list {
  display: grid;
  gap: 10px;
}

.raid-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.raid-item .r-ico {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 93, 108, 0.1);
  border: 1px solid rgba(255, 93, 108, 0.2);
  font-size: 15px;
}

.raid-item .r-main {
  flex: 1;
  min-width: 0;
}

.raid-item .r-main b {
  font-size: 13px;
  font-weight: 500;
}

.raid-item .r-main span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  margin-top: 2px;
}

.raid-item .r-price {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--good);
  text-align: right;
}

.raid-item .r-price span {
  display: block;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.empty-line {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.price-table th {
  text-align: left;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.price-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
}

.price-table td:last-child {
  text-align: right;
  color: var(--text);
  font-family: var(--mono);
}

.price-table tr:last-child td {
  border-bottom: 0;
}

/* ---------------------------------------------------------------- dev */
.bridge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.bridge-card .status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 10px rgba(255, 93, 108, 0.5);
}

.bridge-card.online .status-dot {
  background: var(--good);
  box-shadow: 0 0 10px rgba(85, 230, 165, 0.6);
}

.bridge-card .b-main {
  flex: 1;
}

.bridge-card .b-main b {
  display: block;
  font-size: 12px;
  font-weight: 500;
}

.bridge-card .b-main span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
}

.event-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.event-item:last-child {
  border-bottom: 0;
}

.event-item .e-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-item .e-head b {
  font-size: 13px;
  font-weight: 500;
}

.event-item .e-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.event-item .e-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td b {
  color: var(--text);
  font-weight: 500;
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
}

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

.small {
  font-size: 11.5px;
}

.stack {
  display: grid;
  gap: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 16px 0;
}

/* ---------------------------------------------------------------- modal */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 6, 0.55);
  backdrop-filter: blur(18px) saturate(90%);
  -webkit-backdrop-filter: blur(18px) saturate(90%);
  animation: fade 0.2s ease;
}

.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 900px);
  overflow-y: auto;
  border: 1px solid #262633;
  border-radius: 22px;
  background: linear-gradient(180deg, #111118, #09090e 60%);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: modal-in 0.25s cubic-bezier(0.2, 0.9, 0.25, 1);
  scrollbar-width: thin;
  scrollbar-color: #2b2b38 transparent;
}

.modal.wide {
  width: min(780px, 100%);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 0;
}

.modal-head h3 {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.modal-head .sub {
  color: var(--muted-2);
  font-size: 11.5px;
  margin-top: 3px;
}

.modal-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 14px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 20px 22px 22px;
  display: grid;
  gap: 16px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 8, 12, 0.75);
  position: sticky;
  bottom: 0;
  backdrop-filter: blur(10px);
}

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

.modal-player-head .avatar {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 16px;
  color: #d3c7ff;
  background: linear-gradient(140deg, #2a2045, #152b36);
  border: 1px solid #35354b;
}

.modal-player-head .n {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-player-head .s {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  margin-top: 3px;
  letter-spacing: 0.06em;
}

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

.mini-stat {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0a0a0f;
}

.mini-stat span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mini-stat b {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

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

.player-detail {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #09090e;
}

.player-detail span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.player-detail b {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 9px;
}

.section-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line-soft);
}

.ban-box {
  padding: 14px;
  border: 1px solid rgba(255, 93, 108, 0.18);
  border-radius: 12px;
  background: rgba(255, 93, 108, 0.035);
  display: grid;
  gap: 11px;
}

.ban-box .ban-current {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 93, 108, 0.08);
  border: 1px solid rgba(255, 93, 108, 0.18);
  font-size: 11.5px;
  color: #ffb6bd;
}

.ban-box .ban-current .grow {
  flex: 1;
  min-width: 0;
}

.ban-box .ban-current b {
  font-weight: 500;
}

.ban-box .ban-current span {
  display: block;
  color: #c98a91;
  font-size: 10px;
  margin-top: 2px;
}

.msg-list {
  display: grid;
  gap: 7px;
  max-height: 170px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.msg-bubble {
  padding: 8px 10px;
  border-radius: 9px;
  background: #0c0c12;
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
}

.msg-bubble .who {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.msg-bubble .who span {
  color: var(--muted-2);
}

.msg-bubble.mine {
  border-color: rgba(180, 156, 255, 0.18);
  background: rgba(180, 156, 255, 0.05);
}

.msg-compose {
  display: flex;
  gap: 7px;
}

.msg-compose .input {
  flex: 1;
}

/* raid target picker */
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 7px;
  max-height: 190px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0a0a0f;
  text-align: left;
  transition: 0.14s ease;
}

.pick:hover {
  border-color: #343445;
}

.pick.selected {
  border-color: var(--accent);
  background: rgba(180, 156, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(180, 156, 255, 0.2);
}

.pick .pa {
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #191922;
  border: 1px solid #2a2a37;
  font-family: var(--mono);
  font-size: 9px;
  color: #c6b9ff;
}

.pick .pn {
  min-width: 0;
}

.pick .pn b {
  display: block;
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick .pn span {
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--muted-2);
}

.quote-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #08080d;
  display: grid;
  gap: 9px;
}

.quote-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.quote-row b {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 500;
}

.quote-row.total {
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--text);
}

.quote-row.total b {
  color: var(--good);
  font-size: 17px;
}

.quote-row .bad {
  color: var(--bad);
}

.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(180, 156, 255, 0.1);
  border: 1px solid rgba(180, 156, 255, 0.2);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hour-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.hour {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0a0a0f;
  padding: 6px 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  transition: 0.13s ease;
}

.hour:hover {
  border-color: #333342;
  color: var(--text);
}

.hour.selected {
  background: rgba(180, 156, 255, 0.13);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(180, 156, 255, 0.15);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  width: fit-content;
}

.stepper button {
  width: 30px;
  height: 30px;
  border: 0;
  background: var(--panel);
  color: var(--muted);
}

.stepper span {
  min-width: 34px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  border-inline: 1px solid var(--line);
  padding: 6px 0;
}

/* ---------------------------------------------------------------- raid overlay */
.raid-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 50% 50%, rgba(70, 4, 12, 0.62), rgba(0, 0, 0, 0.94) 70%);
  overflow: hidden;
  animation: raid-in 0.4s ease;
}

@keyframes raid-in {
  from {
    opacity: 0;
  }
}

.raid-overlay::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 30, 50, 0.08) 0deg 2deg, transparent 2deg 12deg);
  animation: spin 26s linear infinite;
  opacity: 0.55;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.raid-overlay::after {
  content: "";
  position: absolute;
  inset: -10%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 50%, transparent 25%, black 90%);
}

.raid-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
}

.raid-alert {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5em;
  color: #ff7f8c;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.raid-title {
  font-size: clamp(42px, 9vw, 100px);
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff, #ff8b96 55%, #b51326);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 50px rgba(255, 30, 50, 0.35));
  animation: rumble 0.14s infinite alternate;
}

@keyframes rumble {
  to {
    transform: translate(1px, -1px) rotate(-0.15deg);
  }
}

.raid-sub {
  margin-top: 22px;
  color: #e7c6ca;
  font-size: 14px;
}

.raid-sub b {
  color: #fff;
}

.raid-timer {
  margin-top: 22px;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding: 9px 15px;
  border: 1px solid rgba(255, 93, 108, 0.3);
  border-radius: 99px;
  background: rgba(255, 93, 108, 0.08);
  font-family: var(--mono);
  font-size: 11px;
  color: #ffb0b8;
  letter-spacing: 0.08em;
}

.raid-actions {
  margin-top: 30px;
}

.raid-close {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.raid-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------------------------------------------------------------- toast */
.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 300;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 14, 20, 0.96);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  animation: toast-in 0.24s ease;
  font-size: 12px;
}

.toast::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.toast.ok::before {
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}

.toast.err::before {
  background: var(--bad);
  box-shadow: 0 0 8px var(--bad);
}

.toast b {
  display: block;
  font-weight: 500;
  margin-bottom: 2px;
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #262633;
  border-radius: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1040px) {
  .cmd-layout {
    grid-template-columns: 1fr;
  }
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .app {
    flex-direction: column;
  }
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    overflow: visible;
    transition: none;
  }
  .sidebar:hover {
    width: 100%;
  }
  .sidebar .brand {
    padding: 0;
    margin-right: auto;
    justify-content: flex-start;
  }
  .brand-text,
  .tabs button > span {
    max-width: none;
    opacity: 1;
  }
  .tabs button {
    justify-content: center;
  }
  .side-row {
    flex-direction: row;
    align-items: center;
  }
  .sidebar:hover .side-row {
    flex-direction: row;
    align-items: center;
  }
  .sidebar:hover .side-row .user-chip,
  .side-row .user-chip {
    justify-content: flex-start;
    padding: 0 12px 0 4px;
  }
  .sidebar:hover .user-chip .uname {
    max-width: 100px;
    opacity: 1;
  }
  .sidebar:hover .user-chip .role {
    max-width: 40px;
    opacity: 1;
  }
  .sidebar:hover .live-toggle {
    justify-content: flex-start;
  }
  .side-label,
  .side-spacer {
    display: none;
  }
  .sidebar-bottom {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    margin-left: auto;
  }
  .live-toggle {
    width: auto;
    height: 34px;
    border: 1px solid var(--line);
  }
  .live-toggle > span:last-child {
    display: none;
  }
  .side-row {
    gap: 8px;
  }
  .tabs {
    order: 3;
    flex-direction: row;
    width: 100%;
    margin: 0;
    overflow-x: auto;
  }
  .tabs button {
    flex: 1;
    justify-content: center;
    padding: 8px 9px;
    font-size: 10.5px;
    white-space: nowrap;
  }
  .tabs button svg {
    display: none;
  }
  .tabs button.active::after {
    left: 50%;
    right: auto;
    top: auto;
    bottom: -1px;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    transform: translateX(-50%);
  }
  main {
    padding: 22px 14px 50px;
  }
  .panel[data-panel="players"] {
    height: calc(100vh - 100px);
  }
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }
  .billboard {
    min-height: 480px;
  }
  .pblock {
    width: 175px;
    padding: 11px;
  }
  .pblock.expanded {
    width: 300px;
  }
  .modal-root {
    padding: 10px;
  }
  .modal {
    max-height: 92vh;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .hour-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mini-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .player-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .brand span {
    display: none;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 27px;
  }
  .modal-head,
  .modal-body,
  .modal-foot {
    padding-inline: 16px;
  }
}
