* {
  box-sizing: border-box;
}

:root {
  --bg-1: #f4f7fb;
  --bg-2: #d8e4ef;
  --text: #1f2933;
  --muted: #5b6b7a;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(18, 59, 93, 0.12);
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--club-font), sans-serif;
  background: radial-gradient(circle at 10% 10%, #ffffff, var(--bg-2) 65%, var(--bg-1));
}

a {
  color: inherit;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.page {
  padding: 1.2rem 0 2rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, white 70%, var(--c-primary));
  border-bottom: 1px solid color-mix(in srgb, var(--c-primary) 18%, #fff);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--c-primary);
  font-weight: 700;
}

.club-name {
  font-weight: 700;
}

.hero {
  background: linear-gradient(120deg, color-mix(in srgb, var(--c-primary) 86%, #000), var(--c-secondary));
  color: white;
  border-radius: calc(var(--radius) + 4px);
  padding: 1.3rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
}

.hero p {
  margin: 0;
  max-width: 70ch;
  opacity: 0.95;
}

.hero-club {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.embed-box,
.badge-box {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 0.7rem;
  max-width: 360px;
}

.embed-box code {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clubs-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--c-primary) 18%, #fff);
  padding: 1rem;
}

.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 0.7rem;
}

.stat-card {
  border-top: 3px solid var(--c-accent);
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  margin-top: 0.4rem;
  font-size: 1.9rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.7rem;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

label {
  display: grid;
  gap: 0.3rem;
  color: #274255;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cad6e2;
  border-radius: 10px;
  min-height: 42px;
  padding: 0.56rem 0.65rem;
  font: inherit;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

button {
  font: inherit;
}

.btn {
  border: 0;
  border-radius: 10px;
  background: var(--c-primary);
  color: white;
  cursor: pointer;
  padding: 0.6rem 0.95rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--c-secondary);
}

.btn-ghost {
  background: white;
  color: var(--c-primary);
  border: 1px solid var(--c-primary);
}

.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}

.flash {
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.flash-success {
  background: #d5f4e3;
  color: #0b5433;
}

.flash-error {
  background: #ffe0df;
  color: #7f1d1d;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #ebf0f6;
  padding: 0.5rem;
  vertical-align: top;
}

.tag {
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c-primary) 25%, #fff);
  color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 8%, #fff);
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
}

.list {
  display: grid;
  gap: 0.6rem;
}

.list.compact {
  gap: 0.4rem;
}

.list-item {
  background: #f7fafc;
  border: 1px solid #e5edf6;
  border-radius: 10px;
  padding: 0.6rem;
  display: grid;
  gap: 0.2rem;
}

.stack {
  display: grid;
  gap: 0.7rem;
}

.panel {
  background: #f8fbfe;
  border: 1px solid #e3edf8;
  border-radius: 10px;
  padding: 0.7rem;
}

.inline-actions {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
}

.weather-card {
  background: linear-gradient(150deg, #f9fcff, #eaf4ff);
  border: 1px solid #ddeaf7;
  border-radius: 10px;
  padding: 0.55rem;
  display: grid;
  gap: 0.2rem;
  font-size: 0.84rem;
}

.embed-wrapper {
  padding: 0.8rem;
  min-height: 100vh;
  background: linear-gradient(155deg, #f6fbff, #eaf4fb);
}

.embed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.embed-header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.embed-list {
  display: grid;
  gap: 0.45rem;
}

.embed-item {
  background: white;
  border: 1px solid #e4edf7;
  border-radius: 10px;
  padding: 0.55rem;
  display: grid;
  gap: 0.15rem;
}

.highlight-row {
  background: color-mix(in srgb, var(--c-accent) 12%, #fff);
}

.muted {
  color: var(--muted);
}

.hint {
  color: var(--muted);
  margin-top: 0.5rem;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.hidden {
  display: none;
}

.board-page {
  color: #f3f4f5;
}

.board-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(90deg, #3e4349, #4a5057);
  border: 1px solid #5f656d;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.8rem;
  font-size: clamp(1rem, 2.1vw, 1.9rem);
  font-weight: 700;
  color: #ffad1f;
}

.board-tabs .tab.club {
  color: #ffc55c;
}

.board-tabs .sep {
  color: #f4c779;
  opacity: 0.75;
}

.board-shell {
  background: linear-gradient(180deg, #646a71, #565d65);
  border: 1px solid #7a828d;
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 1rem;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.28);
}

.board-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.7rem;
}

.board-header h1 {
  margin: 0;
  color: #ffffff;
}

.board-header p {
  margin: 0.2rem 0 0;
  color: #e3e8ee;
}

.week-wrap {
  overflow-x: auto;
  border: 1px solid #7d848d;
  border-radius: 12px;
}

.week-table {
  min-width: 1100px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: #0f1114;
}

.week-table .time-col {
  background: #59a25a;
  color: #041b08;
  font-weight: 800;
  text-align: center;
  width: 70px;
  position: sticky;
  left: 0;
  z-index: 3;
}

.week-table .day-col {
  background: #55a65e;
  color: #f7fff8;
  text-transform: capitalize;
  border-right: 1px solid #4b8953;
  text-align: center;
}

.week-table .court-col {
  background: #ffac11;
  color: #141414;
  text-align: center;
  border-right: 1px solid #d08200;
  padding: 0.35rem;
}

.week-table td,
.week-table th {
  border-bottom: 1px solid #808891;
  border-right: 1px solid #747c84;
  padding: 0.2rem;
}

.slot-cell {
  background: #b8babd;
  width: 82px;
  min-width: 82px;
  height: 50px;
  position: relative;
}

.slot-cell.is-empty:hover {
  background: #c7ccce;
}

.slot-cell.is-disabled {
  background: #9ea3a8;
}

.slot-add-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: #4f5962;
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
}

.slot-add-btn:hover {
  background: rgba(255, 174, 26, 0.24);
  color: #2a2f35;
}

.slot-booking {
  height: 100%;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  padding: 0.22rem 0.25rem;
  display: grid;
  align-content: center;
  gap: 0.1rem;
}

.slot-booking strong {
  font-size: 0.72rem;
  line-height: 1.1;
}

.slot-booking span {
  font-size: 0.67rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-normal {
  background: #f8b13a;
  color: #222;
}

.type-fixed_training {
  background: #40af60;
  color: #0d2414;
}

.type-subscription {
  background: #2d84d8;
  color: #f4f7fc;
}

.type-challenge_match {
  background: #793fd6;
  color: #faf4ff;
}

.type-block,
.type-tournament,
.type-championship {
  background: #df5f4f;
  color: #2a0d09;
}

.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  padding-top: 0.7rem;
  color: #e7ebf0;
  font-size: 0.85rem;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.board-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.board-card {
  background: linear-gradient(160deg, #666d75, #5a626a);
  border: 1px solid #7c8591;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  padding: 0.9rem;
}

.board-card h2 {
  margin: 0 0 0.65rem;
  color: #ffae1a;
}

.board-card .muted {
  color: #ced4dc;
}

.board-card table th,
.board-card table td {
  border-bottom-color: #7f868f;
}

.board-card table thead th {
  color: #0f1114;
  background: #ffac11;
  border-bottom-color: #cc8105;
}

.board-card table tbody td {
  color: #15181c;
  background: #bebfc2;
}

.game-row {
  background: rgba(238, 242, 247, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.6rem;
  display: grid;
  gap: 0.45rem;
}

.result-inline {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.compact-stack {
  gap: 0.5rem;
}

.slot-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 18, 0.62);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 30;
  padding: 1rem;
}

.slot-modal.hidden {
  display: none;
}

.slot-modal-card {
  width: min(720px, 100%);
  background: linear-gradient(180deg, #737a82, #666e76);
  border: 1px solid #8f99a5;
  border-radius: 14px;
  padding: 1rem;
  position: relative;
  color: #f7f8fb;
}

.slot-close {
  position: absolute;
  right: 0.7rem;
  top: 0.3rem;
  border: 0;
  background: transparent;
  color: #ffe8c7;
  font-size: 1.8rem;
  cursor: pointer;
}

.slot-modal-card h3 {
  margin-top: 0;
  color: #ffae1a;
}

.board-page .panel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

@media (max-width: 1080px) {
  .three-col,
  .two-col,
  .stats-grid,
  .board-grid {
    grid-template-columns: 1fr;
  }

  .hero-club {
    flex-direction: column;
  }

  .board-header {
    flex-direction: column;
    align-items: stretch;
  }

  .board-tabs {
    font-size: 1.15rem;
  }

  .result-inline {
    grid-template-columns: 1fr;
  }
}
