/* Base layout */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
}

.sports-navbar {
  background-color: #111a17;
}

.sports-navbar :focus-visible {
  outline: 2px solid #e9b547;
  outline-offset: 2px;
}

/* Use the sports theme on the home and comparison pages. */
body:has(.betting-home),
body:has(.betting-page),
body:has(#teamComparisonForm) {
  background-color: #0d141b;
}

body:has(.betting-home) .navbar,
body:has(.betting-page) .navbar,
body:has(#teamComparisonForm) .navbar {
  background-color: #111a17 !important;
  border-color: #35443b !important;
}

body:has(.betting-home) .navbar .navbar-brand,
body:has(.betting-home) .navbar .nav-link,
body:has(.betting-page) .navbar .navbar-brand,
body:has(.betting-page) .navbar .nav-link,
body:has(#teamComparisonForm) .navbar .navbar-brand,
body:has(#teamComparisonForm) .navbar .nav-link {
  color: #f4f7f5 !important;
}

body:has(.betting-home) .navbar .nav-link:hover,
body:has(.betting-page) .navbar .nav-link:hover,
body:has(#teamComparisonForm) .navbar .nav-link:hover {
  color: #b9fa56 !important;
}

body:has(.betting-home) .navbar-toggler,
body:has(.betting-page) .navbar-toggler,
body:has(#teamComparisonForm) .navbar-toggler {
  border-color: #b9fa56;
}

body:has(.betting-home) .navbar-toggler-icon,
body:has(.betting-page) .navbar-toggler-icon,
body:has(#teamComparisonForm) .navbar-toggler-icon {
  filter: invert(1);
}

body:has(.betting-home) footer,
body:has(.betting-page) footer,
body:has(#teamComparisonForm) footer {
  color: #d9e1dc !important;
  border-color: #35443b !important;
}

body:has(.betting-home) footer a,
body:has(.betting-page) footer a,
body:has(#teamComparisonForm) footer a {
  color: #b9fa56;
}

/* Home and comparison page outer panels. */
.betting-home,
.betting-page {
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #27343e;
  border-radius: 1rem;
  color: #f4f7f5;
  background: #0d141b;
  box-shadow: 0 1rem 3rem rgb(10 20 16 / 18%);
}

/* Home page hero */
.matchup-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 4rem);
  border: 1px solid #35433d;
  border-top: 4px solid #b9fa56;
  border-radius: 0.75rem;
  background:
    linear-gradient(90deg, transparent 49.8%, rgb(255 255 255 / 7%) 50%, transparent 50.2%),
    radial-gradient(ellipse at 15% 0%, rgb(163 255 18 / 13%), transparent 38%),
    linear-gradient(125deg, #111d1a, #15271f 58%, #1b3026);
}

.matchup-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 59px,
    rgb(255 255 255 / 7%) 60px,
    transparent 62px
  );
  content: "";
  pointer-events: none;
}

.matchup-hero__content,
.intel-panel {
  position: relative;
  z-index: 1;
}

.matchup-kicker {
  margin: 0 0 0.8rem;
  color: #b9fa56;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.matchup-kicker span {
  padding-inline: 0.3rem;
  color: #e9b547;
}

.matchup-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.98;
  text-transform: uppercase;
}

.matchup-hero h1 span {
  color: #b9fa56;
}

.matchup-hero__description {
  max-width: 42rem;
  margin: 1.4rem 0 1.7rem;
  color: #d9e1dc;
  font-size: 1.05rem;
  line-height: 1.7;
}

.matchup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
}

.matchup-button {
  padding: 0.85rem 1.15rem;
  border: 2px solid #b9fa56;
  border-radius: 0.35rem;
  color: #101710;
  background: #b9fa56;
  font-weight: 900;
  text-transform: uppercase;
}

.matchup-button:hover {
  border-color: #d0ff8b;
  color: #101710;
  background: #d0ff8b;
}

.matchup-secondary-link {
  color: #f4f7f5;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.matchup-secondary-link:hover {
  color: #b9fa56;
}

.matchup-note {
  margin: 1.25rem 0 0;
  color: #c2ccc5;
  font-size: 0.82rem;
}

/* Home page matchup information panel */
.intel-panel {
  padding: 1.35rem;
  border: 1px solid #49574e;
  border-top: 4px solid #b9fa56;
  border-radius: 0.5rem;
  background: #111a17;
  box-shadow: 0 0.8rem 2rem rgb(0 0 0 / 24%);
}

.intel-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
  color: #b9fa56;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.intel-panel__status {
  padding: 0.25rem 0.45rem;
  border: 1px solid #526343;
  border-radius: 0.2rem;
  color: #d9e1dc;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.intel-panel h2 {
  margin-bottom: 1rem;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 850;
  text-transform: uppercase;
}

.intel-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid #35413a;
}

.intel-row__number {
  color: #e9b547;
  font-size: 0.75rem;
  font-weight: 900;
}

.intel-row__label {
  color: #e6ece8;
  font-size: 0.9rem;
  font-weight: 650;
}

