*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0c0a07;
  --amber: #e8b820;
  --amber-bright: #ffcc22;
  --amber-dim: #a07810;
  --red: #e83010;
  --red-bright: #ff3a18;
  --green: #2ecc40;
  --green-bright: #44ff55;
  --black: #050403;
  --glow-amber: 0 0 4px #e8b820, 0 0 10px rgba(232, 184, 32, 0.55), 0 0 22px rgba(232, 184, 32, 0.2);
  --glow-red: 0 0 4px #e83010, 0 0 10px rgba(232, 48, 16, 0.6), 0 0 18px rgba(232, 48, 16, 0.3);
  --glow-green: 0 0 4px #2ecc40, 0 0 10px rgba(46, 204, 64, 0.55), 0 0 16px rgba(46, 204, 64, 0.25);
  --font-mono: 'Share Tech Mono', monospace;
  --font-display: 'Orbitron', sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--amber);
  font-family: var(--font-mono);
}

.mesh-bg {
  position: fixed;
  inset: 0;
  background-color: #0e0c08;
  background-image:
    linear-gradient(30deg, rgba(180, 140, 40, 0.07) 1px, transparent 1px),
    linear-gradient(150deg, rgba(180, 140, 40, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 140, 40, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(180, 140, 40, 0.04) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 14px 14px, 14px 14px;
  pointer-events: none;
  z-index: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 1;
}

.hud {
  position: relative;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.eclipse-brand {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--amber-bright);
  text-shadow: var(--glow-amber);
  pointer-events: none;
  opacity: 0.85;
}

.quad {
  position: relative;
  padding: 18px 22px;
  overflow: hidden;
}

.quad::before,
.quad::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--amber);
  border-style: solid;
  opacity: 0.7;
  filter: drop-shadow(0 0 3px var(--amber));
  pointer-events: none;
  z-index: 3;
}

.quad-tl::before { top: 10px; left: 14px; border-width: 2px 0 0 2px; }
.quad-tl::after { bottom: 10px; left: 14px; border-width: 0 0 2px 2px; }
.quad-tr::before { top: 10px; right: 14px; border-width: 2px 2px 0 0; }
.quad-tr::after { bottom: 10px; right: 14px; border-width: 0 2px 2px 0; }
.quad-bl::before { top: 10px; left: 14px; border-width: 2px 0 0 2px; }
.quad-bl::after { bottom: 10px; left: 14px; border-width: 0 0 2px 2px; }
.quad-br::before { top: 10px; right: 14px; border-width: 2px 2px 0 0; }
.quad-br::after { bottom: 10px; right: 14px; border-width: 0 2px 2px 0; }

.quad-tl {
  border-right: 1px solid rgba(232, 184, 32, 0.12);
  border-bottom: 1px solid rgba(232, 184, 32, 0.12);
  clip-path: polygon(0 0, 100% 0, 72% 100%, 0 100%);
}

.quad-tr {
  border-left: 1px solid rgba(232, 184, 32, 0.12);
  border-bottom: 1px solid rgba(232, 184, 32, 0.12);
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-right: 28px;
}

.quad-bl {
  border-right: 1px solid rgba(232, 184, 32, 0.12);
  border-top: 1px solid rgba(232, 184, 32, 0.12);
  clip-path: polygon(0 0, 72% 0, 100% 100%, 0 100%);
}

.quad-br {
  border-left: 1px solid rgba(232, 184, 32, 0.12);
  border-top: 1px solid rgba(232, 184, 32, 0.12);
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
}

.diamond-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vh, 92vw);
  height: min(92vh, 92vw);
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 0 6px rgba(232, 184, 32, 0.5)) drop-shadow(0 0 16px rgba(232, 184, 32, 0.25));
}

.d-line {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.d1 { stroke-width: 2; opacity: 1; }
.d2 { opacity: 0.75; }
.d3 { opacity: 0.5; }
.d4 { opacity: 0.35; }

.h-bar {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  height: 38px;
  background: var(--black);
  border-top: 1px solid var(--amber-dim);
  border-bottom: 1px solid var(--amber-dim);
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 14%, transparent 32%, transparent 68%, #000 86%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 14%, transparent 32%, transparent 68%, #000 86%, #000 100%);
}

.h-bar-inner {
  display: flex;
  width: 200%;
  height: 100%;
  align-items: center;
  animation: chev-drift 20s linear infinite;
}

.h-bar-left,
.h-bar-right {
  flex: 1;
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: var(--amber-bright);
  text-shadow: var(--glow-amber);
  letter-spacing: 0;
  line-height: 1;
  overflow: hidden;
}

.h-bar-left {
  justify-content: flex-end;
  padding-right: 4px;
}

.h-bar-right {
  justify-content: flex-start;
  padding-left: 4px;
}

@keyframes chev-drift {
  from { transform: translateX(0); }
  to { transform: translateX(-25%); }
}

.center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% - 48px));
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  width: min(320px, 70vw);
}

.center-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-height: 36px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(232, 184, 32, 0.35);
  box-shadow:
    inset 0 0 24px rgba(232, 184, 32, 0.04),
    0 0 12px rgba(232, 184, 32, 0.12);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.slot-bracket {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--amber-bright);
  text-shadow: var(--glow-amber);
  line-height: 1;
  flex-shrink: 0;
}

.slot-content {
  flex: 1;
  min-width: 80px;
  min-height: 14px;
  margin: 0 6px;
  border-bottom: 1px dashed rgba(232, 184, 32, 0.25);
  opacity: 0.6;
}

