:root {
  --sqrt-3: 1.73205080757;

  --star-color: rgb(255, 215, 40);
  --star-color-hover: rgb(255, 215, 10);
  --star-color-focus: orange;
  --star-color-wise: rgb(255, 216, 116);
  --star-num-color-1: darkblue;
  --star-num-color-2: darkred;
  --star-num-color-3: darkgreen;
  --star-num-color-4: purple;
  --star-num-color-riddle: wheat;
  /* --star-num-color-riddle: rgb(200, 200, 200); */
}

/* sound */
.soundIcon {
  position: fixed;
  left: 8px;
  top: calc(var(--navHeight) + 8px);
  width: 32px;
  z-index: 1;
  transition: 0.15s;
  cursor: pointer;
}
.soundIcon:hover,
.soundIcon:focus {
  scale: 1.1;
}

/* nav btn */
.advCalNavBtn {
  position: fixed;
  right: 16px;
  top: calc(var(--navHeight) + 8px);
  transition: 0.15s;
  cursor: pointer;
  background-color: rgba(2, 0, 54, 1);
  border: 1px solid rgba(6, 6, 92, 1);
  box-shadow: 2px 2px 4px 1px black;
  border-radius: 2px;
  padding: 8px 16px;
  font-size: 0.8em;
  font-variant-caps: petite-caps;
  z-index: 1;
}
.advCalNavBtn:hover,
.advCalNavBtn:focus {
  scale: 1.05;
  border: 1px solid var(--contrastcolor);
}
.advCalNavBtn:active {
  scale: 0.8;
}
.advCalNavBtn.hidden {
  display: none;
}

/* calendar */
.stars {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  height: max-content;
  padding: 8px 0px 32px 0px;
}

.stars.riddle {
  margin-top: 64px;
}

.star {
  margin: var(--margin, 0.4em);
  width: 0;
  height: 0;
  font-size: var(--size, 5em);
  border-right: 1em solid transparent;
  border-left: 1em solid transparent;
  border-bottom: calc(1em * var(--sqrt-3)) solid var(--star-color);
  position: relative;
  filter: drop-shadow(0px 0px 6px var(--star-color))
    drop-shadow(-2px 2px 8px black);

  user-select: none;
  transform: rotate(var(--rotation));
  cursor: wait;
  scale: 1;

  transition:
    all 0.15s,
    opacity 1s,
    scale 0.75s;
  animation-timing-function: ease-in-out;
  animation-duration: 1s;
}
.star:after {
  width: 0;
  height: 0;
  border-top: calc(1em * var(--sqrt-3)) solid var(--star-color);
  border-right: 1em solid transparent;
  border-left: 1em solid transparent;

  position: absolute;
  content: "";
  top: calc(1em * var(--sqrt-3) / 3);
  left: -1em;

  transition:
    all 0.15s,
    opacity 1s,
    scale 1s;
}
.stars.riddle .star:not(.active) {
  cursor: not-allowed;
}
.star.active {
  cursor: pointer;
}
.star.active:focus {
  outline: none;
  border-bottom: calc(1em * var(--sqrt-3)) solid var(--star-color-focus);
  animation-name: shake;
  scale: 1.1;
}
.star.active:hover {
  animation-name: shake;
  scale: 1.1;
}
.star.active:focus:after {
  border-top: calc(1em * var(--sqrt-3)) solid var(--star-color-focus);
}
.star.wise {
  border-bottom: calc(1em * var(--sqrt-3)) solid var(--star-color-wise);
  filter: drop-shadow(0px 0px 6px wheat) drop-shadow(-2px 2px 8px black);
}
.star.wise:after {
  border-top: calc(1em * var(--sqrt-3)) solid var(--star-color-wise);
}

