/* ════════════════════════════════════════
   RESET
   ════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #000;
  overflow-x: hidden;
}

img { display: block; }

button { font-family: inherit; }


/* ════════════════════════════════════════
   CAMPAIGN PAGE
   ════════════════════════════════════════ */
.campaign-page {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


/* ════════════════════════════════════════
   STADIUM BACKGROUND
   assets/stadium-background.png
   Covers the full hero section.
   ════════════════════════════════════════ */
.stadium-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}


/* ════════════════════════════════════════
   DARK OVERLAY
   Gradient darkens bottom more than top
   so the match area remains readable.
   ════════════════════════════════════════ */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.50) 40%,
    rgba(0, 0, 0, 0.72) 100%
  );
  z-index: 1;
  pointer-events: none;
}


/* ════════════════════════════════════════
   TOP BAR — Bello logo
   ════════════════════════════════════════ */
.top-bar {
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 30;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
}

.bello-logo {
  width: clamp(150px, 14vw, 260px);
  height: auto;
  display: block;
  object-fit: contain;
  background: transparent;
  border: none;
  box-shadow: none;
}

.logo-fallback {
  display: none;
}


/* ════════════════════════════════════════
   HERO CONTENT
   Vertically and horizontally centered.
   ════════════════════════════════════════ */
.hero-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3.5vh, 48px);
  padding: 16px 20px clamp(32px, 5vh, 64px);
}


/* ════════════════════════════════════════
   TITLE GRAPHIC
   assets/title-graphic.png.png
   "Choose Your Favorite Team! Win Free Bello Points!"
   ════════════════════════════════════════ */
.title-graphic {
  width: min(1120px, 86vw);
  max-width: 1120px;
  height: auto;
  margin-top: clamp(155px, 20vh, 210px);
  margin-bottom: clamp(10px, 2vh, 28px);
}


/* ════════════════════════════════════════
   MATCH AREA
   Three-column layout: home | center | away
   ════════════════════════════════════════ */
.match-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 72px);
  width: 100%;
  margin-top: clamp(-130px, -13vh, -90px);
  transform: translateY(-355px);
}


/* ════════════════════════════════════════
   TEAM CARD
   Clickable button wrapping flag + name.
   ════════════════════════════════════════ */
.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: 20px;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.team-card:hover {
  transform: scale(1.05);
}

.team-card:active {
  transform: scale(0.97);
}

.team-card:focus-visible {
  outline: 3px solid #ffd700;
  outline-offset: 6px;
}


/* ════════════════════════════════════════
   FLAG FRAME
   Gold gradient ring. Flag image sits inside.
   Flags load from flagcdn.com via script.js.
   ════════════════════════════════════════ */
.flag-frame {
  width: clamp(170px, 18vw, 270px);
  height: clamp(170px, 18vw, 270px);
  border-radius: 50%;
  padding: 12px;
  background: linear-gradient(135deg, #fff4a8, #b87912, #ffe6a1, #7a4a00);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.team-flag {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
  background: #ffffff;
}

/* Shown inside the gold ring if the flag image fails to load */
.flag-fallback {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #002b45;
  font-size: clamp(36px, 5vw, 80px);
  font-weight: 900;
  letter-spacing: 0.04em;
}


/* ════════════════════════════════════════
   TEAM NAME
   ════════════════════════════════════════ */
.team-name {
  color: #fff;
  font-size: clamp(16px, 2.2vw, 28px);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  letter-spacing: 0.02em;
  max-width: 180px;
  line-height: 1.2;
}


/* ════════════════════════════════════════
   MATCH CENTER — date & VS
   ════════════════════════════════════════ */
.match-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 60px;
}

/* .match-date removed from campaign page */

.vs-text {
  color: #ffffff;
  font-size: clamp(26px, 5vw, 68px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.9);
  line-height: 1;
  letter-spacing: 0.06em;
}


/* ════════════════════════════════════════
   REGISTER CTA
   assets/cta-register.png as a button.
   Clicking opens Bello invite URL directly.
   ════════════════════════════════════════ */
.register-visual-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 20px;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  margin-top: clamp(-10px, -1vh, 0px);
  transform: translateY(-355px);
}

