:root {
  --ink: #1c1a17;
  --muted: #6e675d;
  --paper: #f4efe3;
  --paper-deep: #e6dcc6;
  --card: rgba(255, 252, 244, 0.82);
  --line: rgba(58, 49, 38, 0.16);
  --accent: #d94f27;
  --accent-dark: #7d2c1d;
  --teal: #0a6d73;
  --green: #566f31;
  --shadow: 0 24px 70px rgba(57, 43, 25, 0.18);
  --display: Georgia, "Times New Roman", serif;
  --body: "Avenir Next", "Gill Sans", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at 12% 14%, rgba(217, 79, 39, 0.18), transparent 26rem),
    radial-gradient(circle at 88% 6%, rgba(10, 109, 115, 0.18), transparent 28rem),
    linear-gradient(135deg, #f8f1e3 0%, #efe1c8 50%, #f7f0e0 100%);
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px);
  background-size: 13px 13px;
}

main {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.topbar, .results-head, .stats-strip, .team-card, .modal-card {
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 7px 0 0 var(--accent), inset -5px -4px 0 var(--teal);
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 252, 244, 0.58);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.ghost-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 252, 244, 0.92);
  box-shadow: 0 10px 24px rgba(57, 43, 25, 0.12);
}

.hero {
  padding: 8px 0 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 34px;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

h1 {
  max-width: 790px;
  font-size: clamp(48px, 8vw, 104px);
}

h2 {
  font-size: clamp(19px, 3vw, 34px);
}

.lead {
  max-width: 720px;
  margin: 24px 0 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.search-box {
  display: flex;
  max-width: 760px;
  padding: 7px;
  border: 1px solid rgba(28, 26, 23, 0.16);
  border-radius: 24px;
  background: rgba(255, 252, 244, 0.76);
  box-shadow: var(--shadow);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 16px 18px;
  color: var(--ink);
  font-size: 17px;
}

.search-box button, .submit-button {
  color: #fff7e8;
  background: var(--ink);
  border-radius: 18px;
  padding: 14px 20px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease;
}

.search-box button:hover, .submit-button:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quick-tags button, .tag {
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--accent-dark);
  background: rgba(217, 79, 39, 0.10);
  border: 1px solid rgba(217, 79, 39, 0.22);
  font-size: 13px;
  font-weight: 700;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 30px;
  background: linear-gradient(145deg, rgba(28, 26, 23, 0.95), rgba(69, 59, 42, 0.88));
  color: #fff7e8;
  box-shadow: var(--shadow);
}

.panel-ring {
  position: absolute;
  width: 310px;
  height: 310px;
  right: -70px;
  top: -58px;
  border: 34px solid rgba(217, 79, 39, 0.74);
  border-left-color: rgba(10, 109, 115, 0.7);
  border-radius: 50%;
  animation: orbit 18s linear infinite;
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

.panel-kicker {
  position: relative;
  margin-top: 210px;
  color: rgba(255, 247, 232, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero-panel strong {
  position: relative;
  display: block;
  font-family: var(--display);
  font-size: 82px;
  line-height: 1;
}

.hero-panel span {
  position: relative;
  display: block;
  max-width: 250px;
  color: rgba(255, 247, 232, 0.74);
  line-height: 1.7;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 34px 0 46px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--line);
}

.stats-strip article {
  padding: 22px;
  background: rgba(255, 252, 244, 0.58);
}

.stats-strip strong {
  display: block;
  font-family: var(--display);
  font-size: 28px;
}

.stats-strip span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 18px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.team-card {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 20px;
  background: var(--card);
  box-shadow: 0 20px 50px rgba(57, 43, 25, 0.1);
  animation: rise 520ms ease both;
}

@keyframes rise {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.radar-column {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
  position: relative;
}

.card-info {
  min-width: 0;
}

.card-title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: -0.04em;
}

.card-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.summary-list p {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid rgba(10, 109, 115, 0.34);
  color: #484139;
  line-height: 1.7;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.timeline-reset, .week-event-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(10, 109, 115, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--teal);
  background: rgba(10, 109, 115, 0.08);
  font-size: 13px;
  font-weight: 800;
}
.timeline-button {
  background: none;
  text-align: left;
  position: absolute;
  left: 0;
  bottom: 0;
  color: var(--muted);
}

.clock-icon, .broadcast-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

.toggle-glyph {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

button.open .toggle-glyph {
  transform: rotate(90deg);
}

.timeline-button:hover,
.week-event-toggle:hover {
  color: var(--teal);
}

.timeline-button.open {
  color: #ffbf51 !important;
}
.week-event-toggle.open {
  background: #e7feff;
}

.timeline-reset {
  color: var(--accent-dark);
  background: rgba(217, 79, 39, 0.08);
  border-color: rgba(217, 79, 39, 0.22);
}

.timeline-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(10, 109, 115, 0.18);
  border-radius: 20px;
  background: rgba(255, 252, 244, 0.55);
  grid-column: span 2;
}

.timeline-hint, .timeline-loading {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 8px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(10, 109, 115, 0.18);
}

.timeline-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.timeline-point {
  position: relative;
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 42px 10px 42px;
  color: var(--ink);
  background: none;
  text-align: left;
  border-bottom: 1px solid transparent;
}
button svg {
  pointer-events: none;
}

.timeline-point::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 15px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--paper);
}

.timeline-point:hover {
  border-bottom: 1px dashed var(--teal);
}

.timeline-point.active::before {
  background-color: #ffbf51;
}

.timeline-point span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.timeline-point strong {
  font-size: 14px;
}

.timeline-point small {
  color: var(--muted);
  font-size: 12px;
}

.week-event-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  padding: 6px 8px;
  color: var(--green);
  background: rgba(86, 111, 49, 0.11);
  border-color: rgba(86, 111, 49, 0.24);
}

.week-events {
  display: grid;
  width: min(520px, 96%);
  justify-self: center;
  gap: 10px;
  margin-left: 32px;
}
.week-events[hidden] {
  display: none;
}

.major-event {
  padding: 12px;
  border-top: 1px solid rgba(86, 111, 49, 0.16);
  background: rgba(255, 252, 244, 0.62);
  margin-bottom: 1em;
}

.major-event time {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.major-event p {
  margin: 0;
  color: #484139;
  line-height: 1.7;
}

.major-event small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.major-event a {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.major-event a:hover {
  text-decoration: underline;
}

.empty-state {
  margin: 50px 0;
  padding: 24px;
  border: 1px dashed rgba(28, 26, 23, 0.24);
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(28, 26, 23, 0.46);
}

.modal-shell[open] {
  display: grid;
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(840px, 92vh);
  overflow: auto;
  border: 1px solid rgba(255, 252, 244, 0.42);
  border-radius: 32px;
  padding: 28px;
  background: rgba(248, 241, 227, 0.94);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.32);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.modal-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 42px;
  letter-spacing: -0.05em;
}

.close-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(28, 26, 23, 0.08);
  color: var(--ink);
  font-size: 22px;
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.form-grid label.full {
  grid-column: 1 / -1;
}

.form-grid input, .form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.82);
  color: var(--ink);
  outline: 0;
  padding: 13px 14px;
}

.form-grid textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}

.status-line {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .hero-grid, .team-grid, .team-card, .stats-strip {
    grid-template-columns: 1fr;
  }
  .hero-panel {
    min-height: 300px;
  }
  .panel-kicker {
    margin-top: 130px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
