/* ===== CSS Variables ===== */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --bg-dark: #0a0e27;
  --bg-card: rgba(255, 255, 255, 0.05);
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --accent-cyan: #00d4ff;
  --accent-purple: #667eea;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
}

/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== Background Orbs Animation ===== */
.bg-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-purple);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-cyan);
  bottom: -250px;
  right: -250px;
  animation-delay: 5s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: #f5576c;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 10s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(100px, -100px) scale(1.1);
  }

  66% {
    transform: translate(-100px, 100px) scale(0.9);
  }
}

/* ===== Container ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* ===== Top Nav (Compact Header) ===== */
.top-nav {
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  animation: fadeInDown 0.8s ease-out;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-indicator {
  width: 12px;
  height: 12px;
  background: #f5576c;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(245, 87, 108, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

@keyframes celebrate {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-5deg); }
  75% { transform: scale(1.1) rotate(5deg); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nav-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.nav-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.nav-countdown {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-align: right;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.next-online-compact {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.next-online-compact span {
  display: block;
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.85rem;
}

.compact-timer {
  display: flex;
  align-items: baseline;
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.timer-label {
  font-size: 0.8rem;
  font-weight: 600;
  -webkit-text-fill-color: var(--text-secondary);
  margin-left: 2px;
}

.pulse-colon {
  margin: 0 6px;
  -webkit-text-fill-color: var(--text-secondary);
  font-weight: 400;
  animation: blink 1s infinite;
}

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

/* ===== Game Section ===== */
.game-section {
  width: 100%;
  max-width: 100%;
  animation: fadeInUp 0.8s ease-out 0.4s both;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== Score Panel ===== */
.score-panel {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  margin-top: 50px;
}

.score-item {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  min-width: 120px;
}

.score-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.score-item.highlight {
  border: 2px solid var(--accent-cyan);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(102, 126, 234, 0.1));
}

.score-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.score-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  transition: transform 0.2s ease;
}

.score-item.highlight .score-value {
  font-size: 2.5rem;
}


.game-header {
  text-align: center;
  margin-bottom: 2rem;
}

.game-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  background: var(--secondary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-instruction {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.game-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  cursor: crosshair;
}

.game-container:hover {
  box-shadow: 0 12px 48px rgba(0, 212, 255, 0.2);
}

svg#game {
  width: 100%;
  height: auto;
  display: block;
  min-height: 450px;
  max-height: 600px;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  animation: fadeIn 0.8s ease-out 0.6s both;
}

/* ===== Animations ===== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
    gap: 2rem;
  }

  .countdown-section {
    padding: 1.5rem;
  }

  .countdown-timer {
    gap: 0.5rem;
  }

  .time-separator {
    margin: 0 0.25rem;
  }

  .game-container {
    padding: 1rem;
  }

  svg#game {
    max-height: 350px;
  }
}

@media (max-width: 480px) {
  .status-badge {
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
  }

  .countdown-label {
    font-size: 0.875rem;
  }

  .time-label {
    font-size: 0.625rem;
  }

  .game-instruction {
    font-size: 0.875rem;
  }
}