:root {
  --bg: #04060c;
  --panel: rgba(10, 16, 30, 0.72);
  --panel-solid: #0a101e;
  --line: rgba(80, 160, 255, 0.14);
  --line-strong: rgba(34, 227, 255, 0.35);
  --text: #d7e6ff;
  --muted: #6f84a8;
  --cyan: #22e3ff;
  --green: #3dffa8;
  --red: #ff3b6b;
  --amber: #ffb547;
  --violet: #a77bff;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(900px 500px at 10% -10%, rgba(34, 227, 255, 0.12), transparent 60%),
    radial-gradient(800px 600px at 110% 10%, rgba(167, 123, 255, 0.10), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, rgba(61, 255, 168, 0.06), transparent 60%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 227, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 227, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  z-index: 0;
}

.bg-scan {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
  z-index: 0;
}

.dim { color: var(--muted); }
.small { font-size: 12px; }

/* header */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(4, 6, 12, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(34, 227, 255, 0.6));
}

.brand-name {
  position: relative;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.22em;
  color: #fff;
  text-shadow: 0 0 12px rgba(34, 227, 255, 0.55);
}

.brand-name::before,
.brand-name::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.7;
  pointer-events: none;
}

.brand-name::before { color: var(--red); transform: translate(1px, 0); clip-path: inset(0 0 60% 0); animation: glitch 4.5s infinite steps(1); }
.brand-name::after { color: var(--cyan); transform: translate(-1px, 0); clip-path: inset(55% 0 0 0); animation: glitch 3.7s infinite steps(1) reverse; }

@keyframes glitch {
  0%, 92%, 100% { transform: translate(0, 0); opacity: 0; }
  93% { transform: translate(-3px, 1px); opacity: 0.8; }
  95% { transform: translate(3px, -1px); opacity: 0.8; }
  97% { transform: translate(-1px, 0); opacity: 0.6; }
}

.brand-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
}

.brand-sub #domain { color: var(--cyan); text-transform: none; letter-spacing: 0.04em; }

.top-right { display: flex; align-items: center; gap: 18px; }

.clock { font-family: var(--mono); font-size: 13px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  border: 1px solid currentColor;
  color: var(--green);
  background: rgba(61, 255, 168, 0.08);
  box-shadow: 0 0 18px rgba(61, 255, 168, 0.18) inset;
}

.pill[data-state="high_load"] { color: var(--amber); background: rgba(255, 181, 71, 0.08); box-shadow: 0 0 18px rgba(255, 181, 71, 0.2) inset; }
.pill[data-state="under_attack"] { color: var(--red); background: rgba(255, 59, 107, 0.1); box-shadow: 0 0 22px rgba(255, 59, 107, 0.35) inset, 0 0 22px rgba(255, 59, 107, 0.35); animation: alarm 1s infinite; }
.pill[data-state="offline"] { color: var(--muted); background: transparent; box-shadow: none; }

@keyframes alarm { 50% { box-shadow: 0 0 6px rgba(255, 59, 107, 0.2) inset, 0 0 6px rgba(255, 59, 107, 0.2); } }

.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

.pill .dot { animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.link[data-on="1"] { color: var(--green); }
.link[data-on="2"] { color: var(--red); }

/* layout */

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.wrap > *, .hero-side > * { min-width: 0; }

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  backdrop-filter: blur(6px);
}

.panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18px;
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  border-radius: 2px;
}

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

h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9fb4d8;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* hero */

.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; padding: 26px 28px; }
.hero > *, .split > *, .cards > * { min-width: 0; }

.rps {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(56px, 9vw, 112px);
  line-height: 1;
  margin: 12px 0 18px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(34, 227, 255, 0.55), 0 0 60px rgba(34, 227, 255, 0.25);
  transition: color 0.3s, text-shadow 0.3s;
}

.hero[data-state="under_attack"] .rps { color: #ffe3ea; text-shadow: 0 0 24px rgba(255, 59, 107, 0.75), 0 0 70px rgba(255, 59, 107, 0.35); }

.meter { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }

.meter-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--cyan) 50%, var(--violet) 75%, var(--red));
  background-size: 400px 100%;
  box-shadow: 0 0 12px rgba(34, 227, 255, 0.6);
  transition: width 0.6s cubic-bezier(.2, .8, .2, 1);
}

