/* WrestleDelaware-style layout */
:root {
  --bg: #f4f6f8;
  --card: #fff;
  --border: #d8dee6;
  --text: #1a1a1a;
  --muted: #5c6b7a;
  --accent: #9b1b30;
  --accent-hover: #7a1526;
  --link: #1a5fb4;
  --thead: #eef1f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a {
  color: var(--link);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
}

header.page-head {
  border-bottom: 3px solid var(--accent);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
}

header.page-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
}

header.page-head .sub {
  color: var(--muted);
  font-size: 0.95rem;
  font-family: system-ui, sans-serif;
}

.nav-links {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.nav-links a {
  margin-right: 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-family: system-ui, sans-serif;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select {
  min-width: 10rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.field.wide input {
  min-width: 16rem;
}

.btn {
  font-family: system-ui, sans-serif;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.hint {
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.status {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
}

table.data th,
table.data td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

table.data th {
  background: var(--thead);
  font-weight: 600;
  position: sticky;
  top: 0;
}

table.data tbody tr:hover {
  background: #f8fafc;
}

table.data td.name {
  font-weight: 600;
  white-space: normal;
}

table.data a {
  font-weight: 600;
}

.empty-row td {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 1.5rem;
}

.outcome-w {
  color: #0d6b2e;
  font-weight: 600;
}

.outcome-l {
  color: #b42318;
  font-weight: 600;
}

/* Common opponent form */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 1rem;
  font-family: system-ui, sans-serif;
}

.form-card .field input {
  width: 100%;
  max-width: 28rem;
}

.form-row {
  margin-bottom: 1rem;
}

.form-row small {
  display: block;
  color: var(--muted);
  margin-top: 0.25rem;
}

#results-panel {
  display: none;
}

#results-panel.visible {
  display: block;
}

#results-panel h2 {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.visible {
  display: flex;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  padding: 1.25rem;
}

.modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.modal header h2 {
  margin: 0;
  font-size: 1.2rem;
}

/* Wrestler profile (WrestleDelaware-style) */
.profile-nav {
  margin-bottom: 1rem;
}

.profile-hero {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.profile-hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.profile-meta {
  font-family: system-ui, sans-serif;
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
}

.profile-stats strong {
  color: var(--text);
}

.profile-section {
  margin-bottom: 2rem;
}

.profile-section h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--accent);
}

.profile-section .section-note {
  font-size: 0.9rem;
  font-weight: normal;
  color: var(--muted);
}

table.data td.opp-cell {
  white-space: normal;
  min-width: 10rem;
}

.accomplishments-section {
  margin-top: -0.5rem;
}

.accomplishment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.accomplishment {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.accomplishment.acc-champion {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

.accomplishment.acc-finalist {
  background: #ede9fe;
  border-color: #7c3aed;
  color: #5b21b6;
}

.accomplishment.acc-placer {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1e40af;
}

.accomplishment.acc-qualifier {
  background: #ecfdf5;
  border-color: #059669;
  color: #047857;
}

/* Home page */
.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-hero {
  background: linear-gradient(135deg, #1a2744 0%, #2d3a5c 45%, #9b1b30 100%);
  color: #fff;
  padding: 3rem 1.5rem 3.5rem;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(155, 27, 48, 0.35) 0%, transparent 50%);
  pointer-events: none;
}

.home-hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.home-eyebrow {
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0 0 0.75rem;
}

.home-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.home-tagline {
  font-family: system-ui, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.6;
  opacity: 0.92;
  margin: 0 auto 1.25rem;
  max-width: 36rem;
}

.home-stats {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  margin: 0;
  padding: 0.45rem 1rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.home-main {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.home-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.5rem 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(26, 39, 68, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(26, 39, 68, 0.12);
  border-color: #c4cdd8;
}

.home-card-icon {
  width: 3rem;
  height: 3rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.home-card-icon svg {
  width: 100%;
  height: 100%;
}

.home-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.home-card p {
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 1.25rem;
  flex: 1;
}

.home-card-cta {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.home-card:hover .home-card-cta {
  color: var(--accent-hover);
}

.home-about {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
}

.home-about h2 {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.home-about p {
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.home-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.home-footer p {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 600px) {
  .home-hero {
    padding: 2.25rem 1.25rem 2.75rem;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }
}

/* State championship page */
.championship-head {
  margin-bottom: 1.5rem;
}

.championship-head .nav-links {
  margin-bottom: 0.75rem;
}

.champ-congrats {
  background: linear-gradient(135deg, #1a2744 0%, #2d3a5c 50%, #9b1b30 100%);
  color: #fff;
  border-radius: 10px;
  padding: 1.75rem 1.5rem 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.champ-congrats::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.1) 0%, transparent 45%);
  pointer-events: none;
}

.champ-congrats h2 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  position: relative;
}

.champ-congrats-lead {
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  opacity: 0.9;
  margin: 0 0 1.25rem;
  position: relative;
}

.champ-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  position: relative;
}

.champ-card {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border-radius: 8px;
  padding: 1rem 0.85rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.champ-card-weight {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.champ-card-crown {
  font-size: 1.25rem;
  color: #d97706;
  line-height: 1;
  margin: 0.2rem 0;
}

.champ-card-name {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.champ-card-name a {
  color: inherit;
  text-decoration: none;
}

.champ-card-name a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.champ-card-school {
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.3;
}

.home-card-featured {
  border-color: #d97706;
  background: linear-gradient(180deg, #fff 0%, #fffbeb 100%);
}

.champ-results h2 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--accent);
}

.weight-podium {
  margin-bottom: 1.75rem;
}

.weight-podium h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--accent);
}

.podium-table .place-cell {
  font-weight: 700;
  width: 4rem;
  white-space: nowrap;
}

.podium-table tr.podium-first {
  background: #fffbeb;
}

.podium-table tr.podium-first .place-cell {
  color: #92400e;
}

/* Wrestler statistics page + profile totals */
.stats-coverage {
  margin-bottom: 1rem;
}

.stats-coverage-box {
  background: #fff8e6;
  border: 1px solid #e8d4a8;
  padding: 1rem 1.25rem;
  font-family: system-ui, sans-serif;
  font-size: 0.92rem;
}

.stats-coverage-box p {
  margin: 0 0 0.5rem;
}

.stats-coverage-box p:last-child {
  margin-bottom: 0;
}

.stats-coverage-details {
  margin-top: 0.65rem;
  font-size: 0.88rem;
}

.stats-coverage-details summary {
  cursor: pointer;
  color: var(--link);
}

.stats-toolbar .field-grow {
  flex: 1 1 14rem;
  min-width: 12rem;
}

.stats-leaders,
.stats-search-results {
  margin-bottom: 2rem;
}

.stats-leaders h2,
.stats-search-results h2 {
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.stats-leader-table td.num,
table.data td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: system-ui, sans-serif;
}

.tw-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0;
  font-family: system-ui, sans-serif;
}

.tw-stat-item {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
}

.tw-stat-item dt {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.tw-stat-item dd {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