@keyframes shake {
  0% {
    transform: rotate(var(--rotation));
  }

  12% {
    transform: rotate(calc(var(--rotation) + 6deg));
  }

  36% {
    transform: rotate(calc(var(--rotation) - 6deg));
  }

  60% {
    transform: rotate(calc(var(--rotation) + 6deg));
  }

  84% {
    transform: rotate(calc(var(--rotation) - 6deg));
  }

  96% {
    transform: rotate(var(--rotation));
  }
}

.star.opened {
  transition:
    transform 3s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 2s ease-in;
  transform: translate(
      calc(50vw - 50% - var(--start-x, 0px)),
      calc(50vh - 50% - var(--start-y, 0px))
    )
    rotate(0deg);

  scale: 1;
  transform-origin: center center;
  will-change: transform;
}

.star.hidden {
  opacity: 0 !important;
  scale: 0;
}

@media (max-width: 900px) {
  .star {
    font-size: calc(0.85 * var(--size, 5em));
  }
}

@media (max-width: 600px) {
  .star {
    font-size: calc(0.75 * var(--size, 5em));
    margin: calc(0.9 * var(--margin, 0.4em));
  }
}

@media (max-width: 450px) {
  .star {
    font-size: calc(0.6 * var(--size, 5em));
    margin: calc(0.71 * var(--margin, 0.4em));
  }
}

@media (max-width: 375px) {
  .star {
    font-size: calc(0.58 * var(--size, 5em));
    margin: calc(0.69 * var(--margin, 0.4em));
  }
}

.star .number {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 1em;
  height: 1em;
  left: -0.5em;
  top: 0.77em;
  z-index: 2;
  font-size: 0.9em;
  text-shadow: 0px 0px 2px black;
  font-family: Roboto, sans-serif;
}
.star .number.type1 {
  color: var(--star-num-color-1);
}
.star .number.type2 {
  color: var(--star-num-color-2);
}
.star .number.type3 {
  color: var(--star-num-color-3);
}
.star .number.type4 {
  color: var(--star-num-color-4);
}
.star .number.typeRiddle {
  color: var(--star-num-color-riddle);
}

.christmasArea {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 400px;
  margin: 128px 0;
  position: relative;
  overflow: hidden;
}

.christmasStar {
  --christmasSize: 300px;
  width: 95%;
  max-width: var(--christmasSize);
  height: var(--christmasSize);
  fill: var(--star-color);
  filter: drop-shadow(0px 0px 6px var(--star-color))
    drop-shadow(0px 0px 8px wheat) drop-shadow(-2px 2px 16px black);
  transition:
    all 10s,
    scale 1s;

  position: absolute;
  left: calc(50% - (var(--christmasSize) / 2));

  cursor: pointer;
  border-radius: 50%;
  padding: 4px;
  animation: christmasMoving 120s infinite linear;
}
.christmasStar.broken {
  fill: rgb(66, 66, 66);
  filter: drop-shadow(0px 0px 4px black);
  opacity: 0.6;
}

@keyframes christmasMoving {
  0% {
    left: calc(50% - (var(--christmasSize) / 2));
    rotate: 0deg;
  }

  25% {
    left: calc(100% - var(--christmasSize) - 32px);
    rotate: 90deg;
  }

  75% {
    left: 32px;
    rotate: 270deg;
  }

  100% {
    left: calc(50% - (var(--christmasSize) / 2));
    rotate: 360deg;
  }
}

.christmasStar:hover,
.christmasStar:focus {
  animation-play-state: paused;
  scale: 1.1;
  transition:
    all 10s,
    scale 0.5s;
}

.christmasStar.opening {
  scale: 0;
  transition:
    all 0s,
    scale 0.5s;
}

.christmasStar.opened {
  animation-name: christmasOpened;
  scale: 1;
  position: unset;
  left: 0;
  transition: 0.5s;
  cursor: unset;
}
.christmasStar.broken.opened {
  opacity: 0.7;
}