.hero-foot { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: #9fb4d8; }
.hero-foot b { color: var(--cyan); }

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

.mini {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.mini-val { font-family: var(--mono); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini.block .mini-val { color: var(--red); text-shadow: 0 0 14px rgba(255, 59, 107, 0.45); }
.mini.pass .mini-val { color: var(--green); text-shadow: 0 0 14px rgba(61, 255, 168, 0.4); }
.mini.drop .mini-val { color: var(--violet); text-shadow: 0 0 14px rgba(167, 123, 255, 0.45); }

.stages { display: flex; gap: 6px; }
.stage-name { font-family: var(--mono); font-size: 12px; color: #9fb4d8; margin-top: -2px; }
.stage-name.on { color: var(--amber); }
.stages i { flex: 1; height: 14px; border-radius: 3px; border: 1px solid var(--line-strong); background: transparent; transition: background 0.3s, box-shadow 0.3s; }
.stages i.on { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 10px rgba(255, 181, 71, 0.6); }
.stages i.on.hot { background: var(--red); border-color: var(--red); box-shadow: 0 0 10px rgba(255, 59, 107, 0.7); }

/* chart */

.legend { display: flex; gap: 14px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg.total::before { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.lg.blocked::before { background: var(--red); box-shadow: 0 0 6px var(--red); }

.chart-box { position: relative; height: 300px; }
#chart { width: 100%; height: 100%; display: block; }

.tip {
  position: absolute;
  top: 8px;
  pointer-events: none;
  background: rgba(5, 8, 16, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.tip b { color: #fff; }
.tip .c { color: var(--cyan); }
.tip .r { color: var(--red); }

/* cards */

.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover { border-color: var(--line-strong); transform: translateY(-1px); }

.card-val { font-family: var(--mono); font-size: 22px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; color: #fff; }
.card-val.red { color: var(--red); }
.card-val.amber { color: var(--amber); }
.card-val.violet { color: var(--violet); }
.card-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* bars */

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

.bar-row { display: grid; grid-template-columns: 120px 1fr 74px; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; }
.bar-name { color: #b8c9e8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-name .cc { display: inline-block; min-width: 26px; padding: 1px 4px; margin-right: 6px; border: 1px solid var(--line-strong); border-radius: 4px; text-align: center; color: var(--cyan); font-size: 10px; }
.bar-track { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); overflow: hidden; position: relative; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; transition: width 0.6s cubic-bezier(.2, .8, .2, 1); }
.bar-fill.blocked { background: var(--red); box-shadow: 0 0 8px rgba(255, 59, 107, 0.6); }
.bar-val { text-align: right; color: #fff; font-variant-numeric: tabular-nums; }

.empty { color: var(--muted); font-family: var(--mono); font-size: 12px; padding: 10px 0; }

/* live feed */

.term {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  height: 320px;
  overflow: hidden;
  position: relative;
}

.term::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: linear-gradient(transparent, rgba(4, 6, 12, 0.95));
  pointer-events: none;
}

.line { display: grid; grid-template-columns: 76px 118px 40px 56px 1fr 112px; gap: 10px; padding: 3px 0; white-space: nowrap; align-items: baseline; }
.line.fresh { animation: slide 0.5s ease-out; }
@keyframes slide { from { transform: translateX(-6px); background: rgba(34, 227, 255, 0.12); } }
.line .t { color: var(--muted); }
.line .ip { color: #b8c9e8; }
.line .cc { color: var(--cyan); }
.line .m { color: var(--violet); }
.line .p { color: #e4ecff; overflow: hidden; text-overflow: ellipsis; }
.line .v { text-align: right; font-weight: 700; letter-spacing: 0.06em; }
.line .v.pass { color: var(--green); }
.line .v.block { color: var(--red); }
.line .v.challenge { color: var(--amber); }

/* attack log */

.table-wrap { overflow-x: auto; }

.attacks { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.attacks th { text-align: left; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; padding: 0 10px 10px 0; border-bottom: 1px solid var(--line); }
.attacks td { padding: 10px 10px 10px 0; border-bottom: 1px solid rgba(80, 160, 255, 0.07); white-space: nowrap; font-variant-numeric: tabular-nums; }
.attacks tr.live td:first-child::before { content: "LIVE "; color: var(--red); font-weight: 700; animation: blink 1s infinite; }
.attacks .red { color: var(--red); }

.foot {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 28px 32px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8ea3c7;
}

.foot b { color: var(--cyan); }

@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .line { grid-template-columns: 64px 104px 34px 1fr 90px; }
  .line .m { display: none; }
}

@media (max-width: 600px) {
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .top-right { gap: 10px; width: 100%; justify-content: space-between; }
  .clock { display: none; }
  .wrap { padding: 16px 16px 4px; gap: 14px; }
  .panel { padding: 16px; }
  .hero { padding: 20px 16px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .chart-box { height: 220px; }
  .bar-row { grid-template-columns: 90px 1fr 56px; }
  .line { grid-template-columns: 58px minmax(0, 1fr) 100px; }
  .line .ip, .line .cc { display: none; }
  .foot { padding: 16px; flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
