/* ============================================================
   ETPC Tractor Pulling Results
   Theme matched to tractorpulling.com (FoundationPress / app.css)
   Colors: Red #E1363A | Blue #1381C4 | Dark #0a0a0a | White #fefefe
   ============================================================ */

/* Google Fonts — Oswald (headings/nav) + Open Sans (body) */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Open+Sans:wght@400;600;700&display=swap');

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red:       #E1363A;
  --red-dark:  #c61e22;
  --blue:      #1381C4;
  --blue-dark: #0e6296;
  --dark:      #0a0a0a;
  --gray-100:  #f1f1f1;
  --gray-200:  #e6e6e6;
  --gray-300:  #cacaca;
  --gray-600:  #8a8a8a;
  --gray-800:  #333333;
  --white:     #fefefe;
  --font-primary:   "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-heading:   "Oswald", "Impact", "Arial Narrow", sans-serif;
  --shadow:    0 2px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.25);
}

html { font-size: 100%; }

body {
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  /* ETPC subtle diagonal stripe background */
  background: repeating-linear-gradient(
    135deg,
    #FFFFFF,  #FFFFFF  10px,
    #fbfbfb 10px, #fbfbfb 20px
  );
  color: var(--dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blue);
  text-decoration: none;
  line-height: inherit;
}
a:hover, a:focus {
  color: var(--blue-dark);
  text-decoration: underline;
}

img { max-width: 100%; height: auto; display: inline-block; }

/* ---------- Layout Containers ---------- */
.main-container {
  padding-right: 0.9375rem;
  padding-left:  0.9375rem;
  max-width: 75rem;
  margin: 0 auto;
}

.container {
  max-width: 75rem;
  margin:  0 auto;
  padding: 0 0.9375rem;
}

/* ==========================================================
   SITE HEADER — ETPC Red Top-Bar
   ========================================================== */
.site-header {
  background-color: var(--red);
  color: #FFFFFF;
  z-index: 9999;
  position: relative;
}

/* Foundation-style top-bar */
.top-bar {
  background-color: var(--red);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.9375rem;
  max-width: 75rem;
  margin: 0 auto;
}

.top-bar, .top-bar ul { background-color: var(--red); }
.top-bar-left  { flex: 1 1 auto; }
.top-bar-right { flex: 0 0 auto; }

.site-desktop-title a,
.site-desktop-title span {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #FFFFFF;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 1rem 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  line-height: 1;
}
.site-desktop-title a:hover { text-decoration: none; color: #FFFFFF; }

/* ===== LOGO BANNER (below nav) ===== */
.logo-banner {
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 20px 24px;
  border-bottom: 4px solid #E1363A;
}
.logo-banner a { display: block; line-height: 0; }
.logo-banner-img {
  height: auto;
  width: auto;
  max-height: 180px;
  max-width: 560px;
  display: block;
}

/* Desktop nav menu */
.desktop-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.desktop-menu li { display: block; }
.desktop-menu > li > a {
  color: #e6e6e6;
  padding: 1rem;
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  letter-spacing: 0.5px;
  transition: background-color 0.2s;
}
.desktop-menu > li > a:hover,
.desktop-menu > li.active > a {
  background-color: #42525D;
  text-decoration: none;
  color: #FFFFFF;
}

/* ==========================================================
   HERO / FRONT-HERO — clipped diagonal bottom like ETPC
   ========================================================== */
.front-hero {
  background-color: #14141f;
  background-size: cover;
  background-position: center bottom;
  padding: 4.5rem 0 5rem;
  position: relative;
  text-align: left;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 59px), 0px 100%);
  margin-bottom: -20px;
}

.front-hero .marketing {
  padding-right: 0.9375rem;
  padding-left:  0.9375rem;
  max-width: 55rem;
  margin: 0 auto;
}

