/* Custom properties */
:root {
  --home-color-1: #a60000;
  --home-color-2: white;
  --home-color-3: #f70000;
  --home-color-4: #510000;
  --home-color-5: #c3c3c3;
  --away-color-1: black;
  --away-color-2: white;
  --away-color-3: #002cd3;
  --away-color-4: black;
  --away-color-5: #cbcbcb;
  --flash-repeat: 14;
}

/* Box Sizing Rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

html {
  font-size: 75%;
}

body {
  background-color: grey;
}

@media screen and (min-width: 320px) {
  html {
    font-size: 87.5%;
  }
}

@media screen and (min-width: 380px) {
  html {
    font-size: 100%;
  }
}

@media screen and (min-width: 800px) {
  html {
    font-size: 150%;
  }
}

@media screen and (min-width: 1000px) {
  html {
    font-size: 200%;
  }
}

/* Set core body defaults */
body {
  min-height: 100svh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* App styles */
button {
  cursor: pointer;
}

body {
  line-height: normal;
}

.cm2 {
  /* aspect-ratio: 640 / 480; */
  background-image: url(covent-garden.jpg);
  background-size: cover;
}

* {
  font-family: "Microsoft Sans Serif", Arial, sans-serif;
}

.match-header {
  padding-top: 0.3125rem;
}

.headline-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.overlapper {
  grid-row-start: 1;
  grid-column-start: 2;
}

.metadata {
  font-size: 0.75rem;
  background-color: #7d7d7d;
  color: black;
  text-align: center;
  border-radius: 0.1875rem;
  box-shadow: inset 0.0625rem 0.0625rem 0rem #929292,
    inset -0.1875rem -0.1875rem 0.0625rem #474747;
  border: black 0.0625rem solid;
  padding-bottom: 0.0625rem;
  padding-left: 0.625rem;
  padding-right: 0.625rem;
  height: 1.2rem;
}

.date {
  margin-left: -0.3125rem;
  margin-block-start: -0.3125rem;
  max-width: 6rem;
  justify-self: end;
}

.score {
  display: flex;
  gap: 0.1875rem;
}

.home,
.away {
  flex-basis: 0;
  flex-grow: 1;
  justify-content: space-between;
  display: flex;
  height: 3rem;
  align-items: center;
  border-radius: 0.125rem;
  border: black 0.0625rem solid;
}

.home {
  background-color: var(--home-color-1);
  color: var(--home-color-2);
  text-shadow: 0.1875rem 0.1875rem 0.0625rem
    color-mix(in srgb, var(--home-color-1) 40%, black);
  box-shadow: inset 0.0625rem 0.0625rem 0rem var(--home-color-3),
    inset -0.125rem -0.125rem 0.0625rem var(--home-color-4);
}

.away {
  background-color: var(--away-color-1);
  color: var(--away-color-2);
  text-shadow: 0.1875rem 0.1875rem 0.0625rem
    color-mix(in srgb, var(--away-color-1) 40%, black);
  box-shadow: inset 0.0625rem 0.0625rem 0rem var(--away-color-3),
    inset -0.125rem -0.125rem 0.0625rem var(--away-color-4);
}

.team-name {
  padding-left: 1rem;
  padding-inline-start: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
    "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
}

.team-name-center {
  width: 100%;
  text-align: center;
}

.team-score-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: white;
  margin: 0.1875rem 0.1875rem 0.1875rem 0rem;
  margin-block: 0.1875rem;
  margin-inline-start: 0rem;
  margin-inline-end: 0.1875rem;
  border: solid 0.0625rem black;
  width: 3.125rem;
  height: 2.625rem;
  box-shadow: inset 0.0625rem 0.0625rem 0rem white,
    inset -0.125rem -0.125rem 0.0625rem #c7c7c7;
  border-radius: 0.125rem;
}

.team-score {
  color: black;
  font-size: 1.5rem;
  margin: 0;
  text-shadow: none;
}

