/* ═══════════════════════════════════════════════════════════════════════════
   UDEMY COURSE SHOWDOWN — Gumroad Neubrutalist Design System
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink: #FF90E8;
  --yellow: #FFE566;
  --mint: #23C45E;
  --blue: #90B8F8;
  --orange: #FFB067;
  --red: #FF6B6B;
  --black: #1A1A2E;
  --white: #FFFDF7;
  --gray: #F5F0E8;
  --border: 3px solid var(--black);
  --shadow: 5px 5px 0px var(--black);
  --shadow-sm: 3px 3px 0px var(--black);
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--white);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  background-color: var(--pink);
  border-bottom: var(--border);
  padding: 60px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background-color: var(--yellow);
  border-radius: 50%;
  border: var(--border);
  opacity: 0.5;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 60px;
  width: 120px;
  height: 120px;
  background-color: var(--mint);
  border-radius: 50%;
  border: var(--border);
  opacity: 0.4;
}

.badge {
  display: inline-block;
  background-color: var(--yellow);
  border: var(--border);
  border-radius: 50px;
  padding: 6px 20px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  position: relative;
  z-index: 1;
}

.hero h1 .highlight {
  color: var(--black);
  background-color: var(--yellow);
  padding: 0 12px;
  border-radius: 8px;
  border: var(--border);
  display: inline-block;
  transform: rotate(-1deg);
  box-shadow: var(--shadow-sm);
}

.subtitle {
  font-size: 18px;
  max-width: 520px;
  margin: 20px auto 0;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  opacity: 0.85;
}

/* ─── Input Section ────────────────────────────────────────────────────── */
.input-section {
  margin-top: -30px;
  position: relative;
  z-index: 2;
  padding-bottom: 40px;
}

.input-card {
  background-color: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  max-width: 680px;
  margin: 0 auto;
}

.input-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.input-hint {
  font-size: 14px;
  opacity: 0.6;
  margin-bottom: 28px;
}

.url-inputs {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: var(--black);
  color: var(--white);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.optional-tag {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  background-color: var(--gray);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input {
  font-family: var(--font);
  font-size: 15px;
  padding: 14px 16px;
  border: var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
  background-color: var(--gray);
}

.input-group input:focus {
  border-color: var(--black);
  box-shadow: var(--shadow-sm);
  background-color: var(--white);
  transform: translate(-1px, -1px);
}

.input-group input::placeholder {
  color: #aaa;
}

.error-msg {
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
  min-height: 20px;
  line-height: 1.6;
  text-align: left;
  padding: 0;
}

.error-msg:not(:empty) {
  padding: 14px 16px;
  background-color: #fff0f0;
  border: 2px solid var(--red);
  border-radius: var(--radius-sm);
}

/* ─── CAPTCHA Container ────────────────────────────────────────────────── */
.captcha-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 4px;
}

/* ─── Compare Button ───────────────────────────────────────────────────── */
.btn-compare {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 18px;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 800;
  color: var(--black);
  background-color: var(--yellow);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-compare:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0px var(--black);
}

.btn-compare:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--black);
}

.btn-compare:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow);
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid var(--black);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Loading Section ──────────────────────────────────────────────────── */
.loading-section {
  padding: 60px 0;
}

.loading-card {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  background-color: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 50px 40px;
}

.loading-animation {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
}

.loading-ring {
  position: absolute;
  inset: 0;
  border: 4px solid var(--gray);
  border-top-color: var(--pink);
  border-right-color: var(--yellow);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.loading-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

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

  50% {
    transform: scale(1.15);
  }
}

.loading-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.loading-card p {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 28px;
}

.progress-container {
  margin-top: 24px;
}

.progress-bar {
  height: 12px;
  background-color: var(--gray);
  border: 2px solid var(--black);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--mint);
  border-right: 2px solid var(--black);
  transition: width 0.2s linear;
}

.progress-text {
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

/* ─── Reveal Section ───────────────────────────────────────────────────── */
.reveal-section {
  padding: 40px 0;
  text-align: center;
}

.reveal-card {
  max-width: 500px;
  margin: 0 auto;
  background-color: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 50px 40px;
  animation: fadeUp 0.5s ease;
}

.reveal-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}

.reveal-card p {
  font-size: 15px;
  opacity: 0.7;
  margin-bottom: 28px;
}

.btn-reveal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 20px;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 800;
  color: var(--black);
  background-color: var(--mint);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reveal:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0px var(--black);
}

.btn-reveal:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--black);
}

/* ─── Randomize Fallback Section ──────────────────────────────────────── */
.randomize-section {
  padding: 40px 0;
}