.intel-row__indicator {
  color: #b9fa56;
  font-size: 0.55rem;
}

.intel-panel__footer {
  margin: 1rem 0 0;
  color: #c2ccc5;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Home page tool cards */
.matchup-tools {
  padding-top: 2rem;
}

.matchup-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.matchup-section-heading .matchup-kicker {
  margin-bottom: 0.4rem;
}

.matchup-section-heading h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.matchup-section-mark {
  color: #aab7ae;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.35rem;
  border: 1px solid #38443d;
  border-top: 3px solid #b9fa56;
  border-radius: 0.5rem;
  background: linear-gradient(145deg, #17211c, #111a16);
}

.tool-card__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.tool-card__category {
  color: #b9fa56;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.tool-card__number {
  color: #e9b547;
  font-size: 0.8rem;
  font-weight: 900;
}

.tool-card h3 {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 850;
  text-transform: uppercase;
}

.tool-card > p {
  flex: 1;
  color: #cbd4ce;
  line-height: 1.7;
}

.tool-card__link {
  color: #c7f58a;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.tool-card__link:hover {
  color: #e1ffc0;
}

.matchup-hero a:focus-visible,
.tool-card a:focus-visible {
  outline: 3px solid #e9b547;
  outline-offset: 4px;
}

/* Shared saved-comparison and comparison-page heading */
.betting-page__header {
  margin-bottom: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid #35433d;
  border-top: 4px solid #b9fa56;
  border-radius: 0.75rem;
  background:
    radial-gradient(ellipse at 15% 0%, rgb(163 255 18 / 13%), transparent 38%),
    linear-gradient(125deg, #111d1a, #15271f 58%, #1b3026);
}

.betting-page__kicker {
  margin: 0 0 0.7rem;
  color: #b9fa56;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.betting-page__kicker span {
  color: #e9b547;
}

.betting-page__header h1 {
  margin: 0 0 0.75rem;
  color: #fff;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
}

.betting-page__header > p:last-child {
  margin: 0;
  color: #d9e1dc;
}

/* Empty saved-comparisons message */
.betting-empty {
  padding: 2rem;
  border: 1px solid #38443d;
  border-top: 3px solid #b9fa56;
  border-radius: 0.5rem;
  color: #cbd4ce;
  background: linear-gradient(145deg, #17211c, #111a16);
}

.betting-empty h2 {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 850;
  text-transform: uppercase;
}

.betting-empty p {
  margin: 0;
}

/* Saved-comparisons table */
.betting-table {
  --bs-table-bg: #111a17;
  --bs-table-color: #f4f7f5;
  --bs-table-striped-bg: #17211c;
  --bs-table-striped-color: #f4f7f5;
  --bs-table-border-color: #35443b;

  border: 1px solid #35443b;
}

.betting-page .betting-table tbody tr > * {
  color: #f4f7f5 !important;
  background-color: #111a17 !important;
}

.betting-page .betting-table tbody tr:nth-of-type(even) > * {
  background-color: #17211c !important;
}

.betting-page .betting-table thead th {
  color: #b9fa56 !important;
  background-color: #17211c !important;
  text-transform: uppercase;
}

.betting-matchup {
  color: #f4f7f5 !important;
  font-size: 1.05rem;
  font-weight: 800;
}

.betting-matchup__versus {
  margin: 0 0.5rem;
  color: #b9fa56;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

/* Shared comparison buttons */
.betting-row-actions,
.betting-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.betting-action {
  border: 1px solid #647269;
  color: #f4f7f5;
  background: #17211c;
  font-weight: 800;
}

.betting-action:hover {
  border-color: #b9fa56;
  color: #b9fa56;
  background: #17211c;
}

.betting-action--view,
.betting-button {
  border: 1px solid #b9fa56;
  color: #101710;
  background: #b9fa56;
  font-weight: 850;
}

.betting-action--view:hover,
.betting-button:hover {
  border-color: #d0ff8b;
  color: #101710;
  background: #d0ff8b;
}

.betting-button--secondary {
  border: 1px solid #647269;
  color: #f4f7f5;
  background: #17211c;
  font-weight: 800;
}

.betting-button--secondary:hover {
  border-color: #b9fa56;
  color: #b9fa56;
  background: #17211c;
}

.betting-page__actions {
  margin-top: 1.25rem;
}

/* Compare Teams form */
body:has(#teamComparisonForm) main > h1 {
  margin-bottom: 0.5rem;
  color: #fff;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
}

body:has(#teamComparisonForm) main > p {
  margin-bottom: 1.5rem;
  color: #cbd4ce;
}

#teamComparisonForm {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid #35433d;
  border-top: 4px solid #b9fa56;
  border-radius: 0.75rem;
  background:
    radial-gradient(ellipse at 15% 0%, rgb(163 255 18 / 10%), transparent 38%),
    linear-gradient(145deg, #17211c, #111a16);
}

#teamComparisonForm .form-label {
  color: #f4f7f5;
  font-weight: 800;
}

#teamComparisonForm .form-select {
  min-height: 3rem;
  border-color: #49574e;
  color: #f4f7f5;
  background-color: #111a17;
}

#teamComparisonForm .form-select:focus {
  border-color: #b9fa56;
  box-shadow: 0 0 0 0.2rem rgb(185 250 86 / 20%);
}

#teamComparisonForm button,
#saveComparisonForm button {
  border: 1px solid #b9fa56;
  color: #101710;
  background: #b9fa56;
  font-weight: 900;
  text-transform: uppercase;
}

#teamComparisonForm button:hover,
#saveComparisonForm button:hover {
  border-color: #d0ff8b;
  color: #101710;
  background: #d0ff8b;
}

