:root {
  --light: #E2DCC3;
  --dark: #333;
  --bright: #B15D44;
  --darkish: #819D95;
  --green: #54A37880;
  --red: #AA4A4480;

  --shadow-color: 0deg 0% 9%;
  --shadow-layered:
    0px 1px 1.5px hsl(var(--shadow-color) / 0),
    0px 3.9px 5.9px hsl(var(--shadow-color) / 0.12),
    0px 6.9px 10.4px hsl(var(--shadow-color) / 0.23),
    0px 11.6px 17.4px hsl(var(--shadow-color) / 0.35),
    0.1px 19.9px 29.9px hsl(var(--shadow-color) / 0.46);

    background: var(--dark);
}

html {
  box-sizing: border-box
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  background-color: var(--dark);
  color: var(--light);
  font-family: "Noto Sans", sans-serif;
  font-size: clamp(12px, 4.5vmin, 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  overflow: clip;
  overflow-clip-margin: 0px;
}

h2,
h3,
h4 {
  font-weight: 400;
  margin: 0;
}

.hidden {
  display: none;
}

.logo-main {
  width: clamp(200px, 25vmin, 256px);
}

.logo-small {
  height: 36px;
}

.menu-btn {
  width: 100px;
  font-size: 36px;
  text-align: right;
  padding: 0 8px 20px 0;
  opacity: 1;
}& :hover {
  cursor: pointer;
}

nav#menu {
  font-size: clamp(12px, 4.5vmin, 16px);
  position: absolute;
  width: 200px;
  background-color: #fff;
  padding: 0;
  margin: 0;
  display: none;
  z-index: 200;
}

nav#menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav#menu a {
  text-decoration: none;
  color: #333;
  padding: 1rem;
  display: block;
}

nav#menu a:hover {
  background-color: #f0f0f0;
}

.landing-parent,
.start-parent,
.game-parent,
.results-parent {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100dvh;
  /* transition: all .5s ease-in-out; */
}

.landing {
  width: clamp(325px, 85vmin, 512px);
  height: 100dvh;
  max-height: 1024px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 40px 1fr .5fr .75fr 1.5fr 1fr;
  gap: 4px 0px;
  grid-auto-flow: row;
  justify-items: center;
  align-items: center;
  grid-template-areas:
    "header"
    "logo"
    "tagline"
    "welcome"
    "options"
    "bottom";
}

.welcome {
  align-self: end;
  grid-area: welcome;
}

.options {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: .5fr .5fr .5fr;
  gap: 0px 0px;
  grid-auto-flow: row;
  justify-items: center;
  align-items: center;
  grid-template-areas:
    "top-btn"
    "middle-btn"
    "bottom-btn";
  justify-self: stretch;
  align-self: stretch;
  grid-area: options;
}

.start {
  width: clamp(325px, 85vmin, 512px);
  height: 100dvh;
  max-height: 1024px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 40px 1fr .5fr .75fr 1.5fr 1fr;
  gap: 4px 0px;
  grid-auto-flow: row;
  justify-items: center;
  align-items: center;
  grid-template-areas:
    "header"
    "logo"
    "tagline"
    "choose"
    "levels"
    "date";
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  justify-self: stretch;
  grid-area: header;
}

.logo {
  grid-area: logo;
  align-self: end;
}

.tagline {
  align-self: start;
  grid-area: tagline;

  & h3 {
    font-style: italic;
  }
}

.choose {
  align-self: end;
  grid-area: choose;
}

.date {
  align-self: start;
  grid-area: date;
}

.levels {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: .5fr .5fr .5fr;
  gap: 0px 0px;
  grid-auto-flow: row;
  justify-items: center;
  align-items: center;
  grid-template-areas:
    "easy"
    "medium"
    "hard";
  justify-self: stretch;
  align-self: stretch;
  grid-area: levels;
}

.easy {
  grid-area: easy;
}

.medium {
  grid-area: medium;
}

.hard {
  grid-area: hard;
}

.game {
  display: grid;
  height: 100dvh;
  max-height: 1024px;
  grid-template-columns: 1fr;
  grid-template-rows: 40px 1fr;
  grid-auto-rows: 1fr;
  gap: 0px 0px;
  grid-auto-flow: row;
  grid-template-areas:
    "game-header"
    "game-area";
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  grid-area: game-header;
}

.back-btn {
  display: flex;
  width: 100px;
  padding-left: 12px;
  font-size: 14px;
  align-items: center;
}

.back-btn::before {
  content: " ";
  border-right: 2px solid var(--light);
  border-top: 2px solid var(--light);
  width: 14px;
  height: 14px;
  transform: rotate(225deg);
  display: inherit;
}

.game-area {
  height: 100%;
  width: clamp(325px, 85vmin, 512px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 0.05fr 0.07fr 0.08fr 0.1fr 0.7fr;
  gap: 2px 4px;
  justify-self: center;
  justify-items: center;
  justify-content: center;
  align-content: center;
  align-items: center;
  grid-auto-flow: row;
  grid-template-areas:
    "level level"
    "timer timer"
    "stats stats"
    "answer-a answer-b"
    "image-cards image-cards";
  grid-area: game-area;
}

.level {
  grid-area: level;
  padding-top: 0;
  align-self: flex-start;
}

.timer {
  grid-area: timer;
  font-size: 28px;
  padding-bottom: 0;
  margin-bottom: 0;
  align-self: flex-end;
}

.stats {
  grid-area: stats;
  width: 100%;
  align-self: flex-start;
}

.progress-bar {
  display: flex;
  width: 100%;
  height: 32px;

  & #complete {
    flex-grow: 0;
    background-color: var(--bright);
    color: var(--light);
    transition: all .5s ease-in-out;
  }

  & #incomplete {
    flex-grow: 1;
    background-color: var(--light);
    color: var(--dark);
    transition: all .5s ease-in-out;
  }

  & div {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    & p {
      padding: 4px;
    }
  }
}

