/* ============================================================
   RCCC – Roma Capannelle Cricket Club
   Design: Navy + Gold inspired by Lord's MCC
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --navy:   #1a1f3a;
  --navy2:  #252b50;
  --gold:   #d4a017;
  --gold2:  #f0c040;
  --red:    #cc2200;
  --white:  #ffffff;
  --grey:   #6b7280;
  --light:  #f4f5f8;
  --border: #e2e4ed;
  --success:#16a34a;
  --warn:   #ca8a04;
  --r:      6px;
  --shadow: 0 2px 12px rgba(26,31,58,.12);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: #1a1f3a;
  line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold2); }

img { max-width: 100%; display: block; }

/* ── Typography ── */
h1,h2,h3,h4,h5 { font-family: 'Playfair Display', serif; line-height: 1.2; }
h1 { font-size: clamp(2rem,5vw,3.5rem); }
h2 { font-size: clamp(1.5rem,3vw,2.25rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

/* ── Layout ── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.section    { padding: 4rem 0; }
.section-sm { padding: 2rem 0; }

/* ── Header / Nav ── */
#site-header {
  background: var(--navy);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1rem; max-width: 1180px; margin: 0 auto;
}

.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; font-weight: 900;
  color: var(--white); letter-spacing: .5px;
  flex-shrink: 0;
}
.site-logo span { color: var(--gold); }

.nav-toggle {
  display: none; background: none; border: none;
  color: var(--white); font-size: 1.5rem; cursor: pointer; margin-left: auto;
}

#main-nav {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin-left: auto; flex-wrap: wrap;
}

#main-nav a {
  color: rgba(255,255,255,.85);
  padding: .4rem .7rem; border-radius: var(--r);
  font-size: .88rem; font-weight: 500; letter-spacing: .2px;
  transition: color .2s, background .2s;
}
#main-nav a:hover, #main-nav a.active {
  color: var(--gold); background: rgba(212,160,23,.1);
}

.btn-login {
  background: var(--gold); color: var(--navy) !important;
  font-weight: 700 !important; padding: .4rem .9rem !important;
  border-radius: var(--r); transition: background .2s !important;
}
.btn-login:hover { background: var(--gold2) !important; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 60%, #0d1020 100%);
  color: var(--white);
  padding: 5rem 1rem 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url('/assets/images/hero-bg.jpg') center/cover no-repeat;
  opacity: .15;
}
.hero-content { position: relative; z-index: 1; max-width: 700px; }
.hero-eyebrow {
  color: var(--gold); font-size: .8rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: .75rem;
}
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero p   { color: rgba(255,255,255,.8); font-size: 1.1rem; max-width: 540px; margin-bottom: 2rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .65rem 1.4rem; border-radius: var(--r);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  border: 2px solid transparent; transition: all .2s;
}
.btn-primary   { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold2); color: var(--navy); }
.btn-outline   { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: var(--navy); }
.btn-navy      { background: var(--navy); color: var(--white); }
.btn-navy:hover{ background: var(--navy2); }
.btn-sm        { padding: .35rem .8rem; font-size: .8rem; }
.btn-danger    { background: var(--red); color: var(--white); border-color: var(--red); }

/* ── Cards ── */
.card {
  background: var(--white); border-radius: var(--r);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body   { padding: 1.25rem; }
.card-title  { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }

/* ── Grid helpers ── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1rem; }

/* ── Section headers ── */
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header h2 { margin-bottom: .5rem; }
.section-header p  { color: var(--grey); max-width: 560px; margin: 0 auto; }
.gold-line {
  width: 50px; height: 3px; background: var(--gold);
  margin: .75rem auto 0;
}

/* ── Stats strip ── */
.stats-strip {
  background: var(--navy); color: var(--white);
  padding: 2.5rem 1rem;
}
.stats-strip .grid-4 { text-align: center; }
.stat-num  { font-size: 2.5rem; font-weight: 900; color: var(--gold); font-family: 'Playfair Display', serif; }
.stat-lbl  { font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.65); margin-top: .25rem; }

/* ── Match card ── */
.match-card { padding: 1rem 1.25rem; }
.match-date { font-size: .75rem; color: var(--grey); text-transform: uppercase; letter-spacing: 1px; }
.match-teams { font-size: 1rem; font-weight: 700; margin: .3rem 0; }
.match-score { font-size: .9rem; color: var(--grey); }
.match-venue { font-size: .78rem; color: var(--grey); }

