/* ═══════════════════════════════════════════════════════
   Tower of Hanoi — 3D Gesture Game (Light Theme)
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;600;700;800&display=swap');

/* ─── Reset & Base ─── */

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  background: #f0f2f8;
  color: #2a2a3e;
}

/* ═══════════════════════════════════════════════════════
   HOME SCREEN
   ═══════════════════════════════════════════════════════ */

.home-screen {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100;
  background: linear-gradient(135deg, #eef1f8 0%, #e4e8f4 40%, #dfe4f0 100%);
}

.home-screen.visible {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ─── Left Half ─── */

.home-left {
  display: grid;
  grid-template-rows: 3fr 2fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Webcam Section (Top Left — 60%) ── */

.home-webcam-section {
  display: flex;
  gap: 12px;
  padding: 16px 16px 8px 16px;
  overflow: hidden;
}

.webcam-feed-wrapper {
  flex: 1;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.03);
  border: 2px solid rgba(0, 0, 0, 0.08);
  transition: border-color 0.4s, box-shadow 0.4s;
}

.webcam-feed-wrapper.active {
  border-color: rgba(13, 148, 136, 0.5);
  box-shadow: 0 0 30px rgba(13, 148, 136, 0.12), inset 0 0 30px rgba(13, 148, 136, 0.04);
}

#home-webcam-video {
  display: none;
}

#home-webcam-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.home-webcam-status {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(12px);
  z-index: 10;
  transition: all 0.3s ease;
}

.home-webcam-status.info {
  background: rgba(0, 120, 255, 0.1);
  border: 1px solid rgba(0, 120, 255, 0.2);
  color: #0070e0;
}

.home-webcam-status.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
}

.home-webcam-status.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

/* Start zone — centered in webcam */
.start-zone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.start-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 6;
}

.start-ring-fill {
  fill: none;
  stroke: #00ff88;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.1s linear;
  filter: drop-shadow(0 0 6px rgba(0, 255, 136, 0.5));
}

.start-zone-content {
  position: relative;
  text-align: center;
  z-index: 2;
}

.start-zone-fingers {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 2px;
}

.start-zone-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Disk count overlay */
.disk-count-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 12px 18px;
  text-align: center;
  z-index: 5;
}

.disk-count-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999;
  margin-bottom: 2px;
}

.disk-count-number {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #0d9488, #2563eb);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.2s;
}

.disk-count-number.pulse {
  animation: diskPulse 0.4s ease;
}

@keyframes diskPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.disk-difficulty-label {
  font-size: 14px;
  font-weight: 700;
  color: #10b981;
  margin-top: 4px;
  transition: color 0.3s;
}

/* 3D Preview */
.preview-3d-wrapper {
  width: 200px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

#preview-canvas {
  width: 200px !important;
  height: 250px !important;
}

.preview-label {
  position: absolute;
  bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #aaa;
}

/* ── Difficulty Section (Bottom Left — 40%) ── */

.home-difficulty-section {
  padding: 12px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.difficulty-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.difficulty-title {
  font-size: 16px;
  font-weight: 700;
  color: #2a2a3e;
}

.mode-toggle-btn {
  padding: 6px 16px;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.25);
  border-radius: 20px;
  color: #0d9488;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
}

.mode-toggle-btn:hover {
  background: rgba(13, 148, 136, 0.15);
}

.mode-toggle-btn.manual {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.25);
  color: #a855f7;
}

.mode-toggle-btn.manual:hover {
  background: rgba(168, 85, 247, 0.15);
}

/* Auto mode info */
.auto-mode-info {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 14px 18px;
}

.auto-badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #0d9488;
  padding: 3px 10px;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 6px;
  margin-bottom: 8px;
}

.auto-desc {
  font-size: 14px;
  color: #888;
  margin-bottom: 8px;
}

.finger-detect-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finger-label {
  font-size: 14px;
  color: #888;
}

.finger-value {
  font-size: 24px;
  font-weight: 800;
  color: #0d9488;
}

/* Manual controls */
.manual-controls {
  display: none;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 14px 18px;
}

.manual-controls.visible {
  display: block;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.disk-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  color: #2a2a3e;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.disk-btn:hover {
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.3);
  color: #0d9488;
}

.disk-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  outline: none;
}

.disk-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d9488, #2563eb);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(13, 148, 136, 0.3);
}

.slider-val {
  font-size: 18px;
  font-weight: 800;
  color: #0d9488;
  min-width: 24px;
  text-align: center;
}

/* Start game */
.start-game-section {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 14px 18px;
}

.start-instruction {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.start-emoji {
  font-size: 20px;
}

.start-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.start-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #2563eb, #ef4444);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.start-progress-fill.active {
  box-shadow: 0 0 8px rgba(13, 148, 136, 0.5), 0 0 16px rgba(37, 99, 235, 0.3);
  animation: progressGlow 1s ease-in-out infinite;
}

@keyframes progressGlow {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(13, 148, 136, 0.5), 0 0 16px rgba(37, 99, 235, 0.3);
  }

  50% {
    box-shadow: 0 0 14px rgba(13, 148, 136, 0.8), 0 0 24px rgba(37, 99, 235, 0.5);
  }
}

.tutorial-link-btn {
  display: block;
  text-align: center;
  padding: 12px 20px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 12px;
  color: #2563eb;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.tutorial-link-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

/* Start overlay */
.start-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(240, 242, 248, 0.92);
  backdrop-filter: blur(20px);
  z-index: 200;
}

