/* =============================================
   SYNTH JAM — Neon Cyberpunk Game UI Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

:root {
  --neon-cyan:    #00FFFF;
  --neon-pink:    #FF00FF;
  --neon-green:   #00FF41;
  --neon-orange:  #FF6B00;
  --neon-yellow:  #FFE600;
  --neon-red:     #FF2244;
  --dark-bg:      rgba(0, 5, 20, 0.88);
  --panel-bg:     rgba(0, 8, 22, 0.82);
  --glow-cyan:    0 0 8px var(--neon-cyan), 0 0 20px rgba(0,255,255,0.3);
  --glow-pink:    0 0 8px var(--neon-pink), 0 0 20px rgba(255,0,255,0.3);
  --glow-green:   0 0 8px var(--neon-green), 0 0 20px rgba(0,255,65,0.3);
  --glow-yellow:  0 0 8px var(--neon-yellow), 0 0 20px rgba(255,230,0,0.3);
}

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

body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Orbitron', sans-serif;
}

/* =============================================
   SCANLINES — subtle CRT overlay
   ============================================= */
#scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  z-index: 998;
}

/* =============================================
   CORNER FRAME DECORATIONS
   ============================================= */
.corner-decoration {
  position: fixed;
  width: 24px;
  height: 24px;
  z-index: 100;
  pointer-events: none;
}
.corner-decoration::before,
.corner-decoration::after {
  content: '';
  position: absolute;
  background: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}
.corner-decoration.top-left     { top: 12px; left: 12px; }
.corner-decoration.top-right    { top: 12px; right: 12px; }
.corner-decoration.bottom-left  { bottom: 12px; left: 12px; }
.corner-decoration.bottom-right { bottom: 12px; right: 12px; }

.corner-decoration.top-left::before,
.corner-decoration.top-right::before { top: 0; width: 2px; height: 18px; }
.corner-decoration.bottom-left::before,
.corner-decoration.bottom-right::before { bottom: 0; width: 2px; height: 18px; }

.corner-decoration.top-left::before    { left: 0; }
.corner-decoration.top-left::after     { top: 0; left: 0; width: 18px; height: 2px; }
.corner-decoration.top-right::before   { right: 0; }
.corner-decoration.top-right::after    { top: 0; right: 0; width: 18px; height: 2px; }
.corner-decoration.bottom-left::before { left: 0; }
.corner-decoration.bottom-left::after  { bottom: 0; left: 0; width: 18px; height: 2px; }
.corner-decoration.bottom-right::before{ right: 0; }
.corner-decoration.bottom-right::after { bottom: 0; right: 0; width: 18px; height: 2px; }

/* =============================================
   LOADING SCREEN
   ============================================= */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  transition: opacity 0.6s ease;
}
#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: 0.4em;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  text-transform: uppercase;
  animation: logoFlicker 4s ease-in-out infinite;
}
@keyframes logoFlicker {
  0%,100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 1; }
  97% { opacity: 0.7; }
  98% { opacity: 1; }
}

.loading-title {
  font-size: 11px;
  letter-spacing: 0.35em;
  color: rgba(0,255,255,0.5);
  text-transform: uppercase;
}

.loading-bar-track {
  width: min(340px, 80vw);
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(0,255,255,0.15);
}
.loading-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--neon-cyan), var(--neon-pink));
  border-radius: 2px;
  box-shadow: 0 0 8px var(--neon-cyan);
  width: 0%;
  animation: loadAnim 3.5s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes loadAnim {
  0%  { width: 0%; }
  25% { width: 35%; }
  50% { width: 62%; }
  80% { width: 88%; }
  100%{ width: 100%; }
}

.loading-status {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.35);
  font-family: 'Share Tech Mono', monospace;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* =============================================
   INTRO / SPLASH SCREEN
   ============================================= */
#intro-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,10,30,0.98) 0%, #000 100%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.8s ease;
}
#intro-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-title {
  font-size: clamp(38px, 8vw, 86px);
  font-weight: 900;
  letter-spacing: 0.45em;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px var(--neon-cyan), 0 0 60px rgba(0,255,255,0.5), 0 0 100px rgba(0,255,255,0.2);
  text-transform: uppercase;
  animation: titleGlow 3s ease-in-out infinite;
}
@keyframes titleGlow {
  0%,100%{ text-shadow: 0 0 20px var(--neon-cyan), 0 0 60px rgba(0,255,255,0.5); }
  50%    { text-shadow: 0 0 30px var(--neon-cyan), 0 0 90px rgba(0,255,255,0.7), 0 0 130px rgba(0,255,255,0.3); }
}

