/* ============================================================
   FANZONE-STATBATTLE.CSS — Stat Battle game styles
   Visual identity: Cyan accent (#4cc9f0), competitive arena feel

   FIXES APPLIED:
   1. Replaced non-existent CSS variables (--card-bg, --text-primary,
      --text-secondary, --border) with the actual theme tokens
      (--ink-2, --ink-text, --ink-muted, --ink-line).
   2. Added fz-sim-start-btn, fz-setup-label, fz-info-box styles
      that were missing (only defined in other games' CSS files
      that aren't loaded on this page).
   3. Improved mode button styling to match the design system.
   ============================================================ */

/* ─── SHARED SETUP ELEMENTS (previously missing) ─── */
.fz-setup-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted, #9aa3c4);
  margin-bottom: var(--space-sm, 8px);
  font-weight: 600;
}

.fz-info-box {
  background: var(--ink-2, #121a30);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.1));
  border-radius: 10px;
  padding: var(--space-md, 16px);
  margin-bottom: var(--space-lg, 24px);
  font-size: 0.9rem;
  color: var(--ink-muted, #9aa3c4);
  line-height: 1.6;
}

.fz-info-box p {
  margin: 0 0 var(--space-xs, 4px);
}

.fz-info-box p:last-child {
  margin-bottom: 0;
}

.fz-info-box strong {
  color: var(--ink-text, #eef1fb);
}

/* ─── START BUTTON (previously unstyled) ─── */
.fz-sim-start-btn {
  width: 100%;
  min-height: 52px;
  background: var(--page-accent, #4cc9f0);
  color: var(--ink, #0b0f1e);
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
  margin-top: var(--space-md, 16px);
  font-family: inherit;
}

.fz-sim-start-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(76, 201, 240, 0.3);
}

.fz-sim-start-btn:active {
  transform: scale(0.97);
}

/* ─── SETUP SCREEN ─── */
.fz-sb-setup {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-lg, 24px) var(--space-md, 16px);
}

.fz-sb-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: var(--space-md, 16px);
}

@media (max-width: 540px) {
  .fz-sb-mode-grid {
    grid-template-columns: 1fr;
  }
}

/* Mode buttons — now using proper theme tokens */
.fz-sb-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 16px;
  border: 2px solid var(--ink-line, rgba(233, 238, 255, 0.1));
  border-radius: 12px;
  background: var(--ink-2, #121a30);
  color: var(--ink-text, #eef1fb);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: inherit;
}

.fz-sb-mode-btn:hover {
  border-color: var(--page-accent, #4cc9f0);
  background: var(--ink-3, #1a2440);
  transform: translateY(-2px);
}

.fz-sb-mode-btn.selected {
  border-color: var(--page-accent, #4cc9f0);
  background: var(--page-accent-soft, rgba(76, 201, 240, 0.15));
  box-shadow: 0 0 0 1px var(--page-accent, #4cc9f0);
}

.fz-sb-mode-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-text, #eef1fb);
}

.fz-sb-mode-desc {
  font-size: 0.82rem;
  color: var(--ink-muted, #9aa3c4);
  line-height: 1.3;
}

/* ─── GAME SCREEN ─── */
.fz-sb-game {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-md, 16px);
}

/* Top bar */
.fz-sb-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.fz-sb-round {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted, #9aa3c4);
}

.fz-sb-score {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--page-accent, #4cc9f0);
}

.fz-sb-streak {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f59e0b;
  opacity: 0;
  transition: opacity 0.3s;
}

.fz-sb-streak--active {
  opacity: 1;
}

.fz-sb-timer {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--page-accent, #4cc9f0);
  background: var(--page-accent-soft, rgba(76, 201, 240, 0.15));
  padding: 4px 12px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.fz-sb-timer--low {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  animation: fz-sb-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes fz-sb-pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

/* Category banner */
.fz-sb-category {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--page-accent-soft, rgba(76, 201, 240, 0.15));
  border-radius: 12px;
  border: 1px solid rgba(76, 201, 240, 0.2);
  margin-bottom: 20px;
  text-align: center;
}

.fz-sb-category-icon {
  font-size: 1.3rem;
}

.fz-sb-category-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-text, #eef1fb);
}

/* Arena — VS layout */
.fz-sb-arena {
  display: flex;
  align-items: stretch;
  gap: 12px;
  justify-content: center;
}

/* Player cards — now using proper theme tokens */
.fz-sb-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border: 2px solid var(--ink-line, rgba(233, 238, 255, 0.1));
  border-radius: 16px;
  background: var(--ink-2, #121a30);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  max-width: 340px;
  font-family: inherit;
}

.fz-sb-card:hover:not(:disabled) {
  border-color: var(--page-accent, #4cc9f0);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(76, 201, 240, 0.12);
}

.fz-sb-card--correct {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.1) !important;
  animation: fz-sb-correct 0.4s ease;
}

.fz-sb-card--wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
  animation: fz-sb-wrong 0.4s ease;
}

.fz-sb-card--picked {
  box-shadow:
    0 0 0 3px var(--page-accent, #4cc9f0),
    0 8px 24px rgba(76, 201, 240, 0.15);
}

@keyframes fz-sb-correct {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fz-sb-wrong {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

/* Player image */
.fz-sb-card-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--page-accent-soft, rgba(76, 201, 240, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--page-accent, #4cc9f0);
}

.fz-sb-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.fz-sb-card-placeholder {
  font-size: 2rem;
  font-weight: 700;
  color: var(--page-accent, #4cc9f0);
  opacity: 0.6;
}

/* Player info */
.fz-sb-card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fz-sb-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-text, #eef1fb);
  line-height: 1.2;
}

.fz-sb-card-meta {
  font-size: 0.78rem;
  color: var(--ink-muted, #9aa3c4);
  display: flex;
  align-items: center;
  gap: 4px;
}

.fz-sb-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
}

/* Stat reveal */
.fz-sb-card-stat {
  margin-top: 4px;
  padding: 6px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  min-width: 60px;
  text-align: center;
}

.fz-sb-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink-text, #eef1fb);
  font-variant-numeric: tabular-nums;
  display: block;
}

.fz-sb-stat-hidden {
  opacity: 0.3;
}

/* Pick badge */
.fz-sb-card-pick {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--page-accent-soft, rgba(76, 201, 240, 0.15));
  color: var(--page-accent, #4cc9f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  border: 1.5px solid var(--page-accent, #4cc9f0);
  opacity: 0.5;
  transition: opacity 0.2s;
}

.fz-sb-card:hover .fz-sb-card-pick {
  opacity: 1;
}

/* VS divider */
.fz-sb-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fz-sb-vs span {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--page-accent, #4cc9f0);
  letter-spacing: 2px;
  background: var(--page-accent-soft, rgba(76, 201, 240, 0.15));
  padding: 8px 12px;
  border-radius: 50%;
  border: 2px solid var(--page-accent, #4cc9f0);
}

/* Result banner */
.fz-sb-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--ink-2, #121a30);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.1));
}

.fz-sb-result-text {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink-text, #eef1fb);
}

.fz-sb-result--correct {
  color: #22c55e;
}

.fz-sb-result--wrong {
  color: #ef4444;
}

/* Next button — now properly styled */
.fz-sb-next-btn {
  background: var(--page-accent, #4cc9f0) !important;
  color: var(--ink, #0b0f1e) !important;
  border: none !important;
  padding: 12px 32px !important;
  border-radius: 10px !important;
  font-size: 1rem !important;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  min-height: 48px;
}

.fz-sb-next-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(76, 201, 240, 0.3);
}

.fz-sb-next-btn:active {
  transform: scale(0.97);
}

/* ─── RESULTS SCREEN ─── */
.fz-sb-results {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-lg, 24px) var(--space-md, 16px);
}

.fz-sb-results-card {
  background: var(--ink-2, #121a30);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.1));
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
}

.fz-sb-results-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--ink-text, #eef1fb);
}

.fz-sb-results-score {
  font-size: 3rem;
  font-weight: 900;
  color: var(--page-accent, #4cc9f0);
  margin: 8px 0 16px;
  line-height: 1;
}

.fz-sb-results-detail {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

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

.fz-sb-results-stat-label {
  font-size: 0.75rem;
  color: var(--ink-muted, #9aa3c4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fz-sb-results-stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink-text, #eef1fb);
}

/* Breakdown */
.fz-sb-breakdown-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 20px 0 10px;
  text-align: left;
  color: var(--ink-text, #eef1fb);
}

.fz-sb-breakdown-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fz-sb-breakdown-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.82rem;
  color: var(--ink-text, #eef1fb);
}

.fz-sb-breakdown-row--wrong {
  opacity: 0.6;
}

.fz-sb-breakdown-icon {
  font-size: 0.85rem;
}

.fz-sb-breakdown-match {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fz-sb-breakdown-cat {
  font-size: 0.72rem;
  color: var(--ink-muted, #9aa3c4);
  white-space: nowrap;
}

.fz-sb-breakdown-pts {
  font-weight: 700;
  color: var(--page-accent, #4cc9f0);
  min-width: 30px;
  text-align: right;
}

.fz-sb-results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  .fz-sb-arena {
    flex-direction: column;
    gap: 8px;
  }

  .fz-sb-vs {
    padding: 4px 0;
  }

  .fz-sb-vs span {
    font-size: 1rem;
    padding: 4px 10px;
  }

  .fz-sb-card {
    flex-direction: row;
    text-align: left;
    align-items: center;
    max-width: 100%;
    padding: 14px;
    gap: 14px;
  }

  .fz-sb-card-image {
    width: 56px;
    height: 56px;
  }

  .fz-sb-card-info {
    flex: 1;
    align-items: flex-start;
  }

  .fz-sb-card-stat {
    margin-top: 0;
  }

  .fz-sb-card-pick {
    position: static;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .fz-sb-breakdown-row {
    grid-template-columns: 20px 1fr auto;
  }

  .fz-sb-breakdown-cat {
    display: none;
  }
}