/* ── Badges ── */
.badge {
  display: inline-block; padding: .2rem .55rem;
  border-radius: 999px; font-size: .72rem; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
}
.badge-win    { background: #dcfce7; color: #15803d; }
.badge-loss   { background: #fee2e2; color: var(--red); }
.badge-draw   { background: #fef9c3; color: #854d0e; }
.badge-nr     { background: var(--light); color: var(--grey); }
.badge-gold   { background: var(--gold); color: var(--navy); }
.badge-navy   { background: var(--navy); color: var(--white); }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th {
  background: var(--navy); color: var(--white);
  padding: .6rem .8rem; text-align: left; font-size: .78rem;
  letter-spacing: .5px; white-space: nowrap;
}
.data-table td {
  padding: .6rem .8rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8f9ff; }
.data-table th:first-child { border-radius: var(--r) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--r) 0 0; }
.table-wrap { overflow-x: auto; border-radius: var(--r); box-shadow: var(--shadow); }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--navy); }
.form-control {
  width: 100%; padding: .6rem .9rem;
  border: 1px solid var(--border); border-radius: var(--r);
  font-size: .9rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,.15);
}
select.form-control { cursor: pointer; }

/* ── Player card ── */
.player-card {
  text-align: center; padding: 1.5rem 1rem;
  transition: transform .2s, box-shadow .2s;
}
.player-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(26,31,58,.15); }
.player-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--navy); margin: 0 auto .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--gold); font-family: 'Playfair Display', serif;
  overflow: hidden;
}
.player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.player-name  { font-weight: 700; font-size: .95rem; margin-bottom: .2rem; }
.player-squad { font-size: .75rem; color: var(--grey); text-transform: uppercase; letter-spacing: .5px; }
.player-stats { display: flex; gap: .5rem; justify-content: center; margin-top: .75rem; flex-wrap: wrap; }
.mini-stat    { text-align: center; }
.mini-stat .n { font-size: 1rem; font-weight: 700; color: var(--navy); }
.mini-stat .l { font-size: .65rem; color: var(--grey); text-transform: uppercase; }

/* ── Countdown ── */
.countdown-wrap {
  background: var(--navy2); border-radius: var(--r);
  padding: 1.5rem; color: var(--white); text-align: center;
}
.countdown-wrap h3 { color: var(--gold); margin-bottom: .5rem; font-size: 1rem; }
.countdown-boxes { display: flex; gap: .75rem; justify-content: center; margin-top: .75rem; }
.cd-box { background: rgba(255,255,255,.08); border-radius: var(--r); padding: .6rem .9rem; min-width: 60px; }
.cd-num { font-size: 1.8rem; font-weight: 900; font-family: 'Playfair Display', serif; color: var(--gold); line-height: 1; }
.cd-lbl { font-size: .6rem; text-transform: uppercase; letter-spacing: 1px; opacity: .6; }

