@font-face {
  font-display: swap;
  font-family: "ModeSeven";
  font-style: normal;
  font-weight: 400;
  src: url("../public/fonts/Modeseven-L3n5.ttf") format("truetype");
}

:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow-x: hidden;
}

main {
  padding: clamp(0px, 1.8vw, 24px) !important;
}

main > section {
  align-items: flex-start !important;
  max-width: 52rem !important;
  min-height: calc(100dvh - clamp(0px, 3.6vw, 48px)) !important;
  width: 100% !important;
}

a {
  text-decoration: none;
}

.ceefax-screen {
  color: #ffffff;
  font-family: "ModeSeven", monospace;
  font-size: clamp(18px, calc(2.21vw + 9.1px), 27.5px);
  letter-spacing: 0;
  padding-bottom: clamp(20px, calc(4.19vw + 3.2px), 38px) !important;
  padding-left: clamp(20px, calc(8.37vw - 13.7px), 56px) !important;
  padding-right: clamp(20px, calc(8.37vw - 13.7px), 56px) !important;
  padding-top: clamp(20px, calc(3.49vw + 6px), 35px) !important;
  max-width: 52rem;
  width: 100% !important;
}

.ceefax-screen--crt {
  border-radius: 0.18em;
  filter: contrast(1.08) saturate(1.18);
  overflow: hidden;
  text-shadow:
    0 0 0.08em currentColor,
    0.035em 0 0 rgba(255, 0, 0, 0.35),
    -0.035em 0 0 rgba(0, 251, 251, 0.25);
}

.ceefax-screen--crt::before,
.ceefax-screen--crt::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 4;
}

.ceefax-screen--crt::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 50%, rgba(0, 0, 0, 0.2) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.045), rgba(0, 255, 0, 0.025), rgba(0, 0, 255, 0.045));
  background-size: 100% 0.18em, 0.36em 100%;
  mix-blend-mode: screen;
}

.ceefax-screen--crt::after {
  animation: crt-flicker 3.6s steps(2, end) infinite;
  background:
    radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(transparent 0%, rgba(255, 255, 255, 0.08) 48%, transparent 52%);
  box-shadow: inset 0 0 2.4em rgba(0, 0, 0, 0.75);
}

