/* ==========================================================================
   4-BIN WASTE SEGREGATION CHALLENGE — CORE DESIGN SYSTEM & STYLES
   Modern Indian Civic-Tech / Educational Aesthetic
   Mobile-First (360px - 430px optimized, responsive for tablets & desktop)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+Devanagari:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  /* Bin Colors - Civic Standard */
  --bin-wet: #16a34a;       /* 🟢 Wet Waste */
  --bin-wet-bg: #dcfce7;
  --bin-wet-hover: #15803d;
  --bin-wet-glow: rgba(22, 163, 74, 0.35);

  --bin-dry: #2563eb;       /* 🔵 Dry Waste */
  --bin-dry-bg: #dbeafe;
  --bin-dry-hover: #1d4ed8;
  --bin-dry-glow: rgba(37, 99, 235, 0.35);

  --bin-sanitary: #dc2626;  /* 🔴 Sanitary Waste */
  --bin-sanitary-bg: #fee2e2;
  --bin-sanitary-hover: #b91c1c;
  --bin-sanitary-glow: rgba(220, 38, 38, 0.35);

  --bin-special: #334155;   /* ⚫ Special Care */
  --bin-special-bg: #f1f5f9;
  --bin-special-hover: #1e293b;
  --bin-special-glow: rgba(51, 65, 85, 0.35);

  /* Feedback Colors */
  --correct: #16a34a;
  --correct-bg: #dcfce7;
  --wrong: #ef4444;
  --wrong-bg: #fee2e2;
  --accent: #f59e0b;
  --accent-light: #fef3c7;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Geometry & Typography */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-main: 'Plus Jakarta Sans', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-secondary: #131d31;
  --bg-tertiary: #1e293b;
  --bg-card: #152238;
  --bg-glass: rgba(21, 34, 56, 0.85);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --border-color: #23334d;
  --border-subtle: #1e293b;

  --bin-wet: #22c55e;
  --bin-wet-bg: rgba(34, 197, 94, 0.15);
  --bin-wet-hover: #16a34a;

  --bin-dry: #3b82f6;
  --bin-dry-bg: rgba(59, 130, 246, 0.15);
  --bin-dry-hover: #2563eb;

  --bin-sanitary: #f87171;
  --bin-sanitary-bg: rgba(248, 113, 113, 0.15);
  --bin-sanitary-hover: #ef4444;

  --bin-special: #94a3b8;
  --bin-special-bg: rgba(148, 163, 184, 0.15);
  --bin-special-hover: #64748b;

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px 0 rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 24px -3px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 32px -5px rgb(0 0 0 / 0.6);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100vh;
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 24px;
}

/* App Container - Mobile First Focus */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-secondary);
  box-shadow: var(--shadow-xl);
  position: relative;
}

@media (min-width: 640px) {
  body {
    padding: 20px;
    background: radial-gradient(circle at 50% 10%, rgba(37, 99, 235, 0.08) 0%, transparent 60%), var(--bg-primary);
  }
  .app-container {
    min-height: calc(100vh - 40px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
  }
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--bin-wet), var(--bin-dry));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #16a34a, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  transform: scale(1.05);
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.icon-btn:active {
  transform: scale(0.95);
}

.lang-toggle-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.lang-toggle-btn:hover {
  background: var(--bg-tertiary);
}

/* ==========================================================================
   SCREEN MANAGEMENT & TRANSITIONS
   ========================================================================== */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 20px;
  animation: fadeIn var(--transition-normal);
}

.screen.active {
  display: flex;
}

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

/* ==========================================================================
   WELCOME SCREEN
   ========================================================================== */
.welcome-hero {
  text-align: center;
  padding: 20px 0 10px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--bin-wet);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.welcome-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Bins Visual Grid Showcase */
/* 3D Showcase Dustbins Grid (Welcome Screen) */
.bins-showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  perspective: 600px;
}

.bin-card-preview {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  font-family: inherit;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  outline: none;
  min-height: 98px;
}

.bin-card-preview:hover {
  transform: translateY(-4px) scale(1.03);
}

.bin-card-preview:hover .dustbin-lid-assembly {
  transform: translateY(-5px) rotate(-8deg);
}