.intro-subtitle {
  font-size: clamp(10px, 1.8vw, 15px);
  letter-spacing: 0.35em;
  color: var(--neon-pink);
  text-shadow: var(--glow-pink);
  text-transform: uppercase;
  margin-top: -14px;
}

.intro-divider {
  width: min(480px, 70vw);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--neon-cyan), transparent);
  box-shadow: 0 0 10px var(--neon-cyan);
}

.intro-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 48px;
  max-width: 540px;
  width: 90vw;
}
.intro-ctrl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.intro-ctrl-hand {
  font-size: 26px;
  line-height: 1.2;
  filter: drop-shadow(0 0 6px rgba(0,255,255,0.5));
}
.intro-ctrl-desc {
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(9px, 1.2vw, 11px);
}
.intro-ctrl-desc strong {
  color: var(--neon-cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(9px, 1.1vw, 11px);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 2px;
}

.intro-start-btn {
  margin-top: 6px;
  padding: 13px 44px;
  background: transparent;
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(11px, 1.8vw, 15px);
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--glow-cyan), inset 0 0 18px rgba(0,255,255,0.06);
  transition: background 0.25s, box-shadow 0.25s;
  animation: btnPulse 2.2s ease-in-out infinite;
}
.intro-start-btn:hover {
  background: rgba(0,255,255,0.12);
  box-shadow: 0 0 30px rgba(0,255,255,0.55), inset 0 0 24px rgba(0,255,255,0.12);
  animation: none;
}
@keyframes btnPulse {
  0%,100%{ opacity:1; box-shadow: var(--glow-cyan); }
  50%    { opacity:0.75; box-shadow: 0 0 20px rgba(0,255,255,0.5); }
}

.intro-version {
  position: absolute;
  bottom: 18px;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.22);
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
}

/* =============================================
   TOP HUD BAR
   ============================================= */
#hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: linear-gradient(to bottom, rgba(0,5,20,0.92) 0%, transparent 100%);
  z-index: 100;
  pointer-events: none;
}

/* Synth Panel — top left */
#synth-panel {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 160px;
}
.hud-label {
  font-size: 8px;
  letter-spacing: 0.28em;
  color: rgba(0,255,255,0.45);
  text-transform: uppercase;
}
#synth-presets {
  display: flex;
  gap: 7px;
  align-items: center;
}
.synth-dot {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid rgba(0,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(0,255,255,0.35);
  background: rgba(0,255,255,0.04);
  transition: all 0.25s;
}
.synth-dot.active {
  border-color: var(--neon-cyan);
  background: var(--neon-cyan);
  color: #000;
  box-shadow: var(--glow-cyan);
}
#synth-name {
  font-size: 10px;
  color: rgba(0,255,255,0.7);
  letter-spacing: 0.1em;
  font-family: 'Share Tech Mono', monospace;
}

/* Game Title — center */
#game-title {
  flex: 1;
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
#game-title h1 {
  font-size: clamp(16px, 2.6vw, 34px);
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: 0 0 12px var(--neon-cyan), 0 0 35px rgba(0,255,255,0.45);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  animation: titlePulse 3.5s ease-in-out infinite;
}
@keyframes titlePulse {
  0%,100%{ text-shadow: 0 0 12px var(--neon-cyan), 0 0 35px rgba(0,255,255,0.4); }
  50%    { text-shadow: 0 0 22px var(--neon-cyan), 0 0 55px rgba(0,255,255,0.65), 0 0 80px rgba(0,255,255,0.2); }
}

/* Score Panel — top right */
#score-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 160px;
}
#score-value {
  font-size: clamp(22px, 2.8vw, 36px);
  font-weight: 700;
  color: var(--neon-yellow);
  text-shadow: var(--glow-yellow);
  letter-spacing: 0.06em;
  line-height: 1;
  transition: color 0.08s;
}
#score-value.flash { color: #fff; }
#combo-display {
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-pink);
  text-shadow: var(--glow-pink);
  letter-spacing: 0.12em;
  opacity: 0;
  transition: opacity 0.3s;
  transform: scale(1);
}
#combo-display.active {
  opacity: 1;
}
#combo-display.pop {
  animation: comboPop 0.25s ease-out;
}
@keyframes comboPop {
  0%  { transform: scale(1.4); }
  100%{ transform: scale(1); }
}