.slide_title {
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 3.4rem;
  text-transform: uppercase;
  font-weight: 700;
  text-shadow: 0px 4px 3px rgba(0,0,0,0.4), 0px 8px 13px rgba(0,0,0,0.1);
  line-height: 1.05;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
}

.slide_description {
  color: #FFFFFF;
  font-size: 1.15rem;
  font-weight: 700;
  text-shadow: 0px 4px 3px rgba(0,0,0,0.4);
}

.slider_read_more { margin-top: 1rem; }
.slider_read_more a {
  background-color: var(--red);
  color: #FFFFFF;
  padding: 10px 20px;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s;
}
.slider_read_more a:hover {
  background-color: var(--red-dark);
  text-decoration: none;
}

@media screen and (max-width: 39.9375em) {
  .front-hero { padding: 2.5rem 0 4rem; }
  .slide_title { font-size: 2rem; }
}

/* ==========================================================
   AFTER-HEADER BLOCKS — cards overlapping hero
   ========================================================== */
.after_header_blocks_section {
  margin-top: -80px;
  position: relative;
  z-index: 10;
  padding-bottom: 20px;
}

.after_header_blocks {
  padding-right: 0.9375rem;
  padding-left:  0.9375rem;
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  flex-flow: row wrap;
  z-index: 2;
  position: relative;
}

.after_header_block {
  flex: 1 1 260px;
  padding: 0 15px;
  padding-bottom: 15px;
}

.after_header_block .block_title {
  background-color: var(--blue);
  color: #FFFFFF;
  font-weight: bold;
  padding: 15px;
  text-align: center;
  font-size: 1.6rem;
  text-transform: uppercase;
  min-height: 100px;
  display: table;
  width: 100%;
}

.after_header_block .block_title span {
  display: table-cell;
  vertical-align: middle;
}

.after_header_block .block_description {
  background-color: #ECEDED;
  padding: 15px;
  font-size: 0.92rem;
}

.after_header_block .block_read_more {
  margin-top: 10px;
  text-align: right;
}

.after_header_block .block_read_more a {
  background-color: var(--blue);
  color: #FFFFFF;
  font-weight: bold;
  padding: 5px 10px;
  border-bottom: 2px solid var(--blue-dark);
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s, border-color 0.3s;
}
.after_header_block .block_read_more a:hover {
  background-color: var(--red);
  border-bottom-color: var(--red-dark);
  text-decoration: none;
}

/* ==========================================================
   ANGLED DIVIDERS
   ========================================================== */
.section-line-blue {
  width: 100%;
  height: 85px;
  clip-path: polygon(0 59.5px, 100% 0, 100% calc(100% - 59px), 0px 100%);
  background-color: rgba(19, 129, 196, 0.7);
  margin-top: 20px;
}

.section-line-red {
  width: 100%;
  height: 85px;
  clip-path: polygon(0 59.5px, 100% 0, 100% calc(100% - 59px), 0px 100%);
  background-color: rgba(225, 54, 58, 0.7);
  margin-top: -59.5px;
}

/* ==========================================================
   SECTION TITLES — ETPC large uppercase
   ========================================================== */
.section_title {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 95px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
  display: block;
  line-height: 1;
}
.section_title.section_title_blue { color: var(--blue); }
.section_title.section_title_red  { color: var(--red);  }

@media screen and (max-width: 63.9375em) {
  .section_title { font-size: 60px; }
}
@media screen and (max-width: 39.9375em) {
  .section_title { font-size: 40px; }
}

/* ==========================================================
   FRONT EVENTS SECTION
   ========================================================== */
.front_events_section {
  padding: 50px 0 30px;
}

.front_events {
  padding-right: 0.9375rem;
  padding-left:  0.9375rem;
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  flex-flow: row wrap;
  position: relative;
  z-index: 2;
}

/* ==========================================================
   UPCOMING EVENTS TABLE (ETPC events list style)
   ========================================================== */
