/* ============================================================
   Link Roulette - Game-Specific Styles
   Extends the base design system from styles.css
   ============================================================ */

/* ============================================================
   1. Game Screen Container (shared with Password Survivor)
   ============================================================ */
.game-screen {
  display: none;
  flex-direction: column;
  flex: 1;
  padding-bottom: var(--space-2xl);
}

.game-screen.active {
  display: flex;
}

.game-screen.fade-in {
  animation: fadeIn var(--transition-base) forwards;
}

.game-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

/* ============================================================
   2. Intro Screen Extras
   ============================================================ */
.game-rules {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
  max-width: 480px;
}

.game-rules-heading {
  font-size: var(--text-md);
  margin-bottom: var(--space-md);
  text-align: center;
}

.game-rules-list {
  list-style: decimal;
  padding-left: var(--space-lg);
}

.game-rules-list li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
  font-size: var(--text-sm);
}

.game-rules-list li:last-child {
  margin-bottom: 0;
}

.game-back-link {
  display: inline-block;
  margin-top: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-mid-gray);
}

.game-back-link:hover {
  color: var(--color-primary);
}

.lr-back-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
}

.lr-back-links .game-back-link {
  margin-top: 0;
}

/* ============================================================
   3. Challenge Screen - Info Bar
   ============================================================ */
.lr-info-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.lr-round-tag {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  background: rgba(235, 94, 40, 0.08);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
}

.lr-progress-label {
  font-size: var(--text-sm);
  color: var(--color-mid-gray);
}

.lr-score-tag {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-dark);
  background: var(--color-light-gray);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
}

/* ============================================================
   4. Mock Browser Address Bar
   ============================================================ */
.lr-address-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: #f1f3f4;
  border: 1px solid var(--color-light-gray);
  border-radius: 24px;
  padding: var(--space-sm) var(--space-lg);
  margin: 0 auto var(--space-xl);
  max-width: 600px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.lr-padlock {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.lr-padlock-svg {
  display: block;
}

.lr-url-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--text-sm);
  color: var(--color-dark);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--space-xs) 0;
  flex: 1;
  min-width: 0;
}

.lr-url-text::-webkit-scrollbar {
  display: none;
}

/* ============================================================
   5. Challenge Question
   ============================================================ */
.lr-question {
  text-align: center;
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.lr-instruction {
  text-align: center;
  color: var(--color-mid-gray);
  font-size: var(--text-sm);
  margin-bottom: var(--space-xl);
}

/* ============================================================
   6. Choice Buttons
   ============================================================ */
.lr-choices {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 400px;
  margin: 0 auto;
}

.lr-choice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 56px;
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
  border: 2px solid;
  border-radius: var(--radius-md);
  background: var(--color-white);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.lr-choice-btn:active {
  transform: scale(0.97);
}

.lr-choice-btn--safe {
  color: var(--color-green);
  border-color: var(--color-green);
}

.lr-choice-btn--safe:hover,
.lr-choice-btn--safe:focus-visible {
  background: var(--color-green);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.lr-choice-btn--suspect {
  color: var(--color-red);
  border-color: var(--color-red);
}

.lr-choice-btn--suspect:hover,
.lr-choice-btn--suspect:focus-visible {
  background: var(--color-red);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.lr-choice-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.lr-choice-icon svg {
  display: block;
}

/* ============================================================
   7. Result Screen - Banner
   ============================================================ */
.lr-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform: scale(0);
}

.lr-banner--correct {
  background: var(--color-green-light);
  color: var(--color-green);
}

.lr-banner--incorrect {
  background: var(--color-red-light);
  color: var(--color-red);
}

.lr-banner-icon {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
}

.lr-banner-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
}

/* ============================================================
   8. Result Screen - Verdict Badge
   ============================================================ */
.lr-verdict-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}

.lr-verdict-badge--safe {
  background: var(--color-green-light);
  color: var(--color-green);
}

.lr-verdict-badge--suspect {
  background: var(--color-red-light);
  color: var(--color-red);
}

/* ============================================================
   9. Result Screen - URL Breakdown
   ============================================================ */
