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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-elevated: #16213e;
  --accent: #e94560;
  --accent-glow: rgba(233, 69, 96, 0.4);
  --gold: #f5c518;
  --gold-glow: rgba(245, 197, 24, 0.3);
  --green: #00e676;
  --green-glow: rgba(0, 230, 118, 0.3);
  --red: #ff1744;
  --red-glow: rgba(255, 23, 68, 0.3);
  --text-primary: #eaeaea;
  --text-secondary: #8a8aa0;
  --text-muted: #555570;
  --border: rgba(255, 255, 255, 0.06);
  --radius: 12px;
  --radius-lg: 20px;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(233, 69, 96, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(100, 60, 180, 0.06) 0%, transparent 50%),
    var(--bg-primary);
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Screens === */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  padding: 24px;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
}

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

/* === Start Screen === */
.logo-container {
  text-align: center;
  margin-bottom: 48px;
}

.logo {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 2px;
  line-height: 1.2;
}

.logo-accent {
  color: var(--accent);
}

.subtitle {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 16px 40px;
  text-transform: uppercase;
}

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

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #d63a52;
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-glow {
  box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(233, 69, 96, 0.15);
}

.btn-banned {
  background: linear-gradient(135deg, #b71c1c, #e53935);
  color: white;
  flex: 1;
}

.btn-banned:hover {
  box-shadow: 0 0 24px var(--red-glow);
  transform: translateY(-2px);
}

.btn-not-banned {
  background: linear-gradient(135deg, #1b5e20, #43a047);
  color: white;
  flex: 1;
}

.btn-not-banned:hover {
  box-shadow: 0 0 24px var(--green-glow);
  transform: translateY(-2px);
}

.btn-icon {
  font-size: 1.2rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* === Game Header === */
.game-header {
  width: 100%;
  margin-bottom: 24px;
}

.score-display {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.score-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}

/* === Card Showcase === */
.card-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
  width: 100%;
}

.card-container {
  position: relative;
  width: 280px * 2;
  height: 408px * 2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.3s ease;
}

.card-container:hover {
  box-shadow:
    0 12px 50px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(233, 69, 96, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card-image.loaded {
  opacity: 1;
}

.card-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.card-loader.hidden {
  display: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.card-name {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
}

.card-type {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === Answer Buttons === */
.answer-buttons {
  display: flex;
  gap: 16px;
  width: 100%;
}

/* === Result Overlay === */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.result-overlay.hidden {
  display: none;
}

.result-icon {
  font-size: 4rem;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.result-text {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.result-text.correct {
  color: var(--green);
  text-shadow: 0 0 20px var(--green-glow);
}

.result-text.wrong {
  color: var(--red);
  text-shadow: 0 0 20px var(--red-glow);
}

.result-detail {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: center;
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* === End Screen === */
.end-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 3px;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.final-score-container {
  margin-bottom: 24px;
}

.final-score-ring {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.final-score {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
}

.final-score-max {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-muted);
}

.end-message {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  text-align: center;
}

.end-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 36px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 480px) {
  .logo {
    font-size: 1.9rem;
  }

  .card-container {
    width: 240px;
    height: 350px;
  }

  .answer-buttons {
    flex-direction: column;
  }

  .btn {
    padding: 14px 24px;
    font-size: 0.85rem;
  }

  .score-display {
    gap: 20px;
    padding: 12px 16px;
  }
}
