:root {
  --bg: #0b0d10;
  --panel: #12161c;
  --panel-alt: #171d25;
  --text: #e9eef6;
  --muted: #93a0b3;
  --accent: #7bf179;
  --accent-strong: #28c448;
  --warning: #ffd166;
  --danger: #ff6b6b;
  --info: #73c9ff;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(123, 241, 121, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(30, 95, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #0a0d10, #0e1117 45%, #0b0d10);
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
}

.page-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.hero,
.panel,
.stat-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Russo One", sans-serif;
  margin: 0;
  letter-spacing: 0.03em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
}

h2 {
  font-size: 1.2rem;
}

.hero-copy,
.panel-note,
.stat-foot,
.detail-label,
label,
summary,
textarea,
input,
select {
  color: var(--muted);
}

.hero-copy {
  max-width: 60ch;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.status-pill {
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--warning);
  font-weight: 600;
}

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

.status-pill.warning {
  color: #2b1800;
  background: var(--warning);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 20px;
}

.stat-card,
.panel {
  border-radius: 24px;
  padding: 20px;
}

.stat-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
}

.stat-value {
  font-size: clamp(1.4rem, 3vw, 2.6rem);
}

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

.panel {
  grid-column: span 4;
}

.wide-panel {
  grid-column: span 8;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.tab-button {
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.tab-button.is-active {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #081109;
  border-color: transparent;
  font-weight: 700;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

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

.button,
input,
select,
textarea {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--text);
  font: inherit;
}

.button {
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

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

.button-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #081109;
  font-weight: 700;
}

.button-danger {
  background: rgba(255, 107, 107, 0.2);
  color: #ffd7d7;
}

.button-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
}

textarea {
  resize: vertical;
}

.toggle-grid {
  display: grid;
  gap: 12px;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-alt);
  border-radius: 16px;
  border: 1px solid var(--line);
}

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

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-value {
  text-align: right;
}

.activity-feed {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.activity-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.activity-type {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

.raw-log-shell summary {
  cursor: pointer;
  margin-bottom: 10px;
}

pre,
.console-output {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0b1016;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: #d8e2f1;
  overflow: auto;
}

.table-shell {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  align-items: center;
}

.table-row.table-head {
  font-weight: 700;
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.notice-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.notice-card.warning {
  border-color: rgba(255, 209, 102, 0.35);
}

.notice-card.critical {
  border-color: rgba(255, 107, 107, 0.45);
}

.notice-card.success {
  border-color: rgba(123, 241, 121, 0.35);
}

.map-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #0d1118;
  margin-bottom: 14px;
}

#playerMap {
  display: block;
  width: 100%;
  height: 280px;
}

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

.link-button {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 10px;
  z-index: 1000;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(14, 18, 24, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.toast.toast-error {
  border-color: rgba(255, 107, 107, 0.4);
}

.toast.toast-success {
  border-color: rgba(123, 241, 121, 0.4);
}

@media (max-width: 1180px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel,
  .wide-panel {
    grid-column: span 6;
  }

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
  }

  .hero {
    flex-direction: column;
  }

  .hero-actions {
    align-items: stretch;
  }

  .card-grid,
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .wide-panel {
    grid-column: span 1;
  }

  .split-row,
  .table-row {
    grid-template-columns: 1fr;
  }

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