.randomize-card {
  max-width: 520px;
  margin: 0 auto;
  background-color: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  text-align: center;
  animation: fadeUp 0.5s ease;
}

.randomize-error {
  text-align: left;
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  padding: 14px 16px;
  background-color: #fff0f0;
  border: 2px solid var(--red);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.randomize-divider {
  position: relative;
  margin: 8px 0 28px;
  border-top: 2px dashed #ccc;
}

.randomize-divider span {
  position: relative;
  top: -12px;
  background-color: var(--white);
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  color: #555;
}

.slot-display {
  padding: 24px;
  margin-bottom: 20px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--gray);
  overflow: hidden;
}

.slot-text {
  font-size: 20px;
  font-weight: 800;
  transition: transform 0.08s ease;
  text-transform: capitalize;
}

.random-result {
  margin-bottom: 24px;
  padding: 24px;
  border: 3px solid var(--mint);
  border-radius: var(--radius-sm);
  background-color: #e8fdf0;
  animation: fadeUp 0.4s ease;
}

.random-winner-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--white);
  background-color: var(--mint);
  padding: 4px 14px;
  border-radius: 20px;
  border: 2px solid var(--black);
  margin-bottom: 12px;
}

.random-result h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  text-transform: capitalize;
}

.btn-go-course {
  display: inline-block;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  padding: 10px 24px;
  background-color: var(--mint);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-go-course:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--black);
}

.btn-randomize {
  display: block;
  width: 100%;
  padding: 18px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 800;
  color: var(--black);
  background-color: var(--orange);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 14px;
}

.btn-randomize:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0px var(--black);
}

.btn-randomize:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--black);
}

.btn-randomize:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-again-small {
  margin-top: 4px;
  padding: 10px 24px;
  font-size: 13px;
}

/* ─── Results Section ──────────────────────────────────────────────────── */
.results-section {
  padding: 20px 0 60px;
}

.winner-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--yellow);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 32px;
  margin-bottom: 32px;
  animation: slideIn 0.6s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.trophy {
  font-size: 48px;
}

/* removed bounce animation */
@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.winner-banner h2 {
  font-size: 22px;
  font-weight: 800;
}

.winner-banner p {
  font-size: 14px;
  opacity: 0.7;
}

/* ─── Course Cards ─────────────────────────────────────────────────────── */
.course-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.course-card {
  background-color: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.2s ease;
  animation: fadeUp 0.5s ease;
  animation-fill-mode: both;
  position: relative;
}

.course-card:nth-child(1) {
  animation-delay: 0.1s;
}

.course-card:nth-child(2) {
  animation-delay: 0.25s;
}

.course-card:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.course-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0px var(--black);
}

.course-card.winner {
  border-color: var(--mint);
  border-width: 4px;
  box-shadow: 6px 6px 0px var(--mint);
}

.course-card.winner:hover {
  box-shadow: 8px 8px 0px var(--mint);
}

.winner-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  background-color: var(--mint);
  color: var(--black);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  border: 2px solid var(--black);
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-rank {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: var(--yellow);
  color: var(--black);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  border: 2px solid var(--black);
  z-index: 2;
}

.course-thumbnail {
  width: 100%;
  aspect-ratio: 480 / 270;
  overflow: hidden;
  border-bottom: 3px solid var(--black);
}

.course-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(110deg, var(--gray) 30%, #ece7df 50%, var(--gray) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.card-header {
  padding: 16px 24px 0;
}

.card-header .course-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 4px;
}

.card-header .course-instructor {
  font-size: 13px;
  opacity: 0.6;
  font-weight: 600;
}

/* Score Circle */
.score-section {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.score-circle {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.score-circle svg {
  transform: rotate(-90deg);
  width: 80px;
  height: 80px;
}

.score-circle .bg {
  fill: none;
  stroke: var(--gray);
  stroke-width: 6;
}

.score-circle .progress {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease;
}

.score-circle .score-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.score-details {
  flex: 1;
}

.score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  opacity: 0.5;
  margin-bottom: 4px;
}

.score-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 600;
}

.score-bar-label {
  width: 60px;
  opacity: 0.6;
}

.score-bar {
  flex: 1;
  height: 6px;
  background-color: var(--gray);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: var(--border);
}

.stat {
  padding: 14px 18px;
  border-bottom: 2px solid var(--black);
}

.stat:nth-child(odd) {
  border-right: 2px solid var(--black);
}

.stat-value {
  font-size: 18px;
  font-weight: 800;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.5;
  font-weight: 700;
}

/* Reviews */
.reviews-section {
  padding: 20px 24px;
  border-top: var(--border);
}