.answer-a {
  grid-area: answer-a;
  display: flex;
  align-items: center;
  justify-content: left;
  padding-left: 16px;
  width: 100%;
  height: 60%;
}

.answer-b {
  grid-area: answer-b;
  display: flex;
  align-items: center;
  justify-content: right;
  padding-right: 16px;
  width: 100%;
  height: 60%;
}

.choice {
  font-size: clamp(20px, 4.5vmin, 24px);
}

.image-cards {
  grid-area: image-cards;
  display: flex;
  align-self: start;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100%;

  /* padding-top: calc(100% * (4 / 3)); */
  &::after {
    position: absolute;
    content: " ";
    border-right: 2px solid var(--light);
    border-top: 2px solid var(--light);
    width: 14px;
    height: 14px;
    top: 50%;
    right: -14px;
    transform: rotate(45deg);
    display: inline-block;
  }

  ;

  &::before {
    position: absolute;
    content: " ";
    border-right: 2px solid var(--light);
    border-top: 2px solid var(--light);
    width: 14px;
    height: 14px;
    top: 50%;
    left: -14px;
    transform: rotate(225deg);
    display: inline-block;
  }
}

.image-card {
  position: absolute;
  aspect-ratio: 3 / 4;
  height: 100%;
  border-radius: 8px;
  transform: scale(.75);
  top: -8%;
  z-index: 80;
  transition: all .5s ease-in-out;
  box-shadow: var(--shadow-layered);

  &.current {
    transform: scale(.9);
    top: 0;
    z-index: 100;
    /* box-shadow: var(--shadow-layered); */
  }

  ;

  &.next {
    transform: scale(.8);
    z-index: 99;
  }

  ;

  &.answered-a {
    animation: swipe-left .5s ease-in-out both;
    transform: scale(.9);
    top: 0;
    z-index: 105;
  }

  ;

  &.answered-b {
    animation: swipe-right .5s ease-in-out both;
    transform: scale(.9);
    top: 0;
    z-index: 105;
  }

  ;
}

.image {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  user-select: none;
}

.image-card .credit {
  position: absolute;
  bottom: 0;
  width: 100%;
  font-size: .6rem;
  text-align: right;
  color: var(--light);
  padding: 64px 8px 8px 8px;
  background: linear-gradient(#00000000, #00000090);
  pointer-events: none;
  cursor: default;
  border-radius: 0 0 8px 8px;

  & a {
    color: inherit;
    text-decoration: none;
  }
}

.results {
  display: grid;
  height: 100dvh;
  max-height: 1024px;
  grid-template-columns: 1fr;
  grid-template-rows: 48px 1fr;
  gap: 0px 0px;
  grid-auto-flow: row;
  grid-template-areas:
    "results-header"
    "results-area";
}

.results-header {
  grid-area: results-header;
  display: flex;
  justify-content: center;
  /* align-content: center; */

}

.results-area {
  grid-area: results-area;
  display: grid;
  max-width: 80vw;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr .5fr .25fr 1fr;
  gap: 0px 0px;
  grid-auto-flow: row;
  justify-items: center;
  justify-self: center;
  grid-template-areas:
    "message"
    "final-stats"
    "details"
    "options";
}

.message {
  grid-area: message;
  align-self: end;
  text-align: center;
}

.final-stats {
  grid-area: final-stats;
  align-self: end;
  text-align: center;
}

.details {
  grid-area: details;
  align-self: start;
}

.options {
  grid-area: options;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 4px 0px;
  grid-auto-flow: row;
  grid-template-areas:
    "share"
    "play-another"
    ".";
  align-items: center;
  align-self: stretch;

}

.share {
  grid-area: share;
}

.play-another {
  grid-area: play-another;
}

button {
  font-size: clamp(20px, 4.5vmin, 24px);
  width: clamp(128px, 50vmin, 256px);
  min-height: 36px;
  padding: 8px;
  margin: 4px;
  border: none;
  border-radius: 4px;
  background-color: var(--bright);
  color: var(--light);
} & .light {
  background-color: var(--light);
  color: var(--dark);
} 

.display-none {
  display: none;
  opacity: 0;
}

.fade-in {
  animation: fade-in .5s linear forwards;
}

.fade-out {
  animation: fade-out .5s linear forwards;
}

.correct {
  animation: correct .5s ease-in-out;
}

.incorrect {
  animation: incorrect .5s ease-in-out;
}

@keyframes fade-in {
  0% {
    opacity: 0;
    visibility: hidden;
  }

  100% {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes fade-out {
  0% {
    opacity: 1;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes swipe-left {
  0% {
    transform: translateX(0);
  }

  90% {
    transform: translateX(-150%);
    opacity: .9;
  }

  100% {
    transform: translateX(-150%);
    opacity: 0;
  }
}

@keyframes swipe-right {
  0% {
    transform: translateX(0);
  }

  90% {
    transform: translateX(+150%);
    opacity: .9;
  }

  100% {
    transform: translateX(+150%);
    opacity: 0;
  }
}

@keyframes correct {
  0% {
    background-color: var(--dark);
  }

  50% {
    background-color: var(--green);
  }

  100% {
    background-color: var(--dark);
  }
}

@keyframes incorrect {
  0% {
    background-color: var(--dark);
  }

  50% {
    background-color: var(--red);
  }

  100% {
    background-color: var(--dark);
  }
}