.match-info {
  margin: 0.125rem 0.3125rem 0rem 0.3125rem;
  margin-block-start: 0.125rem;
  margin-block-end: 0;
  margin-inline: 0.3125rem;
  min-height: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.competition {
  justify-self: right;
}

.score-history {
  display: inline-block;
  justify-self: left;
}

.score-history[data-hide] {
  display: none;
}

.clock {
  justify-self: center;
}

.clock p {
  font-size: 1.25rem;
  font-weight: bold;
  font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", Geneva,
    Verdana, sans-serif;
  text-shadow: 0.1875rem 0.1875rem 0.0625rem black;
  color: #f6f72a;
}

.info {
  display: grid;
  grid-template-rows: 1fr 1fr;
  margin-top: 0.625rem;
  margin-block-start: 0.625rem;
  margin-left: 1.25rem;
  margin-right: 1.25rem;
  margin-inline: 1.25rem;
  /* min-height: 19.375rem; */
  min-height: 64.583svh;
  background-color: rgba(0, 0, 0, 0.5);
}

.team-events {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0.3125rem;
  text-shadow: 0.125rem 0.125rem 0.0625rem black;
}

.events-section {
  flex-grow: 1;
  flex-basis: 0;
}

.events-home,
.events-away {
  flex-grow: 1;
  flex-basis: 0;
  padding-right: 5rem;
}
.events-away {
  padding-left: 1.25rem;
}

.event {
  margin-bottom: 0.1875rem;
  margin-block-end: 0.1875rem;
}

.goal,
.injury {
  display: flex;
  justify-content: space-between;
}

.event-player {
  color: #c7c8c8;
}

.event-time {
  color: #f6f72a;
}

.attendance {
  color: #00b2b1;
}

.penalty-shootout-header {
  color: #de8912;
}

.penalty-scored {
  color: #c7c8c8;
}

.penalty-missed {
  color: #84847a;
}

.commentary-container {
  align-self: start;
  display: flex;
  min-height: 2.6875rem;
  justify-content: center;
  align-items: center;
  margin-left: 1.25rem;
  margin-right: 1.25rem;
  color: white;
  border-radius: 0.0625rem;
  background-color: #656565;
  box-shadow: inset 0.0625rem 0.0625rem 0rem #919191,
    inset -0.125rem -0.125rem 0.0625rem #2f2f2f;
  border: solid 0.0625rem black;
}

.commentary-home {
  color: var(--home-color-2);
  background-color: var(--home-color-1);
  box-shadow: inset 0.0625rem 0.0625rem 0rem var(--home-color-3),
    inset -0.125rem -0.125rem 0.0625rem var(--home-color-4);
}

.commentary-away {
  color: var(--away-color-2);
  background-color: var(--away-color-1);
  box-shadow: inset 0.0625rem 0.0625rem 0rem var(--away-color-3),
    inset -0.125rem -0.125rem 0.0625rem var(--away-color-4);
}

.commentary-yellow-card {
  background-color: #fefd1f;
  box-shadow: inset -0.125rem -0.125rem 0.0625rem #b79402;
}

.commentary-container[data-hide] {
  display: none;
}

.commentary-text {
  font-size: 1.5rem;
  text-align: center;
  text-shadow: 0.125rem 0.125rem 0.0625rem #101006;
}

.commentary-yellow-card .commentary-text {
  color: black;
  text-shadow: none;
}

.strike {
  text-decoration: line-through;
}

.commentary-home.commentary-goal {
  animation: goal-flash-home 0.232s steps(1, end) 14;
}

.commentary-home.commentary-goal .commentary-text {
  animation: goal-text-home 0.232s steps(1, end) 14;
}

.commentary-away.commentary-goal {
  animation: goal-flash-away 0.232s steps(1, end) 14;
}

.commentary-away.commentary-goal .commentary-text {
  animation: goal-text-away 0.232s steps(1, end) 14;
}

@keyframes goal-flash-home {
  0% {
    background-color: var(--home-color-1);
    box-shadow: inset 0.0625rem 0.0625rem 0rem var(--home-color-3);
  }
  50% {
    background-color: var(--home-color-2);
    box-shadow: inset -0.125rem -0.125rem 0.0625rem var(--home-color-5);
  }
  100% {
    background-color: var(--home-color-1);
    box-shadow: inset 0.0625rem 0.0625rem 0rem var(--home-color-3);
  }
}

@keyframes goal-text-home {
  0% {
    color: var(--home-color-2);
  }
  50% {
    color: var(--home-color-4);
    text-shadow: 0.125rem 0.125rem 0.0625rem var(--home-color-5);
  }
  100% {
    color: var(--home-color-2);
  }
}

@keyframes goal-flash-away {
  0% {
    background-color: var(--away-color-1);
    box-shadow: inset 0.0625rem 0.0625rem 0rem var(--away-color-3);
  }
  50% {
    background-color: var(--away-color-2);
    box-shadow: inset -0.125rem -0.125rem 0.0625rem var(--away-color-5);
  }
  100% {
    background-color: var(--away-color-1);
    box-shadow: inset 0.0625rem 0.0625rem 0rem var(--away-color-3);
  }
}

@keyframes goal-text-away {
  0% {
    color: var(--away-color-2);
    text-shadow: none;
  }
  50% {
    color: var(--away-color-1);
    text-shadow: none;
  }
  100% {
    color: var(--away-color-2);
    text-shadow: none;
  }
}

.possession-header {
  font-size: 0.75rem;
  min-height: 1rem;
  margin: 0;
  text-align: center;
  color: #c7c7c7;
  text-shadow: 0.125rem 0.125rem 0rem #101006;
}

.possession-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #656565;
  height: 1.875rem;
  margin: 0rem 0.625rem;
  margin-inline: 0.625rem;
  margin-block: 0rem;
  box-shadow: inset 0.0625rem 0.0625rem 0rem #919191,
    inset -0.125rem -0.125rem 0.0625rem #2f2f2f;
  border: solid 0.0625rem black;
}

