/* ===== BRIGHT & CHIRPY THEME ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fef9f3;
  --bg-card: #ffffff;
  --bg-soft: #fff5eb;
  --border: #f0e4d4;
  --text: #2d2a26;
  --text-muted: #6b6560;
  --primary: #ff6b4a;          /* coral */
  --primary-soft: #ffe8e2;
  --accent: #00b894;           /* teal */
  --accent-soft: #e0f8f2;
  --purple: #7c5cff;
  --purple-soft: #f0ebff;
  --gold: #f4a261;
  --silver: #a8b2c1;
  --bronze: #c98a5a;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 30px rgba(45, 42, 38, 0.08);
  --shadow-hover: 0 12px 40px rgba(45, 42, 38, 0.12);
  --font: 'Nunito', system-ui, sans-serif;
  --font-display: 'Outfit', 'Nunito', sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(254, 249, 243, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-mark {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), #ff8f6b);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: white;
  box-shadow: 0 4px 14px rgba(255, 107, 74, 0.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-main { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--text); }
.brand-sub { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.event-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.btn-outline {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1.5px solid var(--border);
  padding: 7px 16px;
  border-radius: 999px;
  transition: all 0.2s;
  background: white;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* ===== HERO IMAGE ===== */
.hero-image-section {
  padding: 24px 0 8px;
}
.hero-image-wrap {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: #111;
}
.hero-image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 420px;
  object-fit: cover;
  object-position: center top;
}
.hero-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.72));
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ===== CONTEXT SECTION ===== */
.context-section {
  padding: 28px 0 20px;
}
.context-card {
  background: white;
  border-radius: 28px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.context-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--purple));
}
.context-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.context-card h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}
.context-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 28px;
}
.context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.context-block {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
}
.context-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
}
.context-block h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.context-block p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.context-footer {
  text-align: center;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  margin-top: 8px;
}
.context-footer p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== TEAMS ===== */
.teams-section { padding: 36px 0 50px; }
.section-header {
  text-align: center;
  margin-bottom: 32px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.section-header p { color: var(--text-muted); font-size: 1.05rem; }

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.team-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.team-card.empty {
  opacity: 0.7;
  border-style: dashed;
}

.team-video {
  position: relative;
  background: #1a1a1a;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.team-video iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.team-video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #aaa;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  font-size: 0.9rem;
}
.team-video-placeholder span {
  font-size: 2rem;
}

.team-header {
  padding: 18px 20px 10px;
}
.team-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 11px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.team-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.team-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.team-body {
  padding: 0 20px 14px;
  flex: 1;
}
.team-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.55;
}
.team-members {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.team-members strong { color: var(--text); }

.team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 20px;
}
.btn-sm {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-sm:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.btn-sm.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.btn-sm.primary:hover {
  background: #ff5a36;
  border-color: #ff5a36;
  color: white;
}

/* ===== VOTING ===== */
.voting-section {
  padding: 10px 0 50px;
}
.vote-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.vote-header {
  text-align: center;
  margin-bottom: 26px;
}
.vote-header h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.vote-header p { color: var(--text-muted); font-size: 0.95rem; }

.rank-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.rank-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}
.rank-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: white;
}
.rank-num.gold { background: linear-gradient(135deg, #f4a261, #e76f51); }
.rank-num.silver { background: linear-gradient(135deg, #b0b8c4, #8a93a3); }
.rank-num.bronze { background: linear-gradient(135deg, #d4a574, #b07856); }

select {
  appearance: none;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b6560' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.2);
}

textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.2);
}
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.btn-primary {
  width: 100%;
  margin-top: 10px;
  padding: 15px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, var(--primary), #ff8f6b);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 20px rgba(255, 107, 74, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(255, 107, 74, 0.4);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.error-msg {
  background: #fff0f0;
  border: 1px solid #ffc9c9;
  color: #d63031;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.success-box {
  text-align: center;
  padding: 28px 16px;
  background: var(--accent-soft);
  border: 1px solid #b2f0df;
  border-radius: 16px;
  margin-top: 8px;
}
.success-box h3 {
  color: #00a884;
  margin-bottom: 6px;
  font-size: 1.2rem;
  font-weight: 800;
}

/* ===== RESULTS ===== */
.results-section {
  padding: 10px 0 70px;
}
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto 18px;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.lb-rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  width: 38px;
  text-align: center;
  color: var(--text-muted);
}
.lb-rank.top1 { color: #e76f51; }
.lb-rank.top2 { color: #8a93a3; }
.lb-rank.top3 { color: #c98a5a; }
.lb-info { flex: 1; }
.lb-name { font-weight: 700; margin-bottom: 2px; }
.lb-project { font-size: 0.82rem; color: var(--text-muted); }
.lb-points {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
}
.vote-count {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: white;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.footer-links {
  display: flex;
  gap: 22px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}
.footer-links a:hover { color: var(--primary); }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 42, 38, 0.55);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  width: min(900px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: none;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  font-weight: 600;
}
.modal-close:hover { background: var(--primary-soft); color: var(--primary); }
#modal-title {
  padding: 18px 52px 12px 22px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
#modal-body {
  flex: 1;
  overflow: auto;
  min-height: 400px;
}
#modal-body iframe {
  width: 100%;
  height: 70vh;
  border: none;
  background: #f5f5f5;
}
#modal-body img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header-right .event-badge { display: none; }
  .context-card { padding: 28px 20px 22px; }
  .vote-card { padding: 26px 18px; }
  .team-actions { flex-direction: column; }
  .btn-sm { justify-content: center; }
}
