:root {
  --bg: #07111f;
  --panel-border: rgba(147, 202, 255, 0.16);
  --text: #eef5ff;
  --muted: #8ca7c6;
  --line: rgba(140, 167, 198, 0.15);
  --cyan: #5cc8ff;
  --gold: #ffbf47;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-ui: "Bahnschrift", "Aptos", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at 15% 20%, rgba(92, 200, 255, 0.2), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(255, 191, 71, 0.16), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(22, 46, 89, 0.9), transparent 45%),
    linear-gradient(160deg, #050b14 0%, #081426 55%, #050c17 100%);
  color: var(--text);
  font-family: var(--font-ui);
}

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

.shell {
  position: relative;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.ambient {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

.ambient-a {
  top: 80px;
  left: 10px;
  background: rgba(92, 200, 255, 0.28);
}

.ambient-b {
  top: 320px;
  right: 0;
  background: rgba(255, 191, 71, 0.18);
}

.card {
  background: linear-gradient(180deg, rgba(14, 28, 49, 0.92), rgba(8, 18, 32, 0.92));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.95fr);
  gap: 24px;
  padding: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--cyan);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 1.02;
}

h2 {
  font-size: 1.35rem;
}

.hero-copy {
  margin-top: 14px;
  max-width: 620px;
  color: var(--muted);
  line-height: 1.65;
}

.hero-tagline {
  margin-top: 12px;
  font-size: 0.92rem;
  color: #9fe3ff;
}

.hero-tools {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.hero-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.status-chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  font-weight: 700;
}

.status-chip {
  align-self: flex-start;
  background: rgba(92, 200, 255, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.engine-card {
  margin-top: 18px;
  padding: 22px;
}

.engine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.engine-item {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(6, 14, 26, 0.7);
}

.engine-value {
  display: block;
  margin-top: 10px;
  font-size: 1.15rem;
}

.engine-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(6, 14, 26, 0.58);
  color: var(--muted);
  line-height: 1.5;
}

.engine-note[data-tone="warn"] {
  border-color: rgba(255, 191, 71, 0.24);
  color: #ffe0a0;
}

.stat-card {
  padding: 18px 18px 20px;
  border-radius: var(--radius-md);
}

.tone-success {
  border-color: rgba(76, 224, 179, 0.22);
}

.tone-info {
  border-color: rgba(92, 200, 255, 0.22);
}

.tone-warn {
  border-color: rgba(255, 191, 71, 0.24);
}

.stat-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-value {
  margin-top: 12px;
  font-size: 2rem;
}

.stat-hint {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.controls-card,
.audit-card,
.guilds-card {
  padding: 22px;
}

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

.section-head-inline {
  align-items: center;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field span {
  color: var(--muted);
  font-size: 0.88rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(122, 153, 193, 0.24);
  background: rgba(7, 17, 31, 0.8);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(92, 200, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(92, 200, 255, 0.09);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-presets {
  margin: 14px 0 10px;
}

.section-divider {
  margin: 24px 0;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(92, 200, 255, 0.24), rgba(255, 191, 71, 0.12), transparent);
}

.toolbar.compact {
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #5cc8ff, #80ffd2);
  color: #04101e;
  font-weight: 800;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost.danger,
.btn-danger {
  color: #ffd2d2;
  border-color: rgba(255, 114, 114, 0.28);
  background: rgba(255, 114, 114, 0.08);
}

.btn-mini {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.wide {
  width: 100%;
}

.audit-stream {
  display: grid;
  gap: 12px;
  max-height: 440px;
  overflow: auto;
  padding-right: 6px;
}

.audit-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(6, 14, 26, 0.75);
}

.audit-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.audit-detail {
  margin-top: 10px;
  color: var(--text);
  line-height: 1.45;
}

.audit-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

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

.plan-context {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(6, 14, 26, 0.58);
  color: var(--muted);
  line-height: 1.5;
}

.plan-context[data-tone="premium"],
.plan-context[data-tone="paid"] {
  border-color: rgba(255, 191, 71, 0.22);
  color: #ffe0a0;
}

.plan-context[data-tone="warn"] {
  border-color: rgba(255, 114, 114, 0.22);
  color: #ffd6d6;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.guild-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

.guild-table th,
.guild-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.guild-table th {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guild-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

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

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-free {
  background: rgba(124, 166, 214, 0.11);
  color: #b6d5ff;
}

.badge-premium {
  background: rgba(255, 191, 71, 0.14);
  color: #ffd37a;
}

.badge-ultra {
  background: rgba(118, 241, 211, 0.16);
  color: #9effe6;
}

.badge-boss {
  background: rgba(255, 124, 216, 0.16);
  color: #ffc5ec;
}

.badge-playing {
  background: rgba(76, 224, 179, 0.12);
  color: #7cf2cf;
}

.badge-queued,
.badge-idle {
  background: rgba(92, 200, 255, 0.12);
  color: #97dbff;
}

.badge-standby {
  background: rgba(255, 255, 255, 0.06);
  color: #c8d8ea;
}

.search-input {
  min-width: 220px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 8, 16, 0.72);
  backdrop-filter: blur(18px);
}

.overlay.hidden {
  display: none;
}

.login-card {
  width: min(100%, 460px);
  padding: 28px;
  border-radius: 26px;
  border: 1px solid rgba(92, 200, 255, 0.18);
  background: linear-gradient(180deg, rgba(12, 24, 44, 0.96), rgba(6, 14, 26, 0.96));
  box-shadow: var(--shadow);
}

.login-card form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 260px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(6, 14, 26, 0.9);
  border: 1px solid rgba(92, 200, 255, 0.18);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast[data-tone="success"] {
  border-color: rgba(76, 224, 179, 0.24);
}

.toast[data-tone="warn"] {
  border-color: rgba(255, 191, 71, 0.26);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-block,
.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

@media (max-width: 1100px) {
  .hero,
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

  .hero,
  .controls-card,
  .audit-card,
  .guilds-card {
    padding: 18px;
  }

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

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

  .toolbar.compact {
    justify-content: stretch;
  }

  .search-input {
    min-width: 100%;
  }
}
