:root {
  color-scheme: dark;
  --bg: #07080a;
  --surface: #101216;
  --surface-2: #151820;
  --surface-3: #1c202a;
  --line: #272d38;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f4f6f8;
  --muted: #9aa3af;
  --green: #7cff4d;
  --gold: #ffe45a;
  --orange: #ff7b2d;
  --bad: #ffb169;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@font-face {
  font-family: "Bright Chalk";
  src: url("/assets/fonts/BrightChalk.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -10%, rgba(124, 255, 77, 0.11), transparent 24rem),
    radial-gradient(circle at 86% 8%, rgba(255, 123, 45, 0.1), transparent 24rem),
    linear-gradient(180deg, #08090b, var(--bg));
}

button,
input,
select {
  min-height: 40px;
  border-radius: 6px;
  font: inherit;
}

button {
  border: 1px solid transparent;
  cursor: pointer;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  background: #090b0f;
  color: var(--text);
  padding: 0 11px;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 228, 90, 0.12);
}

.hidden {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 8, 10, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-family: "Bright Chalk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
}

.brand img {
  width: 58px;
  height: 40px;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: screen;
}

.brand span {
  font-size: 1.05rem;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 14px;
  min-width: 0;
}

#status {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

#status.bad {
  color: var(--bad);
}

.account-badge {
  display: inline-grid;
  width: fit-content;
  max-width: min(42vw, 340px);
  min-width: 84px;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 228, 90, 0.22);
  border-radius: 8px;
  background: rgba(21, 24, 32, 0.86);
  white-space: nowrap;
}

.account-badge span,
.account-badge strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-badge span {
  color: var(--muted);
  font-size: 0.72rem;
}

.account-badge strong {
  color: var(--text);
  font-size: 0.9rem;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.login-card {
  width: min(100%, 410px);
  margin: 10vh auto 0;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(16, 18, 22, 0.88);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.login-card img {
  display: block;
  width: min(100%, 390px);
  height: auto;
  aspect-ratio: 1254 / 520;
  object-fit: cover;
  object-position: center 52%;
  mix-blend-mode: screen;
  filter: saturate(1.08) contrast(1.08);
  border-radius: 0;
  margin: -12px auto 18px;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 0.84rem;
}

.dashboard {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar,
.workspace,
.tab-panel,
.editor,
.record,
.metric {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(16, 18, 22, 0.84);
}

.sidebar {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.sidebar-title,
.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tab,
.ghost {
  width: 100%;
  justify-content: start;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
}

.tab.active {
  border-color: rgba(255, 228, 90, 0.28);
  background: linear-gradient(90deg, rgba(255, 228, 90, 0.14), rgba(124, 255, 77, 0.05));
  color: var(--text);
}

.ghost {
  margin-top: 10px;
  border-color: var(--line);
}

.workspace {
  min-height: 620px;
  padding: 18px;
}

.tab-panel {
  display: none;
  border: 0;
  background: transparent;
}

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

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.search-row {
  width: min(100%, 420px);
  grid-template-columns: minmax(0, 1fr) auto;
}

.editor {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 14px;
}

.limas-editor {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 1.25rem;
  border: 1px solid rgba(238, 213, 119, .25);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 244, 190, .05), rgba(8, 12, 13, .8));
}

.limas-editor textarea { min-height: 110px; resize: vertical; }
.limas-editor .wide { grid-column: 1 / -1; }
.limas-impact { margin: 0; padding: 1rem; border: 1px solid rgba(238, 213, 119, .25); border-radius: 10px; }
.limas-impact legend { padding: 0 .35rem; font-weight: 700; }
.limas-scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem .8rem; }
.limas-scope-grid .check { align-items: flex-start; min-height: 0; padding: .25rem 0; }
.limas-scope-grid small { display: block; margin-top: .12rem; color: var(--muted); font-weight: 400; }
.limas-impact-summary { margin: .8rem 0 0; color: var(--gold); }
.limas-impact.optional { opacity: .72; }

.editor .wide {
  grid-column: span 3;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #090b0f;
}

.check input {
  width: auto;
  min-height: auto;
}

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

.accounts-layout {
  display: block;
}

.staff-back {
  display: inline-grid;
  align-items: center;
  padding: 0 12px;
  text-decoration: none;
}

.staff-account-page {
  display: grid;
  gap: 16px;
}

.staff-account-hero,
.staff-account-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(16, 18, 22, 0.86);
  padding: 18px;
}

