@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --red:        #CC0000;
  --red-dark:   #a30000;
  --red-light:  #ff1a1a;
  --anthracite: #2d2d2d;
  --gray-900:   #1a1a1a;
  --gray-700:   #4a4a4a;
  --gray-500:   #7a7a7a;
  --gray-300:   #c8c8c8;
  --gray-100:   #f0f0f0;
  --gray-50:    #f8f8f8;
  --white:      #ffffff;
  --green-bg:   #e8f5e9;
  --green-text: #2e7d32;
  --red-bg:     #ffebee;
  --red-text:   #c62828;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.14), 0 4px 8px rgba(0,0,0,.08);
  --radius:     6px;
  --radius-lg:  10px;
  --transition: .18s ease;
  --font-head:  'Oswald', sans-serif;
  --font-body:  'Source Sans 3', sans-serif;
  --header-h:   64px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--anthracite);
  background: var(--gray-50);
  min-height: 100vh;
}
a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-dark); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

/* ─── Typography ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  color: var(--anthracite);
  letter-spacing: .02em;
  text-transform: uppercase;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }

/* ─── Layout Helpers ─────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
.page-content {
  padding: 1.5rem 0 3rem;
}
.section-title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--anthracite);
  border-left: 4px solid var(--red);
  padding-left: .75rem;
  margin: 2rem 0 1rem;
}
.section-title:first-child { margin-top: 0; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--red);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 1rem;
}
.header-logo {
  flex-shrink: 0;
  height: 44px;
  width: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-logo img { height: 100%; width: 100%; object-fit: cover; }
.header-logo-placeholder {
  font-size: 1.5rem;
  line-height: 1;
}
.header-title {
  flex: 1;
  min-width: 0;
}
.header-title .site-name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}
.header-title .site-sub {
  font-size: .75rem;
  color: rgba(255,255,255,.75);
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Desktop nav */
.header-nav {
  display: none;
  gap: .25rem;
}
@media (min-width: 768px) {
  .header-nav { display: flex; align-items: center; }
}
.header-nav a {
  color: rgba(255,255,255,.88);
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .45rem .85rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.header-nav a:hover,
.header-nav a.active {
  background: rgba(255,255,255,.18);
  color: var(--white);
}
.header-nav .nav-rules {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
}
.header-nav .nav-rules:hover {
  background: rgba(255,255,255,.28);
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
@media (min-width: 768px) { .hamburger { display: none; } }
.hamburger span {
  display: block;
  height: 2.5px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(8.75px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8.75px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--anthracite);
  z-index: 199;
  padding: 1.5rem 1rem;
  flex-direction: column;
  gap: .5rem;
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  color: var(--white);
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.mobile-nav a:hover, .mobile-nav a.active {
  background: rgba(255,255,255,.08);
  border-left-color: var(--red);
  color: var(--white);
}

/* ─── Card ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: .85rem;
  border-bottom: 2px solid var(--gray-100);
}
.card-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--anthracite);
}
.card-body { }
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--gray-100);
}

/* ─── Tournament list cards ──────────────────────────────────────────────────── */
.tournament-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) { .tournament-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tournament-grid { grid-template-columns: repeat(3, 1fr); } }
.tournament-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.tournament-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tournament-card-banner {
  background: var(--red);
  height: 6px;
}
.tournament-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.tournament-card-name {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--anthracite);
}
.tournament-card-date {
  font-size: .875rem;
  color: var(--gray-500);
}
.tournament-card-footer {
  padding: .75rem 1.25rem;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border-top: 1px solid var(--gray-100);
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: .875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(204,0,0,.35);
}
.btn-secondary {
  background: var(--white);
  color: var(--anthracite);
  border-color: var(--gray-300);
}
.btn-secondary:hover {
  background: var(--gray-100);
  border-color: var(--gray-500);
  color: var(--anthracite);
}
.btn-danger {
  background: #b71c1c;
  color: var(--white);
  border-color: #b71c1c;
}
.btn-danger:hover { background: #7f0000; border-color: #7f0000; color: var(--white); }
.btn-success {
  background: #2e7d32;
  color: var(--white);
  border-color: #2e7d32;
}
.btn-success:hover { background: #1b5e20; border-color: #1b5e20; color: var(--white); }
.btn-ghost {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
.btn-ghost:hover { background: var(--red); color: var(--white); }
.btn-sm { padding: .35rem .75rem; font-size: .78rem; }
.btn-lg { padding: .8rem 1.6rem; font-size: 1rem; }
.btn-xl {
  padding: 1.1rem 2rem;
  font-size: 1.15rem;
  border-radius: var(--radius-lg);
}
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.btn-icon { padding: .5rem; }

/* ─── Status Badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}
.badge-pending   { background: var(--gray-100); color: var(--gray-700); }
.badge-active    { background: #e8f5e9; color: #1b5e20; }
.badge-finished  { background: #e3f2fd; color: #0d47a1; }
.badge-registration { background: #fff8e1; color: #e65100; }
.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.badge-active .badge-dot {
  background: #2e7d32;
  box-shadow: 0 0 0 0 rgba(46,125,50,.5);
  animation: pulse-dot 1.4s infinite;
}
.badge-pending .badge-dot  { background: var(--gray-500); }
.badge-finished .badge-dot { background: #1565c0; }
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(46,125,50,.6); }
  70%  { box-shadow: 0 0 0 7px rgba(46,125,50,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); }
}

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--white);
}
.table-wrapper thead th {
  background: var(--anthracite);
  color: var(--white);
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .65rem .85rem;
  text-align: left;
  white-space: nowrap;
}
.table-wrapper thead th:first-child { border-radius: var(--radius) 0 0 0; }
.table-wrapper thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
.table-wrapper tbody td {
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.table-wrapper tbody tr:last-child td { border-bottom: none; }
.table-wrapper tbody tr:hover td { background: var(--gray-50); }

/* Standings row states */
.promotes td { background: var(--green-bg) !important; color: var(--green-text); }
.promotes td strong { color: var(--green-text); }
.promotes:hover td { background: #c8e6c9 !important; }
.relegates td { background: var(--red-bg) !important; color: var(--red-text); }
.relegates td strong { color: var(--red-text); }
.relegates:hover td { background: #ffcdd2 !important; }
.rank-col { font-family: var(--font-head); font-weight: 700; font-size: 1rem; width: 40px; text-align: center; }
.points-col { font-family: var(--font-head); font-weight: 700; color: var(--red); font-size: 1rem; }

/* Match rows */
.match-active td  { background: #fffde7 !important; }
.match-active:hover td { background: #fff9c4 !important; }
.match-finished td { color: var(--gray-700); }
.match-time { font-family: var(--font-head); font-weight: 600; color: var(--anthracite); white-space: nowrap; }
.match-teams { font-weight: 600; }
.match-score {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
  text-align: center;
}
.match-field { color: var(--gray-500); font-size: .85rem; white-space: nowrap; }
.vs-sep { color: var(--gray-500); font-weight: 400; padding: 0 .35rem; }

/* ─── Tabs ───────────────────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 2px solid var(--gray-200, #e0e0e0);
  margin-bottom: 1.25rem;
  gap: 0;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  padding: .65rem 1.2rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: var(--font-head);
  font-size: .88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--anthracite); }
.tab-btn.active {
  color: var(--red);
  border-bottom-color: var(--red);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-700);
  margin-bottom: .35rem;
}
.form-control {
  width: 100%;
  padding: .6rem .85rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--anthracite);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.4;
}
.form-control:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(204,0,0,.12);
}
.form-control::placeholder { color: var(--gray-300); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .8rem; color: var(--gray-500); margin-top: .3rem; }
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}
@media (min-width: 640px) { .form-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .form-row-3 { grid-template-columns: repeat(3, 1fr); } }
.form-section-title {
  font-family: var(--font-head);
  font-size: .88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--red);
  margin: 1.5rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--gray-200, #e0e0e0);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--gray-100);
}
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
}
.alert-error   { background: var(--red-bg);   border-color: var(--red);     color: var(--red-text); }
.alert-success { background: var(--green-bg); border-color: #2e7d32; color: var(--green-text); }
.alert-info    { background: #e3f2fd; border-color: #1565c0; color: #0d47a1; }
.alert-warning { background: #fff8e1; border-color: #e65100; color: #bf360c; }

/* ─── Admin Layout ───────────────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--anthracite);
  min-height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  align-self: flex-start;
  overflow-y: auto;
  display: none;
}
@media (min-width: 900px) { .admin-sidebar { display: block; } }
.admin-sidebar-nav { padding: 1.25rem 0; }
.admin-sidebar-section {
  font-family: var(--font-head);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.4);
  padding: 1rem 1.25rem .35rem;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1.25rem;
  color: rgba(255,255,255,.75);
  font-size: .92rem;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover { background: rgba(255,255,255,.07); color: var(--white); }
.admin-sidebar a.active {
  background: rgba(204,0,0,.2);
  color: var(--white);
  border-left-color: var(--red);
}
.admin-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1rem;
}
@media (min-width: 640px) { .admin-main { padding: 1.5rem; } }
.admin-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200, #e0e0e0);
}
.admin-page-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--anthracite);
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) { .admin-stats { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}
.stat-label {
  font-size: .78rem;
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  margin-top: .25rem;
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--anthracite);
  padding: 1rem;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: var(--red);
  border-radius: 50%;
  margin-bottom: .75rem;
}
.auth-logo-badge svg { width: 32px; height: 32px; fill: white; }
.auth-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--anthracite);
  text-align: center;
  margin-bottom: .25rem;
}
.auth-sub { text-align: center; color: var(--gray-500); font-size: .9rem; margin-bottom: 1.5rem; }

/* ─── Referee Interface ───────────────────────────────────────────────────────── */
.referee-layout {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}
.match-display {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.match-display-header {
  background: var(--red);
  color: var(--white);
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.match-display-header h3 {
  font-size: .88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--white);
}
.match-display-body { padding: 1.5rem 1.25rem; }
.match-teams-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.match-team-name {
  flex: 1;
  font-family: var(--font-head);
  font-size: clamp(1rem, 4vw, 1.4rem);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--anthracite);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}
.match-vs {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-300);
  flex-shrink: 0;
}
.result-input-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.result-input-label {
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-500);
  text-align: center;
  display: block;
  margin-bottom: .35rem;
}
.result-input {
  width: 100%;
  padding: .75rem .5rem;
  text-align: center;
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--anthracite);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  transition: border-color var(--transition);
  -moz-appearance: textfield;
}
.result-input::-webkit-outer-spin-button,
.result-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.result-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(204,0,0,.12); }
.result-sep {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-300);
  text-align: center;
}
.stepper-group { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.stepper-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  touch-action: manipulation;
}
.stepper-btn:hover { background: var(--gray-100); border-color: var(--gray-500); }
.stepper-btn.minus:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.stepper-btn.plus:hover  { background: var(--green-bg); border-color: #2e7d32; color: #2e7d32; }
.referee-confirm-btn {
  width: 100%;
  padding: 1.1rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  touch-action: manipulation;
}
.referee-confirm-btn:hover { background: var(--red-dark); box-shadow: 0 4px 12px rgba(204,0,0,.35); }
.referee-confirm-btn:active { transform: scale(.98); }
.field-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .75rem;
}
.field-btn {
  padding: 1.5rem 1rem;
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  touch-action: manipulation;
}
.field-btn:hover { border-color: var(--red); box-shadow: var(--shadow-md); }
.field-btn-number {
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}
.field-btn-label {
  font-family: var(--font-head);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-500);
  margin-top: .25rem;
}
.confirmation-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.confirmation-overlay.open { display: flex; }
.confirmation-dialog {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.confirmation-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: .75rem;
}
.confirmation-score {
  font-family: var(--font-head);
  font-size: 3rem;
  font-weight: 700;
  color: var(--red);
  margin: .75rem 0;
}
.confirmation-actions { display: flex; gap: .75rem; margin-top: 1.25rem; }
.confirmation-actions .btn { flex: 1; }

/* ─── Team Self-Service ──────────────────────────────────────────────────────── */
.team-hero {
  background: var(--anthracite);
  color: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.team-hero-name {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--white);
  flex: 1;
  min-width: 0;
}
.team-hero-field {
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.team-pin-display {
  background: var(--red);
  padding: .4rem .85rem;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.team-pin-display .pin-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.7);
}
.team-pin-display .pin-value {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .1em;
}
.rename-form {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.rename-form .form-control { flex: 1; min-width: 200px; }
.my-rank-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.rank-number {
  font-family: var(--font-head);
  font-size: 3rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  flex-shrink: 0;
}
.rank-details { flex: 1; }
.rank-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-500);
  font-family: var(--font-head);
}
.rank-detail-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}
.rank-detail-item { font-size: .9rem; }
.rank-detail-item strong { color: var(--anthracite); }

