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

:root {
  --aubergine: #3d2b3d;
  --aubergine-deep: #241a24;
  --gold: #9a7b3a;
  --gold-light: #c7a765;
  --cream: #f6f2ec;
  --ink: #241a24;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--ink);
}

.ps-heading { font-family: 'Space Grotesk', sans-serif; }

#app { max-width: 1100px; margin: 0 auto; }

/* Header */
.header {
  background: #ffffff;
  padding: 24px 20px 16px;
}
.header img { height: 40px; margin-bottom: 8px; object-fit: contain; }
.header h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.header p { margin: 4px 0 0; font-size: 0.9rem; opacity: 0.75; }

.divider { background: #ffffff; }
.divider svg { width: 100%; height: 24px; display: block; }

/* Layout containers */
.container-narrow { max-width: 520px; margin: 0 auto; padding: 24px 20px; }
.container-wide { max-width: 980px; margin: 0 auto; padding: 20px 16px; display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) {
  .container-wide { grid-template-columns: 1fr 280px; }
}

/* Buttons / tabs */
.tab-row { display: flex; gap: 8px; margin-bottom: 20px; }
.tab-btn {
  flex: 1; padding: 10px; border-radius: 10px; font-size: 0.9rem; font-weight: 600;
  border: 1px solid var(--aubergine); background: transparent; color: var(--aubergine); cursor: pointer;
}
.tab-btn.active { background: var(--aubergine); color: white; border-color: var(--aubergine); }

.btn-gold {
  width: 100%; padding: 14px; border: none; border-radius: 10px; font-weight: 700;
  background: var(--gold); color: white; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-outline {
  padding: 14px; border-radius: 10px; font-weight: 700; background: transparent;
  border: 1px solid var(--aubergine); color: var(--aubergine); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1;
}
.btn-row { display: flex; gap: 8px; }

/* Form fields */
label.field { display: block; margin-bottom: 16px; }
label.field .label-text { font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
textarea, input[type="text"], input[type="number"] {
  width: 100%; border: 1px solid #ddd; border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; font-family: inherit;
}
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.hint { font-size: 0.75rem; color: #888; }
.error-text { font-size: 0.85rem; color: #c0392b; margin-bottom: 12px; }

/* Play screen */
.code-banner {
  background: var(--aubergine); color: white; border-radius: 10px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; margin-bottom: 16px;
}
.code-banner strong { letter-spacing: 2px; }

.round-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.round-nav button { background: var(--cream); border: none; border-radius: 999px; width: 36px; height: 36px; cursor: pointer; font-size: 1rem; }
.round-nav button:disabled { opacity: 0.3; cursor: default; }
.round-nav span { font-weight: 700; font-family: 'Space Grotesk', sans-serif; }

.sitout-banner {
  background: #f1e9da; color: var(--aubergine-deep); border-radius: 10px; padding: 10px 14px;
  margin-bottom: 16px; font-size: 0.9rem; display: flex; align-items: center; gap: 8px;
}

.match-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 480px) {
  .match-grid { grid-template-columns: 1fr 1fr; }
}
.match-card { background: white; border: 1px solid #eee; border-radius: 12px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.match-card .court-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold); margin-bottom: 8px; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.team-name { font-size: 0.9rem; font-weight: 500; flex: 1; }
.vs { text-align: center; font-size: 0.75rem; color: #aaa; margin: 6px 0; }
.score-input { width: 56px; border-radius: 8px; border: 1px solid #ddd; padding: 6px; text-align: center; font-size: 0.9rem; }
.score-readonly { width: 56px; text-align: center; font-size: 0.9rem; font-weight: 700; }
.target-note { font-size: 0.7rem; color: #aaa; margin-top: 8px; }

/* Standings */
.standings-card { background: white; border: 1px solid #eee; border-radius: 12px; padding: 16px; height: fit-content; }
.standings-title { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.standing-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; }
.rank-badge { width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; margin-right: 8px; background: #eee; color: #888; }
.rank-badge.first { background: var(--gold); color: white; }
.reset-btn {
  margin-top: 16px; width: 100%; padding: 10px; border-radius: 10px; border: none; background: var(--cream);
  color: var(--aubergine); font-weight: 700; font-size: 0.8rem; cursor: pointer;
}
