:root {
  --green:        #1a4d2e;
  --green-light:  #7ec8a0;
  --cream:        #f5f0e8;
  --cream-dark:   #e8e0d0;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;

  /* Team colors — overridden by JS. Default to brand green. */
  --team-primary: #1a4d2e;
  --team-accent:  #7ec8a0;
  --team-text:    #f5f0e8;
  --team-tint:    rgba(26,77,46,0.05);   /* set by JS to primary @ low alpha */
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}

a { color: inherit; }

/* ── Accent strip + top bar ───────────────────────────────────────────────── */

.accent-strip {
  height: 4px;
  background: var(--team-primary);
  transition: background 0.4s ease;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-full { height: 72px; width: auto; display: block; }
.brand span { color: var(--team-primary); transition: color 0.4s ease; }

.topnav { display: flex; gap: 1.5rem; }
.topnav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.topnav a:hover { color: var(--team-primary); }

/* ── Hero (split: copy + inline tool) ─────────────────────────────────────── */

.hero {
  background: linear-gradient(180deg, var(--team-tint) 0%, #ffffff 70%);
  transition: background 0.4s ease;
  padding: 2.5rem 1.5rem 4rem;
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  /* Top-anchor both columns: the right card grows when a team's fixtures load,
     and centering would push the left copy down to match it. */
  align-items: start;
}

.hero-copy { max-width: 480px; }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--team-primary);
  background: var(--team-tint);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 1.25rem;
  transition: color 0.3s, background 0.3s;
}

.hero-copy h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}

#accent-word {
  color: var(--team-primary);
  /* Accent used as a subtle highlight under the word, not as low-contrast text */
  box-shadow: inset 0 -0.32em 0 var(--team-accent);
  transition: color 0.3s, box-shadow 0.3s;
  border-radius: 2px;
  padding: 0 2px;
}

.hero-copy > p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.hero-points { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.hero-points li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}
.hero-points li span { font-size: 1.1rem; }

/* ── Selector card ────────────────────────────────────────────────────────── */

.hero-tool { width: 100%; }

.card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(16,24,40,0.06), 0 2px 6px rgba(16,24,40,0.04);
  padding: 1.75rem;
}

.card h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--team-primary); transition: color 0.3s; }
.card-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Team / Tournament mode toggle ────────────────────────────────────────── */
.mode-toggle { display: flex; gap: 4px; padding: 4px; background: #f1f3f5; border-radius: 12px; margin-bottom: 1.25rem; }
.mode-btn {
  flex: 1; padding: 8px 16px; border: none; background: transparent; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  font-family: inherit; transition: background 0.2s, color 0.2s;
}
.mode-btn:hover:not(.active):not(:disabled) { color: var(--team-primary); }
.mode-btn.active { background: var(--team-primary); color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.mode-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.event-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 1.25rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group:last-of-type { margin-bottom: 0; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: #fff;
  color: var(--text);
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  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 d='M2 4l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
select:focus { outline: none; border-color: var(--team-primary); box-shadow: 0 0 0 3px var(--team-tint); }

.format-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.fmt-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.18s;
  font-family: inherit;
}
.fmt-btn:hover { border-color: var(--team-primary); color: var(--team-primary); }
.fmt-btn.active {
  background: var(--team-primary);
  border-color: var(--team-primary);
  color: var(--team-text);
}

.url-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--team-tint);
  border-radius: 9px;
  padding: 11px 14px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  color: var(--team-primary);
  margin: 1.25rem 0;
  transition: background 0.3s, color 0.3s;
}
#url-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#copy-btn {
  font-size: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  flex-shrink: 0;
  margin-left: 8px;
}
#copy-btn:hover { color: var(--text); }