.lr-url-breakdown {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--text-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-white);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-sm);
  word-break: break-all;
  line-height: 1.8;
}

.lr-url-part--neutral {
  color: var(--color-dark-soft);
}

.lr-url-part--danger {
  color: var(--color-red);
  background: var(--color-red-light);
  border-radius: var(--radius-sm);
  padding: 1px 3px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--color-red);
  text-underline-offset: 3px;
}

.lr-url-part--safe {
  color: var(--color-green);
  font-weight: 700;
}

/* ============================================================
   10. Result Screen - Key Flag & Top Tip
   ============================================================ */
.lr-key-flag {
  background: var(--color-white);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.lr-key-flag-heading {
  font-size: var(--text-md);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.lr-key-flag-text {
  font-size: var(--text-sm);
  color: var(--color-dark-soft);
  line-height: 1.7;
  margin: 0;
}

.lr-top-tip {
  background: var(--color-off-white);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xl);
}

.lr-top-tip-heading {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lr-top-tip-text {
  font-size: var(--text-sm);
  color: var(--color-mid-gray);
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   11. Result Actions
   ============================================================ */
.lr-result-actions {
  text-align: center;
}

/* ============================================================
   12. Final Results Screen
   ============================================================ */
.lr-final-score-circle {
  margin-top: var(--space-xl);
}

.lr-final-heading {
  text-align: center;
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
  animation: fadeIn var(--transition-base) 0.3s both;
}

.lr-final-summary {
  text-align: center;
  color: var(--color-mid-gray);
  max-width: 480px;
  margin: 0 auto var(--space-xl);
  animation: fadeIn var(--transition-base) 0.4s both;
}

.lr-final-lessons-heading {
  text-align: center;
  font-size: var(--text-md);
  margin-bottom: var(--space-md);
  color: var(--color-dark);
}

.lr-final-lessons {
  width: 100%;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.lr-final-lesson {
  background: var(--color-white);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
  box-shadow: var(--shadow-sm);
}

.lr-final-lesson-url {
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--text-xs);
  color: var(--color-mid-gray);
  margin-bottom: var(--space-xs);
  word-break: break-all;
}

.lr-final-lesson-text {
  font-size: var(--text-sm);
  color: var(--color-dark-soft);
  line-height: 1.7;
  margin: 0;
}

.lr-final-all-correct {
  text-align: center;
  color: var(--color-green);
  font-weight: 600;
  margin: 0;
}

.lr-final-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

/* ============================================================
   13. Confetti Canvas
   ============================================================ */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: var(--z-overlay);
  display: none;
}

/* ============================================================
   14. Responsive — Tablet (768px+)
   ============================================================ */
@media (min-width: 768px) {
  .game-container {
    padding: var(--space-2xl) var(--space-xl);
  }

  .game-rules {
    max-width: 560px;
  }

  .lr-choices {
    flex-direction: row;
    max-width: 500px;
  }

  .lr-choice-btn {
    flex: 1;
  }

  .lr-address-bar {
    padding: var(--space-md) var(--space-xl);
  }

  .lr-url-text {
    font-size: var(--text-base);
  }

  .lr-final-actions {
    flex-direction: row;
    max-width: 500px;
  }

  .lr-final-actions .btn {
    flex: 1 1 0%;
  }

  .lr-back-links {
    flex-direction: row;
    gap: var(--space-lg);
  }
}

/* ============================================================
   15. Responsive — Desktop (1024px+)
   ============================================================ */
@media (min-width: 1024px) {
  .lr-url-breakdown {
    font-size: var(--text-lg);
  }
}

/* ============================================================
   16. Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .lr-banner,
  .lr-final-score-circle {
    animation: none;
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================================
   17. Print Styles
   ============================================================ */
@media print {
  .game-screen {
    display: block !important;
    page-break-inside: avoid;
  }

  .confetti-canvas,
  .btn,
  .game-back-link,
  .lr-back-links {
    display: none !important;
  }

  .lr-banner,
  .lr-final-score-circle {
    animation: none;
    transform: scale(1);
    opacity: 1;
  }
}
