:root {
  --bg: #080a0d;
  --surface: rgba(18, 22, 27, 0.92);
  --surface-2: #161b21;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3f6f7;
  --muted: #8b959e;
  --accent: #d7ff45;
  --accent-dark: #1c2300;
  --danger: #ff6b61;
  --success: #72e69c;
  --warning: #ffc857;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 18% -10%, #1c2519 0, transparent 32%), var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.ambient { position: fixed; width: 28rem; height: 28rem; border-radius: 999px; filter: blur(100px); opacity: .09; pointer-events: none; }
.ambient-one { background: var(--accent); top: -16rem; left: -10rem; }
.ambient-two { background: #3fa9f5; right: -18rem; bottom: -18rem; }

.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid var(--line); background: rgba(8, 10, 13, .82); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: 12px; letter-spacing: .02em; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: .95; }
.brand small { font-size: 9px; letter-spacing: .28em; color: var(--muted); margin-top: 5px; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid rgba(215, 255, 69, .55); background: linear-gradient(145deg, rgba(215,255,69,.18), rgba(215,255,69,.02)); color: var(--accent); font-weight: 900; font-size: 24px; clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%); }
.brand-mark-small { width: 38px; height: 38px; font-size: 17px; }
.topbar-actions, .hero-actions, .console-controls { display: flex; align-items: center; gap: 10px; }
.user-chip { color: var(--muted); font-size: 14px; padding-right: 6px; }

.dashboard { width: min(1320px, calc(100% - 40px)); margin: 32px auto 70px; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0,0,0,.2); }
.hero-panel { display: flex; align-items: center; justify-content: space-between; padding: 34px 38px; overflow: hidden; position: relative; }
.hero-panel::after { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid rgba(215,255,69,.08); border-radius: 50%; right: 12%; top: -170px; box-shadow: 0 0 0 40px rgba(215,255,69,.02), 0 0 0 80px rgba(215,255,69,.015); }
.eyebrow { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .19em; font-weight: 750; margin: 0 0 10px; }
.server-heading { display: flex; align-items: center; gap: 13px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.08; margin-bottom: 8px; letter-spacing: -.035em; }
h2 { font-size: 20px; letter-spacing: -.02em; margin-bottom: 0; }
.status-copy, .muted { color: var(--muted); margin-bottom: 0; }
.status-light { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 6px rgba(255,255,255,.03); }
.status-light.online { background: var(--success); box-shadow: 0 0 16px rgba(114,230,156,.65), 0 0 0 6px rgba(114,230,156,.08); }
.status-light.offline { background: var(--danger); }