.start-overlay.visible {
  display: flex;
  animation: startFadeIn 0.5s ease;
}

.start-anim-text {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #0d9488, #2563eb, #ef4444);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: startTextPulse 0.8s ease infinite alternate;
}

@keyframes startFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes startTextPulse {
  from {
    transform: scale(1);
    opacity: 0.8;
  }

  to {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* ─── Right Half — Leaderboard ─── */

.home-right {
  padding: 16px 16px 16px 8px;
  height: 100vh;
  overflow: hidden;
}

.leaderboard-home-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

.lb-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.lb-title {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lb-table-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
}

.lb-table th {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #999;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: left;
  position: sticky;
  top: 0;
  background: rgba(240, 242, 248, 0.95);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.lb-table td {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: #555;
  transition: all 0.2s;
}

.lb-table tr:hover td {
  background: rgba(13, 148, 136, 0.05);
  color: #2a2a3e;
}

.lb-rank {
  font-weight: 700;
  font-size: 14px;
}

.lb-name {
  font-weight: 600;
  color: #2a2a3e !important;
}

.lb-score {
  font-weight: 700;
  color: #0d9488 !important;
}

.lb-empty {
  text-align: center;
  padding: 40px 20px !important;
  color: #aaa !important;
  font-style: italic;
}


/* ═══════════════════════════════════════════════════════
   GAME SCREEN (Light Theme)
   ═══════════════════════════════════════════════════════ */

.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ─── Full-screen 3D Scene ─── */

.scene-panel {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background: #e4e8f0;
}

#scene-container {
  width: 100%;
  height: 100%;
}

#scene-container canvas {
  display: block;
}

/* ─── Webcam Overlay (top-left floating) ─── */

.webcam-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 420px;
  z-index: 30;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: opacity 0.3s, transform 0.3s;
}

.webcam-overlay-header {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

.webcam-overlay-header .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-dot 2s infinite;
}

.webcam-overlay-feed {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.webcam-overlay-feed #webcam-video {
  display: none;
}

.webcam-overlay-feed #webcam-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.webcam-overlay .webcam-status {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  backdrop-filter: blur(12px);
  z-index: 10;
  white-space: nowrap;
}

.webcam-status.info {
  background: rgba(0, 120, 255, 0.1);
  border: 1px solid rgba(0, 120, 255, 0.2);
  color: #0070e0;
}

.webcam-status.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
}

.webcam-status.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* ─── HUD Overlay ─── */

#game-hud {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 16px;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}

#game-hud.visible {
  display: flex;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  min-width: 90px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.hud-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888;
  margin-bottom: 4px;
}

.hud-value {
  font-size: 22px;
  font-weight: 800;
  color: #2a2a3e;
}

.hud-value.timer {
  color: #059669;
}

.hud-value.moves {
  color: #d97706;
}

.hud-value.score {
  color: #dc2626;
}

.hud-difficulty {
  font-size: 14px;
  font-weight: 600;
  color: #0d9488;
  padding: 4px 12px;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 20px;
}

.hud-exit-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  color: #dc2626;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.2s;
}

.hud-exit-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  transform: scale(1.1);
}

/* ─── Victory Popup ─── */

#victory-popup {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  background: rgba(240, 242, 248, 0.88);
  backdrop-filter: blur(16px);
}

#victory-popup.visible {
  display: flex;
}

.victory-card {
  text-align: center;
  padding: 40px 48px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 24px;
  box-shadow:
    0 4px 40px rgba(16, 185, 129, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.06);
  max-width: 420px;
  width: 90%;
  animation: victoryPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes victoryPop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.victory-emoji {
  font-size: 56px;
  margin-bottom: 8px;
}

.victory-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #059669, #0d9488);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
}

.victory-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.victory-stat {
  padding: 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.victory-stat-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #999;
  margin-bottom: 4px;
}

.victory-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #2a2a3e;
}

.victory-stat-value.score-val {
  color: #dc2626;
}

.victory-stat-value.time-val {
  color: #059669;
}

.victory-stat-value.moves-val {
  color: #d97706;
}

.victory-stat-value.optimal-val {
  color: #2563eb;
}

.name-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#player-name {
  flex: 1;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  color: #2a2a3e;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#player-name:focus {
  border-color: rgba(13, 148, 136, 0.5);
}

#player-name::placeholder {
  color: #aaa;
}

.btn-primary {
  padding: 12px 24px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.btn-secondary {
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  color: #555;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-secondary:hover {
  border-color: rgba(13, 148, 136, 0.4);
  color: #0d9488;
}

/* ─── Toast ─── */

.game-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 10px 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  color: #2a2a3e;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.game-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Scrollbar ─── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ─── Responsive ─── */

@media (max-width: 1100px) {
  .home-screen.visible {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .home-left {
    height: auto;
    grid-template-rows: 300px auto;
  }

  .home-right {
    padding: 0 16px 16px;
    height: auto;
    max-height: 50vh;
  }

  .preview-3d-wrapper {
    display: none;
  }
}

@media (max-width: 900px) {
  .game-container {
    flex-direction: column;
  }

  .webcam-panel {
    width: 100%;
    height: 40%;
  }

  .scene-panel {
    width: 100%;
    height: 60%;
  }
}