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

:root {
  --bg-color: #380011;
  --border-color: var(--color-2);
  --color-1: #06673D;
  --color-2: #799108;
  --color-highlight: #A4C50BFF;
  --container-width: min(90vw, 90vh);
  --countdown-border-width: 10px;
}

html,
body {
  margin: 0px;
  background-color: var(--bg-color);
  overflow: hidden;

  font-family: monospace;
  font-weight: bold;
  font-size: xxx-large;
  color: var(--color-2);

  user-select: none;
}

#container {
  width: 100vw;
  height: 100vh;
  
  max-width: 100vw;
  max-height: 100vh;

  display: grid;

  margin: auto;
  margin-top: 0px;
}

#bottom {
  position: absolute;
  width: 100%;
  bottom: 5%;

  display: grid;

  grid-template-columns: auto auto;
}

.text-left {
  position: absolute;
  left: 5%;
}

.text-right {
  position: absolute;
  right: 5%;
}

#tiles {
  position: absolute;
  left: calc(50% - (var(--container-width) - var(--countdown-border-width) * 3) / 2);
  top: calc(50% - (var(--container-width) - var(--countdown-border-width) * 3) / 2);

  width: calc(var(--container-width) - var(--countdown-border-width) * 3);
  height: calc(var(--container-width) - var(--countdown-border-width) * 3);

  border-radius: 100%;

  display: grid;
  align-content: center;
  justify-items: center;

  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;

  z-index: 20;

  gap: 5px;
}

.tile {
  display: grid;
  align-content: center;
  justify-content: center;
  width: 100%;

  background: var(--color-1);
  border: 2px solid var(--border-color);
}

@media (hover: hover) {
  .tile:hover {
    cursor: pointer;
    background-color: var(--color-2);
    color: var(--color-1);
  }
}
.tile:active {
  cursor: pointer;
  background-color: var(--color-2);
  color: var(--color-1);
}

#tile-tl {
  border-radius: 100% 0 0 0;
}
#tile-tl > span {
  top: 24%;
  left: 24%;
}

#tile-tr {
  border-radius: 0 100% 0 0;
}
#tile-tr > span {
  top: 24%;
  left: 67%;
}

#tile-br {
  border-radius: 0 0 100% 0;
}
#tile-br > span {
  top: calc(100% * 2/3);
  left: calc(100% * 2/3);
}

#tile-bl {
  border-radius: 0 0 0 100%;
}
#tile-bl > span {
  top: calc(100% * 2/3);
  left: 24%;
}

#question-container {
  position: absolute;

  width: 100%;
  height: 100%;

  justify-items: center;
  align-content: center;
  z-index: 30;


  pointer-events: none;
}

#question {
  border: 2px solid var(--border-color);
  background: var(--color-1);
  color: var(--color-2);

  padding: 10px;
  width: fit-content;
  margin: auto;

  pointer-events: auto;
}

#countdown-container {
  position: absolute;
  left: calc(50% - var(--container-width) / 2);
  top: calc(50% - var(--container-width) / 2);

  z-index: 4;

  pointer-events: none;
}

#filler,
#mask,
#spinner {
  border: var(--countdown-border-width) solid green;

  width: calc(var(--container-width) / 2);
  height: var(--container-width);

  position: absolute;

  transform-origin: 100% 50%;
}

#mask {
  animation: opa 5s steps(1, end) infinite reverse;
  background: var(--bg-color);
  border: none;
  position: absolute;
  z-index: 10;

  width: calc(var(--container-width) / 2 + 10px);
  height: calc(var(--container-width) + 10px);

  left: -10px;
  top: -10px;
}

#filler {
  border-radius: 0 100% 100% 0 / 0 50% 50% 0;
  animation: opa 5s steps(1, end) infinite, countdown-color 5s linear infinite;
  border-left: none;

  z-index: 5;

  left: calc(var(--container-width) / 2);
}

#spinner {
  border-radius: 100% 0 0 100% / 50% 0 0 50%;
  border-right: none;

  z-index: 7;

  animation: rota 5s linear infinite reverse, countdown-color 5s linear infinite;
}

@keyframes countdown-color {
  0% {
    border-color: green;
  }
  50% {
    border-color: yellow;
  }
  100% {
    border-color: red;
  }
}

@keyframes opa {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

@keyframes rota {
  to {
    transform: rotate(360deg);
  }
}

@keyframes timer-anim {
  from {
    background-image: conic-gradient(red 0%, transparent 0%);
  }

  to {
    background-image: conic-gradient(red 60%, transparent 0%);
  }
}
