:root {
  --bg: #000000;
  --surface: #0C0C0D;
  --border: #27272A;
  --accent-primary: #F28C5E;
  --accent-hot: #FFB088;
  --accent-electric: #7DF9FF;
  --accent-soft: #6B4A38;
  --muted: #A1A1AA;
}

body, html {
  margin: 0;
  padding: 0;
  background: var(--bg);
  overflow: hidden;
  width: 100%;
  height: 100vh;
}

.live-ticker-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background: var(--bg);
  position: relative;
}

.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 50%, rgba(0, 0, 0, 0.16) 50%),
    linear-gradient(90deg, rgba(242, 140, 94, 0.035), transparent 18%, transparent 82%, rgba(125, 249, 255, 0.03));
  background-size: 100% 4px, 100% 100%;
  z-index: 50;
  opacity: 0.5;
}

.ambient-glow {
  position: absolute;
  inset: auto 0 50%;
  height: 34vh;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 82% 50%, rgba(242, 140, 94, 0.26), transparent 44%),
    radial-gradient(ellipse at 16% 50%, rgba(125, 249, 255, 0.09), transparent 38%);
  filter: blur(18px);
  transform: translateY(50%);
  opacity: 0.75;
}

.live-ticker {
  display: flex;
  width: 100vw;
  height: clamp(128px, 14vw, 162px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 34%, rgba(242, 140, 94, 0.05)),
    linear-gradient(90deg, #020202 0%, #0a0909 58%, #030303 100%);
  position: relative;
  box-sizing: border-box;
  border-top: 2px solid color-mix(in srgb, var(--accent-primary) 86%, #ffffff);
  border-bottom: 2px solid color-mix(in srgb, var(--accent-primary) 86%, #000000);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07) inset,
    0 0 34px rgba(242, 140, 94, 0.24),
    0 18px 44px rgba(0, 0, 0, 0.75);
  align-items: stretch;
  isolation: isolate;
}

.stripes {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent),
    repeating-linear-gradient(-45deg, var(--accent-primary), var(--accent-primary) 10px, var(--bg) 10px, var(--bg) 20px);
  z-index: 10;
}
.stripes-top {
  top: -4px;
}
.stripes-bottom {
  bottom: -4px;
}

.marquee-section {
  width: min(80%, calc(100% - 260px));
  min-width: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(242, 140, 94, 0.08), transparent 18%, transparent 80%, rgba(0, 0, 0, 0.82)),
    radial-gradient(ellipse at 12% 50%, rgba(242, 140, 94, 0.08), transparent 42%);
  cursor: pointer;
  z-index: 5;
}

.marquee-section::before {
  content: '';
  position: absolute;
  inset: 9px 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.85), transparent 72%);
  opacity: 0.5;
}

.marquee-section::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(22vw, 260px);
  background:
    linear-gradient(to left, var(--bg) 8%, rgba(0, 0, 0, 0.72) 34%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 10;
}

/* HUD Labels */
.hud-label {
  position: absolute;
  left: 15px;
  top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.76);
  padding: 4px 8px;
  border: 1px solid rgba(242, 140, 94, 0.72);
  box-shadow: 0 0 18px rgba(242, 140, 94, 0.18);
  pointer-events: none;
}
.hud-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #ff0055;
  border-radius: 50%;
  margin-right: 5px;
  box-shadow: 0 0 8px #ff0055;
  animation: pulse-dot 1s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

.hud-bottom-right {
  position: absolute;
  right: 15px;
  bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 20;
  background: rgba(0,0,0,0.85);
  padding: 1px 4px;
  pointer-events: none;
  border: 1px solid var(--accent-soft);
}

.hud-bottom-left {
  position: absolute;
  left: 15px;
  bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  color: color-mix(in srgb, var(--muted) 74%, var(--accent-primary));
  z-index: 20;
  pointer-events: none;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.marquee-wrapper {
  display: flex;
  width: max-content;
  will-change: transform;
  position: relative;
  z-index: 2;
}
.marquee-content {
  display: inline-block;
  padding-right: 5rem;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(32px, 3.2vw, 48px);
  font-weight: 800;
  color: #ffffff;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.74),
    0 0 22px var(--accent-primary),
    0 0 42px rgba(242, 140, 94, 0.44);
  text-transform: uppercase;
  letter-spacing: 5px;
  white-space: nowrap;
}

.webgl-section {
  width: max(20%, 260px);
  background:
    radial-gradient(circle at 50% 50%, rgba(242, 140, 94, 0.22), transparent 44%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), #030303 32%, #000000);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border-left: 1px solid rgba(242, 140, 94, 0.46);
  box-shadow: -18px 0 36px rgba(0, 0, 0, 0.62), inset 1px 0 rgba(255, 255, 255, 0.08);
}

.webgl-section::before,
.webgl-section::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 2;
}