.bin-card-preview.wet {
  --bin-lid-bg: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  --bin-collar-bg: #166534;
  --bin-body-bg: linear-gradient(145deg, #16a34a 0%, #15803d 55%, #14532d 100%);
  --bin-shadow-color: rgba(22, 163, 74, 0.25);
  --bin-shadow-hover: rgba(22, 163, 74, 0.45);
}

.bin-card-preview.dry {
  --bin-lid-bg: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  --bin-collar-bg: #1e40af;
  --bin-body-bg: linear-gradient(145deg, #2563eb 0%, #1d4ed8 55%, #1e3a8a 100%);
  --bin-shadow-color: rgba(37, 99, 235, 0.25);
  --bin-shadow-hover: rgba(37, 99, 235, 0.45);
}

.bin-card-preview.sanitary {
  --bin-lid-bg: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  --bin-collar-bg: #991b1b;
  --bin-body-bg: linear-gradient(145deg, #dc2626 0%, #b91c1c 55%, #7f1d1d 100%);
  --bin-shadow-color: rgba(220, 38, 38, 0.25);
  --bin-shadow-hover: rgba(220, 38, 38, 0.45);
}

.bin-card-preview.special {
  --bin-lid-bg: linear-gradient(180deg, #475569 0%, #1e293b 100%);
  --bin-collar-bg: #0f172a;
  --bin-body-bg: linear-gradient(145deg, #334155 0%, #1e293b 55%, #020617 100%);
  --bin-shadow-color: rgba(30, 41, 59, 0.35);
  --bin-shadow-hover: rgba(30, 41, 59, 0.6);
}

.bin-preview-name {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.bin-preview-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  margin-top: 1px;
}

/* Mode Selection Cards */
.mode-selection-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.mode-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.mode-card:hover, .mode-card.selected {
  border-color: var(--bin-dry);
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.mode-card-info h4 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-card-info p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.mode-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bin-dry);
  color: white;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  border-color: var(--bin-dry);
  box-shadow: 0 0 0 4px var(--bin-dry-glow);
}

/* Primary Action Buttons */
.btn-primary {
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
  transition: all var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

/* Secondary Button Bar */
.welcome-actions-sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

/* ==========================================================================
   GAMEPLAY SCREEN
   ========================================================================== */
.game-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.stat-pill.question { color: var(--text-secondary); }
.stat-pill.score { color: var(--bin-dry); }
.stat-pill.streak { color: #f59e0b; }

.streak-flame {
  display: inline-block;
  animation: pulseStreak 1s infinite alternate;
}

@keyframes pulseStreak {
  from { transform: scale(1); }
  to { transform: scale(1.25); }
}

/* Timer Bar */
.game-timer-container {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 14px;
}

.game-timer-progress {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #f59e0b, #ef4444);
  transition: width 1s linear;
}

/* Waste Item Display Card */
.waste-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  transition: transform var(--transition-normal);
}

.image-wrapper {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.04);
}

.waste-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.image-wrapper:hover .waste-image {
  transform: scale(1.03);
}

.waste-name-en {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 12px;
  text-align: center;
}

.waste-name-hi {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
  text-align: center;
}

/* Feedback Overlay on Waste Card */
.feedback-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  z-index: 10;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

[data-theme="dark"] .feedback-banner {
  background: rgba(15, 23, 42, 0.96);
}

.feedback-banner.active {
  display: flex;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.feedback-icon {
  font-size: 44px;
  margin-bottom: 8px;
}

.feedback-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.feedback-title.correct { color: var(--correct); }
.feedback-title.wrong { color: var(--wrong); }

.feedback-explanation {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
  margin-top: 6px;
  max-width: 320px;
  background: var(--bg-tertiary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--bin-dry);
}

.feedback-btn {
  margin-top: 14px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
}

/* Bins Button Grid (Large Touch Targets 60px+) */
.bins-interactive-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: auto;
}

/* 3D Municipal Dustbin Grid & Interactive Elements */
.bins-interactive-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: auto;
  perspective: 600px;
}

.bin-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  font-family: inherit;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  outline: none;
  min-height: 110px;
  -webkit-tap-highlight-color: transparent;
}

.bin-btn:hover {
  transform: translateY(-3px) scale(1.02);
}

.bin-btn:active {
  transform: scale(0.96);
}

/* Dustbin Lid Assembly */
.dustbin-lid-assembly {
  width: 92%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: left bottom;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 4;
}

.bin-btn:hover .dustbin-lid-assembly {
  transform: translateY(-5px) rotate(-8deg);
}

.bin-btn:active .dustbin-lid-assembly {
  transform: translateY(-10px) rotate(-18deg);
}

.dustbin-handle {
  width: 30px;
  height: 6px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 4px 4px 0 0;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.3);
}

.dustbin-lid {
  width: 100%;
  height: 14px;
  border-radius: 8px 8px 3px 3px;
  background: var(--bin-lid-bg);
  box-shadow: inset 0 2px 2px rgba(255,255,255,0.5), inset 0 -2px 3px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.2);
}