.account-title,
.panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-title .pill {
  margin-left: auto;
}

.role-glyph {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  color: var(--gold);
  font-weight: 900;
}

.account-role-glyph {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 228, 90, 0.28);
  border-radius: 8px;
  background: rgba(255, 228, 90, 0.07);
  font-size: 1.35rem;
}

.staff-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.account-facts,
.sensitive-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.account-facts div,
.sensitive-facts p {
  display: grid;
  gap: 4px;
  margin: 0;
  overflow-wrap: anywhere;
}

.account-facts dt,
.sensitive-facts strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.account-facts dd { margin: 0; }

.color-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  vertical-align: -1px;
}

.color-swatch.player-color-red { background: #d55252; }.player-color-red { --profile-color: #d55252; }
.color-swatch.player-color-green { background: #69b86f; }.player-color-green { --profile-color: #69b86f; }
.color-swatch.player-color-pink { background: #e78cb5; }.player-color-pink { --profile-color: #e78cb5; }
.color-swatch.player-color-purple { background: #a583d4; }.player-color-purple { --profile-color: #a583d4; }
.color-swatch.player-color-blue { background: #6199d2; }.player-color-blue { --profile-color: #6199d2; }
.color-swatch.player-color-yellow { background: #e6cb5f; }.player-color-yellow { --profile-color: #e6cb5f; }
.color-swatch.player-color-brown { background: #8d674b; }.player-color-brown { --profile-color: #8d674b; }
.color-swatch.player-color-white { background: #e8e8e3; }.player-color-white { --profile-color: #e8e8e3; }
.color-swatch.player-color-gray { background: #8e949d; }.player-color-gray { --profile-color: #8e949d; }

.sensitive-grid { display: grid; grid-template-columns: minmax(200px, .55fr) minmax(0, 1.45fr); gap: 16px; }
.sensitive-sessions { display: grid; gap: 9px; }
.sensitive-sessions h3 { margin: 0; font-size: 1rem; }
.compact-form { grid-template-columns: minmax(0, 1fr) auto; }
.currency-balance { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; }
.currency-balance span { border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 10px; color: var(--muted); }
.currency-balance strong { color: var(--text); margin-right: 4px; }
.currency-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.currency-form label { display: grid; gap: 5px; color: var(--muted); font-size: .8rem; }
.currency-form input:not([type="number"]) { grid-column: 1 / -1; }
.currency-form button { justify-self: start; }
.name-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line-soft); align-items: end; }
.name-form label { display: grid; gap: 5px; color: var(--text); font-size: .85rem; }

.record {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.member-record {
  cursor: pointer;
}

.member-record:hover,
.member-record.selected {
  border-color: rgba(255, 228, 90, 0.34);
  background: rgba(21, 24, 32, 0.96);
}

.record-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.record-actions {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(150px, 1fr) auto;
  gap: 8px;
}

.record-actions.compact {
  grid-template-columns: repeat(2, max-content);
}

.role-record {
  border-left: 3px solid rgba(255, 228, 90, 0.48);
}

.role-record.protected {
  border-left-color: var(--orange);
}

.role-token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(255, 228, 90, 0.24);
  border-radius: 999px;
  background: rgba(255, 228, 90, 0.08);
  padding: 6px 11px;
  font-weight: 750;
}

.role-token strong {
  color: var(--gold);
  font-size: 0.82rem;
}

.role-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  color: var(--gold);
}

.role-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.role-icon-fallback {
  border: 1px solid rgba(255, 228, 90, 0.28);
  border-radius: 2px;
  background: rgba(255, 228, 90, 0.12);
}

.clickable-record { cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.clickable-record:hover, .clickable-record:focus-visible { border-color: var(--gold); background: rgba(255, 228, 90, 0.055); outline: none; }
.role-owner, .role-administrator { --role-accent: #ff6f36; }
.role-staff, .role-moderator { --role-accent: #53d66e; }
.role-vip, .role-plus { --role-accent: #ffe45a; }
.role-player { --role-accent: #57a7ff; }
.role-chip[class*="role-"], .account-role-glyph[class*="role-"] { border-color: color-mix(in srgb, var(--role-accent, var(--gold)) 62%, var(--line-soft)); color: var(--role-accent, var(--gold)); background: color-mix(in srgb, var(--role-accent, var(--gold)) 12%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--role-accent, var(--gold)) 16%, transparent); }
.account-role-glyph { display: grid; place-items: center; width: 58px; height: 58px; border: 1px solid var(--line-soft); border-radius: 7px; font-size: 1.65rem; }
.staff-server-page { display: grid; gap: 18px; }
.server-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.server-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.server-detail-grid article { display: grid; gap: 7px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--panel); padding: 14px; }
.server-detail-grid span, .server-player-row small, .server-player-location { color: var(--muted); font-size: 0.78rem; }
.server-player-list { display: grid; gap: 8px; margin-top: 12px; }
.server-player-row { --profile-color: #aeb5be; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 64px; border: 1px solid var(--line-soft); border-left: 3px solid var(--profile-color); border-radius: 7px; background: rgba(0, 0, 0, 0.14); color: var(--text); padding: 9px 12px; text-decoration: none; }
.server-player-row:hover { border-color: var(--profile-color); background: color-mix(in srgb, var(--profile-color) 7%, var(--panel)); }
.server-player-row strong, .server-player-row small { display: block; }
.server-player-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--profile-color); border-radius: 6px; color: var(--profile-color); background: color-mix(in srgb, var(--profile-color) 13%, transparent); font-size: 1.15rem; box-shadow: 0 0 14px color-mix(in srgb, var(--profile-color) 22%, transparent); }
@media (max-width: 760px) { .server-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .server-player-row { grid-template-columns: 42px minmax(0, 1fr); } .server-player-location { grid-column: 2; } }

.protected-pill {
  border-color: rgba(255, 123, 45, 0.36);
  color: #ffc59e;
}

.member-profile {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(16, 18, 22, 0.9);
  padding: 16px;
}

.member-profile h2 {
  margin: 0;
  font-size: 1.35rem;
}

.profile-block {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.profile-block span {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-block strong {
  overflow-wrap: anywhere;
}

.moderation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.6fr) auto;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.moderation-activity {
  margin-top: 6px;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
}

.history-row span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
}

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 228, 90, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.86rem;
}

.role-chip.protected {
  border-color: rgba(255, 123, 45, 0.34);
}

.role-chip strong {
  color: var(--gold);
}

.role-remove {
  display: inline-grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  border-color: rgba(255, 123, 45, 0.35);
  border-radius: 999px;
  background: rgba(255, 123, 45, 0.12);
  color: #ffc59e;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.role-remove:hover:not(:disabled) {
  border-color: rgba(255, 123, 45, 0.72);
  background: rgba(255, 123, 45, 0.22);
  color: #fff0e6;
}

.role-remove:disabled,
.role-remove.disabled {
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(244, 246, 248, 0.38);
}

.role-grant {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.empty-state,
.log-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(16, 18, 22, 0.88);
  padding: 18px;
}

.empty-state {
  display: grid;
  gap: 10px;
  min-height: 260px;
  align-content: center;
  border-color: rgba(255, 228, 90, 0.18);
  background:
    linear-gradient(90deg, rgba(124, 255, 77, 0.055), rgba(255, 228, 90, 0.05), rgba(255, 123, 45, 0.045)),
    rgba(16, 18, 22, 0.9);
}

.empty-state h2,
.log-card h2 {
  line-height: 1.15;
}

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

.log-card {
  display: grid;
  gap: 10px;
  min-height: 180px;
  align-content: start;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.84rem;
}

.pill strong {
  color: var(--text);
}

.primary {
  background: linear-gradient(90deg, var(--gold), var(--green));
  color: #111500;
  font-weight: 800;
}

.secondary {
  border-color: rgba(255, 228, 90, 0.26);
  background: var(--surface-3);
  color: var(--text);
}

.danger {
  border-color: rgba(255, 123, 45, 0.32);
  background: rgba(255, 123, 45, 0.12);
  color: #ffc59e;
}

.release-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 11, 15, 0.86);
}

.release-card-critical {
  border-color: rgba(255, 123, 45, 0.42);
}

.release-card h2 {
  margin: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

@media (max-width: 860px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: space-between;
  }

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

  .sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .tab,
  .ghost {
    width: auto;
    white-space: nowrap;
  }

  .summary-grid,
  .editor,
  .search-row,
  .record-actions,
  .record-actions.compact,
  .role-grant,
  .moderation-form,
  .name-form,
  .logs-layout,
  .accounts-layout {
    grid-template-columns: 1fr;
  }

  .member-profile {
    position: static;
  }

  .editor .wide {
    grid-column: auto;
  }
}
