@font-face {
  font-family: "SukarBlack"; /* The name you'll use in CSS */
  src: url("/fonts/SukarRegular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:SukarBlack;
}
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;   /* stop sideways scrolling */
  width: 100%; 
}

.page-bg {
  position: fixed; /* default for non-iOS */
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; /* only needs to cover viewport */
  background:
    linear-gradient(180deg, #ffffffab 15%, #000000ad 60%),
    url(/images/horseRacingBackground.webp) center / cover no-repeat;
  z-index: -1;
  will-change: transform;
}


.container {
  max-width: 1000px;
  min-width: 375px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 5px;
  padding: 30px;
  border-radius: 20px;
}

.header p {
  color: #7f8c8d;
  font-size: 1.1em;
  margin-bottom: 15px;
}

#headerLogo {
  width: 100%;
  height: 6rem;
  background-image: url("/images/TTHLogoTextTransparent.png");
  background-repeat: no-repeat;
  background-size: contain; /* better for logos */
  background-position: center;
  margin-top: -40px;
  scale: 1.5;
}

/* If screen width is 600px or more */
@media (min-width: 600px) {
  #headerLogo {
    transform: scale(1.75);
    transform-origin: center; /* keeps it scaling from the middle */
    margin-bottom: 1rem;
    margin-top: -10px;
  }
  .generation-info {
    margin-top: 40px!important;
  }
}

.iosInstructions {
    background-color: #F3F2F0;
    width: 50%;
    border-radius: 10px;
    padding: 6px;
    justify-items: center;
    justify-self: center;
    margin-bottom: 20px;
    display:none;
}
.installBtn {
  background: #1e5631;
  color: white;
  display: none;
  width: -webkit-fill-available;
  height: 40px;
}
.generation-info {
  border-radius: 10px;
  font-size: 1em;
  margin-top: 20px;
}

.generation-info h1 {
  font-size: 1.1em;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.nav-tab{
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  width: 49%;
}

.nav-tab.active {
  background: #1e5631;
  color: white;
  transform: translateY(-2px);
}

.nav-tab:hover {
  transform: translateY(-2px);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  align-content: center;
}

.stat-number {
  font-size: 2em;
  font-weight: bold;
  color: #1e5631;
  margin-bottom: 5px;
}

.stat-label, #kennyGExplanation {
  color: #1e5631;
  font-size: 1em;
}

.race-card,
.prediction-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.race-card:hover,
.prediction-card:hover {
  transform: translateY(-3px);
}

.race-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #ecf0f1;
  flex-wrap: wrap;
  gap: 10px;
}

.race-title {
  flex: 1;
  min-width: 300px;
}

.racecourse {
  font-size: 1.8em;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 5px;
}

.race-details {
  font-size: 0.9em;
  color: #7f8c8d;
}

.race-info {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.race-time {
  background: #1e5631;
  color: white;
  padding: 3px 13px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1.3em;
}

.race-distance {
  color: black;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 1em;
}

.race-class {
  /*background: #f39c12;*/
  color: black;
  /*padding: 6px 12px;*/
  border-radius: 5px;
  font-size: 1em;
}

.prediction-section {
  margin-top: 20px;
}

.prediction-header {
  display: flex;
  /*justify-content: space-between;*/
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.prediction-title {
  font-size: 1.4em;
  font-weight: bold;
  color: #27ae60;
}

.confidence-badge {
  /*background: linear-gradient(45deg, #e74c3c, #c0392b);*/
  color: #757575;
  /*padding: 8px 16px;*/
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.8em;
}

#kennyGStamp {
  width: 70px;
  scale: 1.3;
}
.winner-info {
  background: linear-gradient(45deg, #27ae60, #27a35c);
  color: white;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0px 0px 6px 3px #b86e2bad;
}

.horse-name {
  font-size: 1.8em;
  font-weight: bold;
  margin-bottom: 8px;
  border-bottom: 2px solid #fbfbfb78;
}

.horse-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  font-size: 1em;
  opacity: 1;
}

.analysis-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
  display: none;
}

.factor-score {
  background: rgba(255, 255, 255, 0.2);
  padding: 5px;
  border-radius: 8px;
  text-align: center;
}

.factor-name {
  font-size: 0.8em;
  opacity: 0.8;
  margin-bottom: 5px;
}

.factor-value {
  font-size: 1.2em;
  font-weight: bold;
}

.runners-preview {
  margin-top: 15px;
}

.runners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.runner-item {
  background: #f8f9fa;
  padding: 8px;
  border-radius: 8px;
  border-left: 4px solid #ddd;
}

.runner-item.winner {
  border-left-color: #27ae60;
  background: #d5f4e6;
}

.runner-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.runner-details {
  font-size: 0.85em;
  color: #666;
}

.loading {
  text-align: center;
  padding: 40px;
  color: white;
  font-size: 1.2em;
}
.error {
  background: rgba(231, 76, 60, 0.9);
  color: white;
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  margin-bottom: 20px;
}

.no-data {
  background: rgba(255, 255, 255, 0.9);
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  color: #7f8c8d;
}

@media (max-width: 600px) {
  .race-header {
    flex-direction: column;
  }

  .race-info {
    justify-content: center;
  }

  .analysis-breakdown {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-tabs {
    flex-direction: column;
    align-items: center;
  }
  .nav-tab, .installBtn {
    width: -webkit-fill-available;
  }
  #kennyGStamp {
  width: 50px;
  }
  .prediction-title {
    font-size:1em;
  }
  .iosInstructions {
    width: -webkit-fill-available;
  }
}
