/**
 * ==============================================================================
 * HEADER BLOCK: "Question Before Making It"
 * ==============================================================================
 * WHAT THIS FILE DOES:
 * Provides responsive, modern styling for the interactive affiliate automation runner
 * game (AffiliateDinoGame.tsx) on the homepage.
 * 
 * WHY THIS FILE EXISTS:
 * Delivers an engaging, premium arcade aesthetic for visitors between the Brands
 * Carousel and Capabilities Showcase. Features an expanded 290px canvas stage with
 * clean layout borders, live pace indicator pills, score trackers, and modern
 * overlays (start, progress-tracked game-over, and 30-day coupon victory).
 * 
 * MAJOR RESPONSIBILITIES:
 * - Styles the game container, header bar, pace badge, and score/target tickers.
 * - Styles the HTML5 60fps canvas stage (290px desktop / 230px mobile).
 * - Styles the start overlay, game-over progress indicator, and confetti coupon win screen.
 * - Provides responsive touch jump controls for mobile viewports.
 * 
 * HOW IT FITS INTO THE OVERALL SYSTEM:
 * Loaded in `app/layout.tsx` as `/css/game.css` and consumed by `components/AffiliateDinoGame.tsx`
 * on `app/page.tsx`.
 * ==============================================================================
 */

.dino-game-section {
  position: relative;
  padding: 36px 5% 44px;
  background: #f8fafc;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', var(--primary-font, sans-serif);
}

.dino-game-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header & Tickers */
.dino-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.dino-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dino-game-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dino-diff-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dino-diff-pill i {
  font-size: 0.85rem;
}

.dino-game-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dino-target-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #b45309;
}

.dino-target-pill i {
  color: #f59e0b;
}

.dino-score-board {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  background: #ffffff;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.dino-score-num {
  color: #2563eb;
  font-weight: 800;
}

.dino-high-num {
  color: #64748b;
}

/* Game Canvas Wrapper */
.dino-canvas-wrap {
  position: relative;
  width: 100%;
  height: 330px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 20px 45px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.8);
  overflow: hidden;
  user-select: none;
  touch-action: manipulation;
  cursor: pointer;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.dino-canvas-wrap:hover {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 24px 50px -15px rgba(37, 99, 235, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.dino-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Start / Game-Over Overlays */
.dino-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 10;
  animation: overlayFadeIn 0.25s ease-out;
}

@keyframes overlayFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.dino-start-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7b2ff7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  animation: dinoPulse 2s infinite;
}

.dino-gameover-badge {
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}

@keyframes dinoPulse {
  0% { transform: scale(0.96); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3); }
  50% { transform: scale(1.06); box-shadow: 0 12px 30px rgba(123, 47, 247, 0.5); }
  100% { transform: scale(0.96); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3); }
}

.dino-overlay h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
}

.dino-overlay p {
  font-size: 0.92rem;
  color: #64748b;
  margin: 0 0 16px;
  max-width: 500px;
  line-height: 1.5;
}

/* Progress bar inside Game Over */
.dino-progress-box {
  width: 100%;
  max-width: 320px;
  margin: 0 0 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.dino-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.dino-progress-track {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}

.dino-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #7b2ff7);
  border-radius: 9999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.dino-btn-start {
  padding: 11px 24px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #7b2ff7);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dino-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(123, 47, 247, 0.45);
}

.dino-key-hint {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.dino-key-hint kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 2px 7px;
  font-family: inherit;
  font-weight: 700;
  color: #475569;
}

/* Victory Win Overlay (Score >= 500) */
.dino-win-overlay {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 249, 255, 0.98) 100%);
  animation: winFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px 20px;
  box-sizing: border-box;
}

@keyframes winFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.dino-win-trophy {
  font-size: 32px;
  margin-bottom: 2px;
  animation: trophyBounce 1s infinite alternate ease-in-out;
}

@keyframes trophyBounce {
  from { transform: translateY(0) rotate(-4deg); }
  to { transform: translateY(-5px) rotate(4deg); }
}

.dino-win-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px;
  letter-spacing: -0.01em;
}

.dino-win-subtitle {
  font-size: 0.86rem;
  color: #475569;
  margin: 0 0 10px;
  max-width: 500px;
  line-height: 1.45;
}

.dino-coupon-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: #ffffff;
  border: 2px dashed #3b82f6;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.dino-coupon-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: 0.05em;
}

.dino-btn-copy {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.dino-btn-copy:hover {
  background: #2563eb;
  color: #ffffff;
}

.dino-btn-copy.is-copied {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.dino-win-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2px;
}

.dino-btn-claim {
  padding: 9px 18px;
  border-radius: 9px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dino-btn-claim:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45);
}

.dino-btn-replay {
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.dino-btn-replay:hover {
  background: #f8fafc;
  color: #0f172a;
}

/* Mobile Quick-Jump Control */
.dino-mobile-jump-bar {
  display: none;
  margin-top: 12px;
  text-align: center;
}

.dino-btn-jump-mobile {
  width: 100%;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

@media (max-width: 768px) {
  .dino-game-section {
    padding: 28px 4% 34px;
  }
  .dino-canvas-wrap {
    height: 250px;
  }
  .dino-mobile-jump-bar {
    display: block;
  }
  .dino-game-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .dino-title-wrap {
    justify-content: space-between;
  }
  .dino-game-meta {
    justify-content: space-between;
  }
  .dino-win-trophy {
    font-size: 26px;
  }
  .dino-win-title {
    font-size: 1.15rem;
  }
  .dino-win-subtitle {
    font-size: 0.78rem;
    margin-bottom: 8px;
  }
  .dino-coupon-card {
    margin-bottom: 8px;
    padding: 4px 10px;
  }
  .dino-coupon-code {
    font-size: 0.98rem;
  }
}

/**
 * ==============================================================================
 * FOOTER BLOCK: "Answer in the End"
 * ==============================================================================
 * MAIN WORKFLOW & EXECUTION STEPS:
 *   1. Styles the header with dynamic pace indicators, score, and target trial goal.
 *   2. Styles the interactive canvas stage (expanded 290px desktop / 230px mobile).
 *   3. Displays start/restart overlays, goal progress bar, and confetti coupon win card.
 *   4. Provides responsive touch jump controls for mobile viewports.
 * 
 * DEPENDENCIES:
 *   Loaded in `app/layout.tsx` via `/css/game.css`.
 *   Used by `components/AffiliateDinoGame.tsx`.
 * ==============================================================================
 */
