@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-void: #060607;
  --surface: #0e0e10;
  --surface-raised: #17171a;
  --border: #2a1416;
  --neon-red: #ff2b3f;
  --neon-red-bright: #ff5c6c;
  --neon-red-dim: rgba(255, 43, 63, 0.14);
  --signal-green: #39ff8e;
  --alert-red: #ff2b3f;
  --text-primary: #f2eeee;
  --text-muted: #8a7476;
  --font-display: 'Chakra Petch', ui-sans-serif, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --corner: 10px;
}

* { box-sizing: border-box; }

/* Angled "cut corner" panel look, used on cards/sections instead of rounded corners */
.hud-panel {
  clip-path: polygon(
    var(--corner) 0, 100% 0, 100% calc(100% - var(--corner)),
    calc(100% - var(--corner)) 100%, 0 100%, 0 var(--corner)
  );
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(255, 43, 63, 0.08), transparent 60%),
    var(--bg-void)
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22420%22%20height%3D%22420%22%20viewBox%3D%220%200%20420%20420%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20stroke%3D%22%23ff2b3f%22%20stroke-width%3D%221.4%22%20opacity%3D%220.55%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M20%2020%20L20%2090%20L90%2090%20L90%2060%22/%3E%0A%20%20%20%20%3Cpath%20d%3D%22M90%2060%20L160%2060%20L160%2020%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%2220%22%20cy%3D%2220%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%2290%22%20cy%3D%2290%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%22160%22%20cy%3D%2220%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Cpath%20d%3D%22M260%2030%20L340%2030%20L340%20100%20L400%20100%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%22340%22%20cy%3D%22100%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%22260%22%20cy%3D%2230%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Cpath%20d%3D%22M30%20200%20L30%20260%20L100%20260%20L100%20320%20L60%20320%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%22100%22%20cy%3D%22260%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%2260%22%20cy%3D%22320%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Cpath%20d%3D%22M220%20180%20L280%20180%20L280%20240%20L360%20240%20L360%20210%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%22280%22%20cy%3D%22180%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%22360%22%20cy%3D%22240%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Cpath%20d%3D%22M180%20320%20L180%20380%20L260%20380%20L260%20350%20L340%20350%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%22180%22%20cy%3D%22380%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Ccircle%20cx%3D%22340%22%20cy%3D%22350%22%20r%3D%223%22/%3E%0A%20%20%20%20%3Cpath%20d%3D%22M0%20150%20L15%20150%20M0%20155%20L10%20155%22%20stroke-width%3D%221%22/%3E%0A%20%20%20%20%3Cpath%20d%3D%22M405%20260%20L420%20260%20M410%20265%20L420%20265%22%20stroke-width%3D%221%22/%3E%0A%20%20%3C/g%3E%0A%3C/svg%3E");
  background-size: auto, auto, 420px 420px;
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-display);
  padding: 28px 40px 60px;
  position: relative;
  overflow-x: hidden;
}

/* Slow scanline sweep across the whole page — subtle, not distracting */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 43, 63, 0.05) 50%, transparent 100%);
  height: 200px;
  animation: scan 7s linear infinite;
  z-index: 1000;
  mix-blend-mode: screen;
}
@keyframes scan {
  0%   { transform: translateY(-200px); }
  100% { transform: translateY(100vh); }
}
@media (prefers-reduced-motion: reduce) {
  body::after { display: none; }
}

/* HUD corner brackets — reusable on major panels */
.hud-corners { position: relative; }
.hud-corners::before, .hud-corners::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  pointer-events: none;
}
.hud-corners::before {
  top: -1px; right: -1px;
  border-top: 2px solid var(--neon-red);
  border-right: 2px solid var(--neon-red);
  box-shadow: 1px -1px 6px rgba(255, 43, 63, 0.5);
}
.hud-corners::after {
  bottom: -1px; left: -1px;
  border-bottom: 2px solid var(--neon-red);
  border-left: 2px solid var(--neon-red);
  box-shadow: -1px 1px 6px rgba(255, 43, 63, 0.5);
}

