/* ============================================================
   THE FAIR PLAY — SHARED STYLES
   ============================================================ */

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

:root {
  --gold: #C9A84C;
  --gold-light: #E8C96A;
  --gold-dark: #A07830;
  --green-dark: #1A2E1A;
  --green-mid: #2C4A2C;
  --green-light: #3D6B3D;
  --cream: #F5F0E8;
  --cream-dark: #E8E0D0;
  --white: #FFFFFF;
  --text-dark: #1A1A1A;
  --text-mid: #4A4A4A;
  --text-light: #888888;
  --red: #C0392B;
  --green-correct: #27AE60;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.18);
  --shadow-gold: 0 4px 24px rgba(201,168,76,0.25);
}

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

html { font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--green-dark);
  color: var(--cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ── */
.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-padded {
  padding: 0 20px;
}

/* ── HEADER ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}

.app-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.app-logo span {
  color: var(--cream);
  font-weight: 700;
}

.back-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--cream);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.14); }

/* ── CARDS ── */
.card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 24px;
}

.card-gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border: none;
  color: var(--green-dark);
}

.card-dark {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 24px;
}

/* ── BUTTONS ── */
.btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius);
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--green-dark);
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 30px rgba(201,168,76,0.4); }
.btn-gold:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.25);
  color: var(--cream);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-ghost {
  background: rgba(255,255,255,0.07);
  color: var(--cream);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

.btn-sm {
  padding: 10px 18px;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ── INPUTS ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.input-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.input-field {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--cream);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.input-field:focus { border-color: var(--gold); }
.input-field::placeholder { color: rgba(255,255,255,0.3); }

select.input-field {
  cursor: pointer;
  appearance: none;
  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 d='M1 1l5 5 5-5' stroke='%23C9A84C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
select.input-field option { background: var(--green-dark); color: var(--cream); }

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: 'Playfair Display', serif; }

.headline {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--cream);
}

.subheadline {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}

.gold-text { color: var(--gold); }
.cream-text { color: var(--cream); }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 20px 0;
}

/* ── BADGE ── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.badge-gold { background: rgba(201,168,76,0.2); color: var(--gold); border: 1px solid rgba(201,168,76,0.3); }
.badge-green { background: rgba(39,174,96,0.2); color: #5DD68A; border: 1px solid rgba(39,174,96,0.3); }
.badge-red { background: rgba(192,57,43,0.2); color: #E87E74; border: 1px solid rgba(192,57,43,0.3); }
.badge-grey { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── ROUND STATUS PILL ── */
.round-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
}
.round-pill.open { background: rgba(39,174,96,0.12); border: 1px solid rgba(39,174,96,0.25); }
.round-pill.closed { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.4); }
.round-pill.played { background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.2); }
.round-pill.upcoming { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.35); }

.round-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-open { background: #5DD68A; }
.dot-played { background: var(--gold); }
.dot-closed, .dot-upcoming { background: rgba(255,255,255,0.2); }

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--green-mid);
  border: 1px solid rgba(201,168,76,0.4);
  color: var(--cream);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 0.3s ease;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── LOADING SPINNER ── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(201,168,76,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── UTILITY ── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-600 { font-weight: 600; }
.opacity-60 { opacity: 0.6; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.3); border-radius: 2px; }

/* ── ANIMATIONS ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.35s ease forwards; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 0.4s ease forwards; }

/* ── SPLASH BG ── */
.splash-bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -1;
}
.splash-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,40,20,0.55) 0%, rgba(20,40,20,0.92) 60%);
  z-index: -1;
}