.upcoming_events_section_body {
  background-color: transparent;
  width: 100%;
  padding: 30px 0;
  margin-top: 15px;
}

.upcoming_events_body {
  padding-right: 0.9375rem;
  padding-left:  0.9375rem;
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  flex-flow: row wrap;
}

.upcoming_events_inner {
  background-color: #ffffff;
  position: relative;
  padding-top: 20px;
  padding-bottom: 20px;
  width: 100%;
}

.upcoming_events_label {
  position: absolute;
  background-color: var(--blue);
  color: #ffffff;
  font-weight: bold;
  text-transform: uppercase;
  padding: 5px 10px;
  letter-spacing: 1px;
  top: -30px;
  left: 20px;
  font-size: 0.82rem;
}

.upcoming_events_table_wrapper {
  padding-right: 0.9375rem;
  padding-left:  0.9375rem;
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  flex-flow: row wrap;
}

.upcoming_events_table {
  width: 100%;
  border-collapse: collapse;
}

.upcoming_events_table tbody tr {
  border-bottom: 2px solid #FFFFFF;
}

.upcoming_events_table tbody tr:nth-child(odd)  { background-color: #f1f1f1; }
.upcoming_events_table tbody tr:hover           { cursor: pointer; }
.upcoming_events_table tbody tr:hover:nth-child(even) td { background-color: #d8d8d8; }
.upcoming_events_table tbody tr:hover:nth-child(odd)  td { background-color: #e6e6e6; }

td.event_date_td {
  font-weight: bold;
  text-transform: uppercase;
  font-size: 2rem;
  text-align: center;
  width: 18%;
  border-right: 5px solid #FFFFFF;
  vertical-align: middle;
  padding: 15px 10px;
  line-height: 1.1;
}

td.event_details_td {
  font-weight: bold;
  text-transform: uppercase;
  font-size: 1rem;
  text-align: left;
  padding: 15px;
  vertical-align: middle;
}

.event_place_span {
  font-size: 1.2rem;
  display: block;
}

.event_place_address_span {
  font-size: 0.82rem;
  font-weight: 400;
  display: block;
  text-transform: none;
  color: #555;
  margin-top: 3px;
}

td.event_status_td {
  text-align: center;
  width: 180px;
  padding: 15px 10px;
  vertical-align: middle;
}

@media screen and (max-width: 63.9375em) {
  td.event_date_td { font-size: 1.3rem; width: 12%; }
}
@media screen and (max-width: 39.9375em) {
  td.event_date_td  { display: none; }
  td.event_details_td { font-size: 0.9rem; }
}

/* ==========================================================
   PAGE TITLE SECTION — event results page
   ========================================================== */
.page_title_section {
  background-color: rgba(0, 0, 0, 0.22);
  padding: 60px 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 59px), 0px 100%);
  margin-bottom: -30px;
}

.page_title_wrapper {
  padding-right: 0.9375rem;
  padding-left:  0.9375rem;
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  flex-flow: row wrap;
}

.page_title {
  font-family: var(--font-heading);
  color: var(--blue);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 75px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
  display: block;
  line-height: 1.1;
  word-break: break-word;
}

.page_subtitle {
  color: rgba(255,255,255,0.85);
  width: 100%;
  text-align: center;
  display: block;
  font-size: 1.05rem;
  margin-top: 10px;
  font-weight: 400;
}

@media screen and (max-width: 63.9375em) {
  .page_title { font-size: 48px; }
}
@media screen and (max-width: 39.9375em) {
  .page_title { font-size: 34px; line-height: 1.2; }
}

/* ==========================================================
   EVENT RESULTS SECTION — dark angled, class blocks
   ========================================================== */
.event_results_section {
  background-color: rgba(0, 0, 0, 0.22);
  padding: 80px 0 60px;
  clip-path: polygon(0 59.5px, 100% 0, 100% calc(100% - 59px), 0px 100%);
  margin-top: -59.5px;
}

.event_results {
  padding-right: 0.9375rem;
  padding-left:  0.9375rem;
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  flex-flow: row wrap;
  z-index: 2;
  position: relative;
}

/* ==========================================================
   PAGE LOAD — STAGGER ENTRANCE ANIMATIONS
   ========================================================== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideLeft {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes rowFlashGreen {
  0%   { background-color: #c6f0d2; box-shadow: inset 4px 0 0 #1e7a3a; }
  60%  { background-color: #c6f0d2; box-shadow: inset 4px 0 0 #1e7a3a; }
  100% { background-color: transparent; box-shadow: none; }
}
@keyframes rowFlashBlue {
  0%   { background-color: #cde4f5; box-shadow: inset 4px 0 0 #1381C4; }
  60%  { background-color: #cde4f5; box-shadow: inset 4px 0 0 #1381C4; }
  100% { background-color: transparent; box-shadow: none; }
}
@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUpFade {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-20px); }
}

/* Class blocks entrance — only on initial page load via .entrance class */
.result_class_block.entrance {
  animation: fadeSlideUp 0.45s ease both;
}
.result_class_block.entrance:nth-child(1) { animation-delay: 0.05s; }
.result_class_block.entrance:nth-child(2) { animation-delay: 0.12s; }
.result_class_block.entrance:nth-child(3) { animation-delay: 0.19s; }
.result_class_block.entrance:nth-child(4) { animation-delay: 0.26s; }
.result_class_block.entrance:nth-child(5) { animation-delay: 0.33s; }
.result_class_block.entrance:nth-child(6) { animation-delay: 0.40s; }
.result_class_block.entrance:nth-child(7) { animation-delay: 0.47s; }
.result_class_block.entrance:nth-child(8) { animation-delay: 0.54s; }

/* Row entrance — only on initial page load via .entrance class */
.results-table tbody tr.entrance {
  animation: fadeSlideLeft 0.35s ease both;
}
.results-table tbody tr.entrance:nth-child(1)  { animation-delay: 0.08s; }
.results-table tbody tr.entrance:nth-child(2)  { animation-delay: 0.14s; }
.results-table tbody tr.entrance:nth-child(3)  { animation-delay: 0.20s; }
.results-table tbody tr.entrance:nth-child(4)  { animation-delay: 0.26s; }
.results-table tbody tr.entrance:nth-child(5)  { animation-delay: 0.32s; }
.results-table tbody tr.entrance:nth-child(6)  { animation-delay: 0.38s; }
.results-table tbody tr.entrance:nth-child(7)  { animation-delay: 0.44s; }
.results-table tbody tr.entrance:nth-child(8)  { animation-delay: 0.50s; }
.results-table tbody tr.entrance:nth-child(9)  { animation-delay: 0.56s; }
.results-table tbody tr.entrance:nth-child(10) { animation-delay: 0.62s; }
.results-table tbody tr.entrance:nth-child(n+11) { animation-delay: 0.68s; }

/* New row slide-in (live poller insertion) */
@keyframes rowEnter {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.results-table tbody tr.row-enter-anim td {
  animation: rowEnter 0.45s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

/* Position shifted row — subtle blue pulse */
.results-table tbody tr.row-bumped {
  animation: rowFlashBlue 2.0s ease forwards !important;
}

/* ============================================================
   RESULT SPOTLIGHT OVERLAY
   ============================================================ */
@keyframes spotlightIn {
  0%   { opacity: 0; transform: scale(0.88); }
  60%  { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes spotlightOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.94); }
}
@keyframes posNumPop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#result-spotlight {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}
#result-spotlight.visible {
  pointer-events: auto;
  animation: spotlightIn 0.5s cubic-bezier(0.34, 1.1, 0.64, 1) forwards;
}
#result-spotlight.hiding {
  animation: spotlightOut 0.45s ease-in forwards;
}
.spotlight-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  cursor: pointer;
}
.spotlight-card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-top: 7px solid var(--red);
  border-radius: 3px;
  padding: 44px 70px 50px;
  min-width: 380px;
  max-width: 580px;
  width: 90vw;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}