/* ─── Misc / Utility ─────────────────────────────────────────────────────────── */
.page-hero {
  background: var(--red);
  color: var(--white);
  padding: 1.75rem 0 1.5rem;
  margin-bottom: 1.5rem;
}
.page-hero-inner { display: flex; flex-direction: column; gap: .5rem; }
.page-hero-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 5vw, 2.6rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--white);
}
.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}
.page-hero-meta span {
  font-size: .85rem;
  color: rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  gap: .3rem;
}
.page-hero-actions { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.page-hero-actions .btn {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
  color: var(--white);
}
.page-hero-actions .btn:hover {
  background: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.6);
  color: var(--white);
}
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #2e7d32;
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2e7d32;
  animation: pulse-dot 1.4s infinite;
}
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}
.empty-state-icon { font-size: 3rem; margin-bottom: .75rem; opacity: .5; }
.empty-state p { font-size: 1rem; }
.tag {
  display: inline-block;
  padding: .15rem .55rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: var(--radius);
  font-size: .75rem;
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.divider { border: none; border-top: 2px solid var(--gray-100); margin: 1.5rem 0; }
.text-red   { color: var(--red); }
.text-muted { color: var(--gray-500); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Schedule round headings */
.round-heading {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.75rem 0 1rem;
}
.round-heading-line { flex: 1; height: 2px; background: var(--gray-100); }
.round-heading-text {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--red);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Rules page */
.rules-content {
  max-width: 720px;
  line-height: 1.8;
}
.rules-content h1, .rules-content h2, .rules-content h3 {
  text-transform: none;
  color: var(--red);
  margin: 1.5rem 0 .75rem;
}
.rules-content ul, .rules-content ol {
  margin-left: 1.5rem;
  margin-bottom: .75rem;
  list-style: revert;
}
.rules-content blockquote {
  border-left: 4px solid var(--red);
  padding: .75rem 1rem;
  margin: 1rem 0;
  background: var(--gray-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: center;
  font-size: .8rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb-sep { color: var(--gray-300); }

/* Footer */
.site-footer {
  background: var(--anthracite);
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 1.25rem 1rem;
  font-size: .8rem;
  margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,.7); }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .card { padding: 1.5rem; }
  .page-content { padding: 2rem 0 4rem; }
  .referee-layout { padding: 1.5rem; }
}
@media (min-width: 1024px) {
  :root { --header-h: 70px; }
  .header-title .site-name { font-size: 1.25rem; }
}

/* ─── Print ──────────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .hamburger, .mobile-nav,
  .admin-sidebar, .btn, .tab-nav, .live-indicator, .confirmation-overlay { display: none !important; }
  body { background: white; color: black; font-size: 10pt; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .table-wrapper { overflow: visible; box-shadow: none; }
  .table-wrapper table { font-size: 9pt; }
  .table-wrapper thead th { background: #333 !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .promotes td { background: #e8f5e9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .relegates td { background: #ffebee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { text-decoration: none; color: black; }
  .page-hero { background: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 1cm; }
  .page-hero-title { color: white !important; }
  h1, h2, h3 { break-after: avoid; }
  .tab-content { display: block !important; }
}