@keyframes christmasOpened {
  0% {
    rotate: 0deg;
  }

  25% {
    rotate: 90deg;
  }

  75% {
    rotate: 270deg;
  }

  100% {
    rotate: 360deg;
  }
}

.christmasStar.hidden {
  animation-play-state: paused;
  scale: 0;
}

/* game */
.gameArea {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  color: aliceblue;
  scale: 1;
  opacity: 1;
  transition: 0.3s ease-out;
  padding: 16px;
}
.gameArea.hidden {
  scale: 0.9;
  opacity: 0;
}

.gameBoard {
  width: 90%;
  max-width: 300px;

  background-color: rgb(33, 33, 44);
  border: 2px solid rgb(22, 22, 22);
  border-radius: 16px;
  box-shadow: 0px 2px 16px 0px rgba(205, 205, 205, 0.5);

  margin-top: 16px;
  padding: 16px;
  padding-top: 36px;

  z-index: 3;
  transition: 0.3s ease-out;

  position: relative;
}
.gameBoard.hidden {
  scale: 0.9;
  opacity: 0;
}

.gameBackBtn {
  background: none;
  color: rgba(205, 205, 205, 0.5);
  cursor: pointer;
  transition: 0.15s;
  outline: none;
  border: 2px solid transparent;
  border-radius: 8px;
  font-variant-caps: all-petite-caps;

  display: flex;
  align-items: center;
  letter-spacing: 1px;

  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
}
.gameBackBtn:hover,
.gameBackBtn:focus {
  color: rgba(205, 205, 205, 0.75);
  border: 2px solid rgba(205, 205, 205, 0.75);
}
.gameBackBtn:disabled {
  opacity: 0.6;
  border: 2px solid transparent;
  cursor: not-allowed;
}

.gameBackBtn.riddle {
  position: absolute;
  top: -40px;
  left: 0;
  transform: unset;
  color: wheat;
}

.gameBackBtn.riddleControl {
  position: unset;
  top: unset;
  left: unset;
  transform: unset;
  color: wheat;
}

.gameBackBtnImg {
  width: 32px;
  margin-right: 4px;
}
.gameBackBtnImg.controlBtn {
  opacity: 0.8;
}
.gameBackBtnImg.next {
  transform: rotateY(-180deg);
}

.gameRow {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  margin: 8px 0px;
  position: relative;
  opacity: 0.75;
}
.gameRow.inGame {
  opacity: 1;
}
.gameRow.solution {
  margin-bottom: 16px;
  opacity: 1;
}

.gameElement {
  width: 40px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid rgb(8, 8, 8);
  background-color: rgb(66, 66, 66);

  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.25em;
  font-weight: bold;
  user-select: none;

  background-position: center;
  background-size: 85%;
  background-repeat: no-repeat;
}

.gameElement.bells {
  background-image: url(./src/img/bells.svg);
}
.gameElement.christmas-tree {
  background-image: url(./src/img/christmas-tree.svg);
}
.gameElement.present {
  background-image: url(./src/img/present.svg);
}
.gameElement.snowflake {
  background-image: url(./src/img/snowflake.svg);
}
.gameElement.snowman {
  background-image: url(./src/img/snowman.svg);
}
.gameElement.sock {
  background-image: url(./src/img/sock.svg);
}
.gameElement.shooting-star {
  background-image: url(./src/img/shooting-star.svg);
}
.gameElement.skate {
  background-image: url(./src/img/skate.svg);
}

.gameElement.active {
  box-shadow: 0px 0px 4px 2px white;
}

.gameIndicator {
  padding: 2px;
  font-weight: bold;
  font-size: 1.1em;
  position: absolute;
  font-family: Arial, Helvetica, sans-serif;
}
.gameIndicator.correctPosition {
  color: lightseagreen;
  left: -12px;
}
.gameIndicator.correctColor {
  color: orange;
  right: -12px;
}