.possession {
  height: 1rem;
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  width: 83.871%;
  box-shadow: -0.0625rem -0.0625rem #4d4d4d, -0.0625rem 0rem #4d4d4d,
    0.0625rem 0.0625rem #9b9b9b, -0.0625rem 0.0625rem #9b9b9b,
    0.0625rem 0rem #9b9b9b, 0.0625rem -0.0625rem #4d4d4d,
    0.0625rem -0.0625rem #9b9b9b;
}

.possession-segment {
  height: 1rem;
}

.possession-segment-home {
  background-color: var(--home-color-1);
}

.possession-segment-away {
  background-color: var(--away-color-1);
}

.possession-segment-tick {
  display: grid;
  grid-template-columns: 1fr;
  height: 1rem;
}

.possession-segment-tick.possession-segment {
  grid-column-start: 1;
  grid-row-start: 1;
}

.possession-tick {
  grid-column-start: 1;
  grid-row-start: 1;
  width: 0.0625rem;
  height: 0.1875rem;
  margin-top: -0.3125rem;
  margin-block-start: -0.3125rem;
  background-color: #f5f900;
}

.possession-tick-trailing {
  justify-self: end;
}

.footer-description-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #656565;
  height: 1.875rem;
  margin: 0rem 0.625rem;
  margin-block: 0rem;
  margin-inline: 0.625rem;
  box-shadow: inset 0.0625rem 0.0625rem 0rem #919191,
    inset -0.125rem -0.125rem 0.0625rem #2f2f2f;
  border: solid 1px black;
}

.footer-description-container:has(.button-advance:not(:disabled):active) {
  box-shadow: none;
}

.footer-description {
  color: white;
  text-shadow: 0.125rem 0.125rem 0rem #101006;
  font-size: 1.375rem;
  width: 100%;
  text-align: center;
}

.button-advance {
  width: 100%;
  background-color: inherit;
  font-size: inherit;
  color: inherit;
  text-shadow: inherit;
  box-shadow: inherit;
  cursor: pointer;
  border: inherit;
}