/* ── Live score ── */
.live-badge { background: var(--red); color: white; border-radius: 999px;
  padding: .15rem .5rem; font-size: .7rem; font-weight: 700;
  animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.live-score-panel {
  background: var(--navy); color: var(--white);
  border-radius: var(--r); padding: 1.25rem;
}
.live-total { font-size: 2.5rem; font-weight: 900; font-family: 'Playfair Display', serif; color: var(--gold); }
.live-overs { font-size: .9rem; opacity: .7; }
.live-batting { margin-top: .75rem; border-top: 1px solid rgba(255,255,255,.1); padding-top: .75rem; }
.live-row  { display: flex; justify-content: space-between; align-items: center;
  padding: .2rem 0; font-size: .88rem; }
.live-row .name { font-weight: 600; }
.live-row .score { opacity: .8; }
.ball-row  { display: flex; gap: .3rem; margin-top: .6rem; }
.ball { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: .75rem; font-weight: 700; }
.ball-0  { background: rgba(255,255,255,.1); }
.ball-4  { background: #2563eb; color: white; }
.ball-6  { background: var(--gold); color: var(--navy); }
.ball-W  { background: var(--red); color: white; }
.ball-wd,.ball-nb { background: #ca8a04; color: white; }

/* ── Footer ── */
#site-footer {
  background: #0d1020; color: rgba(255,255,255,.7);
  padding: 3rem 1rem 1.5rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: var(--white); margin-bottom: .75rem; font-size: .9rem; letter-spacing: .5px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul a { color: rgba(255,255,255,.65); font-size: .85rem; }
.footer-col ul a:hover { color: var(--gold); }
.footer-logo { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 900; color: var(--white); margin-bottom: .5rem; }
.footer-logo span { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
  font-size: .78rem; }

/* ── Members area ── */
.members-layout { display: flex; min-height: calc(100vh - 64px); }
.members-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--navy); padding: 1.5rem .75rem;
}
.members-sidebar .nav-section { margin-bottom: 1.5rem; }
.members-sidebar .nav-section-title {
  color: rgba(255,255,255,.4); font-size: .68rem;
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 0 .5rem; margin-bottom: .4rem;
}
.members-sidebar a {
  display: flex; align-items: center; gap: .5rem;
  color: rgba(255,255,255,.75); padding: .45rem .6rem;
  border-radius: var(--r); font-size: .85rem; font-weight: 500;
  transition: all .15s;
}
.members-sidebar a:hover, .members-sidebar a.active {
  background: rgba(212,160,23,.15); color: var(--gold);
}
.members-main { flex: 1; padding: 2rem 1.5rem; overflow-x: hidden; }
.page-title { margin-bottom: 1.5rem; }
.page-title h1 { font-size: 1.75rem; }
.page-title p  { color: var(--grey); margin-top: .25rem; }

/* ── Availability buttons ── */
.avail-btn { padding: .35rem .75rem; border-radius: var(--r); font-size: .8rem;
  font-weight: 600; border: 2px solid transparent; cursor: pointer; transition: all .2s; }
.avail-available   { background: #dcfce7; color: #15803d; border-color: #86efac; }
.avail-unavailable { background: #fee2e2; color: var(--red); border-color: #fca5a5; }
.avail-maybe       { background: #fef9c3; color: #854d0e; border-color: #fde047; }

/* ── Live scoring mobile UI ── */
.score-app { max-width: 420px; margin: 0 auto; }
.scoreboard-top {
  background: var(--navy); color: white;
  padding: 1rem; border-radius: var(--r); margin-bottom: 1rem; text-align: center;
}
.ball-buttons { display: grid; grid-template-columns: repeat(4,1fr); gap: .5rem; margin: 1rem 0; }
.ball-btn {
  padding: 1rem .5rem; border: 2px solid var(--border); border-radius: var(--r);
  font-size: 1.1rem; font-weight: 700; cursor: pointer; background: var(--white);
  transition: all .15s; text-align: center;
}
.ball-btn:hover { border-color: var(--gold); background: #fffbeb; }
.ball-btn.selected { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.ball-btn.wicket  { border-color: var(--red); }
.ball-btn.wicket:hover { background: #fee2e2; }
.ball-btn.extra   { border-color: #ca8a04; }

/* ── Overlay (OBS) ── */
.obs-overlay {
  position: fixed; bottom: 20px; left: 20px;
  background: rgba(10,15,40,.85); backdrop-filter: blur(4px);
  border: 1px solid rgba(212,160,23,.4); border-radius: 8px;
  padding: .6rem 1rem; color: white; min-width: 220px;
}
.obs-score { font-size: 1.6rem; font-weight: 900; color: var(--gold); font-family: 'Playfair Display', serif; }
.obs-batting { font-size: .78rem; opacity: .85; margin-top: .2rem; }
.obs-logo { font-size: .65rem; opacity: .4; margin-top: .4rem; letter-spacing: 1px; }

/* ── Scoreboard fullscreen ── */
.scoreboard-full {
  background: #05080f; color: white; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
}
.sb-score { font-size: 6rem; font-weight: 900; color: var(--gold); line-height: 1; }
.sb-overs { font-size: 1.5rem; opacity: .6; margin-top: .5rem; }
.sb-batting { font-size: 1.2rem; margin-top: 1rem; display: flex; gap: 2rem; }
.sb-batting .bat-name { font-size: 1rem; }
.sb-bowling { font-size: 1rem; margin-top: .75rem; color: rgba(255,255,255,.65); }
.sb-logo { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  font-size: 1.1rem; letter-spacing: 2px; opacity: .3; }

/* ── Alerts ── */
.alert { padding: .9rem 1.1rem; border-radius: var(--r); margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: var(--red); border: 1px solid #fca5a5; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.alert-warn    { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  #main-nav { display: none; flex-direction: column; width: 100%;
    background: var(--navy2); padding: .5rem 0; border-top: 1px solid rgba(255,255,255,.1); }
  #main-nav.open { display: flex; }
  #main-nav li { width: 100%; }
  #main-nav a  { display: block; padding: .6rem 1rem; }
  .header-inner { flex-wrap: wrap; }

  .members-layout { flex-direction: column; }
  .members-sidebar { width: 100%; padding: 1rem; }
  .members-sidebar .nav-section { display: flex; flex-wrap: wrap; gap: .3rem; }
  .members-sidebar .nav-section-title { width: 100%; }
  .members-main { padding: 1rem; }

  .stats-strip .grid-4 { grid-template-columns: repeat(2,1fr); }
  .hero { padding: 3rem 1rem 2.5rem; }
  .sb-score { font-size: 4rem; }
}