.spotlight-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 4px;
}
.spotlight-class-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #444;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e0e0e0;
}
.spotlight-pos-num {
  font-family: var(--font-heading);
  font-size: 5.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--blue);
  margin-bottom: 18px;
  animation: posNumPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.25s;
}
.spotlight-vehicle {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.15;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.spotlight-driver {
  font-size: 1rem;
  color: #666;
  margin-bottom: 24px;
}
.spotlight-distance {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 1px;
}
.spotlight-dismiss {
  margin-top: 22px;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #aaa;
}

/* Live polling status dot */
.live-poll-dot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1e7a3a;
  box-shadow: 0 0 0 3px rgba(30,122,58,0.3);
  animation: pulse-glow-green 2s ease-in-out infinite;
  z-index: 9999;
}
@keyframes pulse-glow-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(30,122,58,0.3); }
  50%       { box-shadow: 0 0 0 9px rgba(30,122,58,0.08); }
}

/* Blue class title bar */
.result_class_title {
  font-family: var(--font-heading);
  text-transform: uppercase;
  background-color: var(--blue);
  color: #FFFFFF;
  font-size: 1.2rem;
  font-weight: 600;
  width: 100%;
  padding: 10px 15px;
  display: block;
  margin-top: 25px;
  letter-spacing: 0.5px;
}
.result_class_block:first-child .result_class_title { margin-top: 0; }

