:root {
  --bg: #07110d;
  --bg-2: #112015;
  --bg-3: #182819;
  --card: rgba(17, 30, 20, 0.88);
  --card-soft: rgba(20, 38, 24, 0.84);
  --text: #eef7e6;
  --muted: #b8c9b4;
  --accent: #cfe86a;
  --accent-2: #8df2b1;
  --accent-3: #8ad8ff;
  --danger: #ff7f8f;
  --border: rgba(190, 225, 140, 0.16);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(162, 219, 106, 0.12), transparent 22%),
    radial-gradient(circle at 85% 12%, rgba(83, 160, 109, 0.16), transparent 18%),
    radial-gradient(circle at 50% 0%, rgba(111, 84, 46, 0.15), transparent 20%),
    linear-gradient(180deg, #122116 0%, #0b120c 58%, #050806 100%);
}
a { color: inherit; text-decoration: none; }
.bg-orb {
  position: fixed; inset: auto; width: 28rem; height: 28rem; border-radius: 999px; filter: blur(70px); opacity: 0.14; pointer-events: none; z-index: 0;
}
.orb-a { top: -8rem; left: -8rem; background: #d2e97e; }
.orb-b { right: -10rem; top: 10rem; background: #53c286; }
.page-shell { position: relative; z-index: 1; max-width: 1500px; margin: 0 auto; padding: 24px; }
.topbar, .section-nav, .card {
  border: 1px solid var(--border); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; padding: 18px 22px;
}
.section-nav {
  display: flex; gap: 10px; flex-wrap: wrap; padding: 12px; margin-bottom: 18px; background: rgba(14, 26, 17, 0.8);
}
.section-link {
  border-radius: 12px; padding: 10px 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; font-weight: 700;
}
.section-link.active { color: #101a0f; background: linear-gradient(135deg, var(--accent), #7fd18e); }
.brand { font-size: 1.45rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.subbrand, .muted { color: var(--muted); }
.subbrand { letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.77rem; margin-top: 4px; }
.topnav, .actions, .inline-actions, .row-actions, .inline-between, .wrap-gap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.inline-between { justify-content: space-between; }
.button {
  border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--accent), #7dcf77);
  color: #10140c; font-weight: 800; padding: 11px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.button.secondary { background: linear-gradient(135deg, var(--accent-2), var(--accent-3)); }
.button.ghost, .button.ghost-danger {
  background: rgba(255,255,255,0.02); color: var(--text); border: 1px solid var(--border);
}
.button.danger { background: linear-gradient(135deg, #ff9aa8, var(--danger)); color: white; }
.button.tiny { padding: 8px 11px; font-size: 0.9rem; }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }
.pill, .statline, .status-chip {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,0.04);
}
.pill { font-size: 0.9rem; }
.pill.accent, .status-chip { background: rgba(207, 232, 106, 0.18); color: #eff8c9; }
.pill.accent-two { background: rgba(138, 216, 255, 0.18); color: #dff6ff; }
.card { padding: 22px; }
.hero { display: grid; gap: 22px; align-items: center; min-height: 300px; }
.hero-pal {
  grid-template-columns: 1.7fr 0.9fr;
  background:
    linear-gradient(135deg, rgba(13, 29, 18, 0.92), rgba(23, 39, 22, 0.82)),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 400 400"><g fill="none" stroke="rgba(219,240,170,0.12)" stroke-width="1"><path d="M20 300 Q90 180 180 220 T380 160"/><path d="M40 340 Q120 220 200 260 T360 210"/><circle cx="320" cy="90" r="24"/></g></svg>');
  background-size: cover;
}
.hero-grid, .triple-grid, .twin-grid, .grid { display: grid; gap: 22px; }
.hero-grid { grid-template-columns: 2fr 1fr; margin-bottom: 22px; }
.triple-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 22px; }
.twin-grid { grid-template-columns: 1.2fr 1fr; margin-bottom: 22px; }
.span-2 { grid-column: span 2; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent); font-size: 0.76rem; margin-bottom: 10px; font-weight: 800;
}
h1, h2 { margin: 0 0 14px; }
h1 { font-size: clamp(2rem, 3.2vw, 3.2rem); }
.lede { font-size: 1.02rem; color: var(--muted); max-width: 72ch; line-height: 1.6; }
.status-panel-pal {
  min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 10px; background: rgba(13, 24, 15, 0.74); border: 1px solid rgba(207, 232, 106, 0.14); border-radius: 18px; padding: 18px;
}
.mini-grid, .settings-grid { display: grid; gap: 14px; }
.mini-grid { grid-template-columns: repeat(4, 1fr); }
.settings-grid { grid-template-columns: repeat(3, 1fr); }
.metric {
  padding: 14px; border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.04);
}
.metric span { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.metric strong { font-size: 1.02rem; }
.compact-card p { min-height: 4.8em; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.compact-form label { font-size: 0.92rem; color: var(--muted); }
input, textarea, select, summary { font: inherit; }
input, textarea, select {
  width: 100%; border-radius: 14px; border: 1px solid var(--border); background: rgba(4, 9, 6, 0.82); color: var(--text); padding: 12px 14px;
}
textarea { resize: vertical; }
.top-gap { margin-top: 16px; }
.flash {
  margin-bottom: 18px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: rgba(207, 232, 106, 0.15);
}
.flash.warn { background: rgba(255, 210, 110, 0.14); }
.flash.error { background: rgba(255, 109, 135, 0.18); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.08em; }
.mono, .pre-wrap { font-family: "SFMono-Regular", Consolas, monospace; }
.pre-wrap {
  white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; border-radius: 16px; background: rgba(4, 8, 18, 0.5); border: 1px solid rgba(255,255,255,0.06); max-height: 560px; overflow: auto;
}
.audit-list, .backup-list, .role-list, .env-grid, .gate-grid { display: flex; flex-direction: column; gap: 12px; }
.audit-item, .backup-item, .env-row, .edit-card {
  border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 14px; background: rgba(255,255,255,0.03);
}
.backup-item summary { display: grid; grid-template-columns: 2fr auto auto; gap: 12px; cursor: pointer; }
.env-row { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 14px; align-items: center; }
.edit-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.edit-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 228px;
}
.current-value {
  font-size: 0.95rem;
  color: var(--muted);
}
.compact { margin-bottom: 2px; }
.countdown-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.stat-card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: flex-start;
}
.short-pre {
  max-height: 320px;
}
.raw-card {
  margin-top: 22px;
}
.small { font-size: 0.84rem; }
.warning-block { margin-top: 14px; }
.warning-card, .danger-card { background: var(--card-soft); }
.disabled-card { opacity: 0.72; }
.slim-card {
  padding-top: 18px;
  padding-bottom: 18px;
}
.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}
.intro-pills, .chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.action-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.section-head-top {
  align-items: flex-start;
}
.settings-list-card {
  margin-bottom: 18px;
}
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 180px minmax(300px, 0.95fr);
  gap: 18px;
  align-items: center;
}
.setting-row-pending {
  border-color: rgba(207, 232, 106, 0.28);
  background: rgba(207, 232, 106, 0.04);
}
.setting-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.setting-title-row h3 {
  margin: 0;
  font-size: 1.02rem;
}
.setting-desc {
  line-height: 1.55;
  max-width: 72ch;
}
.sync-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.sync-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}
.sync-note {
  margin-top: 10px;
  max-width: 78ch;
  line-height: 1.45;
}
.setting-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meta-label {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.setting-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.tiny-pill {
  font-size: 0.8rem;
  padding: 7px 10px;
}
.clean-env-grid {
  gap: 10px;
}
.clean-env-row {
  background: rgba(255,255,255,0.02);
}
.details-card summary {
  cursor: pointer;
  font-weight: 700;
}
.hero-minimal {
  min-height: 240px;
}
.status-panel-centered {
  align-items: flex-start;
  justify-content: center;
}
.hero-wordmark {
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f3ffd6;
}
.user-pill-link {
  text-decoration: none;
  color: inherit;
}
.dashboard-grid-tight {
  align-items: start;
}
.stats-grid-dense {
  margin-top: 18px;
}
.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pending-list {
  display: grid;
  gap: 12px;
}
.pending-row {
  grid-template-columns: minmax(0, 2fr) minmax(110px, 0.6fr) minmax(110px, 0.6fr) auto;
}
.pending-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}
.icon-button {
  border: 1px solid rgba(182, 231, 89, 0.2);
  background: rgba(255,255,255,0.02);
  color: #f4ffe1;
  border-radius: 12px;
  min-width: 42px;
  min-height: 42px;
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
}
.icon-button:hover {
  background: rgba(182, 231, 89, 0.12);
}
.status-pill.good, .status-card-good {
  border-color: rgba(84, 214, 114, 0.35);
}
.status-pill.warn, .status-card-warn {
  border-color: rgba(255, 166, 0, 0.35);
}
.status-pill.accent, .status-card-accent {
  border-color: rgba(98, 200, 255, 0.35);
}
.status-grid {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.trend-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.trend-row {
  display: grid;
  grid-template-columns: 200px repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}
.trend-metric {
  display: grid;
  gap: 6px;
}
.trend-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.trend-fill {
  height: 100%;
  border-radius: 999px;
}
.trend-fill.good {
  background: linear-gradient(90deg, #73f0a2, #b6e759);
}
.trend-fill.warn {
  background: linear-gradient(90deg, #f0c973, #ff8f59);
}
.trend-fill.accent {
  background: linear-gradient(90deg, #59c8ff, #73f0e2);
}
.trend-fill.muted-fill {
  background: linear-gradient(90deg, #7f9f8f, #d2ebc7);
}
.player-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.selected-player-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.player-detail-grid {
  align-items: start;
}
.radar-wrap {
  display: flex;
  justify-content: center;
  margin: 10px 0 18px;
}
.radar-chart {
  width: 100%;
  max-width: 320px;
  height: auto;
}
.radar-ring,
.radar-axis,
.progress-axis {
  fill: none;
  stroke: rgba(255,255,255,0.14);
  stroke-width: 1;
}
.radar-shape {
  fill: rgba(141, 242, 177, 0.28);
  stroke: rgba(141, 242, 177, 0.9);
  stroke-width: 2;
}
.radar-label,
.progress-label {
  fill: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.radar-key-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.explain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.explain-grid .metric {
  align-content: start;
  gap: 10px;
  min-height: 190px;
}
.explain-grid .metric strong {
  line-height: 1.3;
}
.explain-grid .metric p {
  margin: 0;
  line-height: 1.6;
}
.progress-chart-shell {
  position: relative;
}
.progression-chart {
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(255,255,255,0.035) 0, rgba(255,255,255,0.035) 106px, rgba(255,255,255,0.02) 106px, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.06);
}
.progress-axis-strip {
  fill: rgba(255,255,255,0.03);
}
.progress-grid-line {
  stroke: rgba(255,255,255,0.10);
  stroke-width: 1;
  stroke-dasharray: 2 8;
}
.progress-grid-line.minor {
  stroke: rgba(141, 242, 177, 0.14);
  stroke-width: 1.15;
  stroke-dasharray: 0;
}
.progress-grid-line.major {
  stroke: rgba(141, 242, 177, 0.30);
  stroke-width: 1.5;
  stroke-dasharray: 0;
}
.progress-grid-label {
  fill: rgba(188, 208, 187, 0.72);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.progress-grid-label.minor {
  fill: rgba(216, 243, 219, 0.82);
}
.progress-grid-label.major {
  fill: rgba(216, 243, 219, 0.96);
  font-size: 12px;
  font-weight: 700;
}
.progress-line {
  fill: none;
  stroke: #8df2b1;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(141, 242, 177, 0.24));
}
.progress-dot {
  fill: #d8f3db;
  stroke: rgba(141, 242, 177, 0.88);
  stroke-width: 1.2;
}
.progress-dot-hitbox {
  fill: rgba(141, 242, 177, 0.001);
  stroke: transparent;
  cursor: pointer;
}
.progress-dot-group {
  cursor: pointer;
}
.progress-dot-group:hover .progress-dot,
.progress-dot-group:focus .progress-dot,
.progress-dot-group.selected .progress-dot {
  r: 4.4;
  fill: #ffffff;
  stroke: rgba(141, 242, 177, 1);
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(141, 242, 177, 0.45));
}
.progress-dot-group:focus {
  outline: none;
}
.progress-point-detail {
  padding: 12px 14px;
  border: 1px solid rgba(141, 242, 177, 0.18);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  max-width: 72ch;
}
.progress-float-card {
  position: absolute;
  min-width: 290px;
  max-width: 360px;
  padding: 16px 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(26, 48, 33, 0.96) 0%, rgba(12, 24, 17, 0.97) 100%),
    radial-gradient(circle at top left, rgba(141, 242, 177, 0.18), transparent 52%);
  border: 1px solid rgba(141, 242, 177, 0.34);
  box-shadow: 0 18px 44px rgba(0,0,0,0.34), 0 0 0 1px rgba(141, 242, 177, 0.10) inset, 0 0 22px rgba(141, 242, 177, 0.12);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 3;
}
.progress-float-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.progress-float-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
  color: #effff3;
}
.progress-float-sub {
  margin-top: 4px;
  color: rgba(218, 241, 223, 0.72);
}
.progress-float-time {
  margin-top: 10px;
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(141, 242, 177, 0.16);
  color: #dfffe8;
}
.progress-caption {
  max-width: 72ch;
}
@media (max-width: 1180px) {
  .trend-row {
    grid-template-columns: 1fr;
  }
  .filter-row, .status-grid {
    align-items: flex-start;
  }
  .hero-pal, .hero-grid, .triple-grid, .twin-grid, .span-2 { grid-template-columns: 1fr; grid-column: auto; }
  .mini-grid, .settings-grid, .edit-card-grid, .sync-meta, .radar-key-grid, .player-form-grid { grid-template-columns: repeat(2, 1fr); }
  .explain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setting-row, .pending-row { grid-template-columns: 1fr; }
  .setting-control { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .page-shell { padding: 14px; }
  .topbar { padding: 16px; flex-direction: column; align-items: flex-start; }
  .section-nav { padding: 10px; }
  .mini-grid, .settings-grid, .env-row, .backup-item summary, .edit-card-grid, .countdown-banner, .sync-meta, .radar-key-grid, .player-form-grid, .explain-grid { grid-template-columns: 1fr; }
  .countdown-banner { display: grid; }
  .page-intro, .selected-player-strip { flex-direction: column; }
  .progress-float-card {
    min-width: 0;
    max-width: min(280px, calc(100% - 20px));
  }
}
