:root {
  --bg: #000000;
  --blue: #073c86;
  --yellow: #ffe600;
  --white: #f4f4f4;
  --green: #00ff66;
  --red: #ff3b30;
  --cyan: #25d9ff;
  --muted: #9aa7b8;
  --line: #171717;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--white);
}

body {
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.035em;
  font-size: 18px;
  line-height: 1.25;
}

button,
input,
select {
  font: inherit;
}

.tv-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 100vh;
  background: #000;
  border-left: 1px solid #101010;
  border-right: 1px solid #101010;
}

/* =========================
   TOPP / BOTTEN
========================= */

.tv-topbar,
.tv-footer {
  background: var(--blue);
  color: var(--yellow);
  display: grid;
  align-items: center;
  gap: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.tv-topbar {
  min-height: 58px;
  grid-template-columns: 100px 1fr 180px;
  padding: 10px 18px;
  border-bottom: 4px solid var(--yellow);
  font-size: 1.05rem;
}

.page-no {
  text-align: left;
  font-size: 1.15rem;
}

.page-title {
  text-align: center;
  font-size: 1.15rem;
  letter-spacing: 0.07em;
}

#current-round-label {
  text-align: right;
  white-space: nowrap;
}

main {
  padding: 18px 18px 10px;
}

.tv-section + .tv-section {
  margin-top: 34px;
}

/* =========================
   TABELL
========================= */

.section-title-row {
  display: grid;
  grid-template-columns: 170px 1fr 110px;
  gap: 14px;
  color: var(--yellow);
  padding: 10px 8px;
  border-bottom: 3px solid var(--yellow);
  font-weight: 700;
  font-size: 1rem;
}

.section-title-row span:last-child {
  text-align: right;
}

.league-table {
  width: 100%;
}

.league-row {
  display: grid;
  grid-template-columns: 170px 1fr 110px;
  gap: 14px;
  align-items: center;
  min-height: 42px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 1.02rem;
}

.league-row span:first-child {
  padding-left: 8px;
}

.league-row .points {
  text-align: right;
  white-space: nowrap;
}

.league-row.first {
  color: var(--green);
}

.league-row.last {
  color: var(--red);
}

/* =========================
   OMGÅNGSVY
========================= */

.round-section {
  margin-bottom: 12px;
}

.round-heading {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  gap: 14px;
  align-items: center;
  border-top: 3px solid var(--yellow);
  border-bottom: 3px solid var(--yellow);
  padding: 14px 0;
}

.round-heading > div {
  text-align: center;
}

.round-title {
  color: var(--yellow);
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.round-match {
  margin-top: 8px;
  color: var(--cyan);
  font-size: 1.05rem;
}

.tv-button {
  width: 100%;
  min-height: 44px;
  background: var(--blue);
  color: var(--yellow);
  border: 2px solid var(--yellow);
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.tv-button:hover:not(:disabled) {
  background: #0a4da8;
}

.tv-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.predictions-list {
  width: 100%;
}

.prediction-row {
  display: grid;
  grid-template-columns: 1fr 130px 80px;
  gap: 14px;
  align-items: center;
  min-height: 38px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
}

.prediction-row .guess,
.prediction-row .earned {
  text-align: right;
  white-space: nowrap;
}

.prediction-row .guess {
  color: var(--white);
}

.prediction-row .earned {
  color: var(--yellow);
  font-weight: 700;
}

/* =========================
   STATUS
========================= */

.loading,
.empty,
.error {
  padding: 18px 8px;
  color: var(--muted);
}

.error {
  color: var(--red);
}

/* =========================
   FOOTER
========================= */

.tv-footer {
  min-height: 52px;
  margin-top: 34px;

  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;

  padding: 9px 18px;

  border-top: 4px solid var(--yellow);

  font-size: .95rem;
}

.admin-link {
  margin-left: auto;

  color: var(--white);
  text-decoration: none;

  font-size: .8rem;
  opacity: .65;
}

.admin-link:hover {
  color: var(--yellow);
  opacity: 1;
}

/* =========================
   DESKTOP JUSTERING
========================= */

@media (min-width: 1200px) {
  body {
    font-size: 19px;
  }

  .tv-shell {
    width: min(1380px, calc(100% - 50px));
  }

  main {
    padding-left: 24px;
    padding-right: 24px;
  }

  .section-title-row,
  .league-row {
    grid-template-columns: 185px 1fr 120px;
  }

  .league-row {
    min-height: 44px;
  }
}

/* =========================
   TABLET
========================= */

@media (max-width: 900px) {
  .tv-shell {
    width: 100%;
    border-left: 0;
    border-right: 0;
  }

  body {
    font-size: 17px;
  }

  .tv-topbar {
    grid-template-columns: 70px 1fr 150px;
  }

  .section-title-row,
  .league-row {
    grid-template-columns: 125px 1fr 90px;
  }

  .prediction-row {
    grid-template-columns: 1fr 105px 70px;
  }
}

/* =========================
   MOBIL
========================= */

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .tv-topbar {
    grid-template-columns: 52px 1fr;
    min-height: 54px;
    padding: 8px 10px;
  }

  .page-no {
    font-size: 1rem;
  }

  .page-title {
    font-size: 0.95rem;
  }

  #current-round-label {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.82rem;
    padding-top: 2px;
  }

  main {
    padding: 10px 8px;
  }

  .section-title-row,
  .league-row {
    grid-template-columns: 78px 1fr 62px;
    gap: 8px;
    font-size: 0.88rem;
  }

  .section-title-row {
    padding-left: 4px;
    padding-right: 4px;
  }

  .league-row {
    min-height: 34px;
    padding: 4px;
  }

  .league-row span:first-child {
    padding-left: 0;
  }

  .round-heading {
    grid-template-columns: 48px 1fr 48px;
    gap: 8px;
    padding: 10px 0;
  }

  .round-title {
    font-size: 1rem;
  }

  .round-match {
    font-size: 0.9rem;
  }

  .tv-button {
    min-height: 38px;
    padding: 5px 6px;
  }

  .prediction-row {
    grid-template-columns: 1fr 76px 48px;
    gap: 8px;
    min-height: 32px;
    padding: 4px;
    font-size: 0.86rem;
  }

.tv-footer {
  gap: 12px 18px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

  .admin-link {
  margin-left: 0;
  width: 100%;
  font-size: 0.72rem;
}

/* =========================================
   TEXT-TV SIDOR / NAVIGATION
========================================= */

.tv-page[hidden] {
  display: none;
}

.tv-page.active {
  display: block;
}


/* =========================================
   FOOTER-NAVIGATION
========================================= */

.tv-nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--white);
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  text-align: left;
}