.gameGamepieces {
  margin-top: 16px;
  background-color: rgb(77, 77, 77);
  border: 1px solid rgb(8, 8, 8);
  border-radius: 4px;
  padding: 4px;
}

.gameGamepiecesRow {
  display: flex;
  justify-content: space-evenly;
  margin: 2px 0px 4px 0px;
}

.gameGamepiecesRow .gameElement {
  cursor: grab;
}

.gameBtn {
  display: block;
  margin: 0 auto;
  margin-top: 16px;
  padding: 8px 16px;

  border: 1px solid rgb(8, 8, 8);
  background-color: rgb(66, 66, 66);
  border-radius: 2px;

  font-variant-caps: petite-caps;
  font-size: 1em;

  cursor: pointer;
  outline: none;
  transition: 0.15s;
}
.gameBtn:hover,
.gameBtn:focus {
  border: 1px solid rgba(205, 205, 205, 0.5);
  scale: 1.1;
}
.gameBtn:active {
  scale: 0.8;
}
.gameBtn:disabled {
  opacity: 0.6;
  scale: 1;
  border: 1px solid rgb(8, 8, 8);
  cursor: not-allowed;
}

.gameAlertText {
  display: block;
  margin: 16px;
  opacity: 0.85;
  text-align: center;
}
.gameAlertText.info {
  letter-spacing: 1px;
  font-style: italic;
}

/* riddle */
.riddleArea {
  width: 100%;
  display: flex;
  justify-content: center;
  color: aliceblue;
}

.riddleLetter {
  width: 90%;
  max-width: 450px;
  min-height: 636px;

  background: radial-gradient(
    ellipse at center,
    #f8f2e4 0%,
    #e8dcc4 40%,
    #d1be9d 75%,
    #9c8058 100%
  );

  box-shadow:
    inset 0 0 30px rgba(70, 45, 15, 0.4),
    1px 1px 6px 0px black;
  border-radius: 4px;
  padding: 2rem;

  margin: 3em 0.5em;
  rotate: -1deg;
  scale: 1;
  opacity: 1;
  transition: 1s ease-in-out;

  position: relative;
}
.riddleLetter.bigger {
  max-width: 550px;
  min-height: 778px;
  width: 85%;
}
.riddleLetter.hidden {
  scale: 0;
  opacity: 0.8;
}

.riddleText {
  font-family: Caveat;
  font-size: 1.3em;
  font-weight: bold;
  color: #1c2333;
  text-shadow: 0 0 1px rgba(27, 42, 58, 0.4);
}
.riddleText.headline {
  font-size: 2em;
  font-variant-caps: petite-caps;
  text-align: center;
  margin-top: 2em;
}
.riddleText.legal {
  font-size: 1em;
  font-weight: normal;
  text-align: center;
  margin-top: 2em;
  font-family: "Times New Roman", Times, serif;
}
.riddleText.video {
  display: block;
  margin-top: 8em;
  text-align: center;
  font-variant-caps: petite-caps;
  font-family: "Times New Roman", Times, serif;
  font-size: 1em;
  font-weight: normal;
}

.riddleControlBtns {
  position: absolute;
  bottom: -40px;
  display: flex;
  align-items: center;
}

.riddleControlIndicator {
  color: wheat;
  font-size: 0.9em;
  margin: 0 8px;
}

.riddleInput {
  background: none;
  border: none;
  color: #1c2333;
  font-family: Caveat;
  color-scheme: light;
  font-weight: bold;
  font-size: 0.9em;
  outline: none;
  border-bottom: 1px solid transparent;
  margin-right: 2px;
  transition: 0.15s;
  max-width: 100%;
}
.riddleInput:hover,
.riddleInput:focus {
  border-bottom: 1px solid #1c2333;
}

.riddleInput option {
  font-size: 0.8em;
  font-weight: normal;
}

.timeJump {
  position: fixed;
  display: block;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 auto;
  font-variant-caps: petite-caps;
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
  animation: zoomThrough 3s ease-in-out;
}

