@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Barlow+Condensed:wght@400;600;700;800&display=swap');

:root {
  --orange: #F47920;
  --gray: #58595B;
  --bg: #111111;
  --surface: #1A1A1A;
  --surface2: #222222;
  --border: #2C2C2C;
  --text: #F0F0F0;
  --text-muted: #888888;
  --orange-light: rgba(244, 121, 32, 0.12);
  --orange-glow: rgba(244, 121, 32, 0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

/* ── Layout ── */
.container { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* ── Nav ── */
nav {
  background: var(--surface);
  border-bottom: 2px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  max-width: 900px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo-icon {
  width: 32px; height: 32px;
  background: var(--orange);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.nav-logo-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav-logo-text span { color: var(--orange); }

.nav-links { display: flex; gap: 4px; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--surface2); }
.nav-links a.active { color: var(--orange); }

/* ── Page header ── */
.page-header { padding: 32px 0 20px; }
.page-header h1 { font-size: clamp(28px, 5vw, 42px); color: var(--text); }
.page-header h1 span { color: var(--orange); }
.page-header p { color: var(--text-muted); margin-top: 4px; font-size: 14px; }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--orange); border-bottom-color: var(--orange); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

/* ── Podium ── */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 220px;
}

.podium-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
}

.podium-item.rank-1 .podium-avatar { width: 70px; height: 70px; font-size: 26px; border-color: #F4C430; background: rgba(244,196,48,0.1); color: #F4C430; box-shadow: 0 0 20px rgba(244,196,48,0.3); }
.podium-item.rank-2 .podium-avatar { border-color: #C0C0C0; background: rgba(192,192,192,0.08); color: #C0C0C0; }
.podium-item.rank-3 .podium-avatar { border-color: #CD7F32; background: rgba(205,127,50,0.08); color: #CD7F32; }

.podium-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 15px; text-align: center; }
.podium-leader { font-size: 12px; color: var(--text-muted); }
.podium-pts { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 22px; color: var(--orange); }
.podium-item.rank-1 .podium-pts { font-size: 28px; }

.podium-plinth {
  width: 100%;
  border-radius: 6px 6px 0 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--text-muted);
}

.podium-item.rank-1 .podium-plinth { height: 80px; background: rgba(244,196,48,0.08); border-color: rgba(244,196,48,0.2); color: #F4C430; }
.podium-item.rank-2 .podium-plinth { height: 60px; background: rgba(192,192,192,0.05); border-color: rgba(192,192,192,0.15); color: #C0C0C0; }
.podium-item.rank-3 .podium-plinth { height: 44px; background: rgba(205,127,50,0.05); border-color: rgba(205,127,50,0.15); color: #CD7F32; }

/* ── Leaderboard table ── */
.lb-table { width: 100%; border-collapse: collapse; }

.lb-table thead th {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.lb-table thead th:last-child, .lb-table td:last-child { text-align: right; }

.lb-row { border-bottom: 1px solid var(--border); transition: background 0.12s; }
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: var(--surface2); }
.lb-row td { padding: 14px 12px; vertical-align: middle; }

.lb-rank { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; color: var(--text-muted); width: 36px; }
.lb-rank.top-1 { color: #F4C430; }
.lb-rank.top-2 { color: #C0C0C0; }
.lb-rank.top-3 { color: #CD7F32; }

.lb-team-name { font-weight: 600; color: var(--text); font-size: 15px; }
.lb-leader { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.lb-pts { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; color: var(--orange); white-space: nowrap; }

.progress-wrap { width: 100%; background: var(--surface2); border-radius: 99px; height: 6px; overflow: hidden; min-width: 80px; }
.progress-bar { height: 100%; background: var(--orange); border-radius: 99px; transition: width 0.8s cubic-bezier(0.16,1,0.3,1); }

/* ── Today cards ── */
.today-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.today-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.today-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.today-team-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; }
.today-pts { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 22px; color: var(--orange); }

.bonus-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(244,121,32,0.15); border: 1px solid rgba(244,121,32,0.3);
  color: var(--orange); font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 99px; margin-top: 4px; letter-spacing: 0.04em;
}

.member-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.member-row:last-child { border-bottom: none; }
.member-name { color: var(--text-muted); }
.member-steps { font-weight: 600; color: var(--text); }
.member-steps.hit { color: #4ade80; }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; }
.stat-value { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 42px; color: var(--orange); line-height: 1; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 6px; }

/* ── Form ── */
.form-wrap { max-width: 560px; margin: 0 auto; }
.form-group { margin-bottom: 20px; }

.form-label {
  display: block; font-weight: 600; font-size: 13px;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 8px;
}

.form-select, .form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  padding: 10px 14px;
  transition: border-color 0.15s;
  appearance: none; -webkit-appearance: none;
  outline: none;
}

.form-select:focus, .form-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-light); }
.form-select option { background: var(--surface2); }

.members-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.members-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.members-table tr:last-child td { border-bottom: none; }
.members-table .td-name { color: var(--text); font-weight: 500; width: 40%; }
.members-table .td-input input { background: transparent; border: none; color: var(--text); font-family: 'Barlow', sans-serif; font-size: 15px; font-weight: 600; width: 100%; text-align: right; outline: none; }
.members-table .td-input input::placeholder { color: var(--text-muted); font-weight: 400; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 28px;
  text-align: center; cursor: pointer; transition: all 0.15s; position: relative;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--orange); background: var(--orange-light); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 28px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--text-muted); }
.upload-text strong { color: var(--orange); }

.previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preview-thumb { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 15px;
  padding: 12px 28px; border-radius: 8px; border: none; cursor: pointer;
  transition: all 0.15s; text-decoration: none;
}

.btn-primary { background: var(--orange); color: white; }
.btn-primary:hover { background: #e06810; transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: rgba(239,68,68,0.12); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ── Alert ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-success { background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.25); color: #4ade80; }
.alert-error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); color: #ef4444; }
.alert-info { background: var(--orange-light); border: 1px solid var(--orange-glow); color: var(--orange); }

/* ── Disabled ── */
.disabled-banner { text-align: center; padding: 48px 20px; }
.disabled-banner .icon { font-size: 48px; margin-bottom: 12px; }
.disabled-banner h2 { font-size: 28px; margin-bottom: 8px; }
.disabled-banner p { color: var(--text-muted); }

/* ── Gallery ── */
.gallery-date-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.date-input { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Barlow', sans-serif; font-size: 14px; padding: 8px 12px; outline: none; }
.date-input:focus { border-color: var(--orange); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.gallery-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.gallery-card-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.gallery-team-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 17px; }
.gallery-total { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 16px; color: var(--orange); }
.gallery-members { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.gallery-member-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.gallery-member-row .gm-name { color: var(--text-muted); }
.gallery-member-row .gm-steps { font-weight: 600; }
.gallery-member-row .gm-steps.hit { color: #4ade80; }
.gallery-screenshots { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; }
.gallery-thumb { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); cursor: pointer; transition: opacity 0.15s; }
.gallery-thumb:hover { opacity: 0.75; }

/* ── Lightbox ── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: white; font-size: 32px; cursor: pointer; opacity: 0.7; }
.lightbox-close:hover { opacity: 1; }

/* ── Admin ── */
.admin-section { margin-bottom: 32px; }
.admin-section-title { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.team-list-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.team-list-name { font-weight: 700; font-size: 15px; }
.team-list-members { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.team-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: none; align-items: center; justify-content: center; z-index: 150; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 100%; max-width: 480px; }
.modal-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 22px; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }

/* ── Lock screen ── */
.lock-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lock-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 360px; text-align: center; }
.lock-icon { font-size: 40px; margin-bottom: 12px; }
.lock-card h2 { font-size: 26px; margin-bottom: 6px; }
.lock-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

/* ── Spinner / empty ── */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { text-align: center; padding: 40px 0; }
.empty-state { text-align: center; padding: 48px 0; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 8px; }

/* ── Footer ── */
footer { border-top: 1px solid var(--border); padding: 20px 16px; text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 60px; }
footer span { color: var(--orange); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .nav-links a { font-size: 12px; padding: 5px 8px; }
  .podium { gap: 8px; }
  .lb-table thead th.hide-mobile, .lb-row td.hide-mobile { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .today-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
}
