/* ============================================================
   CAMP COMPETITION — GLOBAL STYLES
   Aesthetic: Bold camp energy — deep navy + vivid neon accents
   Font: Bebas Neue (display) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --bg:        #0b0f1a;
  --bg2:       #111827;
  --bg3:       #1e2a3a;
  --surface:   #162032;
  --border:    #1e3a5f;
  --accent:    #00d4ff;
  --accent2:   #ff6b35;
  --accent3:   #7fff6e;
  --gold:      #ffd700;
  --silver:    #c0c0c0;
  --bronze:    #cd7f32;
  --text:      #e8f4f8;
  --text-muted:#7ba3c0;
  --danger:    #ff4757;
  --success:   #2ed573;
  --warn:      #ffa502;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --glow:      0 0 20px rgba(0,212,255,0.3);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, .display {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }

/* ── Layout Utilities ────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.p-2 { padding: 1rem; }
.hidden { display: none !important; }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-sm { padding: 1rem; }
.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #0b0f1a; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #0b0f1a; }
.btn-warn    { background: var(--warn); color: #0b0f1a; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-xl {
  padding: 1.4rem 2.5rem;
  font-size: 1.6rem;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.06em;
  border-radius: var(--radius);
  min-width: 140px;
  min-height: 80px;
}
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

/* ── Form Elements ───────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.form-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.7rem 1rem;
  font-size: 1rem;
  transition: border-color 0.18s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237ba3c0' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  background: var(--bg3);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid rgba(30,58,95,0.4); transition: background 0.12s; }
tbody tr:hover { background: rgba(0,212,255,0.04); }
tbody td { padding: 0.75rem 1rem; }
tbody tr:last-child { border-bottom: none; }

/* ── Rank Badges ─────────────────────────────────────────── */
.rank-1 { color: var(--gold); font-weight: 700; }
.rank-2 { color: var(--silver); font-weight: 700; }
.rank-3 { color: var(--bronze); font-weight: 700; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--bg3);
}
.rank-badge.r1 { background: var(--gold); color: #0b0f1a; }
.rank-badge.r2 { background: var(--silver); color: #0b0f1a; }
.rank-badge.r3 { background: var(--bronze); color: #fff; }

/* ── Team Color Dot ──────────────────────────────────────── */
.team-dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* ── Status Tags ─────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-win     { background: rgba(46,213,115,0.15); color: var(--success); border: 1px solid rgba(46,213,115,0.3); }
.tag-loss    { background: rgba(255,71,87,0.15);  color: var(--danger);  border: 1px solid rgba(255,71,87,0.3); }
.tag-pending { background: rgba(123,163,192,0.1); color: var(--text-muted); border: 1px solid rgba(123,163,192,0.2); }

/* ── Nav/Header ──────────────────────────────────────────── */
.page-header {
  background: linear-gradient(180deg, rgba(11,15,26,0.98), rgba(11,15,26,0.9));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.page-header .inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-shadow: var(--glow);
}

/* ── Event Banner ────────────────────────────────────────── */
.event-banner {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.event-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ── Score Display ───────────────────────────────────────── */
.score-big {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 4rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-shadow: var(--glow);
  line-height: 1;
}
.score-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

/* ── Tab System ──────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Toast Notification ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Loading Spinner ─────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(0,212,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  z-index: 9998;
}

/* ── Live Indicator ──────────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: rgba(255,71,87,0.15);
  border: 1px solid rgba(255,71,87,0.4);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--danger);
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); animation: pulse 1.5s infinite; }

/* ── Points Breakdown ────────────────────────────────────── */
.points-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(30,58,95,0.3);
  font-size: 0.9rem;
}
.points-row:last-child { border-bottom: none; }
.points-val { font-weight: 700; color: var(--accent); }

/* ── Leaderboard Podium ──────────────────────────────────── */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.podium-bar {
  width: 80px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.podium-1 .podium-bar { height: 100px; background: linear-gradient(180deg, #ffd700, #f59e0b); }
.podium-2 .podium-bar { height: 70px; background: linear-gradient(180deg, #c0c0c0, #9ca3af); }
.podium-3 .podium-bar { height: 50px; background: linear-gradient(180deg, #cd7f32, #92400e); }
.podium-name { font-size: 0.8rem; font-weight: 700; text-align: center; }
.podium-pts  { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--text); }

/* ── Ultimate Score Buttons ──────────────────────────────── */
.uu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: var(--radius);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.06em;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 100px;
  position: relative;
  overflow: hidden;
}
.uu-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity 0.15s;
}
.uu-btn:hover::before { opacity: 1; }
.uu-btn:active { transform: scale(0.96); }
.uu-btn-frisbee { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.uu-btn-football { background: linear-gradient(135deg, #f97316, #c2410c); }
.uu-btn-squid    { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.uu-btn-label { font-size: 0.8rem; letter-spacing: 0.1em; opacity: 0.8; margin-top: 0.25rem; font-family: 'DM Sans', sans-serif; font-weight: 600; }
.uu-btn-val { font-size: 3rem; }

/* ── Morning Service Bonus ───────────────────────────────── */
.morning-bonus-btn {
  background: linear-gradient(135deg, #ffd700, #f59e0b);
  color: #0b0f1a;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.morning-bonus-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.morning-bonus-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  border-radius: 999px;
  width: 20px; height: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── QR Code Tile ────────────────────────────────────────── */
.qr-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}
.qr-tile canvas { border-radius: var(--radius-sm); background: #fff; padding: 8px; }

/* ── Section Title ───────────────────────────────────────── */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
  margin-left: 0.5rem;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 1rem; }
  .btn-xl { min-height: 70px; padding: 1rem 1.5rem; font-size: 1.3rem; }
  .score-big { font-size: 3rem; }
  table { font-size: 0.8rem; }
  thead th, tbody td { padding: 0.5rem 0.65rem; }
  .tabs { gap: 0; }
  .tab-btn { padding: 0.65rem 0.85rem; font-size: 0.8rem; }
}

/* ── PWA Standalone ──────────────────────────────────────── */
@media (display-mode: standalone) {
  .page-header { padding-top: env(safe-area-inset-top, 1rem); }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  body { background: white; color: black; }
  .no-print { display: none !important; }
  .card { background: white; border: 1px solid #ccc; }
  thead th { background: #f0f0f0; color: black; }
}
