:root {
  --bg-color: #030308;
  --primary-color: #00f0ff;
  --secondary-color: #8a2be2;
  --danger-color: #ff003c;
  --text-main: #ffffff;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

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

#webgl-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 1s ease;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Typography & Holographic Effects */
.holographic-text {
  font-family: var(--font-display);
  color: var(--primary-color);
  text-transform: uppercase;
  text-shadow: 
    0 0 5px rgba(0, 240, 255, 0.5),
    0 0 10px rgba(0, 240, 255, 0.5),
    0 0 20px rgba(0, 240, 255, 0.8),
    0 0 40px rgba(138, 43, 226, 0.8);
  letter-spacing: 4px;
}

/* Start Screen */
.brand-panel {
  text-align: center;
  margin-bottom: 50px;
  margin-top: -8vh;
}

.subtitle {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 6px;
  margin-right: -6px;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  margin-bottom: 12px;
  text-transform: uppercase;
  animation: pulseOpacity 2s infinite alternate;
}

.title {
  font-size: 6rem;
  font-weight: 900;
  margin: 20px 0;
  margin-right: -8px;
  letter-spacing: 8px;
}

/* Cyber Button */
.cyber-button {
  margin-top: 6vh;
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  padding: 20px 40px;
  text-transform: uppercase;
  letter-spacing: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3) inset, 0 0 20px rgba(0, 240, 255, 0.4);
}

.cyber-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.4), transparent);
  transition: all 0.5s ease;
}

.cyber-button:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.6) inset, 0 0 40px rgba(0, 240, 255, 0.8);
  transform: scale(1.05);
}

.cyber-button:hover::before {
  left: 100%;
}

/* Main Screen Header */
.top-bar {
  position: absolute;
  top: 30px;
  width: 90%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(0, 240, 255, 0.3);
  padding-bottom: 15px;
  box-shadow: 0 20px 20px -20px rgba(0, 240, 255, 0.5);
}

.logo-box {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-color);
  letter-spacing: 5px;
  text-align: center;
}

.nav-left, .nav-right {
  font-size: 2rem;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.nav-left {
  text-align: left;
}

.nav-right {
  text-align: right;
  color: var(--text-main);
  text-shadow: 0 0 10px var(--text-main);
}

/* Timer */
.timer-container {
  position: relative;
  width: 500px;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateY(20px);
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 15px var(--primary-color));
}

.progress-ring-track {
  stroke: rgba(255, 255, 255, 0.05);
}

.progress-ring-fill {
  stroke: var(--primary-color);
  stroke-dasharray: 1507.96; /* 2 * PI * 240 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 1s ease, filter 1s ease;
}

.timer-display {
  font-size: 6rem;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 2;
  position: relative;
  padding-top: 10px;
}

.colon {
  transform: translateY(-5px);
  animation: blink 1s infinite;
}

/* End phase styles */
.timer-display.phase-violet {
  color: var(--secondary-color);
  text-shadow: 0 0 10px var(--secondary-color), 0 0 30px var(--secondary-color);
}

.timer-display.phase-red {
  color: var(--danger-color);
  text-shadow: 0 0 10px var(--danger-color), 0 0 30px var(--danger-color);
}

.timer-display.glitch-active {
  animation: txtGlitch 0.2s infinite;
}

/* Time's up */
#times-up-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8rem;
  color: #fff;
  text-shadow: 0 0 20px #fff, 0 0 50px #fff, 0 0 100px var(--danger-color);
  z-index: 1000;
  letter-spacing: 15px;
  width: 100%;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Glitch Overlay */
#glitch-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 0, 60, 0.1);
  mix-blend-mode: overlay;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Animations */
@keyframes pulseOpacity {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes txtGlitch {
  0% { transform: translate(0) }
  20% { transform: translate(-2px, 2px) }
  40% { transform: translate(-2px, -2px) }
  60% { transform: translate(2px, 2px) }
  80% { transform: translate(2px, -2px) }
  100% { transform: translate(0) }
}

.screen-shake {
  animation: crtShake 0.5s infinite;
}

@keyframes crtShake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* Overload flash */
.flash-white {
  background: white !important;
  z-index: 9999;
  animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; display: none; }
}

/* Admin Controls */
.admin-panel {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  z-index: 1000;
  pointer-events: auto;
}

.cyber-button-small {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--secondary-color);
  color: var(--secondary-color);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 20px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.3) inset;
}

.cyber-button-small:hover {
  background: rgba(138, 43, 226, 0.2);
  color: #fff;
  border-color: #fff;
  box-shadow: 0 0 15px rgba(138, 43, 226, 0.6) inset, 0 0 20px rgba(138, 43, 226, 0.8);
  transform: scale(1.05);
}