h1, h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--neon-red-dim);
  margin-bottom: 28px;
  position: relative;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 140px; height: 2px;
  background: var(--neon-red);
  box-shadow: 0 0 8px var(--neon-red), 0 0 16px var(--neon-red);
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar h1 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 12px rgba(255, 43, 63, 0.35);
}
.topbar__meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

.trace-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--neon-red);
  box-shadow: 0 0 6px var(--neon-red), 0 0 0 0 rgba(255, 43, 63, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 6px var(--neon-red), 0 0 0 0 rgba(255, 43, 63, 0.55); }
  70%  { box-shadow: 0 0 6px var(--neon-red), 0 0 0 8px rgba(255, 43, 63, 0); }
  100% { box-shadow: 0 0 6px var(--neon-red), 0 0 0 0 rgba(255, 43, 63, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .trace-dot { animation: none; }
}

.dragon-perch {
  position: relative;
  margin-top: 260px;
  margin-bottom: 24px;
}
.dragon-svg {
  position: absolute;
  right: 12px;
  bottom: -30px;
  width: 200px;
  height: auto;
  opacity: 0.94;
  filter: drop-shadow(0 0 10px rgba(255, 43, 63, 0.55)) drop-shadow(0 0 22px rgba(255, 43, 63, 0.25));
  pointer-events: none;
  z-index: 3;
}
@media (max-width: 900px) {
  .dragon-svg { width: 130px; }
  .dragon-perch { margin-top: 180px; }
}
.pool-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 0 !important;
}
.pool-summary { clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.pool-stat {
  background: var(--surface);
  padding: 20px 22px;
}
.pool-stat__value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  color: var(--neon-red-bright);
  text-shadow: 0 0 10px rgba(255, 92, 108, 0.45);
}
.pool-stat__label {
  margin-top: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.chart-section {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 24px 8px;
  margin-bottom: 32px;
}
.chart-section { clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.chart-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.chart-section__head h2 { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.chart-section__hint { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
#chart { width: 100%; height: 200px; display: block; }

.workers-section h2 {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}

.workers-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.warehouse {
  background: var(--surface);
  border: 1px solid var(--border);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}

.warehouse__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.warehouse__summary::-webkit-details-marker { display: none; }

.warehouse__chevron {
  font-family: var(--font-mono);
  color: var(--neon-red);
  text-shadow: 0 0 6px var(--neon-red);
  font-size: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.warehouse[open] .warehouse__chevron { transform: rotate(90deg); }

.warehouse__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.warehouse__meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.warehouse__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.empty-state {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--border);
}

.worker-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: border-color 0.2s ease;
}
.worker-card:hover { border-color: var(--neon-red-dim); }
.worker-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--signal-green);
  box-shadow: 0 0 8px var(--signal-green);
}
.worker-card.offline::before {
  background: var(--alert-red);
  box-shadow: 0 0 8px var(--alert-red);
}

.worker-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.worker-card__name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.worker-card__status {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: rgba(57, 255, 142, 0.1);
  color: var(--signal-green);
  border: 1px solid rgba(57, 255, 142, 0.3);
}
.worker-card.offline .worker-card__status {
  background: rgba(255, 43, 63, 0.1);
  color: var(--neon-red-bright);
  border-color: rgba(255, 43, 63, 0.35);
}

.worker-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.worker-card__row:first-of-type { border-top: none; }
.worker-card__row .label { color: var(--text-muted); }
.worker-card__row .value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.cpu-bar-track {
  width: 100px;
  height: 6px;
  background: var(--bg-void);
  border: 1px solid var(--border);
  overflow: hidden;
}
.cpu-bar-fill {
  height: 100%;
  background: var(--neon-red);
  box-shadow: 0 0 6px var(--neon-red);
  transition: width 0.4s ease;
}
.cpu-bar-fill.hot {
  background: var(--neon-red-bright);
  box-shadow: 0 0 10px var(--neon-red-bright);
}

.pool-address {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}
.pool-summary {
    position: relative;
    overflow: visible;
}

.pool-dragon {
    position: absolute;
    top: -120px;
    right: -40px;
    width: 200px;
    height: auto;
    z-index: 10;
    pointer-events: none;
    filter: drop-shadow(0 0 15px rgba(255, 43, 63, 0.6));
}
