:root {
  --primary: #00f2fe;
  --secondary: #4facfe;
  --bg: #0f172a;
  --surface: rgba(30, 41, 59, 0.7);
  --text: #f8fafc;
  --accent: #f472b6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
}

/* Landing Page Overlay */
.overlay-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.overlay-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing-content {
  max-width: 600px;
  text-align: center;
  padding: 2rem;
  animation: fadeIn 1s ease-out;
}

.logo.large {
  font-size: 3.5rem;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-content p {
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.feature-list {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.feature-item i {
  color: var(--primary);
  background: rgba(0, 242, 254, 0.1);
  padding: 1rem;
  border-radius: 12px;
}

.feature-item span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f8fafc;
}

.button-group {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.primary-btn {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border: none;
  padding: 1.25rem 2.5rem;
  border-radius: 999px;
  color: #0f172a;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 20px rgba(0, 242, 254, 0.3);
}

.primary-btn.secondary {
  background: linear-gradient(to right, #f472b6, #a855f7);
  color: #fff;
  box-shadow: 0 10px 20px rgba(244, 114, 182, 0.3);
}

.primary-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 242, 254, 0.4);
}

.primary-btn.secondary:hover {
  box-shadow: 0 20px 40px rgba(244, 114, 182, 0.4);
}


.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 0.75rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  width: 100%;
}

.action-btn:hover {
  background: var(--primary);
  color: #0f172a;
  border-color: transparent;
}

.action-btn.secondary {
  margin-bottom: 1.5rem;
}

/* Developer Credit */
.developer-credit {
  margin-top: 3rem;
  font-size: 0.9rem;
  color: #64748b;
  letter-spacing: 0.05em;
}

.developer-credit span {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

/* Color Picker */
.color-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.color-dot {
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.color-dot:hover {
  transform: scale(1.1);
}

.color-dot.active {
  border-color: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Sidebar */
.sidebar {
  width: 320px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 10;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-group label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  text-transform: uppercase;
}

.tip-box {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.1);
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tip-box i {
  color: var(--primary);
  flex-shrink: 0;
}

.tip-box p {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
}

.hand-labels {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hand-label {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hand-label span { font-size: 0.85rem; color: #94a3b8; }
.hand-label b { color: var(--text); font-size: 1rem; }
.label-dot { width: 8px; height: 8px; border-radius: 50%; }
.hand-label.left .label-dot { background: var(--accent); }
.hand-label.right .label-dot { background: var(--primary); }

.slider-container { display: flex; flex-direction: column; gap: 0.5rem; }
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  appearance: none;
}

.value-display { font-size: 0.75rem; color: var(--primary); text-align: right; }

/* Main Content Area */
.main-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

#canvas-container {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

canvas { display: block; }
video { display: none; }

/* Stats Overlay */
.stats-overlay {
  position: absolute;
  top: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-card {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card i { color: var(--primary); }
.stat-info .label { font-size: 0.7rem; color: #64748b; text-transform: uppercase; }
.stat-info .value { font-size: 1.25rem; font-weight: 700; color: var(--text); }

.finger-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 0.75rem;
}

.finger-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.finger-dot.active { background: var(--primary); box-shadow: 0 0 10px var(--primary); }

.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVENESS --- */

@media (max-width: 1024px) {
  .sidebar {
    width: 280px;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    gap: 1.5rem;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }

  .logo.large {
    font-size: 2.5rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .button-group {
    flex-direction: column;
    width: 100%;
  }

  .primary-btn {
    width: 100%;
    justify-content: center;
  }

  .feature-list {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .main-content {
    min-height: 500px;
    padding: 1rem;
  }

  #canvas-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 4/3;
  }

  canvas {
    width: 100% !important;
    height: auto !important;
  }

  .stats-overlay {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .stat-card {
    padding: 0.75rem 1rem;
    flex: 1;
    min-width: 140px;
  }

  .finger-indicator {
    bottom: 1rem;
    width: 90%;
    padding: 0.5rem;
  }

  .developer-credit {
    margin-top: 2rem;
  }
}

@media (max-width: 480px) {
  .logo.large {
    font-size: 2rem;
  }

  .feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .feature-item i {
    padding: 0.75rem;
  }

  .stat-card .value {
    font-size: 1rem;
  }
}
