/* ============================================================
   SAWD FEVER — design tokens
   Grounded in the mascot: a dachshund bent into an S, rust body,
   gold chain collar, on deep pine green. Poster/fight-card feel.
   ============================================================ */

:root {
  --pine:        #1f4b3f;   /* deep green — base background */
  --pine-dark:   #16342b;   /* recessed panels / cards */
  --pine-darker: #0f2621;   /* deepest shadow surfaces */
  --rust:        #c1502e;   /* mascot body — primary accent */
  --rust-dark:   #8b3a1e;   /* mascot outline — borders, pressed states */
  --gold:        #e8a63d;   /* chain collar — highlights, CTA */
  --gold-bright: #f4c169;
  --cream:       #f1ede3;   /* primary text on dark */
  --cream-dim:   #c8cfc7;   /* secondary text on dark */

  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-body: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --radius: 10px;
  --chain-size: 22px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--pine);
  color: var(--cream);
  font-family: var(--font-body);
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(ellipse at 70% -10%, rgba(232, 166, 61, 0.10), transparent 45%),
    radial-gradient(ellipse at 100% 0%, rgba(193, 80, 46, 0.12), transparent 40%);
}

a { color: var(--gold-bright); }

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

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-stats {
  max-width: 1240px;
}

/* ---------- Header / masthead ---------- */

.masthead {
  border-bottom: 4px solid var(--rust-dark);
  background: linear-gradient(180deg, var(--pine-dark), var(--pine));
  padding: 28px 0 22px;
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.masthead-logo {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: var(--pine-darker);
  object-fit: cover;
}

.masthead-text .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 4px;
}

.masthead-text h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 54px);
  letter-spacing: 0.02em;
  line-height: 0.95;
  margin: 0;
  color: var(--cream);
  text-shadow: 2px 3px 0 var(--rust-dark);
}

.masthead-text .tagline {
  margin: 6px 0 0;
  color: var(--cream-dim);
  font-size: 14px;
}

/* ---------- Chain-link divider (the signature element) ---------- */

.chain-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--chain-size);
  margin: 0;
  overflow: hidden;
  user-select: none;
}

.chain-divider span {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  margin: 0 -4px;
  transform: rotate(0deg);
}

.chain-divider span:nth-child(even) { transform: rotate(90deg); border-color: var(--gold-bright); }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 10px;
  margin: 26px 0 18px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 2px solid var(--rust-dark);
  border-radius: var(--radius);
  background: var(--pine-dark);
  color: var(--cream-dim);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.tab-btn:hover { color: var(--cream); }

.tab-btn.active {
  background: var(--rust);
  border-color: var(--gold);
  color: var(--cream);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 var(--rust-dark);
}

.view { display: none; }
.view.active { display: block; }

/* ---------- Cards / panels ---------- */

.panel {
  background: var(--pine-dark);
  border: 2px solid var(--rust-dark);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  font-size: 22px;
  margin: 0 0 14px;
  color: var(--gold-bright);
}

/* ---------- Filter bar ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-bar input {
  flex: 1;
  min-width: 180px;
  background: var(--pine-darker);
  border: 2px solid var(--rust-dark);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--cream);
  font-size: 14px;
}

.filter-bar input::placeholder { color: var(--cream-dim); }
 
.events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(193, 80, 46, 0.28);
  border-radius: var(--radius);
  background: rgba(15, 38, 33, 0.35);
}
 
.events-list strong {
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
 
.event-link-item {
  width: 100%;
}
 
.event-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--pine-darker);
  border: 1px solid rgba(193, 80, 46, 0.24);
  color: var(--cream);
  text-decoration: none;
}
 
.event-link:hover {
  color: var(--gold-bright);
  border-color: rgba(232, 166, 61, 0.45);
}
 
/* ---------- Results (card list, works down to mobile) ---------- */

.results-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--cream-dim);
}

.results-empty .empty-headline {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.match-card {
  border: 2px solid var(--rust-dark);
  border-radius: var(--radius);
  background: var(--pine-darker);
  padding: 14px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.match-card:hover {
  border-color: var(--gold-bright);
  background: var(--pine-dark, var(--pine-darker));
}

.match-card .row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream-dim);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.match-card .weight-pill {
  background: var(--rust);
  color: var(--cream);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
}

.matchup {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  flex-wrap: wrap;
}

.matchup .contestants {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.matchup .name { font-weight: 600; }
.matchup .name.winner { color: var(--gold-bright); }
.matchup .champ-tag {
  margin-left: 4px;
  color: var(--cream-dim);
  font-size: 12px;
  font-weight: 400;
}
.matchup .vs { color: var(--cream-dim); font-family: var(--font-mono); font-size: 12px; }

.match-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--cream-dim);
  font-family: var(--font-mono);
}