/* Collar / Lip under lid */
.dustbin-collar {
  width: 95%;
  height: 6px;
  background: var(--bin-collar-bg);
  border-radius: 3px;
  margin-top: -2px;
  z-index: 3;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), 0 2px 4px rgba(0,0,0,0.3);
}

/* Tapered 3D Bin Body */
.dustbin-body {
  width: 88%;
  min-height: 80px;
  background: var(--bin-body-bg);
  border-radius: 0 0 10px 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px 10px 6px;
  color: #ffffff;
  box-shadow: inset 0 0 16px rgba(0,0,0,0.4), inset 3px 0 6px rgba(255,255,255,0.25), inset -3px 0 6px rgba(0,0,0,0.5), 0 8px 20px var(--bin-shadow-color);
  border: 1px solid rgba(255,255,255,0.15);
  border-top: none;
  transition: all 0.2s ease;
}

.bin-btn:hover .dustbin-body {
  box-shadow: inset 0 0 18px rgba(0,0,0,0.4), inset 3px 0 6px rgba(255,255,255,0.35), inset -3px 0 6px rgba(0,0,0,0.5), 0 12px 28px var(--bin-shadow-hover);
}

/* Vertical Ribs */
.dustbin-ribs {
  position: absolute;
  inset: 6px 10px;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
  opacity: 0.3;
}

.dustbin-ribs span {
  width: 3px;
  height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.6), rgba(255,255,255,0.5));
  border-radius: 2px;
}

/* Bin Content & Labels */
.dustbin-content-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.dustbin-badge-icon {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.bin-btn-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

.bin-btn-sub {
  font-size: 11px;
  opacity: 0.95;
  font-weight: 600;
  margin-top: 1px;
}

.dustbin-recycle-symbol {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
  line-height: 1;
}

/* Bin Base Foot / Wheels */
.dustbin-base {
  width: 76%;
  height: 6px;
  background: #0f172a;
  border-radius: 0 0 6px 6px;
  margin-top: -1px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.45);
}

