/* ================================================================
   NO CAP OR CAP? – SimplyJavaScript Game
   Swipe through JavaScript facts & myths. True = No Cap, False = Cap.
   styles.css
   ================================================================ */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0d0d0d;
  color: #f0f0f0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
}

/* ================================================================
   TOP BAR
   ================================================================ */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: rgba(13, 13, 20, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(236, 72, 153, 0.18);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  z-index: 20;
  gap: 6px 12px;
}

.top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: -0.2px;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.15s;
}
.brand:hover { opacity: 0.75; }
.brand-accent { color: #ec4899; }

.game-controls { display: flex; gap: 6px; align-items: center; }

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.ctrl-btn:hover {
  background: rgba(236, 72, 153, 0.14);
  border-color: rgba(236, 72, 153, 0.45);
  color: #ec4899;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.18);
}
.ctrl-btn:active { transform: translateY(0); box-shadow: none; }
.ctrl-btn svg { width: 14px; height: 14px; fill: currentColor; pointer-events: none; }

.stats { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; flex-shrink: 0; }

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stat-value {
  color: #ec4899;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 18px;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
  transition: color 0.3s;
}
.stat-value.timer-low  { color: #fb923c; animation: timer-pulse 1s ease-in-out infinite; }
.stat-value.timer-crit { color: #f87171; animation: timer-pulse 0.5s ease-in-out infinite; }
.stat-value.score-pop  { animation: score-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }

@keyframes timer-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes score-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ================================================================
   PROGRESS BAR
   ================================================================ */
#progress-bar-container {
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  z-index: 10;
}
#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.4);
}

/* ================================================================
   GAME CONTENT
   ================================================================ */
#game-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 22px 18px 34px;
}

#card-stage {
  width: 100%;
  max-width: 560px;
  display: flex;
  justify-content: center;
}

.cap-card {
  width: 100%;
  background: linear-gradient(160deg, #17172a, #12121f);
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: 20px;
  padding: 30px 26px 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.02);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  animation: card-in 0.35s ease both;
  touch-action: pan-y;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cap-card.correct-flash { animation: flash-green 0.5s ease; }
.cap-card.wrong-flash   { animation: flash-red 0.5s ease; }
@keyframes flash-green { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } 30% { box-shadow: 0 0 0 6px rgba(34,197,94,0.35); } 100% { box-shadow: 0 18px 50px rgba(0,0,0,0.55); } }
@keyframes flash-red   { 0% { box-shadow: 0 0 0 0 rgba(248,113,113,0); } 30% { box-shadow: 0 0 0 6px rgba(248,113,113,0.35); } 100% { box-shadow: 0 18px 50px rgba(0,0,0,0.55); } }

.cap-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#concept-tag {
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd;
  padding: 4px 12px;
  border-radius: 20px;
}
#card-index { color: rgba(255,255,255,0.35); }

#statement-text {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #f4f4f5;
}

.cap-card__hint {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
}
.cap-card__hint strong { color: rgba(255,255,255,0.65); }

/* ================================================================
   VERDICT BUTTONS
   ================================================================ */
#verdict-row {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 560px;
}
.verdict-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.verdict-btn:active:not(:disabled) { transform: scale(0.96); }
.verdict-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.verdict-emoji { font-size: 1.15rem; }

.verdict-btn--cap {
  background: linear-gradient(135deg, #3f1d2e, #2a1420);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}
.verdict-btn--cap:hover:not(:disabled) {
  box-shadow: 0 8px 22px rgba(248, 113, 113, 0.2);
  filter: brightness(1.1);
}
.verdict-btn--nocap {
  background: linear-gradient(135deg, #133327, #0e2019);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}
.verdict-btn--nocap:hover:not(:disabled) {
  box-shadow: 0 8px 22px rgba(34, 197, 94, 0.2);
  filter: brightness(1.1);
}

/* ================================================================
   FEEDBACK SECTION
   ================================================================ */
#feedback-section {
  width: 100%;
  max-width: 560px;
  background: #14141f;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: card-in 0.3s ease both;
}
#feedback-section.hidden { display: none; }

.fb-header { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 800; }
.fb-icon { font-size: 1.4rem; }
#fb-label.is-correct { color: #4ade80; }
#fb-label.is-wrong   { color: #f87171; }

#feedback-score-gained { font-size: 0.85rem; font-weight: 700; color: #ec4899; }
#feedback-explanation { font-size: 0.9rem; line-height: 1.6; color: rgba(255,255,255,0.72); }

#next-btn {
  align-self: flex-start;
  margin-top: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
#next-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(236, 72, 153, 0.35); }
#next-btn:active { transform: translateY(0); }

/* ================================================================
   GAME OVER SCREEN
   ================================================================ */
#gameover-screen {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 12, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
#gameover-screen.hidden { display: none; }

#gameover-content {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(160deg, #17172a, #101018);
  border: 1px solid rgba(236, 72, 153, 0.28);
  border-radius: 22px;
  padding: 38px 32px 32px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  animation: card-in 0.4s ease both;
}

#go-grade {
  font-size: 2.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 6px;
}
#go-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
#go-score-val { font-size: 2.1rem; font-weight: 800; color: #f4f4f5; margin-bottom: 6px; }
#go-subtitle { font-size: 0.9rem; color: rgba(255,255,255,0.6); line-height: 1.55; margin-bottom: 22px; }

.go-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}
.go-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 12px 6px;
}
.go-stat-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.42); margin-bottom: 4px; }
.go-stat-value { font-size: 1.1rem; font-weight: 800; color: #ec4899; }

#play-again-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
}
#play-again-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(236, 72, 153, 0.35); }

#back-games-link {
  display: inline-block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.15s;
}
#back-games-link:hover { color: #ec4899; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 560px) {
  .cap-card { padding: 24px 18px 20px; min-height: 180px; }
  #statement-text { font-size: 0.98rem; }
  .verdict-btn { padding: 14px 10px; font-size: 0.9rem; }
  .stats { gap: 5px; }
  .stat-item { padding: 3px 8px; font-size: 0.65rem; }
}
