:root{
  --bg:#ffffff;--surface:#ffffff;--surface-soft:#f7f9fb;--text:#243246;--muted:#5f6c7b;
  --accent:#f08a1f;--accent-dark:#d57616;--border:#e5e7eb;--container:1160px
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,Arial,sans-serif;color:var(--text);background:var(--bg);line-height:1.55}
img{display:block;max-width:100%}
a{text-decoration:none;color:inherit}
button,input,textarea,select{font:inherit}
.container{width:min(calc(100% - 2rem),var(--container));margin:0 auto}

.site-header{border-bottom:1px solid var(--border);background:#fff;position:sticky;top:0;z-index:20}
.site-header .inner{display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:74px;position:relative}
.logo img{height:40px;width:auto}
.nav{display:flex;align-items:center;gap:1.4rem}
.nav a{font-weight:600;color:var(--muted)}
.nav a.active,.nav a:hover{color:var(--text)}
.mobile-toggle{display:none;width:42px;height:42px;border:1px solid var(--border);background:#fff;cursor:pointer}

.hero{padding:3rem 0 4rem}
.hero-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:3rem;align-items:center}
.eyebrow{font-size:.78rem;text-transform:uppercase;letter-spacing:.18em;color:var(--accent);font-weight:700;margin-bottom:.8rem}
.hero h1,.page-hero h1{font-size:clamp(2.7rem,6vw,4.8rem);line-height:.95;letter-spacing:-.04em;margin:0}
.hero p,.page-hero p,.muted,.small{color:var(--muted)}
.small{font-size:.94rem}

.btn{display:inline-flex;align-items:center;justify-content:center;min-height:50px;padding:.95rem 1.3rem;border:1px solid var(--border);background:#fff;font-weight:700;cursor:pointer}
.btn-primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.btn-primary:hover{background:var(--accent-dark);border-color:var(--accent-dark)}

.card,.data-card,.kpi{border:1px solid var(--border);background:#fff;padding:1.35rem}
.card-grid,.camp-grid,.contact-grid,.admin-grid,.kpi-admin,.category-grid{display:grid;gap:1rem}
.card-grid,.camp-grid,.admin-grid{grid-template-columns:repeat(3,1fr)}
.contact-grid{grid-template-columns:1fr 1fr}

.section{padding:4rem 0}
.page-hero{padding:2rem 0 2.4rem}
.split-grid{display:grid;grid-template-columns:1.05fr .95fr;gap:1rem;align-items:start}

.top-switch,.tabs{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:1rem}
.switch-pill,.category-pill,.tab-pill{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);padding:.9rem 1rem;font-weight:700;background:#fff}
.switch-pill.active,.category-pill.active,.tab-pill.active{background:var(--text);border-color:var(--text);color:#fff}

.table-wrap{overflow:auto}
table{width:100%;min-width:760px;border-collapse:collapse}
th,td{padding:.8rem .7rem;border-bottom:1px solid var(--border);text-align:left}
th{font-size:.82rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.rank{display:inline-grid;place-items:center;width:32px;height:32px;border:1px solid var(--border);font-weight:800}

.field{display:flex;flex-direction:column;gap:.45rem}
.field.full{grid-column:1/-1}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}
input,textarea,select{width:100%;border:1px solid var(--border);background:#fff;color:var(--text);padding:.95rem 1rem}
textarea{min-height:140px;resize:vertical}
.textarea-lg{min-height:220px}

.notice{margin:1rem 0;padding:1rem;border:1px solid #f2c79b;background:#fff7ef;color:#8a4f12}
.notice.error{background:#ffe5e5;padding:.75rem 1rem;border:1px solid #f1b5b5;color:#8b2f2f}

.site-footer{padding:2rem 0 3rem}
.footer-box{display:flex;justify-content:space-between;align-items:center;gap:1rem;border-top:1px solid var(--border);padding-top:1.2rem}
.footer-box img{height:42px;width:auto}

.admin-shell{display:grid;grid-template-columns:260px 1fr;min-height:100vh}
.admin-sidebar{border-right:1px solid var(--border);padding:1.25rem}
.admin-nav{display:grid;gap:.4rem;margin-top:1rem}
.admin-nav a{padding:.8rem 1rem;border:1px solid var(--border);font-weight:600}
.admin-nav a.active,.admin-nav a:hover{background:var(--text);color:#fff;border-color:var(--text)}
.admin-main{padding:1.25rem}

.login-wrap{min-height:100vh;display:grid;place-items:center}
.login-card{width:min(100% - 2rem,440px)}

.card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}

.tab-panel {
  display:none;
  margin-top:1rem;
}
.tab-panel.active {
  display:block;
}

.camp-card-image,
.camp-admin-preview {
  overflow:hidden;
  border:1px solid var(--border);
  background:#fff;
}
.camp-card-image img,
.camp-admin-preview img {
  width:100%;
  height:auto;
  display:block;
}
.camp-card-image { margin-bottom:1rem; }

.camp-top-image {
  display:flex;
  justify-content:center;
  margin:0 auto 2rem auto;
}
.camp-top-image img {
  width:100%;
  max-width:900px;
  height:420px;
  object-fit:cover;
  display:block;
  border:1px solid var(--border);
  background:#fff;
}
.camp-admin-preview { max-width:420px; }

.badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:.45rem .8rem;
  border:1px solid var(--border);
  font-weight:700;
  background:var(--surface-soft);
}

.match-list {
  display:grid;
  gap:.75rem;
}
.match-item {
  border:1px solid var(--border);
  background:#fff;
  padding:1rem;
}

.tabs {
  display:flex;
  gap:.75rem;
  flex-wrap:wrap;
  margin-bottom:1rem;
}

/* unified top menu */
.unified-menu {
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
}
.unified-menu-wrap {
  margin-top:1rem;
  margin-bottom:1rem;
}
.unified-menu .switch-pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:50px;
  padding:.95rem 1.15rem;
  border:1px solid var(--border);
  background:#fff;
  font-weight:700;
  text-align:center;
  box-sizing:border-box;
}
.unified-menu .switch-pill.active {
  background:var(--text);
  border-color:var(--text);
  color:#fff;
}

/* camp menu rebuilt */
.camp-tabs-wrap { margin-top:.5rem; }
.camp-mobile-menu {
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin:1.5rem 0 1.25rem 0;
}
.camp-menu-btn {
  appearance:none;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  font:inherit;
  font-weight:700;
  min-height:50px;
  padding:.95rem 1.15rem;
  cursor:pointer;
}
.camp-menu-btn.active {
  background:var(--text);
  border-color:var(--text);
  color:#fff;
}

/* frontend league */
.league-season-select {
  margin-top:1rem;
  max-width:220px;
}
.league-season-select select { width:100%; }

.league-category-shell {
  width:100%;
  margin-bottom:1.5rem;
}
.league-category-grid {
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  width:100%;
}
.league-category-grid .category-pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:1 1 calc(25% - 11px);
  min-height:56px;
  padding:.95rem 1rem;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  text-align:center;
  font-weight:700;
  box-sizing:border-box;
}
.league-category-grid .category-pill.active {
  background:var(--text);
  border-color:var(--text);
  color:#fff;
}

.league-front-grid {
  display:grid;
  grid-template-columns:minmax(0,2.8fr) minmax(220px,.7fr);
  gap:1rem;
  align-items:start;
}
.league-table-card,
.league-teams-card {
  min-width:0;
  overflow:hidden;
}
.league-team-list {
  display:flex;
  flex-direction:column;
  gap:12px;
}
.league-team-item {
  display:block;
  text-decoration:none;
  word-break:break-word;
}
.league-team-item strong {
  display:block;
  line-height:1.45;
}

.league-table-shell {
  width:100%;
  max-width:100%;
  overflow:hidden;
}
.league-table-compact {
  width:100%;
  max-width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  font-size:.95rem;
}
.league-table-compact th,
.league-table-compact td {
  padding:.68rem .38rem;
  vertical-align:middle;
  overflow:hidden;
}
.league-table-compact th {
  white-space:nowrap;
  font-size:.92rem;
}
.league-table-compact td {
  white-space:normal;
}
.league-table-compact th:nth-child(1),
.league-table-compact td:nth-child(1) {
  width:48px;
  text-align:center;
}
.league-table-compact th:nth-child(2),
.league-table-compact td:nth-child(2) {
  width:auto;
  min-width:0;
  word-break:break-word;
  overflow-wrap:anywhere;
}
.league-table-compact th:nth-child(3),
.league-table-compact td:nth-child(3),
.league-table-compact th:nth-child(4),
.league-table-compact td:nth-child(4),
.league-table-compact th:nth-child(5),
.league-table-compact td:nth-child(5),
.league-table-compact th:nth-child(6),
.league-table-compact td:nth-child(6),
.league-table-compact th:nth-child(7),
.league-table-compact td:nth-child(7) {
  width:62px;
  text-align:center;
}

.rules-card { max-width:900px; }

/* camp add buttons */
.camp-add-buttons {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:1rem;
}
.camp-add-btn {
  flex:1 1 260px;
  min-height:48px;
  justify-content:center;
}

/* admin dashboard */
.admin-dashboard-cards {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:16px;
}
.admin-dashboard-card {
  min-width:0;
  padding:1.1rem 1.25rem;
}
.admin-dashboard-card .eyebrow {
  margin-bottom:.65rem;
}
.admin-dashboard-card h3,
.admin-dashboard-card h2 {
  margin:.1rem 0 .5rem 0;
}

.admin-action-cards {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}
.admin-action-card {
  min-width:0;
  padding:1.45rem 1.35rem;
  border:1px solid #d8dee6;
  background:linear-gradient(180deg,#fff 0%,#fbfcfd 100%);
  box-shadow:0 6px 16px rgba(36,50,70,.05);
}
.admin-action-card .eyebrow {
  margin-bottom:.55rem;
}
.admin-action-card h3 {
  margin:.1rem 0 .7rem 0;
  font-size:1.1rem;
}
.admin-action-card p {
  margin:0;
  color:var(--text);
}

/* layout helpers */
.container {
  max-width:1200px;
  margin:0 auto;
}

@media (max-width:1100px){
  .league-front-grid{grid-template-columns:minmax(0,1fr)}
  .league-table-shell{overflow-x:auto}
  .league-table-compact{min-width:700px;table-layout:auto}
}

@media (max-width:1024px){
  .hero-grid,.split-grid,.contact-grid,.admin-shell{grid-template-columns:1fr}
  .card-grid,.camp-grid,.category-grid,.kpi-admin,.form-grid,.admin-grid{grid-template-columns:repeat(2,1fr)}
  .admin-dashboard-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .admin-action-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .nav{
    display:none;
    position:absolute;
    top:74px;
    left:1rem;
    right:1rem;
    flex-direction:column;
    align-items:stretch;
    gap:1rem;
    background:#fff;
    border:1px solid var(--border);
    padding:1rem
  }
  .nav.open{display:flex}
  .mobile-toggle{display:inline-grid;place-items:center}
}

@media (max-width:900px){
  .league-season-select{max-width:100%}
  .camp-top-image{margin-bottom:1.25rem}
}

@media (max-width:640px){
  .card-grid,.camp-grid,.category-grid,.kpi-admin,.form-grid,.admin-grid{grid-template-columns:1fr}
  .hero h1,.page-hero h1{font-size:clamp(2.2rem,10vw,4rem)}
  .btn{width:100%}
  .logo img{height:34px}

  .camp-top-image img{height:auto}

  .camp-mobile-menu{
    flex-direction:column;
    gap:10px;
  }
  .camp-menu-btn{
    width:100%;
    justify-content:center;
  }

  .league-category-grid{
    flex-direction:column;
    gap:10px;
  }
  .league-category-grid .category-pill{
    flex:1 1 100%;
    width:100%;
  }

  .unified-menu{gap:.5rem}
  .unified-menu .switch-pill{
    min-height:44px;
    padding:.8rem .9rem;
  }

  .league-table-shell{overflow-x:auto}
  .league-table-compact{min-width:700px}

  .camp-add-buttons{flex-direction:column}
  .camp-add-btn{width:100%}

  .admin-dashboard-cards{grid-template-columns:1fr}
  .admin-action-cards{grid-template-columns:1fr}
}