/* === Base (desktop-first kept) === */
body {
  background-color: #0a0a23;
  color: #ffffff;
  font-family: Arial, sans-serif;
  margin: 0;
}

.main-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background-color: #1a1d38;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 2rem;
  z-index: 999;
  box-shadow: 0 4px 8px rgba(0,0,0,0.6);
}

.header-left { flex: 0 0 auto; display: flex; align-items: center; }
.header-right { flex: 1; display: flex; justify-content: center; align-items: center; }

.logo { height: 40px; margin-right: 1rem; }

h1#event-title {
  font-size: 1.6rem;
  margin: 0;
  color: #ffffff;
  text-align: center;
}

.container {
  padding: 100px 2rem 2rem;   /* space for fixed header */
  max-width: 1400px;
  margin: 0 auto;
}

.section-label {
  font-size: 1.1rem;
  color: #aaa;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.category-label {
  background-color: #a6d6f9;
  color: #000000;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  font-size: 1.3rem;
  font-weight: bold;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 2px #444;
}

.startlist-entry {
  display: flex;
  align-items: center;
  padding: 1rem;
  margin: 0.3rem 0;
  border-radius: 12px;
  font-size: 1.25rem;
  background-color: #1c1f33;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  transition: background-color 0.2s ease;
}

.startlist-entry:hover { background-color: #2a2e45; }

.startlist-entry img.flag {
  width: 36px;
  height: 24px;
  object-fit: contain;
  margin-left: 0.8rem;
  margin-right: 0.2rem;
}

.startlist-entry .inline {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.startlist-entry .clubname {
  font-size: 1.05rem;
  font-style: italic;
  color: #ccc;
  margin-left: 0.5rem;
}

.results-marker {
  background-color: #5c2d91;
  text-align: center;
  font-weight: bold;
  justify-content: center;
}

#countdown-timer {
  font-size: 1.3rem;
  font-weight: bold;
  color: #00ff00;
  display: inline-block;
  min-width: 4.2ch;
  text-align: right;
}

#countdown-timer.expired { color: #ff5555; }

/* Desktop column widths */
.inline { display: flex; align-items: center; }
.inline span:first-child { width: 60px; text-align: right; }   /* time */
.inline span:nth-child(2) { width: 50px; text-align: center; margin-left: 0.8rem; } /* start number */
.inline span:nth-child(4) { margin-left: 0.5rem; font-weight: normal; } /* team */

/* ===== Mobile layout: time | number | flag | content ===== */
html { -webkit-text-size-adjust: 100%; }

@media (max-width: 768px) {
  .container { padding: 90px 1rem 1.2rem; }

  .startlist-entry {
    padding: 0.75rem 0.8rem;
    font-size: 1.05rem;
    border-radius: 12px;
  }

  .startlist-entry .inline {
    display: grid !important;
    /* 4 columns: time | number | flag | content */
    grid-template-columns: 58px 32px 26px 1fr !important;
    grid-auto-rows: auto;
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
  }

  /* reset desktop widths/margins */
  .inline span, .inline img { width: auto; margin: 0 !important; }

  /* Čas ali #countdown-timer v 1. stolpec */
  .startlist-entry .inline > #countdown-timer,
  .startlist-entry .inline > :first-child {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    align-self: center;
    text-align: right !important;
    min-width: 4.2ch;
  }

  /* Startna številka v 2. stolpec (NE skrivaj je) */
  .startlist-entry .inline > span:nth-child(2),
  .startlist-entry .start-number {
    display: block !important;
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: center;
    justify-self: end;
    min-width: 2.4rem;
    text-align: right !important;
    white-space: nowrap;
    opacity: 0.95;
  }

  /* Zastava v 3. stolpec */
  .startlist-entry img.flag {
    grid-column: 3 !important;
    grid-row: 1 / span 2 !important;
    width: 24px;
    height: 16px;
    align-self: center;
    justify-self: start;
  }

  /* Team v 4. stolpec, 1. vrstica */
  .startlist-entry .inline > span:nth-child(4) {
    grid-column: 4 !important;
    grid-row: 1 !important;
    font-weight: 600;
    font-size: 0.90rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Club pod team, 4. stolpec */
  .startlist-entry .inline > .clubname {
    grid-column: 4 !important;
    grid-row: 2 !important;
    font-size: 0.70rem;
    color: #bfc3d9;
    opacity: 0.9;
    line-height: 1.15;
  }

  h1#event-title { font-size: clamp(1.1rem, 5vw, 1.4rem); }

  .category-label {
    font-size: 1.0rem;
    padding: 0.6rem 0.7rem;
  }
}
/* === Desktop spacing fix: čas | št. | zastava | vsebina === */
/* Tighter spacing: time ↔ number (desktop) */
@media (min-width: 769px) {
  .startlist-entry .inline { gap: 0.6rem; } /* prej 0.9rem */

  /* Čas / countdown – malo ožji stolpec */
  .startlist-entry .inline > #countdown-timer,
  .startlist-entry .inline > span:first-child {
    width: 58px;                 /* prej 64px */
    text-align: right;
  }

  /* Štartna številka – bližje času */
  .startlist-entry .inline .start-number,
  .startlist-entry .inline > span:nth-child(2) {
    width: 40px;                 /* prej 44px */
    margin-left: 0.25rem;        /* prej 0.6rem */
    text-align: right;
  }
}