.button-advance:not(:disabled):active {
  width: 100%;
  background-color: inherit;
  font-size: inherit;
  color: inherit;
  text-shadow: inherit;
  box-shadow: none;
  cursor: pointer;
  border-inline-start: 0.125rem solid black;
  border-block-start: 0.125rem solid black;
  border-color: #2f2f2f;
}

.button-advance:disabled {
  cursor: not-allowed;
}

.button-advance[data-hide] {
  display: none;
}

.footer-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr 2fr 2fr;
  margin: 0rem 0.625rem;
  margin-block: 0rem;
  margin-inline: 0.625rem;
}

.footer-button {
  height: 1.875rem;
  background-color: #656565;
  color: #c7c7c7;
  font-size: 0.75rem;
  box-shadow: inset 0.0625rem 0.0625rem 0rem #919191,
    inset -0.125rem -0.125rem 0.0625rem #2f2f2f;
  text-shadow: 0.125rem 0.125rem 0rem #101006;
  border: black 1px solid;
  border-radius: 0rem;
}

.footer-link {
  height: 1.875rem;
  background-color: #656565;
  color: #c7c7c7;
  font-size: 0.75rem;
  box-shadow: inset 0.0625rem 0.0625rem 0rem #919191,
    inset -0.125rem -0.125rem 0.0625rem #2f2f2f;
  text-shadow: 0.125rem 0.125rem 0rem #101006;
  border: black 1px solid;
  border-radius: 0rem;
  grid-column-start: 1;
  grid-column-end: 6;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-button:active {
  width: 100%;
  box-shadow: none;
  border-inline-start: 0.125rem solid black;
  border-block-start: 0.125rem solid black;
  border-color: #2f2f2f;
}

.footer-button-toggled {
  height: 100%;
  background-color: #494949;
  color: #ffff22;
}

.footer-button-recording {
  box-shadow: inset 0.0625rem 0.0625rem #ffff22,
    inset -0.0625rem -0.0625rem #ffff22;
  animation-name: recording;
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

@keyframes recording {
  0% {
    box-shadow: inset 0.0625rem 0.0625rem #ffff22,
      inset -0.0625rem -0.0625rem #ffff22;
  }
  50% {
    box-shadow: inset 0.1875rem 0.1875rem #ffff22,
      inset -0.1875rem -0.1875rem #ffff22;
  }
  100% {
    box-shadow: inset 0.0625rem 0.0625rem #ffff22,
      inset -0.0625rem -0.0625rem #ffff22;
  }
}

/* About page styles */
.about-wrapper {
  display: grid;
  grid-template-columns: 1fr;
}

.about-overlapper {
  grid-row-start: 1;
  grid-column-start: 1;
}

.message-container {
  margin-left: 1.25rem;
  margin-right: 1.25rem;
  margin-inline: 1.25rem;
  margin-bottom: 1.5rem;
  margin-block-end: 1.5rem;
  min-height: 62.5svh;
  background-color: rgba(0, 0, 0, 0.5);
}

.message {
  font-size: 1.125rem;
  color: #c7c8c8;
  text-shadow: 0.125rem 0.125rem 0.0625rem black;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-inline: 0.5rem;
  margin-bottom: 1rem;
  margin-block-end: 1rem;
}

.message:first-of-type {
  padding-top: 0.5rem;
  padding-block-start: 0.5rem;
}

.message:last-of-type {
  margin-bottom: 0;
  margin-block-end: 0;
}

h1 {
  margin-top: 1.5rem;
  margin-block-start: 1.5rem;
  margin-bottom: 1.2rem;
  margin-block-end: 1.2rem;
  text-align: center;
  text-shadow: 0.1875rem 0.25rem 0rem black;
  color: white;
  font-size: 1.4rem;
}

.email-link {
  color: #c7c7c7;
}

.big-link {
  color: white;
  font-size: 1.125rem;
  font-weight: bold;
  margin-bottom: 0.3125rem;
  margin-block-end: 0.3125rem;
}