@keyframes crt-flicker {
  0%,
  100% {
    opacity: 0.75;
  }

  50% {
    opacity: 0.92;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ceefax-screen--crt::after {
    animation: none;
  }
}

.ceefax-screen--short {
  min-height: max(100dvh, clamp(760px, 103.5vw, 861px));
}

.ceefax-screen--table {
  min-height: max(100dvh, clamp(875px, calc(54.4vw + 656px), 1109px));
}

.ceefax-screen--article {
  min-height: max(100dvh, clamp(1050px, 154vw, 1283px));
}

.font-ceefax {
  font-family: "ModeSeven", monospace;
}

.bg-cee-blue {
  background-color: #2046f2;
}

.text-cee-cyan {
  color: #00fbfb;
}

.text-cee-green {
  color: #00ff00;
}

.text-cee-red,
.text-vee-red {
  color: #d12929;
}

.text-cee-yellow {
  color: #fcee67;
}

.border-cee-red {
  border-color: #d12929;
}

.bbc-football-logo {
  display: block;
  height: auto;
  width: 100%;
}

.ceefax-table {
  font-size: 0.9em;
  line-height: 1.1;
  width: 100%;
}

.ceefax-row {
  align-items: center;
  column-gap: 0.58ch;
  display: grid;
  grid-template-columns: 2.7ch minmax(0, 1fr) repeat(4, 2.8ch) repeat(2, 3ch) 4ch;
  min-width: 0;
  padding-block: 0.13em;
}

.ceefax-row > span {
  overflow: hidden;
  white-space: nowrap;
}

.num {
  text-align: right;
}

.team {
  text-align: left;
}

.source-stamp {
  grid-column: 1 / span 2;
  text-align: left;
}

.separator {
  border-bottom: 0.18em solid #d12929;
}

.table-key {
  color: #fcee67;
  display: none;
  font-size: 0.58em;
  line-height: 1.12;
  margin-top: 1.15em;
}

.team-short {
  display: none;
}

.ceefax-nav {
  justify-content: space-between;
  margin-top: 0.85em;
  position: static;
  width: 100%;
}

.ceefax-match-list {
  font-size: 0.9em;
  line-height: 1.1;
  margin-top: 1em;
}

.match-day {
  margin-top: 0.65em;
}

.match-day:first-child {
  margin-top: 0.9em;
}

.fixture-season-finished {
  color: #fcee67;
  display: grid;
  gap: 0.45em;
  line-height: 1.12;
  margin-top: 1.25em;
  max-width: 30ch;
  text-transform: uppercase;
}

.fixture-season-finished p {
  margin: 0;
}

.fixture-season-finished p:nth-child(2) {
  color: #00fbfb;
}

.fixture-season-finished p:nth-child(3) {
  color: #ffffff;
}

.match-day-title {
  color: #ffffff;
  font-size: 1em;
  font-weight: 400;
  line-height: 1;
  margin: 0 0 0.42em;
}

.fixture-row,
.result-score-row,
.result-scorers {
  display: grid;
  min-width: 0;
}

.fixture-row {
  grid-template-columns: 5ch minmax(0, 1fr) 2ch minmax(0, 1fr);
}

.result-score-row,
.result-scorers {
  grid-template-columns: minmax(0, 1fr) 4ch minmax(0, 1fr) 3ch;
}

.fixture-row,
.result-score-row {
  align-items: center;
}

.fixture-row {
  color: #00fbfb;
  column-gap: 1.3ch;
  min-height: 1.23em;
  text-transform: uppercase;
}

.match-team,
.scorer-list {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.versus,
.match-time,
.result-score,
.result-status {
  color: #ffffff;
  text-align: center;
}

.match-meta {
  color: #fcee67;
  font-size: 0.9em;
  line-height: 1.08;
  text-align: left;
}

.results-list {
  margin-top: 1.32em;
}

.result-match {
  display: grid;
  margin-top: 0.78em;
  row-gap: 0.08em;
}

.result-match:first-child {
  margin-top: 0;
}

.result-score-row {
  color: #00fbfb;
  column-gap: 1.6ch;
  line-height: 1.08;
  min-height: 1.08em;
  text-transform: uppercase;
}

.result-scorers {
  color: #ffffff;
  column-gap: 1.6ch;
  font-size: 0.86em;
  line-height: 1.08;
  min-height: 2.16em;
}

.scorer-list {
  display: flex;
  flex-direction: column;
}

.ceefax-remote {
  background: #111111;
  border: 0.12em solid #fcee67;
  bottom: 1.1em;
  box-shadow: 0.22em 0.22em 0 #2046f2;
  color: #ffffff;
  display: grid;
  gap: 0.32em;
  opacity: 0;
  padding: 0.48em;
  pointer-events: none;
  position: absolute;
  right: 1.1em;
  transform: translateY(0.4em);
  transition: opacity 120ms linear, transform 120ms linear;
  width: 6.7em;
  z-index: 5;
}

.ceefax-remote--active {
  opacity: 1;
  transform: translateY(0);
}

.remote-led {
  background: #000000;
  border: 0.08em solid #00fbfb;
  color: #fcee67;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  line-height: 1;
  padding: 0.18em 0.2em;
  text-align: center;
}

.remote-label {
  color: #00ff00;
  font-size: 0.56em;
  line-height: 1;
  text-align: center;
}

.remote-crt-toggle {
  appearance: none;
  background: #000000;
  border: 0.08em solid #fcee67;
  color: #fcee67;
  cursor: pointer;
  font-family: "ModeSeven", monospace;
  font-size: 0.5em;
  line-height: 1.2;
  padding: 0.12em 0;
  pointer-events: auto;
  text-align: center;
}

.remote-crt-toggle[aria-pressed="true"] {
  background: #00ff00;
  color: #000000;
}

.remote-pad {
  display: grid;
  gap: 0.18em;
  grid-template-columns: repeat(3, 1fr);
}

.remote-pad span {
  background: #2046f2;
  border: 0.08em solid #00fbfb;
  color: #ffffff;
  font-size: 0.52em;
  line-height: 1.25;
  text-align: center;
}

.ceefax-news-list {
  display: flex;
  flex-direction: column;
  gap: 0.63em;
  margin-top: 0.72em;
}

.news-row {
  color: #00fbfb;
  display: grid;
  gap: 0.55em;
  grid-template-columns: minmax(0, 1fr) 3ch;
  line-height: 1.08;
}

.news-row--lead {
  color: #ffffff;
  font-size: 1.17em;
  line-height: 1.02;
}

.news-row span:first-child {
  min-width: 0;
}

.news-page-num {
  align-self: end;
  color: #ffffff;
  text-align: right;
}

.ceefax-article {
  margin-top: 0.72em;
}

.ceefax-article h1 {
  color: #fcee67;
  font-size: 1.17em;
  font-weight: 400;
  line-height: 1.02;
  margin: 0 0 0.42em;
}

.article-copy {
  color: #ffffff;
  font-size: 0.94em;
  line-height: 1.08;
  max-width: 36ch;
}

.article-copy p {
  margin: 0 0 0.95em;
}

.article-link,
.article-date {
  display: block;
  font-size: 0.9em;
  line-height: 1.05;
  margin-top: 1em;
}

.article-date {
  color: #ffffff;
}

@media (max-width: 719px) {
  .stat-fa {
    display: none;
  }

  .ceefax-row {
    grid-template-columns: 2.4ch minmax(0, 1fr) repeat(4, 3ch) 4ch;
  }
}

@media (max-width: 560px) {
  main {
    padding: 0 !important;
  }

  main > section {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    max-width: none !important;
    min-height: 100dvh !important;
    padding: 0;
    width: 100vw !important;
  }

  .ceefax-screen {
    box-shadow: none !important;
    flex-shrink: 0;
    font-size: clamp(16px, 4.48vw, 18px);
    padding-bottom: clamp(16px, 4.98vw, 20px) !important;
    padding-left: clamp(16px, 4.98vw, 20px) !important;
    padding-right: clamp(16px, 4.98vw, 20px) !important;
    padding-top: clamp(16px, 4.98vw, 20px) !important;
    max-width: 52rem;
    width: 100vw !important;
  }

  .ceefax-header {
    font-size: 0.7778em;
    line-height: 1;
  }

  .ceefax-brand span + span {
    margin-left: 10px !important;
  }

  .ceefax-clock {
    gap: 5px !important;
  }

  .bbc-football-logo {
    margin-top: 12px !important;
  }

  .ceefax-title {
    font-size: 1.3333em;
    margin-top: 10px !important;
  }

  .ceefax-table {
    font-size: 1em;
    line-height: 1;
    margin-top: 17px !important;
  }

  .ceefax-row {
    column-gap: 0;
    grid-template-columns: 1.6667em minmax(0, 1fr) 2.2222em 2.2222em 2.2222em 2.7778em;
    height: 1.6667em;
    padding-block: 0;
  }

  .ceefax-row:not(.ceefax-head) > .num:first-child {
    text-align: left;
  }

  .team-full {
    display: inline;
  }

  .team-short {
    display: none;
  }

  .stat-fa {
    display: none;
  }

  .stat-d {
    display: none;
  }

  .separator {
    border-bottom-width: 0.1667em;
    height: 1.8889em;
    margin-bottom: 0.6667em;
  }

  .table-key {
    font-size: 0.58em;
    line-height: 1.12;
    margin-top: 1em;
  }

  .ceefax-screen nav {
    font-size: 0.7778em;
    justify-content: space-between !important;
    margin-top: 14px;
  }

  .ceefax-screen nav a:nth-child(1) {
    width: auto;
  }

  .ceefax-screen nav a:nth-child(2) {
    width: auto;
  }

  .ceefax-screen nav a:nth-child(3) {
    width: auto;
  }

  .ceefax-screen nav a:nth-child(4) {
    width: auto;
  }

  .ceefax-screen--short,
  .ceefax-screen--table,
  .ceefax-screen--article {
    min-height: 100dvh;
  }

  .ceefax-match-list {
    font-size: 1em;
    line-height: 1;
    margin-top: 18px;
  }

  .match-day {
    margin-top: 18px;
  }

  .match-day:first-child {
    margin-top: 17px;
  }

  .match-day-title {
    margin-bottom: 12px;
  }

  .fixture-row,
  .result-score-row,
  .result-scorers {
    grid-template-columns: minmax(0, 1fr) 2.8em minmax(0, 1fr) 1.8em;
  }

  .fixture-row {
    grid-template-columns: 3.2em minmax(0, 1fr) 1.2em minmax(0, 1fr);
  }

  .fixture-row {
    column-gap: 0.55ch;
    min-height: 1.6667em;
  }

  .result-score-row,
  .result-scorers {
    column-gap: 0.55ch;
  }

  .result-match {
    margin-top: 0.72em;
    row-gap: 0.08em;
  }

  .match-meta {
    font-size: 0.88em;
    line-height: 1.08;
  }

  .result-scorers {
    font-size: 0.86em;
    line-height: 1.08;
    min-height: 2.16em;
  }

  .ceefax-remote {
    bottom: 0.8em;
    right: 0.8em;
    width: 5.9em;
  }

  .match-team .team-full {
    display: none;
  }

  .match-team .team-short {
    display: inline;
  }

  .ceefax-news-list {
    gap: 0.55em;
    margin-top: 18px;
  }

  .news-row {
    gap: 0.55em;
    grid-template-columns: minmax(0, 1fr) 2.8em;
    line-height: 1.05;
  }

  .news-row--lead {
    font-size: 1.06em;
  }

  .ceefax-article {
    margin-top: 18px;
  }

  .ceefax-article h1 {
    font-size: 1.06em;
    line-height: 1.05;
    margin-bottom: 14px;
  }

  .article-copy {
    font-size: 1em;
    line-height: 1.05;
    max-width: 100%;
  }

  .article-copy p {
    margin-bottom: 1em;
  }

  .article-link,
  .article-date {
    font-size: 0.9em;
  }
}

@media (min-width: 500px) and (max-width: 719px) {
  .stat-d {
    display: inline;
  }

  .ceefax-row {
    grid-template-columns: 1.6667em minmax(0, 1fr) repeat(4, 2.2222em) 2.7778em;
  }
}

@media (min-width: 52rem) {
  .ceefax-screen--table {
    min-height: 1109px;
  }

  .ceefax-screen--short {
    min-height: 861px;
  }

  .ceefax-screen--article {
    min-height: 1283px;
  }
}
