* {
  box-sizing: border-box;
}

main {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 16px 60px;
}

body {
  margin: 0;
  min-height: 100vh;
  /*background: #d4f8ff;*/
  background: #ade0ff;
  font-family: "Gabarito", sans-serif;
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.intro h1 {
  color: #d42828;
  font-weight: 600;
  font-size: 2.5rem;
  margin: 0.5rem;
  text-align: center;
}

.intro p {
  max-width: 290px;
  font-size: 1rem;
  line-height: 1.35;
  color: #d42828;
  margin-bottom: 0.5rem;
  text-align: center;
}

.intro .logo img {
  height: auto;
  width: 90px;
  position: relative;
  display: flex;
}

h2 {
  margin: 0 0 12px;
  color: #d42828;
  font-weight: 400;
  font-size: 1.5rem;
  text-align: center;
}

.button {
  padding: 14px 22px;
  border: 0;
  border-radius: 22px;
  background: #d42828;
  color: #fff0cc;
  text-decoration: none;
  font-size: 1.5rem;
}

p {
  margin: 0 auto;
  max-width: 290px;
  font-size: 1rem;
  line-height: 1.35;
  color: #d42828;
  text-align: center;
}

h3 {
  color: #d42828;
  font-weight: 500;
  font-size: 1.5rem;
  margin-bottom: 1px;
  text-align: center;
}

.goodie-content {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.goodie-content .intro {
  width: 100%;
  margin: 0;
  text-align: center;
}

.goodie-content h1,
.goodie-content h2,
.goodie-content p {
  margin-top: 0;
  text-align: center;
}

.goodie-content p {
  max-width: 480px;
  line-height: 1.5;
}

.getTheGoodie {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.getTheGoodie img {
  display: block;
  width: min(70vw, 280px);
  height: auto;
  margin: 0 auto;
  border-radius: 15px;
}

.goodie-content .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .goodie-content {
    gap: 14px;
  }

  .getTheGoodie img {
    width: min(65vw, 240px);
  }
}

.medimemory {
  width: 100%;
  max-width: 430px;
  min-height: calc(100vh - 70px);
  margin: 0 auto;
  padding: 24px 20px 16px;
}

.memory-area {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;

  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.memory-karte {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 4px;
  border: 0;
  border-radius: 9px;
  /*background-color: #c77575;*/
  background:repeating-linear-gradient(0deg,#d42828,#d42828 10px,#d44848 10px,#d44848 20px);
  overflow: hidden;
  transition: ease-in-out 0.3s;
}

.memory-karte img {
  width: 75%;
  height: 75%;
  object-fit: contain;
}

.memory-karte.aufgedeckt {
  /*background: linear-gradient(#fff0cc, #faaeae)*/
  background: #fff0cc;
}

.memory-karte:disabled {
  cursor: default;
}

.start-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  padding: 12px 22px;
  border: 0;
  border-radius: 22px;
  background: #fff0cc;
  color: #d42828;
  font-size: 24px;
}

.start-button[hidden] {
  display: none;
}

.spiel-info {
  padding-top: 16px;
  text-align: center;
}

.found-pairs {
  color: #d42828;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  margin-bottom: 9px;
}

.goodie-button {
  width: 100%;
  display: inline-block;
  max-width: 300px;
  min-height: 42px;
  margin: 0 auto;
  padding: 8px 16px;
  box-sizing: border-box;
  border: none;
  text-decoration: none;
  text-align: center;
  border-radius: 999px;
  font-size: 19px;
  transition:
    background-color 0.3s ease,
    color 0.3s;
}

.goodie-button[aria-disabled="true"] {
  background-color: rgb(189, 180, 180);
  color: rgb(45, 56, 56);
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.goodie-button[aria-disabled="false"] {
  background-color: #d42828;
  color: #fff0cc;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.agb-hinweis {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #d42828;
  text-align: center;
}

.tutorial-dialog {
  width: calc(100% - 40px);
  max-width: 340px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #fff0cc;
  color: #d42828;
}

.tutorial-dialog::backdrop {
  background: rgb(0 0 0 / 25%);
}

.tutorial-inhalt {
  padding: 28px 20px;
  border-radius: 9px;
  text-align: center;
}

.tutorial-inhalt h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 400;
}

.tutorial-inhalt p {
  font-size: 1rem;
  line-height: 1.35;
}

.tutorial-done {
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: #d42828;
  color: #fff0cc;
  font-size: 14px;
}

@media (min-width: 500px) {
  .spiel {
    padding-top: 36px;
  }

  .memory-grid {
    gap: 6px;
  }
}

@media (max-height: 750px) {
  .memory-grid {
    gap: 6px;
  }

  main {
    padding-top: 6px;
  }

  .memory-karte img {
    width: 50%;
    height: 50%;
    object-fit: contain;
  }

  .navigation {
    padding: 8px;
  }
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 430px;
  margin: 0 auto 12px;
  position: relative;
  z-index: 1002;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-link img {
  display: block;
  width: 68px;
  height: auto;
}

.hamburger-menu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 1002;
}

.hamburger-menu span {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: #d42828;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgb(0 0 0 / 20%);
}

.menu-backdrop[hidden] {
  display: none;
}

.off-screen-menu {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1001;
  width: min(280px, 78vw);
  height: 100vh;
  height: 100dvh;
  padding: 100px 24px 30px;
  background: #fff0cc;
  border-radius: 0 0 0 18px;
  box-shadow: -8px 0 24px rgb(0 0 0 / 10%);
  transform: translateX(105%);
  visibility: hidden;
  transition:
    transform 0.25s ease,
    visibility 0.25s ease;
}

.off-screen-menu.active {
  transform: translateX(0);
  visibility: visible;
}

.off-screen-menu nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.off-screen-menu a {
  display: block;
  padding: 13px 12px;
  border-radius: 10px;
  color: #d42828;
  text-decoration: none;
  font-size: 1.2rem;
}

.tutorial-button {
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 900;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: #d42828;
  color: #fff0cc;
  font-family: "Gabarito", sans-serif;
  font-size: 16px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
  cursor: pointer;
  touch-action: manipulation;
}

.tutorial-button:active {
  transform: scale(0.97);
}

.intro-text {
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .off-screen-menu,
  .hamburger-menu span {
    transition: none;
  }
}

@media (max-width: 600px) {
  .memory-area {
    scroll-margin-top: 12px;
  }
}

.spiel-container {
  scroll-margin-top: 12px;
}

@media (max-width: 600px) {
  .spiel-container {
    scroll-margin-top: 8px;
  }
}