/* =============================================
   HAND STATUS PANELS — floating side panels
   ============================================= */
#hand1-status,
#hand2-status {
  position: absolute;
  bottom: 195px;
  z-index: 100;
  pointer-events: none;
  padding: 10px 14px;
  background: rgba(0, 8, 22, 0.72);
  border-radius: 4px;
  backdrop-filter: blur(6px);
  min-width: 130px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}
#hand1-status {
  left: 20px;
  border-left: 2px solid var(--neon-cyan);
  box-shadow: -3px 0 15px rgba(0,255,255,0.15);
}
#hand2-status {
  right: 20px;
  border-right: 2px solid var(--neon-green);
  box-shadow: 3px 0 15px rgba(0,255,65,0.15);
  text-align: right;
}
#hand1-status.visible,
#hand2-status.visible {
  opacity: 1;
  transform: translateY(0);
}

.hand-status-title {
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
#hand1-status .hand-status-title { color: rgba(0,255,255,0.55); }
#hand2-status .hand-status-title { color: rgba(0,255,65,0.55); }

.hand-note {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}
.hand-vol {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-family: 'Share Tech Mono', monospace;
  margin-top: 3px;
}
.hand-drums {
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-green);
  text-shadow: var(--glow-green);
  line-height: 1.3;
}

/* =============================================
   BOTTOM HUD BAR
   ============================================= */
#hud-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 24px 11px;
  background: linear-gradient(to top, rgba(0,5,20,0.92) 0%, transparent 100%);
  z-index: 100;
  pointer-events: none;
}

/* Energy bar */
#energy-bar-container {
  display: flex;
  align-items: center;
  gap: 9px;
}
#energy-bar-track {
  width: 110px;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  border: 1px solid rgba(0,255,255,0.18);
  overflow: hidden;
}
#energy-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--neon-cyan), var(--neon-pink));
  border-radius: 3px;
  box-shadow: 0 0 6px var(--neon-cyan);
  transition: width 0.1s linear;
}

/* Controls reference */
#controls-ref {
  display: flex;
  gap: 14px;
  align-items: center;
}
.ctrl-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.05em;
}
.ctrl-icon {
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  opacity: 0.7;
}
.ctrl-hand1 { color: rgba(0,255,255,0.55); }
.ctrl-hand2 { color: rgba(0,255,65,0.55); }

/* =============================================
   NOTIFICATION / ACHIEVEMENT POPUPS
   ============================================= */
#notification-area {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  pointer-events: none;
  text-align: center;
  width: 400px;
}
.notification {
  font-size: clamp(22px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--neon-yellow);
  text-shadow: 0 0 18px var(--neon-yellow), 0 0 40px rgba(255,230,0,0.45);
  animation: notifPop 1.6s ease-out forwards;
  white-space: nowrap;
}
.notification.type-synth {
  color: var(--neon-pink);
  text-shadow: 0 0 18px var(--neon-pink), 0 0 40px rgba(255,0,255,0.45);
}
.notification.type-combo {
  color: var(--neon-green);
  text-shadow: 0 0 18px var(--neon-green), 0 0 40px rgba(0,255,65,0.45);
}
@keyframes notifPop {
  0%  { opacity:0; transform: scale(0.4) translateY(24px); }
  18% { opacity:1; transform: scale(1.08) translateY(0); }
  35% { transform: scale(1); }
  65% { opacity:1; }
  100%{ opacity:0; transform: translateY(-38px); }
}

/* =============================================
   REPO LINK — below game title
   ============================================= */
#repo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: rgba(0, 255, 255, 0.5);
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(11px, 1.2vw, 13px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 3px;
  padding: 4px 12px 4px 9px;
  pointer-events: auto;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#repo-link:hover {
  color: var(--neon-cyan);
  border-color: rgba(0, 255, 255, 0.55);
  background: rgba(0, 255, 255, 0.06);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.18);
}
#repo-link svg {
  flex-shrink: 0;
  opacity: 0.75;
}

/* =============================================
   RENDER DIV
   ============================================= */
#renderDiv {
  position: relative;
  width: 100vw;
  height: 100vh;
}