.reviews-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 12px;
}

.review-item {
  margin-bottom: 14px;
  padding: 12px;
  background-color: var(--gray);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

.review-item:hover {
  border-color: var(--black);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.review-name {
  font-size: 12px;
  font-weight: 700;
}

.review-stars {
  font-size: 12px;
  color: #e8a835;
}

.review-text {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.8;
}

.card-footer {
  padding: 16px 24px;
  border-top: var(--border);
  text-align: center;
}

.card-footer a {
  display: inline-block;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  padding: 10px 24px;
  background-color: var(--pink);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.card-footer a:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--black);
}

/* Error card */
.course-card.error-card {
  border-color: var(--red);
  background-color: #fff5f5;
}

.error-content {
  padding: 40px 24px;
  text-align: center;
}

.error-content .error-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.error-content h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.error-content p {
  font-size: 13px;
  opacity: 0.6;
}

/* ─── Scoring Info ─────────────────────────────────────────────────────── */
.scoring-info {
  background-color: var(--gray);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 28px;
}

.scoring-info h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}

.scoring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.scoring-item {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scoring-weight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 24px;
  background-color: var(--black);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  border-radius: 6px;
}

/* ─── Try Again Button ─────────────────────────────────────────────────── */
.btn-again {
  display: block;
  margin: 0 auto;
  padding: 14px 32px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  background-color: var(--white);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-again:hover {
  background-color: var(--pink);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0px var(--black);
}

/* ─── Footer ───────────────────────────────────────────────────────────── */
.footer {
  border-top: var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  opacity: 0.5;
  font-weight: 600;
}

/* ─── Responsive — Tablet (≤768px) ─────────────────────────────────────── */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  /* Hero */
  .hero {
    padding: 36px 0 30px;
  }

  .hero h1 {
    font-size: 38px;
    letter-spacing: -1px;
  }

  .hero h1 .highlight {
    padding: 0 8px;
  }

  .hero::before {
    width: 120px;
    height: 120px;
    top: -20px;
    right: -20px;
  }

  .hero::after {
    width: 80px;
    height: 80px;
    bottom: -20px;
    left: 20px;
  }

  .subtitle {
    font-size: 15px;
    max-width: 90%;
  }

  .badge {
    font-size: 13px;
    padding: 5px 16px;
  }

  /* Input Card */
  .input-section {
    margin-top: -20px;
  }

  .input-card {
    padding: 24px 18px;
  }

  .input-card h2 {
    font-size: 20px;
  }

  .input-group input {
    font-size: 14px;
    padding: 12px 14px;
  }

  .btn-compare {
    font-size: 16px;
    padding: 15px;
  }

  /* Loading */
  .loading-card {
    padding: 36px 24px;
  }

  .loading-animation {
    width: 80px;
    height: 80px;
  }

  .loading-ring {
    border-width: 3px;
  }

  .loading-emoji {
    font-size: 28px;
  }

  .loading-card h2 {
    font-size: 18px;
  }

  /* Results */
  .course-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .winner-banner {
    padding: 18px 16px;
    gap: 12px;
  }

  .winner-banner h2 {
    font-size: 18px;
  }

  .trophy {
    font-size: 36px;
  }

  .card-header {
    padding: 48px 18px 0;
  }

  .card-header .course-title {
    font-size: 16px;
  }

  .score-section {
    padding: 16px 18px;
    gap: 16px;
  }

  .score-circle {
    width: 70px;
    height: 70px;
  }

  .score-circle svg {
    width: 70px;
    height: 70px;
  }

  .score-circle .score-text {
    font-size: 18px;
  }

  .stat {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 16px;
  }

  .card-footer {
    padding: 14px 18px;
  }

  .card-footer a {
    font-size: 13px;
    padding: 9px 20px;
  }

  /* Scoring Info */
  .scoring-info {
    padding: 20px 18px;
  }

  .scoring-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Button */
  .btn-again {
    padding: 12px 24px;
    font-size: 14px;
    width: 100%;
  }
}