.match-notes {
  margin-top: 8px;
  font-size: 14px;
  color: var(--cream-dim);
  font-style: italic;
}

.match-card .row-actions {
  margin-top: 10px;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--cream-dim);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover { color: var(--gold-bright); }

/* ---------- Form ---------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .full { grid-column: 1 / -1; }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 6px;
}

.required-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(232, 166, 61, 0.16);
  color: var(--gold-bright);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--pine-darker);
  border: 2px solid var(--rust-dark);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--cream);
  font-size: 15px;
}

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

.winner-choice {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.winner-choice label.pick {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--rust-dark);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  color: var(--cream);
  margin-bottom: 0;
}

.winner-choice input[type="radio"] { accent-color: var(--gold); width: 16px; height: 16px; }

.submit-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-primary {
  background: var(--rust);
  border: 2px solid var(--gold);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.03em;
  padding: 12px 26px;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--rust-dark);
  transition: transform 0.1s ease;
}

.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--rust-dark); }

.form-status {
  font-size: 14px;
  font-family: var(--font-mono);
}

.form-status.error { color: #ff8a70; }
.form-status.ok { color: var(--gold-bright); }

/* ---------- Statistics page ---------- */

.page-links {
  margin: 18px 0 8px;
}

.page-links a {
  color: var(--gold-bright);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.page-links a:hover {
  text-decoration: underline;
}

.stats-help {
  color: var(--cream-dim);
  font-size: 14px;
  margin: 6px 0 12px;
}

.stats-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.btn-secondary {
  background: var(--pine-darker);
  border: 2px solid var(--rust-dark);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

.btn-secondary:hover {
  color: var(--gold-bright);
}

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

.stats-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.stats-table th,
.stats-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(193, 80, 46, 0.28);
  text-align: left;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.stats-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gold-bright);
  line-height: 1.3;
}

/* Wrestler name column gets more room than the numeric stat columns */
.stats-table th:first-child,
.stats-table td:first-child {
  width: 22%;
}

@media (max-width: 640px) {
  .stats-table th,
  .stats-table td {
    padding: 8px 5px;
    font-size: 12px;
  }
  .stats-table th {
    font-size: 10px;
  }
}

.stats-table td {
  color: var(--cream);
}

.stats-wrestler-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  color: var(--gold-bright);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.stats-wrestler-toggle:hover {
  color: var(--cream);
}

.stats-toggle-indicator {
  display: inline-block;
  width: 12px;
  text-align: center;
  font-family: var(--font-mono);
}

.stats-leader-row {
  background: rgba(232, 166, 61, 0.12);
  box-shadow: inset 0 0 0 1px rgba(232, 166, 61, 0.24);
}

.stats-detail-row td {
  padding: 0 12px 12px;
  white-space: normal;
}

.stats-detail-panel {
  padding: 12px 14px;
  border: 1px solid rgba(193, 80, 46, 0.25);
  border-radius: var(--radius);
  background: rgba(15, 38, 33, 0.45);
}

.stats-detail-title {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.stats-match-item {
  padding: 10px 0;
  border-top: 1px solid rgba(193, 80, 46, 0.22);
}

.stats-match-item:first-child {
  border-top: none;
  padding-top: 0;
}

.stats-match-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 14px;
}

.stats-match-head span {
  color: var(--cream-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.stats-match-meta {
  font-size: 13px;
  color: var(--cream-dim);
  margin-top: 3px;
}

.stats-match-notes {
  margin-top: 6px;
  color: var(--cream);
  font-size: 13px;
}

.stats-match-empty {
  color: var(--cream-dim);
  font-size: 13px;
}

.sort-btn {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sort-btn:hover {
  color: var(--gold-bright);
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 30px 0 50px;
  color: var(--cream-dim);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ---------- Event video embed ---------- */

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 2px solid var(--rust-dark);
  margin-bottom: 12px;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.event-video-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.event-video-form input[type="url"] {
  flex: 1;
  min-width: 220px;
  background: var(--pine-darker);
  border: 2px solid var(--rust-dark);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--cream);
  font-size: 15px;
}

/* ---------- Event match reordering ---------- */

.reorder-hint {
  font-size: 12px;
  color: var(--cream-dim);
  margin: -4px 0 10px;
}

.reorder-controls {
  display: inline-flex;
  gap: 4px;
  margin-right: auto;
}

.reorder-controls .link-btn {
  font-size: 15px;
  text-decoration: none;
  border: 2px solid var(--rust-dark);
  border-radius: var(--radius);
  width: 26px;
  height: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reorder-controls .link-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.reorder-controls .link-btn:disabled:hover {
  color: var(--cream-dim);
}