.register-visual-btn:hover {
  transform: translateY(-355px) scale(1.03);
}

.register-visual-btn:active {
  transform: translateY(-355px) scale(0.97);
}

.register-visual-btn:focus-visible {
  outline: 3px solid #ffd700;
  outline-offset: 6px;
}

.cta-register-img {
  max-width: min(480px, 86vw);
  width: 100%;
  height: auto;
  border-radius: 20px;
}


/* ════════════════════════════════════════
   SIMPLE ALERT MODAL
   ════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fffdf6;
  border-radius: 18px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.modal-message {
  color: #1a2744;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 22px;
}

.modal-close {
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.modal-close:hover { background: #ea6c0a; }


/* ════════════════════════════════════════
   PREDICTION FORM MODAL
   ════════════════════════════════════════ */
.form-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.form-overlay.active {
  display: flex;
}

.form-card {
  background: #fffdf6;
  border-radius: 22px;
  padding: 32px 28px 28px;
  max-width: 440px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.40);
}

.form-close-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 20px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}

.form-close-btn:hover { color: #374151; }

.form-heading {
  font-size: 22px;
  font-weight: 800;
  color: #1a2744;
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.55;
  margin-bottom: 18px;
}

.prediction-bar {
  background: #1a2744;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 12px;
}

.prediction-label {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.prediction-value {
  color: #f97316;
  font-size: 15px;
  font-weight: 800;
  text-align: right;
}

.modal-normal-content {
  display: block;
}

.voting-closed-only {
  display: none;
  padding: 8px 0 4px;
}

.voting-locked-msg {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #dc2626;
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.field-group {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  transition: border-color 0.18s;
}

.form-input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.form-input.input-error {
  border-color: #ef4444;
}

.field-error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

.duplicate-error {
  display: none;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 8px;
  margin-bottom: 10px;
}

.duplicate-error.visible { display: block; }

.form-submit {
  width: 100%;
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 13px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.18s;
}

.form-submit:hover:not(:disabled) { background: #ea6c0a; }

.form-submit:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a2744;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 600;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ════════════════════════════════════════
   ADMIN LOGIN MODAL
   ════════════════════════════════════════ */
.admin-login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.70);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-login-overlay.active { display: flex; }

.admin-login-card {
  background: #fffdf6;
  border-radius: 22px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  position: relative;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.45);
}

.admin-login-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.admin-login-close:hover { color: #374151; }

.admin-login-heading {
  font-size: 20px;
  font-weight: 800;
  color: #1a2744;
  margin-bottom: 22px;
}

.admin-login-field {
  margin-bottom: 14px;
}

.admin-login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.admin-login-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  color: #111827;
  background: #fff;
}

.admin-login-field input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.admin-login-error {
  color: #ef4444;
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 10px;
}

.admin-login-btn {
  width: 100%;
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
}

.admin-login-btn:hover { background: #ea6c0a; }


/* ════════════════════════════════════════
   ADMIN DASHBOARD
   ════════════════════════════════════════ */
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 500;
  overflow-y: auto;
  padding: 24px 16px;
}

.admin-overlay.active { display: block; }

.admin-panel {
  background: #fffdf6;
  border-radius: 22px;
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 18px 64px rgba(0, 0, 0, 0.50);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  gap: 12px;
}

.admin-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a2744;
}

.admin-close-btn {
  background: none;
  border: 1.5px solid #d1d5db;
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-close-btn:hover { background: #f3f4f6; }

/* Navy config panel */
.navy-section {
  background: #1a2744;
  padding: 22px 24px;
}

.admin-section {
  padding: 20px 24px;
}

.admin-section-heading {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 18px;
}

.admin-section-heading.dark {
  color: #6b7280;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-row-block {
  flex-direction: column;
  align-items: flex-start;
}

.admin-label {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  min-width: 148px;
  flex-shrink: 0;
  line-height: 1.3;
}

.admin-input,
.admin-select {
  flex: 1;
  background: #253460;
  border: 1px solid #3b4f7a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}

.admin-input:focus,
.admin-select:focus {
  outline: none;
  border-color: #f97316;
}

.admin-row-block .admin-input {
  width: 100%;
  margin-top: 6px;
}

.admin-hint {
  color: #64748b;
  font-size: 11px;
  margin-top: 4px;
  flex-basis: 100%;
}

.admin-lock-msg {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
}

.admin-divider {
  height: 1px;
  background: #2d3f6e;
  margin: 16px 0;
}

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px 24px;
  background: #f8f5ee;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 8px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
  color: #f97316;
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.07em;
  margin-top: 6px;
  text-transform: uppercase;
}

/* Voter table */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.voter-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.voter-table thead tr {
  background: #f1f5f9;
}

.voter-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.voter-table td {
  padding: 9px 12px;
  border-top: 1px solid #f1f5f9;
  color: #374151;
  white-space: nowrap;
}

.voter-table tr:hover td { background: #fafaf8; }

.no-votes {
  text-align: center;
  color: #9ca3af;
  padding: 28px 12px !important;
  white-space: normal !important;
}

/* Action buttons */
.admin-actions {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.btn-export {
  flex: 1;
  min-width: 180px;
  background: #1a2744;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
}

.btn-export:hover { background: #243566; }

.btn-clear {
  flex: 1;
  min-width: 180px;
  background: none;
  color: #ef4444;
  border: 1.5px solid #ef4444;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
}

.btn-clear:hover { background: #fef2f2; }


/* ════════════════════════════════════════
   IMAGE FALLBACKS
   Shown automatically when image files are
   missing or fail to load.
   ════════════════════════════════════════ */

/* Bello logo text fallback (assets/bello-logo.png missing) */
.bello-logo-text {
  color: #fff;
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: 0.02em;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* Title graphic text fallback (assets/title-graphic.png missing) */
.title-graphic-fallback {
  text-align: center;
  max-width: min(580px, 88vw);
  width: 100%;
}

.title-graphic-fallback p:first-child {
  color: #ffffff;
  font-size: clamp(22px, 4vw, 52px);
  font-weight: 900;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
  margin-bottom: 10px;
  line-height: 1.15;
}

.title-graphic-fallback p:last-child {
  color: #ffd700;
  font-size: clamp(16px, 2.5vw, 34px);
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* CTA register fallback (assets/cta-register.png missing) */
.cta-register-fallback {
  max-width: min(480px, 86vw);
  width: 100%;
  background: linear-gradient(135deg, #f97316, #c2570c);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 36px) clamp(24px, 5vw, 56px);
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.cta-fallback-new {
  color: #fff;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 800;
}

.cta-fallback-sub {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(12px, 1.4vw, 16px);
  line-height: 1.45;
}

.cta-fallback-btn {
  display: inline-block;
  margin-top: 10px;
  background: #fff;
  color: #f97316;
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 800;
  padding: 10px 30px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}


/* ════════════════════════════════════════
   MOBILE
   ════════════════════════════════════════ */
@media (max-width: 540px) {
  .top-bar { top: 14px; left: 14px; }

  .hero-content {
    gap: clamp(16px, 3vh, 28px);
    padding-bottom: 28px;
  }

  .match-area {
    gap: 10px;
    transform: translateY(-185px);
    margin-top: clamp(-60px, -8vh, -30px);
  }

  .register-visual-btn {
    transform: translateY(-185px);
  }

  .register-visual-btn:hover {
    transform: translateY(-185px) scale(1.03);
  }

  .register-visual-btn:active {
    transform: translateY(-185px) scale(0.97);
  }

  .flag-frame {
    width: clamp(110px, 26vw, 160px);
    height: clamp(110px, 26vw, 160px);
    padding: 8px;
  }

  .flag-fallback {
    font-size: clamp(22px, 8vw, 40px);
  }

  .team-name { font-size: clamp(13px, 3.5vw, 18px); }

  .vs-text { font-size: clamp(22px, 8vw, 38px); }


  .stat-number { font-size: 22px; }

  .admin-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-input,
  .admin-select { width: 100%; }

  .admin-label { min-width: unset; }

  .admin-actions { flex-direction: column; }

  .btn-export,
  .btn-clear { min-width: unset; }
}