.btn-subscribe {
  width: 100%;
  padding: 14px;
  border-radius: 9px;
  border: none;
  background: var(--team-primary);
  color: var(--team-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, opacity 0.2s, transform 0.05s;
  font-family: inherit;
}
.btn-subscribe:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-subscribe:not(:disabled):hover { opacity: 0.92; }
.btn-subscribe:not(:disabled):active { transform: translateY(1px); }

/* ── Match preview ──────────────────────────────────────────────────────────── */

.match-preview {
  margin-top: 1rem;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(16,24,40,0.05);
  overflow: hidden;
}

.preview-header {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--team-text);
  background: var(--team-primary);
  transition: background 0.3s;
}

.match-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.match-item:last-child { border-bottom: none; }

.match-date { font-size: 12px; color: var(--text-muted); min-width: 52px; }

.match-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.badge-test { background: #1a1a1a; color: #f5f0e8; }
.badge-odi  { background: #f5f5f5; color: #1a1a1a; border: 1px solid #e5e7eb; }
.badge-t20i { background: var(--team-primary); color: var(--team-accent); transition: background 0.3s; }

.match-title { font-size: 14px; color: var(--text); font-weight: 500; }
.match-venue { font-size: 12px; color: var(--text-muted); }

.skeleton {
  background: #f0f0f0;
  border-radius: 4px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Features ───────────────────────────────────────────────────────────────── */

#features {
  background: var(--cream);
  padding: 4.5rem 1.5rem;
  text-align: center;
}

#features h2, #how-it-works h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--green);
  margin-bottom: 0.5rem;
}

.section-sub { color: var(--text-muted); margin-bottom: 2.5rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.feature-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,0.07); }
.feature-icon { font-size: 1.6rem; display: block; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 15px; font-weight: 600; color: var(--green); margin-bottom: 0.5rem; }
.feature-card p  { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* ── How it works ───────────────────────────────────────────────────────────── */

#how-it-works {
  background: #fff;
  padding: 4.5rem 1.5rem;
  text-align: center;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 580px;
  margin: 0 auto;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--cream);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: left;
}

.step-n {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.step strong { display: block; font-weight: 600; color: var(--green); margin-bottom: 2px; }
.step p      { font-size: 14px; color: var(--text-muted); }

/* ── Footer ─────────────────────────────────────────────────────────────────── */

footer {
  background: var(--green);
  padding: 2rem;
  text-align: center;
  color: rgba(245,240,232,0.55);
  font-size: 14px;
}
.footer-brand { color: var(--green-light); font-weight: 600; }
.footer-meta { margin-top: 0.6rem; font-size: 13px; color: rgba(245,240,232,0.45); }
.footer-meta a { color: rgba(245,240,232,0.7); text-decoration: none; }
.footer-meta a:hover { text-decoration: underline; }
.footer-sep { margin: 0 6px; opacity: 0.5; }
.support-link { color: var(--green-light) !important; font-weight: 600; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  background: var(--team-primary);
  border-radius: 16px 16px 0 0;
  transition: background 0.3s;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 600; color: var(--team-text); }
.modal-header p  { font-size: 13px; color: var(--team-text); opacity: 0.7; margin-top: 2px; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--team-text);
  opacity: 0.7;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.modal-url {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-url-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.modal-url code {
  display: block;
  background: #f5f5f5;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #333;
  word-break: break-all;
  user-select: all;
}

.modal-body { padding: 1rem 1.5rem; }

.app-instructions { margin-bottom: 1.5rem; }
.app-instructions h3 { font-size: 14px; font-weight: 600; margin-bottom: 0.75rem; }
.app-instructions ol { padding-left: 1.25rem; font-size: 14px; color: var(--text-muted); }
.app-instructions ol li { margin-bottom: 4px; }
.app-instructions a   { color: var(--text-muted); }

.app-btn {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  background: var(--team-tint);
  color: var(--team-primary);
  transition: opacity 0.2s;
}
.app-btn:hover { opacity: 0.8; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.modal-support { margin-top: 0.6rem; }
.modal-support a { color: var(--team-primary, var(--green)); font-weight: 600; text-decoration: none; }
.modal-support a:hover { text-decoration: underline; }

/* ── Utilities ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-copy { max-width: none; }
  .hero { padding-top: 1.5rem; }
}
@media (max-width: 480px) {
  .topnav { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