/* ─── Responsive — Mobile (≤480px) ─────────────────────────────────────── */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  /* Hero */
  .hero {
    padding: 28px 0 24px;
  }

  .hero h1 {
    font-size: 32px;
    letter-spacing: -0.5px;
  }

  .hero h1 .highlight {
    transform: rotate(0deg);
    padding: 0 6px;
  }

  .hero::before,
  .hero::after {
    display: none;
  }

  .subtitle {
    font-size: 14px;
    max-width: 100%;
    line-height: 1.5;
  }

  .badge {
    font-size: 12px;
    padding: 4px 14px;
    margin-bottom: 14px;
  }

  /* Input Card */
  .input-section {
    margin-top: -16px;
    padding-bottom: 24px;
  }

  .input-card {
    padding: 20px 14px;
    border-radius: 12px;
  }

  .input-card h2 {
    font-size: 18px;
  }

  .input-hint {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .url-inputs {
    gap: 14px;
  }

  .input-group input {
    font-size: 13px;
    padding: 12px;
    border-radius: 8px;
  }

  .input-group label {
    font-size: 13px;
  }

  .input-number {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .btn-compare {
    font-size: 15px;
    padding: 14px;
    border-radius: 8px;
    margin-top: 20px;
  }

  /* Loading */
  .loading-section {
    padding: 30px 0;
  }

  .loading-card {
    padding: 28px 16px;
    border-radius: 12px;
  }

  .loading-animation {
    width: 70px;
    height: 70px;
    margin-bottom: 18px;
  }

  .loading-emoji {
    font-size: 24px;
  }

  .loading-card h2 {
    font-size: 17px;
  }

  .loading-card p {
    font-size: 13px;
  }

  .loading-steps .step {
    font-size: 13px;
    padding: 8px 12px;
  }

  /* Results */
  .results-section {
    padding: 16px 0 40px;
  }

  .winner-banner {
    padding: 14px 14px;
    border-radius: 12px;
    gap: 10px;
    margin-bottom: 20px;
    flex-direction: row;
    align-items: center;
  }

  .winner-banner h2 {
    font-size: 15px;
    line-height: 1.3;
  }

  .winner-banner p {
    font-size: 12px;
  }

  .trophy {
    font-size: 32px;
  }

  /* Cards */
  .course-cards {
    gap: 14px;
  }

  .course-card {
    border-radius: 12px;
    box-shadow: 3px 3px 0px var(--black);
  }

  .course-card:hover {
    transform: none;
    box-shadow: 3px 3px 0px var(--black);
  }

  .course-card.winner {
    box-shadow: 4px 4px 0px var(--mint);
  }

  .course-card.winner:hover {
    box-shadow: 4px 4px 0px var(--mint);
  }

  .winner-tag {
    top: 12px;
    right: 12px;
    font-size: 11px;
    padding: 3px 10px;
  }

  .card-rank {
    top: 12px;
    left: 12px;
    font-size: 11px;
    padding: 3px 10px;
  }

  .card-header {
    padding: 44px 14px 0;
  }

  .card-header .course-title {
    font-size: 15px;
    line-height: 1.3;
  }

  .card-header .course-instructor {
    font-size: 12px;
  }

  /* Score section — stack vertically on small screens */
  .score-section {
    flex-direction: column;
    text-align: center;
    padding: 14px;
    gap: 12px;
  }

  .score-circle {
    width: 68px;
    height: 68px;
    margin: 0 auto;
  }

  .score-circle svg {
    width: 68px;
    height: 68px;
  }

  .score-circle .score-text {
    font-size: 17px;
  }

  .score-details {
    width: 100%;
  }

  .score-label {
    text-align: center;
  }

  .score-bar-label {
    width: 52px;
    font-size: 10px;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    padding: 10px 12px;
  }

  .stat-value {
    font-size: 14px;
    word-break: break-word;
  }

  .stat-label {
    font-size: 10px;
    letter-spacing: 0.5px;
  }

  .card-footer {
    padding: 12px 14px;
  }

  .card-footer a {
    font-size: 13px;
    padding: 9px 18px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  /* Scoring Info */
  .scoring-info {
    padding: 18px 14px;
    border-radius: 12px;
    margin-bottom: 20px;
  }

  .scoring-info h3 {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .scoring-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .scoring-item {
    font-size: 12px;
    gap: 6px;
  }

  .scoring-weight {
    width: 36px;
    height: 22px;
    font-size: 10px;
  }

  /* Button */
  .btn-again {
    width: 100%;
    padding: 13px;
    font-size: 14px;
    border-radius: 8px;
  }

  /* Footer */
  .footer {
    padding: 18px 0;
    font-size: 12px;
  }

  /* Error card */
  .error-content {
    padding: 28px 16px;
  }

  .error-content .error-icon {
    font-size: 36px;
  }

  .error-content h3 {
    font-size: 14px;
  }

  .error-content p {
    font-size: 12px;
  }
}

/* ─── Responsive — Very small devices (≤360px) ─────────────────────────── */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 28px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat:nth-child(odd) {
    border-right: none;
  }

  .scoring-grid {
    grid-template-columns: 1fr;
  }

  .winner-banner {
    flex-direction: column;
    text-align: center;
  }
}