.center-warn {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--red-bright);
  text-shadow: var(--glow-red);
  letter-spacing: 3px;
  animation: warn-pulse 2.4s ease-in-out infinite;
}

.center-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(232, 184, 32, 0.7);
  text-shadow: 0 0 6px rgba(232, 184, 32, 0.3);
  letter-spacing: 2px;
}

@keyframes warn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.panel-bars {
  display: flex;
  align-items: center;
  padding-left: 28px;
  padding-top: 24px;
}

.panel-bars .bars {
  border: 1px solid rgba(232, 184, 32, 0.35);
  padding: 10px 12px 10px 8px;
  box-shadow: inset 0 0 20px rgba(232, 184, 32, 0.04), var(--glow-amber);
  background: rgba(0, 0, 0, 0.25);
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 340px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 6px;
}

.bar-label {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--amber);
  text-shadow: var(--glow-amber);
  white-space: nowrap;
}

.bar-track {
  height: 7px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(232, 184, 32, 0.25);
  position: relative;
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 50%, calc(100% - 5px) 100%, 0 100%);
}

.bar-fill {
  height: 100%;
  transition: width 0.8s ease;
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 50%, calc(100% - 5px) 100%, 0 100%);
}

.bar-fill.amber {
  background: linear-gradient(90deg, #8a6808, var(--amber-bright));
  box-shadow: var(--glow-amber);
}

.bar-fill.red {
  background: linear-gradient(90deg, #8a1808, var(--red-bright));
  box-shadow: var(--glow-red);
}

.bar-fill.green {
  background: linear-gradient(90deg, #0a5a18, var(--green-bright));
  box-shadow: var(--glow-green);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 13px);
  grid-template-rows: repeat(4, 13px);
  gap: 2px;
  flex-shrink: 0;
}

.status-cell {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(232, 184, 32, 0.3);
}

.status-cell.red {
  background: rgba(232, 48, 16, 0.7);
  border-color: var(--red-bright);
  box-shadow: var(--glow-red);
}

.status-cell.green {
  background: rgba(46, 204, 64, 0.55);
  border-color: var(--green-bright);
  box-shadow: var(--glow-green);
}

.hazard-stripes {
  width: 22px;
  height: 72px;
  flex-shrink: 0;
  background: repeating-linear-gradient(
    -55deg,
    var(--amber-bright) 0px,
    var(--amber-bright) 5px,
    #000 5px,
    #000 10px
  );
  opacity: 0.9;
}

.ready-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--amber);
  box-shadow: var(--glow-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.4);
}

.ready-inner {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, rgba(40, 10, 5, 0.9) 0%, #0a0402 65%, #000 100%);
  box-shadow: inset -4px -6px 14px rgba(0, 0, 0, 0.8), inset 3px 3px 10px rgba(232, 48, 16, 0.15);
}

.sphere-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 1;
}

.ready-text {
  position: relative;
  z-index: 3;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: var(--amber-bright);
  text-shadow: var(--glow-amber), 0 0 12px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.5px;
  pointer-events: none;
}

.panel-logs {
  display: flex;
  align-items: flex-end;
  padding-left: 24px;
  padding-bottom: 20px;
}

.logs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.log-line {
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.3px;
  color: rgba(232, 184, 32, 0.75);
  text-shadow: 0 0 3px rgba(232, 184, 32, 0.3);
  white-space: nowrap;
  overflow: hidden;
}

.marker {
  margin-left: 4px;
}

.marker.red {
  color: var(--red-bright);
  text-shadow: var(--glow-red);
}

.marker.green {
  color: var(--green-bright);
  text-shadow: var(--glow-green);
}

.panel-viz {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding-right: 24px;
  padding-bottom: 18px;
}

.panel-viz .viz-grid {
  border: 1px solid rgba(232, 184, 32, 0.3);
  padding: 3px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5);
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  grid-template-rows: repeat(14, 1fr);
  gap: 1px;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 24 / 14;
}

.viz-cell {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(232, 184, 32, 0.12);
}

.viz-cell.lit {
  background: var(--amber-bright);
  border-color: var(--amber);
  box-shadow: 0 0 3px rgba(232, 184, 32, 0.6);
}

.viz-cell.lit-green {
  background: var(--green-bright);
  border-color: var(--green);
  box-shadow: 0 0 3px rgba(46, 204, 64, 0.6);
}

@media (max-width: 768px) {
  .quad {
    padding: 10px 12px;
  }

  .eclipse-brand {
    font-size: 9px;
    letter-spacing: 5px;
    top: 10px;
  }

  .bar-row {
    grid-template-columns: 58px 1fr;
  }

  .bar-label {
    font-size: 8px;
  }

  .ready-circle {
    width: 64px;
    height: 64px;
  }

  .ready-inner {
    width: 54px;
    height: 54px;
  }

  .ready-text {
    font-size: 7px;
  }

  .hazard-stripes {
    width: 14px;
    height: 52px;
  }

  .status-grid {
    grid-template-columns: repeat(4, 9px);
    grid-template-rows: repeat(4, 9px);
  }

  .h-bar {
    height: 28px;
  }

  .center-slot {
    min-height: 28px;
    padding: 6px 10px;
  }

  .slot-bracket {
    font-size: 14px;
  }

  .center-warn {
    font-size: 9px;
    letter-spacing: 2px;
  }

  .center-sub {
    font-size: 7px;
  }

  .log-line {
    font-size: 7px;
  }
}
