/* =============================================
   G6 Summer Challenge — Shared Styles
   ============================================= */

:root {
  --primary:        #1e3a5f;
  --primary-light:  #2d5a8e;
  --gold:           #f0b429;
  --gold-dark:      #d97706;
  --men-color:      #2563eb;
  --men-light:      #dbeafe;
  --women-color:    #7c3aed;
  --women-light:    #ede9fe;
  --primary-color:  #d97706;
  --primary-light-color: #fef3c7;
  --bg:             #f8fafc;
  --bg-alt:         #eef2f7;
  --white:          #ffffff;
  --text:           #1e293b;
  --text-mid:       #475569;
  --text-light:     #94a3b8;
  --border:         #e2e8f0;
  --shadow-sm:      0 1px 4px rgba(0,0,0,0.08);
  --shadow:         0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:      0 10px 40px rgba(0,0,0,0.15);
  --radius:         12px;
  --radius-lg:      20px;
  --ease:           0.2s ease;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Open Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* === Utility === */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* === Navbar === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--primary);
  box-shadow: var(--shadow);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
}
.brand-icon { font-size: 1.4rem; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,0.82);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 7px 13px;
  border-radius: 8px;
  transition: var(--ease);
}
.nav-link:hover  { background: rgba(255,255,255,0.1); color: #fff; }
.nav-link.active { background: rgba(255,255,255,0.15); color: #fff; }
.btn-nav {
  background: var(--gold) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
}
.btn-nav:hover { background: var(--gold-dark) !important; color: #fff !important; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span { display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; }
.mobile-menu { display: none; flex-direction: column; background: var(--primary-light); padding: 8px 20px 14px; }
.mobile-menu.open { display: flex; }
.mobile-link {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.95rem;
}
.mobile-link:last-child { border-bottom: none; }

@media (max-width: 640px) {
  .nav-links  { display: none; }
  .hamburger  { display: flex; }
}

/* === Hero === */
.hero {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 55%, #1a3a6c 100%);
  color: #fff;
  text-align: center;
  padding: 80px 20px 110px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.035'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.hero-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto 34px;
}

/* Countdown */
.countdown { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 38px; }
.countdown-item {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 14px 20px;
  min-width: 82px;
}
.countdown-num {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.countdown-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; margin-top: 3px; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 1rem;
  transition: all var(--ease);
  cursor: pointer;
  border: none;
  font-family: 'Open Sans', sans-serif;
}
.btn-hero {
  background: var(--gold);
  color: var(--primary);
  font-size: 1.05rem;
  padding: 15px 38px;
  box-shadow: 0 4px 20px rgba(240,180,41,0.4);
}
.btn-hero:hover { background: var(--gold-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 28px rgba(240,180,41,0.5); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger  { background: #ef4444; color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text-mid); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 7px 16px; font-size: 0.85rem; }

/* === Sections === */
.section     { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  text-align: center;
  color: var(--primary);
  margin-bottom: 8px;
}
.section-subtitle { text-align: center; color: var(--text-mid); margin-bottom: 40px; }

/* === Standings === */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}
.standing-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: all var(--ease);
  position: relative;
  overflow: hidden;
}
.standing-card.first-place {
  border-color: var(--gold);
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}
.rank-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 1.6rem;
}
.group-emoji { font-size: 2.8rem; display: block; margin-bottom: 10px; }
.group-name  { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.2rem; margin-bottom: 6px; }
.group-points { font-family: 'Montserrat', sans-serif; font-size: 2.8rem; font-weight: 800; line-height: 1; }
.group-pts-label { color: var(--text-light); font-size: 0.82rem; margin-top: 4px; }

/* Progress bars */
.progress-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pb-label { width: 140px; font-size: 0.85rem; font-weight: 600; text-align: right; color: var(--text-mid); flex-shrink: 0; }
.pb-track  { flex: 1; height: 22px; background: var(--border); border-radius: 11px; overflow: hidden; }
.pb-fill   { height: 100%; border-radius: 11px; transition: width 0.9s ease; position: relative; min-width: 4px; }
.pb-fill::after {
  content: attr(data-pts);
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.pb-pts { width: 55px; font-size: 0.9rem; font-weight: 700; color: var(--text); }

/* === Activity Feed === */
.activity-feed { max-width: 700px; margin: 0 auto; }
.activity-empty { text-align: center; color: var(--text-light); padding: 48px 20px; }
.activity-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid transparent;
}
.activity-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.activity-body    { flex: 1; min-width: 0; }
.activity-name    { font-weight: 700; font-size: 0.95rem; }
.activity-group   { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.activity-acts    { color: var(--text-mid); font-size: 0.83rem; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta    { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.activity-date    { color: var(--text-light); font-size: 0.75rem; }
.activity-pts     { font-weight: 800; font-family: 'Montserrat', sans-serif; font-size: 0.92rem; color: var(--gold-dark); }

/* === Point Guide === */
.point-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}
.guide-category   { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.guide-cat-title  {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.guide-item       { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--bg-alt); }
.guide-item:last-child { border-bottom: none; }
.guide-icon       { font-size: 1.25rem; width: 28px; text-align: center; flex-shrink: 0; }
.guide-info       { flex: 1; }
.guide-label      { font-weight: 600; font-size: 0.88rem; }
.guide-desc       { color: var(--text-light); font-size: 0.76rem; }
.guide-pts        {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
}

/* === Page Header (non-hero pages) === */
.page-header      { background: var(--primary); color: #fff; padding: 52px 20px 70px; text-align: center; }
.page-header-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 8px;
}
.page-header-sub  { opacity: 0.8; font-size: 1rem; }

/* === Form Card === */
.form-wrap  { max-width: 740px; margin: -36px auto 64px; padding: 0 20px; }
.form-card  { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }

.form-section           { padding: 32px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-section-title     {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.form-group   { margin-bottom: 16px; }
.form-label   { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--text); }
.form-label span { color: #ef4444; }
.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: var(--ease);
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}

/* Group Radio Selector */
.group-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 460px) { .group-selector { grid-template-columns: 1fr; } }
.group-option { display: none; }
.group-opt-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--ease);
  text-align: center;
  gap: 6px;
  user-select: none;
}
.group-opt-label:hover { border-color: var(--primary); }
.group-opt-emoji { font-size: 2rem; }
.group-opt-name  { font-size: 0.85rem; font-weight: 600; }

/* Activity Count Rows */
.act-cat-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin: 20px 0 10px;
}
.act-cat-title:first-child { margin-top: 0; }

.act-count-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background var(--ease);
  border: 1px solid transparent;
}
.act-count-row:hover    { background: var(--bg); }
.act-count-row.has-count {
  background: #f0f7ff;
  border-color: #bfdbfe;
}
.act-count-icon { font-size: 1.2rem; width: 26px; text-align: center; flex-shrink: 0; }
.act-count-info { flex: 1; min-width: 0; }
.act-count-label { font-weight: 600; font-size: 0.88rem; }
.act-count-desc  { color: var(--text-light); font-size: 0.76rem; }

.act-count-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.act-count-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  flex-shrink: 0;
}
.act-count-btn:hover  { border-color: var(--primary); color: var(--primary); background: var(--bg); }
.act-count-minus:hover { border-color: #ef4444; color: #ef4444; }

.act-count-input {
  width: 52px;
  padding: 5px 4px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  background: #fff;
  transition: all var(--ease);
  -moz-appearance: textfield;
}
.act-count-input::-webkit-outer-spin-button,
.act-count-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.act-count-input:focus     { outline: none; border-color: var(--primary); }
.act-count-input.has-value { border-color: var(--men-color); color: var(--men-color); background: var(--men-light); }

.act-count-rate { font-size: 0.75rem; color: var(--text-light); white-space: nowrap; }
.act-count-sub  {
  min-width: 52px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-dark);
  text-align: right;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
}
.act-count-sub.zero { color: var(--text-light); font-weight: 400; }

@media (max-width: 500px) {
  .act-count-rate { display: none; }
  .act-count-row  { gap: 8px; }
}

/* Point Counter */
.point-counter {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.pc-label { font-size: 1rem; opacity: 0.9; }
.pc-total { font-family: 'Montserrat', sans-serif; font-size: 2.6rem; font-weight: 800; color: var(--gold); line-height: 1; }
.pc-pts   { font-size: 1rem; opacity: 0.8; }

/* Form Footer & Alerts */
.form-footer { padding: 24px 32px; background: var(--bg); }
.form-footer .btn { width: 100%; font-size: 1.05rem; padding: 14px; }

.alert        { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error  { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success{ background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert        { display: none; }

/* Success Screen */
.success-screen { display: none; text-align: center; padding: 64px 32px; }
.success-screen.show { display: block; }
.success-icon  { font-size: 4.5rem; margin-bottom: 16px; }
.success-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--primary);
  margin-bottom: 8px;
}
.success-sub   { color: var(--text-mid); margin-bottom: 20px; }
.success-pts-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--primary);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  padding: 8px 28px;
  border-radius: 24px;
  margin-bottom: 28px;
}
.success-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* === Admin === */
.admin-lock       { max-width: 420px; margin: 80px auto; text-align: center; padding: 0 20px; }
.admin-lock-icon  { font-size: 3rem; margin-bottom: 14px; }
.admin-lock-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--primary); margin-bottom: 8px; }
.admin-lock-sub   { color: var(--text-mid); margin-bottom: 24px; }
.admin-lock-form  { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }

.admin-content { padding: 40px 0; display: none; }
.admin-content.show { display: block; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.admin-stat  { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); text-align: center; }
.admin-stat-val   { font-family: 'Montserrat', sans-serif; font-size: 2rem; font-weight: 800; color: var(--primary); }
.admin-stat-label { color: var(--text-light); font-size: 0.82rem; margin-top: 2px; }

.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.admin-table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: auto; margin-bottom: 24px; }
.admin-table      { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.admin-table th   { background: var(--primary); color: #fff; font-weight: 700; text-align: left; padding: 12px 16px; white-space: nowrap; }
.admin-table td   { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }

.group-pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; }

/* === Footer === */
.footer { background: var(--primary); color: rgba(255,255,255,0.65); text-align: center; padding: 24px 20px; font-size: 0.83rem; }

/* === Notice Banner === */
.notice {
  background: #fefce8;
  border-bottom: 1px solid #fde68a;
  text-align: center;
  padding: 10px 20px;
  font-size: 0.82rem;
  color: #92400e;
}
.notice strong { font-weight: 700; }