/* Round sub-blocks within a class */
.round-block {
  width: 100%;
  margin-bottom: 4px;
}
.round-title {
  background: #2c2c2c;
  color: #d0d0d0;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 7px 15px;
  border-left: 4px solid var(--blue);
}
.round-no-results {
  padding: 16px 15px;
  font-size: 0.85rem;
  color: #888;
  background: rgba(255,255,255,0.7);
  font-style: italic;
}

/* White table area */
.result_class_content {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.92);
}

/* ==========================================================
   RESULTS TABLE
   ========================================================== */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.results-table thead th {
  background: var(--blue);
  color: #FFFFFF;
  padding: 9px 12px;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.results-table tbody tr:nth-child(even) { background-color: #f1f1f1; }
.results-table tbody tr:hover           { background-color: #e6e6e6; }

.results-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f1f1;
}

.results-table .position-cell {
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  width: 52px;
}

.results-table .distance-cell {
  font-weight: 600;
  color: var(--blue-dark);
}

/* ==========================================================
   CLASS QUICK-NAV (anchor tabs on event detail page)
   ========================================================== */
.class-nav-bar {
  background-color: #FFFFFF;
  border-bottom: 3px solid var(--blue);
  padding: 0 0.9375rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.class-nav {
  max-width: 75rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.class-nav a {
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--gray-800);
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: all 0.15s;
  text-decoration: none;
  display: block;
}

.class-nav a:hover,
.class-nav a.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  text-decoration: none;
  background-color: transparent;
}

/* ==========================================================
/*   LIVE ALERT BAR (between logo and hero)
   ========================================================== */
.live-alert-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-left: 5px solid var(--red);
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 28px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.92rem;
  color: #222;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.live-alert-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  animation: liveBlinkDot 1.1s step-start infinite;
}
@keyframes liveBlinkDot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.live-alert-label {
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 3px;
  color: var(--red);
  text-transform: uppercase;
}
.live-alert-name {
  font-weight: 600;
  color: #222;
  flex: 1;
}
.live-alert-btn {
  background: var(--red);
  color: #fff !important;
  padding: 5px 16px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 2px;
  transition: background 0.2s;
  white-space: nowrap;
}
.live-alert-btn:hover { background: #c61e22; }

/* Nav live chip — blends into red top-bar */
.nav-live-blink {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  margin-right: 5px;
  vertical-align: middle;
  animation: liveBlinkDot 1.1s step-start infinite;
}
.nav-live-chip {
  color: #fff !important;
  font-weight: 700 !important;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 0.8rem !important;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 2px;
  padding: 2px 10px !important;
  text-decoration: none !important;
}
.nav-live-chip:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1) !important;
}