/* Compare page status messages */
#comparisonMessage.alert-success {
  border-color: #526343;
  color: #e6ece8;
  background: #17211c;
}

#comparisonMessage.alert-warning {
  border-color: #8d7947;
  color: #f4e4b6;
  background: #292417;
}

#comparisonMessage.alert-danger {
  border-color: #7d4c4c;
  color: #f1cccc;
  background: #29191b;
}

/* Comparison results table, created by the page's JavaScript */
#comparisonResults table {
  --bs-table-bg: #111a17;
  --bs-table-color: #f4f7f5;
  --bs-table-striped-bg: #17211c;
  --bs-table-striped-color: #f4f7f5;
  --bs-table-border-color: #35443b;

  border-color: #35443b;
}

#comparisonResults table thead th {
  color: #b9fa56 !important;
  background-color: #17211c !important;
}

#comparisonResults table tbody tr > * {
  color: #f4f7f5 !important;
  background-color: #111a17 !important;
}

#comparisonResults table tbody tr:nth-of-type(even) > * {
  background-color: #17211c !important;
}

#saveComparisonForm {
  padding: 1rem;
  border: 1px solid #38443d;
  border-left: 3px solid #b9fa56;
  border-radius: 0.5rem;
  background: #111a17;
}

body:has(#teamComparisonForm) main > a.btn {
  margin-top: 1rem;
  border: 1px solid #647269;
  color: #f4f7f5;
  background: #17211c;
  font-weight: 800;
}

body:has(#teamComparisonForm) main > a.btn:hover {
  border-color: #b9fa56;
  color: #b9fa56;
}

/* Visible keyboard focus on dark pages */
.betting-page a:focus-visible,
.betting-page button:focus-visible,
#teamComparisonForm a:focus-visible,
#teamComparisonForm button:focus-visible,
#teamComparisonForm select:focus-visible,
#saveComparisonForm button:focus-visible {
  outline: 3px solid #e9b547;
  outline-offset: 3px;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .betting-home,
  .betting-page {
    padding: 0.75rem;
  }

  .matchup-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.35rem;
  }

  .matchup-hero h1 {
    font-size: clamp(2.4rem, 12vw, 3.5rem);
  }

  .matchup-section-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .betting-page__header {
    padding: 1.25rem;
  }
}

/* Honor reduced-motion preferences. */
@media (prefers-reduced-motion: no-preference) {
  .tool-card,
  .matchup-button {
    transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
  }

  .tool-card:hover {
    transform: translateY(-3px);
    border-color: #6f8d50;
  }
}

/* Prediction forms use the home page's dark panel style. */
.prediction-form-panel {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid #35433d;
  border-top: 4px solid #b9fa56;
  border-radius: 0.75rem;
  color: #f4f7f5;
  background: linear-gradient(145deg, #17211c, #111a16);
}

.prediction-form-panel .form-label,
.prediction-form-panel legend {
  color: #f4f7f5;
  font-weight: 800;
}

.betting-control {
  border-color: #49574e;
  color: #f4f7f5;
  background-color: #111a17;
}

.betting-control:focus {
  border-color: #b9fa56;
  color: #fff;
  background-color: #111a17;
  box-shadow: 0 0 0 0.2rem rgb(185 250 86 / 20%);
}

.prediction-team-choice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.6rem 0;
  color: #d9e1dc;
}

.prediction-team-choice .form-check-input {
  border-color: #647269;
  background-color: #111a17;
}

.prediction-team-choice .form-check-input:checked {
  border-color: #b9fa56;
  background-color: #6f8d50;
}

.prediction-form-note {
  color: #aab7ae;
  font-size: 0.9rem;
}

.prediction-validation,
.prediction-status {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #526343;
  border-radius: 0.4rem;
  color: #e6ece8;
  background: #17211c;
}

.prediction-validation:empty {
  display: none;
}

.prediction-result {
  color: #aab7ae;
  font-weight: 800;
}

.prediction-result--correct {
  color: #b9fa56;
}

.prediction-result--incorrect {
  color: #e9b547;
}

.account-validation.validation-summary-valid {
  display: none;
}

.account-validation.validation-summary-errors {
  margin-bottom: 1rem;
}

.account-panel :is(a, button, input):focus-visible {
  outline: 2px solid #154985;
  outline-offset: 2px;
}
