:root {
  --bg: #f4f8ff;
  --panel: #ffffff;
  --panel-2: #eaf2ff;
  --line: #c9d9ee;
  --text: #10233f;
  --muted: #5f718a;
  --accent: #0b69d8;
  --accent-2: #20a4f3;
  --danger: #d9364f;
  --warning: #b86f00;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(11, 105, 216, 0.16);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  width: 58px;
  height: 38px;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-weight: 700;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 360px;
  display: flex;
  align-items: end;
  margin: 22px 0;
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.55)),
    url("https://images.unsplash.com/photo-1517649763962-0c623066013b?auto=format&fit=crop&w=1800&q=80") center/cover;
  box-shadow: 0 24px 70px rgba(11, 105, 216, 0.14);
}

.hero-copy {
  max-width: 650px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.filters {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--text);
}

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 16px;
}

.section-title span {
  color: var(--muted);
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  padding-bottom: 42px;
}

.event-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(15, 50, 95, 0.08);
}

.event-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  background: #0d171d;
}

.event-card-body {
  padding: 16px;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.badge.live { background: var(--danger); color: white; }
.badge.finished { background: #7488a3; color: #ffffff; }

.primary-button,
.danger-button,
.secondary-button,
.back-button,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 900;
}

.primary-button { background: var(--accent); color: #ffffff; }
.secondary-button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.danger-button { background: var(--danger); color: white; }
.back-button { margin: 24px 0 12px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.icon-button { min-width: 42px; background: var(--accent-2); color: #ffffff; }
.link-button { border: 0; background: transparent; color: var(--muted); font-weight: 800; }

.event-hero {
  min-height: 330px;
  display: flex;
  align-items: end;
  padding: 34px;
  border-radius: var(--radius);
  border: 1px solid rgba(11, 105, 216, 0.14);
  background-position: center;
  background-size: cover;
}

.event-hero-content {
  max-width: 740px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  overflow-x: auto;
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.tab.active {
  background: var(--accent);
  color: #ffffff;
}

.tab-content {
  padding-bottom: 46px;
}

.info-grid, .tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.info-card, .admin-card, .auth-panel form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--panel);
}

.doc-category, .court-block, .gallery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
}

.doc-row, .match-row, .media-row, .admin-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(11, 105, 216, 0.12);
}

.doc-row:first-of-type, .match-row:first-of-type, .media-row:first-of-type {
  border-top: 0;
}

.match-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  font-weight: 900;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.gallery-card button {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
}

.lightbox {
  width: min(900px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.lightbox::backdrop { background: rgba(0, 0, 0, 0.75); }
.lightbox img, .lightbox video, .doc-preview iframe { width: 100%; max-height: 70vh; }

.admin-body main {
  width: min(1360px, calc(100% - 28px));
}

.auth-panel {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 90px);
}

.login-logo {
  width: min(280px, 100%);
  justify-self: center;
  margin-bottom: 4px;
}

.panel-form {
  display: grid;
  gap: 14px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 24px 0 42px;
}

.admin-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(15, 50, 95, 0.08);
}

.compact { margin-top: 0; }
.admin-event-list { display: grid; gap: 8px; }
.admin-event-row { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: #ffffff; color: var(--text); }
.admin-event-row.active { outline: 2px solid var(--accent); }

.admin-workspace {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
}

.two-col, .three-col, .button-row {
  display: grid;
  gap: 12px;
}

.two-col { grid-template-columns: 1fr 1fr; }
.three-col { grid-template-columns: 1fr 1fr 1fr; }
.button-row { grid-template-columns: auto auto; }

.stack-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.stack-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f8fbff;
}

.form-message {
  min-height: 22px;
  color: var(--warning);
}

@media (max-width: 820px) {
  .topbar { padding: 0 16px; }
  main { width: min(100% - 20px, 1180px); }
  .hero, .event-hero { padding: 24px; min-height: 300px; }
  .filters, .admin-layout, .two-col, .three-col { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .doc-row, .match-row, .media-row { align-items: flex-start; flex-direction: column; }
}