.webgl-section::before {
  inset: 12px;
  border: 1px solid rgba(242, 140, 94, 0.22);
  clip-path: polygon(0 0, 28px 0, 28px 1px, 1px 1px, 1px 28px, 0 28px, 0 0, 100% 0, 100% 28px, calc(100% - 1px) 28px, calc(100% - 1px) 1px, calc(100% - 28px) 1px, calc(100% - 28px) 0, 100% 0, 100% 100%, calc(100% - 28px) 100%, calc(100% - 28px) calc(100% - 1px), calc(100% - 1px) calc(100% - 1px), calc(100% - 1px) calc(100% - 28px), 100% calc(100% - 28px), 100% 100%, 0 100%, 0 calc(100% - 28px), 1px calc(100% - 28px), 1px calc(100% - 1px), 28px calc(100% - 1px), 28px 100%, 0 100%);
}

.webgl-section::after {
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent-hot), transparent);
  box-shadow: 0 0 18px var(--accent-primary);
}
.webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
}
.webgl-grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(242, 140, 94, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 140, 94, 0.24) 1px, transparent 1px);
  background-size: 18px 18px;
  z-index: 1;
  pointer-events: none;
}

.cube-halo {
  position: absolute;
  width: min(78%, 218px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(242, 140, 94, 0.45);
  box-shadow:
    0 0 18px rgba(242, 140, 94, 0.4),
    inset 0 0 36px rgba(242, 140, 94, 0.16);
  z-index: 2;
  animation: halo-breathe 3.2s ease-in-out infinite;
}

.cube-halo::before,
.cube-halo::after {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px dashed rgba(125, 249, 255, 0.28);
}

.cube-halo::after {
  inset: -12%;
  border-color: rgba(242, 140, 94, 0.2);
  animation: reticle-spin 10s linear infinite;
}

.cube-reticle {
  position: absolute;
  width: min(88%, 240px);
  aspect-ratio: 1;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(242, 140, 94, 0.32) 50%, transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), rgba(242, 140, 94, 0.32) 50%, transparent calc(50% + 1px));
  opacity: 0.56;
}

@keyframes halo-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.72; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes reticle-spin {
  to { transform: rotate(360deg); }
}

.webgl-label {
  position: absolute;
  right: 15px;
  bottom: 10px;
  z-index: 6;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.72);
  padding: 3px 7px;
  border: 1px solid rgba(242, 140, 94, 0.58);
  box-shadow: 0 0 16px rgba(242, 140, 94, 0.2);
  pointer-events: none;
}

.config-panel {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%) translateY(5px);
  width: min(620px, 92vw);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    var(--surface);
  border: 1px solid rgba(242, 140, 94, 0.72);
  border-top: none;
  z-index: 100;
  padding: 12px 16px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.82), 0 0 24px rgba(242, 140, 94, 0.16);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'JetBrains Mono', monospace;
}
.config-panel:hover,
.config-panel:focus-within {
  transform: translate(-50%, 0);
}
.config-header {
  font-size: 10px;
  color: var(--accent-primary);
  letter-spacing: 1.6px;
  margin-bottom: 10px;
  text-align: center;
  font-weight: bold;
}
.config-body {
  display: flex;
  gap: 10px;
}
.config-body input {
  flex-grow: 1;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 9px 11px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55);
}
.config-body input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(242, 140, 94, 0.16), inset 0 0 18px rgba(0, 0, 0, 0.55);
}
.config-body button {
  background: linear-gradient(180deg, var(--accent-hot), var(--accent-primary));
  color: var(--bg);
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.8px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(242, 140, 94, 0.28);
}
.config-body button:hover {
  background: #ffffff;
}
.config-body button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .marquee-wrapper {
    animation-play-state: paused;
  }
  .hud-pulse {
    animation: none;
  }
  .cube-halo,
  .cube-halo::after {
    animation: none;
  }
}

@media (max-width: 900px) {
  .live-ticker {
    height: 128px;
  }
  .marquee-section {
    width: calc(100% - 240px);
  }
  .webgl-section {
    width: 240px;
  }
  .marquee-content {
    font-size: 32px;
    letter-spacing: 3px;
  }
}
