:root {
  --ink: #221e1a;
  --paper: #f7f3ea;
  --paper2: #fbf8f1;
  --crayon-red: #c73b2f;
  --crayon-blue: #2b4fb8;
  --crayon-green: #2c8b4b;
  --shadow: rgba(0, 0, 0, 0.28);
  --shadow-soft: rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #2b241e;
  background-image: url("./images/desk.png");
  background-position: center;
  background-size: cover;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      1200px 700px at 50% 30%,
      rgba(255, 255, 255, 0.06),
      rgba(0, 0, 0, 0.55)
    ),
    linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12));
  pointer-events: none;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 6vh 4vw;
}

.paper-scene {
  position: relative;
  width: min(980px, 94vw);
  perspective: 1400px;
}


.paper-scene::before {
  top: 14px;
  left: 18%;
  transform: rotate(-8deg);
}

.paper-scene::after {
  bottom: 18px;
  right: 16%;
  transform: rotate(7deg);
}

.paper {
  position: relative;
  width: 100%;
  display: grid;
  transform-style: preserve-3d;
  transition: transform 780ms cubic-bezier(0.2, 0.9, 0.2, 1);
  transform: rotateZ(-0.7deg);
}

.paper.is-flipped {
  transform: rotateY(180deg) rotateZ(0.5deg);
}

.paper__side {
  position: relative;
  grid-area: 1 / 1;
  padding: clamp(18px, 3.2vw, 34px);
  padding-bottom: calc(clamp(18px, 3.2vw, 34px) + 72px);
  border-radius: 18px;
  background:
    linear-gradient(180deg, var(--paper2), var(--paper)),
    radial-gradient(500px 300px at 20% 10%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(900px 700px at 80% 70%, rgba(0, 0, 0, 0.04), transparent);
  box-shadow:
    0 38px 80px var(--shadow),
    0 8px 22px var(--shadow-soft);
  border: 1px solid rgba(70, 55, 35, 0.22);
  backface-visibility: hidden;
  overflow: hidden;
}

.paper__side::before {
  content: "";
  position: absolute;
  inset: -80px;
  background:
    radial-gradient(
      1px 1px at 18% 12%,
      rgba(80, 60, 40, 0.06),
      transparent 60%
    ),
    radial-gradient(
      1px 1px at 42% 65%,
      rgba(80, 60, 40, 0.05),
      transparent 60%
    ),
    radial-gradient(
      1px 1px at 78% 32%,
      rgba(80, 60, 40, 0.05),
      transparent 60%
    );
  transform: rotate(-2deg);
  pointer-events: none;
}

.paper__back {
  transform: rotateY(180deg);
}

.paper__header {
  position: relative;
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.paper__header::after {
  content: "";
  height: 3px;
  width: 100%;
  background:
    linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.18), transparent),
    repeating-linear-gradient(
      90deg,
      rgba(199, 59, 47, 0.35) 0,
      rgba(199, 59, 47, 0.35) 16px,
      rgba(43, 79, 184, 0.25) 16px,
      rgba(43, 79, 184, 0.25) 28px,
      rgba(44, 139, 75, 0.22) 28px,
      rgba(44, 139, 75, 0.22) 42px
    );
  border-radius: 999px;
  opacity: 0.7;
}

.crayon-title {
  margin: 0;
  font-family:
    "Marker Felt",
    "Chalkboard SE",
    "Comic Sans MS",
    "Bradley Hand",
    system-ui;
  font-size: clamp(40px, 6vw, 68px);
  letter-spacing: 0.5px;
  line-height: 1.02;
  text-shadow:
    0.8px 0.8px 0 rgba(199, 59, 47, 0.55),
    -0.6px 0.2px 0 rgba(43, 79, 184, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.06);
}

.subtitle {
  margin: 0;
  opacity: 0.78;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cards {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 2.2vw, 22px);
  padding-top: 4px;
}

.game-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.38));
  border: 1px solid rgba(60, 50, 35, 0.18);
  box-shadow:
    0 18px 32px rgba(0, 0, 0, 0.12),
    0 5px 14px rgba(0, 0, 0, 0.09);
  transform: rotate(-0.6deg);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
  outline: none;
}

.game-card:nth-child(2) {
  transform: rotate(0.7deg);
}

.game-card:hover {
  transform: rotate(-1.2deg) translateY(-3px);
  box-shadow:
    0 28px 48px rgba(0, 0, 0, 0.18),
    0 10px 18px rgba(0, 0, 0, 0.12);
}

.game-card:nth-child(2):hover {
  transform: rotate(1.2deg) translateY(-3px);
}

.game-card:focus-visible {
  box-shadow:
    0 0 0 4px rgba(43, 79, 184, 0.25),
    0 24px 42px rgba(0, 0, 0, 0.16);
}

.game-card__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.game-card__meta {
  display: grid;
  gap: 4px;
  padding: 2px 4px;
}

.game-card__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-family:
    "Marker Felt",
    "Chalkboard SE",
    "Comic Sans MS",
    "Bradley Hand",
    system-ui;
}

.game-card__desc {
  margin: 0;
  font-size: 13px;
  opacity: 0.8;
}

.note {
  margin: 16px 0 0;
  font-family:
    "Marker Felt",
    "Chalkboard SE",
    "Comic Sans MS",
    "Bradley Hand",
    system-ui;
  opacity: 0.7;
}

.about {
  position: relative;
  display: grid;
  gap: 14px;
  padding-top: 8px;
}

.handwriting {
  margin: 0;
  font-family:
    "Bradley Hand",
    "Comic Sans MS",
    "Marker Felt",
    ui-sans-serif,
    system-ui;
  font-size: clamp(18px, 2.6vw, 22px);
  line-height: 1.55;
}

.handwriting--muted {
  opacity: 0.55;
  font-size: clamp(14px, 2.2vw, 18px);
}

.flip-btn {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(70, 55, 35, 0.22);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(0, 0, 0, 0.78);
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.flip-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 32px rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.82);
}

.flip-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(43, 79, 184, 0.25),
    0 20px 32px rgba(0, 0, 0, 0.18);
}

.flip-btn__text {
  font-family:
    "Marker Felt",
    "Chalkboard SE",
    "Comic Sans MS",
    "Bradley Hand",
    system-ui;
  letter-spacing: 0.02em;
}

.flip-btn__icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 780px) {
  .stage {
    place-items: start center;
    padding-top: max(18px, 4vh);
    padding-bottom: 92px;
  }

  .paper-scene {
    aspect-ratio: auto;
  }

  .paper {
    height: auto;
    min-height: 0;
    transform: none;
    transition: none;
  }

  .paper.is-flipped {
    transform: none;
  }

  .paper__side {
    position: relative;
    inset: auto;
    backface-visibility: visible;
    overflow: visible;
    transform: none;
    padding-bottom: 92px;
  }

  .paper__front {
    display: block;
  }

  .paper__back {
    display: none;
  }

  .paper.is-flipped .paper__front {
    display: none;
  }

  .paper.is-flipped .paper__back {
    display: block;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .flip-btn {
    position: fixed;
    right: 14px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .paper,
  .game-card,
  .flip-btn {
    transition: none !important;
  }
}


.omenicard {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    0 18px 32px rgba(0, 0, 0, 0.12),
    0 5px 14px rgba(0, 0, 0, 0.09);
}