.tv-nav-link:hover {
  color: var(--yellow);
}

.tv-nav-link.active {
  color: var(--yellow);
}

.nav-number {
  color: var(--yellow);
  margin-right: 4px;
}

.tv-nav-link.active .nav-number {
  color: var(--white);
}


/* =========================================
   ENKLA SIDRUBRIKER
========================================= */

.simple-section-title {
  color: var(--yellow);
  font-weight: 700;
  font-size: 1.15rem;
  text-transform: uppercase;
  padding: 10px 8px;
  border-bottom: 3px solid var(--yellow);
  margin-bottom: 8px;
}


/* =========================================
   RESULTATLISTA
========================================= */

.results-list {
  width: 100%;
}

.result-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 42px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}

.result-round {
  color: var(--yellow);
  font-weight: 700;
}

.result-match {
  color: var(--white);
}


/* =========================================
   REGLER
========================================= */

.rules-list {
  width: 100%;
}

.rule-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 46px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.rule-points {
  color: var(--green);
  font-weight: 700;
}

.rules-note {
  margin-top: 20px;
  padding: 10px 8px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}


/* =========================================
   ROUND HEADER CENTER
========================================= */

.round-heading-center {
  min-width: 0;
}


/* =========================================
   MOBIL
========================================= */

@media (max-width: 680px) {

  .tv-nav-link {
    font-size: 0.78rem;
  }

  .result-row {
    grid-template-columns: 76px 1fr;
    gap: 8px;
    min-height: 34px;
    padding: 5px 4px;
    font-size: 0.86rem;
  }

  .rule-row {
    grid-template-columns: 70px 1fr;
    gap: 8px;
    min-height: 38px;
    padding: 5px 4px;
    font-size: 0.86rem;
  }

  .simple-section-title {
    font-size: 1rem;
    padding-left: 4px;
    padding-right: 4px;
  }

  .rules-note {
    padding-left: 4px;
    padding-right: 4px;
    font-size: 0.82rem;
  }

/* =========================================
   HALL OF FAME
========================================= */

.hall-intro {
  color: var(--red);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 8px 8px;
  text-transform: uppercase;
}

.hall-list {
  width: 100%;
  max-width: 760px;
}

.hall-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 44px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}

.hall-year {
  color: var(--red);
  font-weight: 700;
}

.hall-current {
  color: var(--yellow);
}

.hall-current .hall-year {
  color: var(--yellow);
}

.hall-current span:last-child {
  font-size: 1.5rem;
  font-weight: 700;
}

/* MOBIL */

@media (max-width: 680px) {

  .hall-row {
    grid-template-columns: 70px 1fr;
    gap: 10px;
    min-height: 36px;
    padding: 5px 4px;
    font-size: 0.88rem;
  }

  .hall-intro {
    padding-left: 4px;
    font-size: 1rem;
  }
}