@keyframes zoomThrough {
  0% {
    scale: 0.5;
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  70% {
    opacity: 1;
  }

  100% {
    scale: 2;
    opacity: 0;
  }
}

/* envelope */
.envelope {
  position: relative;
  width: 95%;
  max-width: 500px;
  aspect-ratio: 25 / 16;
  user-select: none;
  opacity: 1;
  scale: 1;
  rotate: 1deg;
  transition: 1s;
  margin: 3em 1em;
}
.envelope.hidden {
  opacity: 0;
  scale: 0;
  rotate: -90deg;
}

.envelopeFront {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f9f6ef, #ece5d9);
  border: 1px solid #c8c0b1;
  border-radius: 4px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.envelopePostmark {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 100px;
  height: 80px;

  background-color: var(--contrastcolor);
  background-image: url("https://per-la-vita.de/src/icon/plv-bakawe.png");
  background-size: 100px;
  background-repeat: no-repeat;
  background-position: center;

  border: 3px solid var(--contrastcolor);

  clip-path: polygon(
    0% 5%,
    5% 0%,
    10% 5%,
    15% 0%,
    20% 5%,
    25% 0%,
    30% 5%,
    35% 0%,
    40% 5%,
    45% 0%,
    50% 5%,
    55% 0%,
    60% 5%,
    65% 0%,
    70% 5%,
    75% 0%,
    80% 5%,
    85% 0%,
    90% 5%,
    95% 0%,
    100% 5%,

    95% 10%,
    100% 15%,
    95% 20%,
    100% 25%,
    95% 30%,
    100% 35%,
    95% 40%,
    100% 45%,
    95% 50%,
    100% 55%,
    95% 60%,
    100% 65%,
    95% 70%,
    100% 75%,
    95% 80%,
    100% 85%,
    95% 90%,
    100% 95%,

    95% 100%,
    90% 95%,
    85% 100%,
    80% 95%,
    75% 100%,
    70% 95%,
    65% 100%,
    60% 95%,
    55% 100%,
    50% 95%,
    45% 100%,
    40% 95%,
    35% 100%,
    30% 95%,
    25% 100%,
    20% 95%,
    15% 100%,
    10% 95%,
    5% 100%,
    0% 95%,

    5% 90%,
    0% 85%,
    5% 80%,
    0% 75%,
    5% 70%,
    0% 65%,
    5% 60%,
    0% 55%,
    5% 50%,
    0% 45%,
    5% 40%,
    0% 35%,
    5% 30%,
    0% 25%,
    5% 20%,
    0% 15%,
    5% 10%,
    0% 5%
  );

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 0px 8px;
  box-sizing: content-box;
}

.envelopeAddress {
  position: absolute;
  left: 60px;
  bottom: 40px;
  color: #444;
  line-height: 1.5;
  font-size: 20px;
}

.envelopeSender {
  position: absolute;
  left: 25px;
  top: 20px;
  font-size: 12px;
  color: #777;
}

@media (max-width: 450px) {
  .envelopeAddress {
    left: 40px;
    bottom: 30px;
    line-height: 1.2;
    font-size: 18px;
  }

  .envelopeSender {
    left: 15px;
    top: 15px;
  }

  .envelopePostmark {
    top: 15px;
    right: 15px;
    width: 80px;
    height: 60px;
    background-size: 80px;
  }
}

@media (max-width: 350px) {
  .envelopeAddress {
    left: 30px;
    bottom: 20px;
    line-height: 1.1;
    font-size: 16px;
  }

  .envelopeSender {
    font-size: 10px;
  }

  .envelopePostmark {
    width: 70px;
    height: 55px;
    background-size: 70px;
  }
}

/* statistics */
.statsArea {
  width: 80%;
  margin-left: 10%;

  background-color: rgb(33, 33, 44);
  border: 2px solid rgb(22, 22, 22);
  border-radius: 16px;
  box-shadow: 0px 2px 16px 0px rgba(205, 205, 205, 0.5);
  color: white;

  margin-top: 16px;
  padding: 16px;

  position: relative;
}

.statsHeadline {
  font-size: 1.5em;
  font-variant-caps: petite-caps;
  text-align: center;
}

.statsAsAt {
  position: absolute;
  top: 2px;
  left: 16px;
  opacity: 0.5;
  font-size: 0.8em;
}

.statsStatisticsArea {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin-top: 32px;
}

.statsStatisticsElementArea {
  width: 100%;
  margin-top: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--thirdgrey);
  display: flex;
  justify-content: space-between;
  transition: 0.15s;
}
.statsStatisticsElementArea:hover {
  border-bottom: 1px solid var(--contrastcolor);
}
.statsStatisticsElementArea.child {
  width: calc(100% - 16px);
  margin-left: 16px;
}
.statsStatisticsElementArea.childsChild {
  width: calc(100% - 32px);
  margin-left: 32px;
}

.statsStatisticsElementHeadline {
  font-variant-caps: petite-caps;
  font-weight: bold;
  opacity: 0.8;
}

.statsStatisticsHeadline {
  font-variant-caps: petite-caps;
  font-weight: bold;
  border-bottom: 1px solid var(--thirdgrey);
  margin-top: 16px;
  padding-bottom: 4px;
}

/* help */
.gameBoard.explanation {
  margin-left: 3em;
  max-width: 450px;
}
@media (max-width: 880px) {
  .gameArea {
    flex-direction: column;
    align-items: center;
  }
  .gameBoard.explanation {
    margin-left: 0;
  }
}

.gameAlertText.explanationHeadline {
  font-variant-caps: petite-caps;
  opacity: 1;
  margin: 0;
  margin-bottom: 16px;
  font-size: 1.2em;
  font-weight: bold;
}

.gameAlertText.explanation {
  opacity: 1;
  margin: 0;
  margin-top: 8px;
}

/* popUp */
.smallPopUp {
  position: fixed;
  left: 50%;
  bottom: -100px;
  width: max-content;
  max-width: 90%;
  transform: translateX(-50%);
  opacity: 0;
  transition: 0.3s ease-out;

  padding: 8px 16px;
  border-radius: 2px;
  text-align: center;
  z-index: 300;
  box-shadow: 0px 2px 8px 1px black;
}
.smallPopUp.top {
  bottom: unset;
  top: 0px;
  z-index: 299;
}
.smallPopUp.success {
  background-color: rgb(89, 255, 23);
  border: 4px double rgb(89, 187, 23);
  color: black;
}
.smallPopUp.warning {
  background-color: rgb(255, 205, 40);
  border: 4px double rgb(255, 165, 40);
  color: black;
}
.smallPopUp.error {
  background-color: rgb(255, 99, 71);
  border: 4px double rgb(255, 71, 71);
  color: white;
}
.smallPopUp.info {
  background-color: var(--backgroundcolor);
  border: 4px double var(--secondbackgroundcolor);
  color: white;
}
.smallPopUp.shown {
  bottom: 32px;
  opacity: 1;
}
.smallPopUp.top.shown {
  bottom: unset;
  top: calc(var(--navHeight) + 32px);
  opacity: 1;
}

/* background */
body {
  background: linear-gradient(
      45deg,
      rgba(2, 0, 18, 1) 0%,
      rgba(2, 0, 36, 1) 13%,
      rgba(2, 0, 54, 1) 68%,
      rgba(6, 6, 92, 1) 97%
    )
    fixed;
}

.backStars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
}

.backStar {
  box-shadow: 0px 0px 1px 1px rgba(255, 255, 255, 0.4);
  position: absolute;
  width: 1px;
  height: 1px;
  border-radius: 2px;
  background-color: white;
  transition: 0.5s;
  margin: 2px;
}