/* Category Specific Color Schemes */
.bin-btn.bin-wet {
  --bin-lid-bg: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  --bin-collar-bg: #166534;
  --bin-body-bg: linear-gradient(145deg, #16a34a 0%, #15803d 55%, #14532d 100%);
  --bin-shadow-color: rgba(22, 163, 74, 0.25);
  --bin-shadow-hover: rgba(22, 163, 74, 0.45);
}

.bin-btn.bin-dry {
  --bin-lid-bg: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  --bin-collar-bg: #1e40af;
  --bin-body-bg: linear-gradient(145deg, #2563eb 0%, #1d4ed8 55%, #1e3a8a 100%);
  --bin-shadow-color: rgba(37, 99, 235, 0.25);
  --bin-shadow-hover: rgba(37, 99, 235, 0.45);
}

.bin-btn.bin-sanitary {
  --bin-lid-bg: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  --bin-collar-bg: #991b1b;
  --bin-body-bg: linear-gradient(145deg, #dc2626 0%, #b91c1c 55%, #7f1d1d 100%);
  --bin-shadow-color: rgba(220, 38, 38, 0.25);
  --bin-shadow-hover: rgba(220, 38, 38, 0.45);
}

.bin-btn.bin-special {
  --bin-lid-bg: linear-gradient(180deg, #475569 0%, #1e293b 100%);
  --bin-collar-bg: #0f172a;
  --bin-body-bg: linear-gradient(145deg, #334155 0%, #1e293b 55%, #020617 100%);
  --bin-shadow-color: rgba(30, 41, 59, 0.35);
  --bin-shadow-hover: rgba(30, 41, 59, 0.6);
}

/* ==========================================================================
   3D DUSTBIN ANIMATIONS & ANSWER EFFECTS
   ========================================================================== */

/* Lid Open State (when answered) */
.bin-btn.dustbin-lid-open .dustbin-lid-assembly,
.bin-card-preview.dustbin-lid-open .dustbin-lid-assembly {
  transform: translateY(-12px) rotate(-26deg) !important;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

/* Correct Answer 3D Bounce Animation */
.bin-btn.dustbin-anim-correct {
  animation: dustbinCorrectBounce 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  z-index: 10;
}

.bin-btn.dustbin-anim-correct .dustbin-body {
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.4), 0 0 0 3px #4ade80, 0 12px 30px rgba(34, 197, 94, 0.6) !important;
  border-color: #86efac !important;
}

@keyframes dustbinCorrectBounce {
  0% { transform: scale(1); }
  25% { transform: scale(0.92, 1.08) translateY(-8px); }
  50% { transform: scale(1.08, 0.94) translateY(2px); }
  75% { transform: scale(0.98, 1.02) translateY(-2px); }
  100% { transform: scale(1.04) translateY(-4px); }
}

/* Wrong Answer 3D Violent Shake Animation */
.bin-btn.dustbin-anim-wrong {
  animation: dustbinWrongShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  z-index: 10;
}

.bin-btn.dustbin-anim-wrong .dustbin-body {
  box-shadow: inset 0 0 20px rgba(220, 38, 38, 0.5), 0 0 0 3px #ef4444, 0 8px 24px rgba(239, 68, 68, 0.6) !important;
  border-color: #fca5a5 !important;
}

@keyframes dustbinWrongShake {
  0%, 100% { transform: rotateY(0deg) translateX(0); }
  15% { transform: rotateY(-18deg) translateX(-8px) scale(0.96); }
  30% { transform: rotateY(18deg) translateX(8px) scale(0.96); }
  45% { transform: rotateY(-12deg) translateX(-6px); }
  60% { transform: rotateY(12deg) translateX(6px); }
  75% { transform: rotateY(-6deg) translateX(-3px); }
  90% { transform: rotateY(6deg) translateX(3px); }
}

/* Target Beacon (Teaches player the correct bin on mistake) */
.bin-btn.dustbin-anim-target {
  animation: dustbinBeaconPulse 0.8s ease-in-out infinite alternate;
  z-index: 9;
}

.bin-btn.dustbin-anim-target .dustbin-body {
  box-shadow: 0 0 0 3px #fbbf24, 0 0 25px rgba(251, 191, 36, 0.7) !important;
  border-color: #fde68a !important;
}

@keyframes dustbinBeaconPulse {
  from {
    transform: scale(1) translateY(0);
    filter: brightness(1);
  }
  to {
    transform: scale(1.06) translateY(-6px);
    filter: brightness(1.2);
  }
}

/* 3D Flying Waste Trash into Dustbin */
.dustbin-flying-trash {
  position: fixed;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 99999;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.55s ease;
}

/* Floating +Score Popup Badge */
.dustbin-score-popup {
  position: fixed;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 9999px;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.5);
  border: 2px solid #ffffff;
  pointer-events: none;
  z-index: 99999;
  animation: scoreFloatUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scoreFloatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -20px) scale(1.15);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -45px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -65px) scale(0.85);
  }
}

/* Card Shake Animation for Wrong Answer */
.shake-anim {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

/* ==========================================================================
   RESULT & SCORE CARD SCREEN
   ========================================================================== */
.results-header {
  text-align: center;
  padding: 10px 0;
}

.results-trophy {
  font-size: 54px;
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.3));
  animation: floatTrophy 2s ease-in-out infinite alternate;
}

@keyframes floatTrophy {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.results-title {
  font-size: 24px;
  font-weight: 800;
  margin-top: 8px;
}

.results-card-container {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  margin: 16px 0;
  text-align: center;
}

.results-score-big {
  font-size: 44px;
  font-weight: 900;
  color: var(--bin-wet);
  line-height: 1;
  margin-bottom: 4px;
}

.results-score-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.results-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.result-metric-box {
  background: var(--bg-tertiary);
  padding: 10px 6px;
  border-radius: var(--radius-sm);
}

.result-metric-val {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.result-metric-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}

.share-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.btn-whatsapp {
  background: #25d366;
  color: white;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}
.btn-whatsapp:hover {
  background: #20ba59;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5);
}

/* Canvas Container (Hidden from view, used for export) */
#resultCanvas {
  display: none;
}

/* ==========================================================================
   LEADERBOARD & MODALS
   ========================================================================== */
.leaderboard-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.leaderboard-table th {
  background: var(--bg-tertiary);
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 12px;
}

.rank-1 { background: #fef3c7; color: #b45309; }
.rank-2 { background: #f1f5f9; color: #475569; }
.rank-3 { background: #ffedd5; color: #c2410c; }

/* Tutorial / How To Play Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 18px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.tutorial-step {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bin-dry);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.step-text h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.step-text p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Toast Notifications */
.toast-msg {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: var(--text-inverse);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}