.button { min-height: 42px; border-radius: 10px; border: 1px solid transparent; padding: 0 17px; font-weight: 720; font-size: 13px; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: #111500; }
.button-danger { background: transparent; color: var(--danger); border-color: rgba(255,107,97,.3); }
.button-ghost { background: rgba(255,255,255,.035); border-color: var(--line); color: #dce2e5; }
.button-wide { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 14px 0; }
.metric-card { padding: 21px 22px; display: flex; flex-direction: column; min-height: 128px; }
.metric-label { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.metric-card strong { font-size: 22px; letter-spacing: -.025em; }
.metric-card small { color: var(--muted); margin-top: auto; font-size: 11px; }
.meter { height: 4px; background: rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; margin-top: 13px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.meter.warning span { background: var(--warning); }
.meter.critical span { background: var(--danger); }

.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, .82fr); gap: 14px; align-items: start; }
.settings-panel, .quick-panel, .resilience-panel, .console-panel, .advanced-panel { padding: 28px; }
.gameplay-panel { margin-top: 14px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; }
.section-heading.compact { margin-bottom: 10px; }
.save-state { color: var(--muted); font-size: 11px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span:first-child { color: #bbc3c8; font-size: 12px; font-weight: 660; }
.field input:not([type="checkbox"]), .field select { width: 100%; height: 46px; border: 1px solid var(--line); background: #0d1115; color: var(--text); border-radius: 10px; padding: 0 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus { border-color: rgba(215,255,69,.55); box-shadow: 0 0 0 3px rgba(215,255,69,.08); }
.field-help { color: var(--muted); font-size: 10px; line-height: 1.4; }
.toggle-control { display: flex; align-items: center; gap: 9px; height: 46px; }
.toggle-control input { position: absolute; opacity: 0; }
.toggle { width: 42px; height: 23px; background: #30373e; border-radius: 99px; position: relative; transition: background .15s; }
.toggle::after { content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%; background: #d8dde0; left: 3px; top: 3px; transition: transform .15s; }
.toggle-control input:checked + .toggle { background: var(--accent); }
.toggle-control input:checked + .toggle::after { transform: translateX(19px); background: #171b09; }
.toggle-control small { color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 24px; }

.side-column { display: grid; gap: 14px; }
.action-row { width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 17px 2px; display: flex; align-items: center; justify-content: space-between; text-align: left; cursor: pointer; }
.action-row span { display: flex; flex-direction: column; gap: 5px; }
.action-row strong { font-size: 13px; }
.action-row small { color: var(--muted); }
.action-row b { color: var(--accent); font-size: 18px; transition: transform .15s; }
.action-row:hover b { transform: translateX(3px); }
.health-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 16px; }
.health-list li { display: flex; align-items: center; gap: 12px; }
.health-list li > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.health-list strong { font-size: 12px; }
.health-list small { color: var(--muted); font-size: 11px; }
.check { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: rgba(114,230,156,.09); color: var(--success); font-size: 12px; }

.console-panel { margin-top: 14px; }
.advanced-panel { margin-top: 14px; }
.advanced-panel summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.advanced-panel summary::-webkit-details-marker { display: none; }
.advanced-panel summary > span { display: flex; flex-direction: column; gap: 3px; }
.advanced-panel summary .eyebrow { margin-bottom: 2px; }
.advanced-panel summary small { color: var(--muted); }
.advanced-panel[open] summary { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 22px; }
.advanced-form textarea { width: 100%; min-height: 420px; resize: vertical; border: 1px solid var(--line); background: #080b0d; color: #c7d0d4; border-radius: 12px; padding: 16px; outline: none; font: 12px/1.6 "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
.advanced-form textarea:focus { border-color: rgba(215,255,69,.5); box-shadow: 0 0 0 3px rgba(215,255,69,.07); }
.advanced-warning { margin-bottom: 18px; padding: 12px 14px; border: 1px solid rgba(255,200,87,.18); background: rgba(255,200,87,.05); border-radius: 10px; color: #c9b77d; font-size: 12px; }
.console-heading { align-items: center; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 9px var(--success); }
.console { min-height: 300px; max-height: 520px; overflow: auto; margin: 0; background: #080b0d; border: 1px solid var(--line); border-radius: 12px; padding: 18px; color: #b7c0c5; font: 12px/1.65 "Cascadia Code", "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 14px; }
.flash { border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; padding: 12px 14px; color: #dbe0e3; font-size: 13px; margin-bottom: 14px; background: rgba(255,255,255,.035); }
.flash-success { border-left-color: var(--success); }
.flash-error { border-left-color: var(--danger); }
.flash-info { border-left-color: #77baff; }
.site-footer { width: min(1320px, calc(100% - 40px)); margin: 0 auto 28px; display: flex; justify-content: space-between; color: #626b72; font-size: 11px; }

.login-page { display: grid; place-items: center; }
.login-shell { width: min(430px, calc(100% - 34px)); padding: 50px 0; }
.login-card { background: rgba(17,21,25,.93); border: 1px solid var(--line); border-radius: 22px; padding: 42px; box-shadow: 0 35px 100px rgba(0,0,0,.45); }
.login-card .brand-mark { margin-bottom: 26px; }
.login-card h1 { font-size: 34px; margin-bottom: 10px; }
.login-form { display: grid; gap: 17px; margin-top: 30px; }
.login-form label { display: grid; gap: 8px; color: #bfc7cb; font-size: 12px; font-weight: 650; }
.login-form input { height: 48px; border: 1px solid var(--line); background: #0b0e11; color: var(--text); border-radius: 10px; padding: 0 13px; outline: none; }
.login-form input:focus { border-color: rgba(215,255,69,.55); box-shadow: 0 0 0 3px rgba(215,255,69,.08); }
.login-footnote { color: #697279; font-size: 11px; display: flex; align-items: center; justify-content: center; gap: 7px; margin: 22px 0 0; }
.lock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .hero-panel { align-items: flex-start; gap: 24px; flex-direction: column; }
}

@media (max-width: 580px) {
  .dashboard { width: min(100% - 24px, 1320px); margin-top: 18px; }
  .topbar { padding: 0 14px; }
  .user-chip { display: none; }
  .hero-panel, .settings-panel, .quick-panel, .resilience-panel, .console-panel, .advanced-panel { padding: 22px; }
  .hero-actions { width: 100%; flex-wrap: wrap; }
  .hero-actions form { flex: 1; }
  .hero-actions .button { width: 100%; }
  .metric-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-footer { align-items: stretch; flex-direction: column; gap: 18px; }
  .login-card { padding: 30px 24px; }
  .site-footer { width: calc(100% - 24px); }
}