/* Live event row highlight in events table */
tr.event-row-live {
  background: rgba(42,157,78,0.07) !important;
  border-left: 3px solid #2a9d4e;
}
tr.event-row-live .event_place_span { color: #2a9d4e; }

/* ---- Today / Upcoming / Past section labels ---- */
.events-label-today {
  background-color: #2a9d4e !important;
}
.events-today-section .upcoming_events_table tr {
  border-left: 3px solid #2a9d4e;
}
.events-today-section .upcoming_events_table .event_place_span {
  color: #2a9d4e;
}
.events-label-past {
  background-color: #888 !important;
}
.events-past-section .upcoming_events_table tr {
  opacity: 0.82;
}
.events-past-section .upcoming_events_table tr:hover {
  opacity: 1;
}
/* Results button -- muted blue for past events */
.btn.btn-results {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
.btn.btn-results:hover { background: #0e6296; color: #fff; }
/* Upcoming badge */
.upcoming-badge {
  display: inline-block;
  background: transparent;
  color: var(--blue);
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--blue);
  border-radius: 2px;
}

/* ==========================================================
   LIVE BADGE
   ========================================================== */
.live-badge {
  display: inline-block;
  background: var(--red);
  color: #FFFFFF;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ==========================================================
   BADGES
   ========================================================== */
.badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-full-pull { background: #1e7a3a;      color: #FFFFFF; font-weight: 700; }
.badge-measured   { background: var(--blue);  color: #FFFFFF; }
.badge-dq         { background: #767676;      color: #FFFFFF; }
.badge-dns        { background: #cacaca;      color: #0a0a0a; }
.badge-scratch    { background: #ffae00;      color: #0a0a0a; }
.badge-active     { background: #3adb76;      color: #0a0a0a; }

/* ==========================================================
   FORMS
   ========================================================== */
.form-group       { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 0.9rem; }

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cacaca;
  border-radius: 0;
  font-size: 0.95rem;
  font-family: var(--font-primary);
  line-height: 1.5;
  color: #0a0a0a;
  background-color: #fefefe;
  transition: border-color 0.25s ease-in-out, box-shadow 0.5s;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(19,129,196,0.15);
}

select.form-control {
  appearance: none;
  background: #fefefe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8a8a' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 2rem;
}

.form-inline {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-inline .form-group { margin-bottom: 0; }

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-block;
  padding: 0.85em 1em;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background-color 0.25s ease-out, color 0.25s ease-out;
  text-decoration: none;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}
.btn:hover { text-decoration: none; }

.btn-primary       { background-color: var(--blue);     color: #fefefe; }
.btn-primary:hover { background-color: var(--blue-dark); color: #fefefe; }
.btn-red           { background-color: var(--red);      color: #fefefe; }
.btn-red:hover     { background-color: var(--red-dark); color: #fefefe; }
.btn-sm            { padding: 4px 12px; font-size: 0.78rem; }
.btn-outline       { background: transparent; border: 1px solid var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fefefe; }
.btn-danger        { background-color: #cc4b37; color: #fefefe; }
.btn-danger:hover  { background-color: #a53b2a; }
.btn-success       { background-color: #3adb76; color: #0a0a0a; }
.btn-success:hover { background-color: #22bb5b; }
.btn-warning       { background-color: #ffae00; color: #0a0a0a; }
.btn-warning:hover { background-color: #cc8b00; }

/* ==========================================================
   BEFORE-FOOTER + FOOTER (ETPC gradient)
   ========================================================== */
.before_footer {
  height: 25px;
  background-color: #FFFFFF;
}

.site-footer {
  background-color: #1e1e1e;
  border-top: 4px solid var(--red);
  color: #cccccc;
  text-align: center;
  padding: 28px 0.9375rem 24px;
  font-size: 0.88rem;
}
.footer-logo-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; vertical-align: middle; }
.footer-logo      { height: 22px; width: auto; opacity: 0.9; vertical-align: middle; }
.footer-logo:hover { opacity: 1; }
.footer-copy      { margin: 0; font-weight: bold; }
.site-footer a       { color: #FFFFFF; }
.site-footer a:hover { text-decoration: underline; }

/* ==========================================================
   LOGIN PAGE
   ========================================================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  background: repeating-linear-gradient(
    135deg, #FFFFFF, #FFFFFF 10px, #fbfbfb 10px, #fbfbfb 20px
  );
}

.login-box {
  background: #fefefe;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--blue);
}

.login-box h2 {
  text-align: center;
  color: var(--red);
  font-size: 1.8rem;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-box .subtitle {
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 30px;
  font-size: 0.9rem;
}

.login-box .error {
  background: #f7e4e1;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  text-align: center;
}

/* ==========================================================
   ADMIN LAYOUT (dark sidebar)
   ========================================================== */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #1a1a2e 0%, #121220 100%);
  color: #fefefe;
  flex-shrink: 0;
}

.admin-sidebar .sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar .sidebar-header h3 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
}

.admin-sidebar .sidebar-header small { color: rgba(255,255,255,0.5); font-size: 0.8rem; }
.admin-sidebar nav { padding: 15px 0; }

.admin-sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: rgba(255,255,255,0.08);
  color: #fefefe;
  border-left-color: var(--red);
  text-decoration: none;
}

.admin-sidebar nav a .icon {
  margin-right: 10px;
  width: 20px;
  display: inline-block;
  text-align: center;
}

.admin-main {
  flex: 1;
  padding: 30px;
  background: #f5f5f5;
  overflow-x: auto;
}

.admin-main h2 {
  color: #0a0a0a;
  margin-bottom: 20px;
  font-size: 1.4rem;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--red);
}

/* ---------- Dashboard Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #fefefe;
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
  border-top: 4px solid var(--blue);
}
.stat-card.red   { border-top-color: var(--red); }
.stat-card.green { border-top-color: #3adb76; }

.stat-card .stat-number { font-size: 2.5rem; font-weight: 700; color: #0a0a0a; line-height: 1; }
.stat-card .stat-label  { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: #8a8a8a; margin-top: 8px; }

/* ---------- Tabs (admin + public) ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 3px solid #e6e6e6;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tabs .tab {
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  background: none;
  color: #8a8a8a;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: all 0.2s;
  font-family: var(--font-primary);
  text-decoration: none;
}

.tabs .tab:hover              { color: var(--blue); text-decoration: none; }
.tabs .tab.active             { color: var(--blue); border-bottom-color: var(--blue); }
.tab-content                  { display: none; }
.tab-content.active           { display: block; }

/* ---------- Cards ---------- */
.card {
  background: #fefefe;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid #e6e6e6;
}

.card-header {
  background: var(--blue);
  color: #FFFFFF;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-body { padding: 20px; }

/* ---------- Misc helpers ---------- */
.mb-20 { margin-bottom: 20px; }

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}



/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
  .admin-wrapper     { flex-direction: column; }
  .admin-sidebar     { width: 100%; }
  .admin-sidebar nav { display: flex; flex-wrap: wrap; padding: 10px; gap: 5px; }
  .admin-sidebar nav a { padding: 8px 14px; border-left: none; }
  .after_header_block { flex-basis: 100%; }
  .event_results_section { clip-path: none; }
  .page_title_section    { clip-path: none; margin-bottom: 0; }
}

/* ==========================================================
   MULTI-ROUND RESULTS TABLE
   ========================================================== */
.results-round-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.results-round-table thead th {
  background: var(--blue);
  color: #FFFFFF;
  padding: 9px 12px;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
.results-round-table thead th.col-round {
  text-align: center;
  min-width: 90px;
}
.results-round-table thead th.col-pos {
  width: 52px;
  text-align: center;
}
.results-round-table tbody tr:nth-child(even) { background-color: #f1f1f1; }
.results-round-table tbody tr:hover           { background-color: #e6e6e6; }
.results-round-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f1f1;
}
.results-round-table .position-cell {
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  width: 52px;
}
.round-dist-cell {
  text-align: center;
  font-size: 0.88rem;
  padding: 9px 10px !important;
}

/* Round distance display variants */
.dist-full-pull {
  color: #1a7a35;
  font-weight: 800;
}
.dist-dq {
  color: #E1363A;
  font-weight: 700;
  font-style: italic;
}
.dist-dropped {
  color: #aaa;
  font-style: italic;
}

/* Inline round rename input */
.round-rename-input {
  font-size: 0.82rem;
  padding: 2px 6px;
  width: 90px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

/* Row animations reused for round table */
.results-round-table tbody tr.row-enter-anim td {
  animation: rowEnter 0.45s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}
.results-round-table tbody tr.row-bumped {
  animation: rowFlashBlue 2.0s ease forwards !important;
}

/* ==========================================================
   ROUND-FIRST NAVIGATION + BLOCKS
   ========================================================== */

/* Tab switching: only show active round block */
.round-block                  { display: none; }
.round-block.round-block-active { display: block; }

/* Round tab nav links — styled like class-nav anchors with tab feel */
.round-tab-nav-link {
  display: inline-block;
  padding: 9px 20px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #444;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.round-tab-nav-link:hover {
  color: var(--blue);
  text-decoration: none;
}
.round-tab-nav-link.active {
  color: var(--red);
  border-bottom: 3px solid var(--red);
  font-weight: 700;
}
/* Live round indicator dot — persists on whichever round the console operator is working */
.round-tab-nav-link {
  position: relative;
}
/* ---- Overall / All-Rounds tab table ---- */
.round-tab-overall { font-weight: 700; }
.results-overall-table { table-layout: auto; width: 100%; }
.results-overall-table th[data-round-id] {
  background: #1381C4;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  padding: 8px 12px;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.results-overall-table td.round-cell {
  text-align: center;
  white-space: nowrap;
  min-width: 90px;
  padding: 8px 12px;
  border-right: 1px solid #e8e8e8;
  font-size: 0.92rem;
}
.dist-empty { color: #aaa; }
/* Flash a cell green when it updates */
@keyframes cellUpdated { 0% { background: rgba(30,122,58,0.25); } 100% { background: transparent; } }
.cell-updated { animation: cellUpdated 2s ease-out forwards; }

.round-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1e7a3a;
  margin-left: 7px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  box-shadow: 0 0 0 0 rgba(30, 122, 58, 0.7);
  animation: liveDotPulse 1.8s ease-in-out infinite;
}
@keyframes liveDotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(30, 122, 58, 0.7); }
  60%  { box-shadow: 0 0 0 7px rgba(30, 122, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 122, 58, 0); }
}

/* Empty state */
.no-results-placeholder {
  text-align: center;
  padding: 50px 20px;
  color: #ECEDED;
  width: 100%;
}
.no-results-title {
  font-size: 2rem;
  text-transform: uppercase;
  font-weight: bold;
  color: #1381C4;
  margin: 0 0 10px;
}
.no-results-body {
  font-weight: normal;
  color: #ccc;
  margin: 0;
}

/* Spotlight round name line */
.spotlight-round-name {
  font-size: 0.95rem;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 6px;
  min-height: 1.2em;
}
