@font-face {
  font-family: "Fredoka";
  src: url("fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #fff8ee;
  --card: #fff;
  --text: #401c08;
  --muted: #80491c;
  --accent: #e49a3c;
  --accent-dark: #b8701f;
  --icon: #401c08;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 3px; border-radius: 8px; }

/* Logo */
.top { text-align: center; padding: 60px 16px 20px; }
.top h1 { margin: 0 auto; width: min(360px, 80vw); }
.top p { margin: 14px 0 0; color: var(--muted); font-size: clamp(1rem, 2.6vw, 1.2rem); }

/* Games */
.games {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px clamp(40px, 8vw, 80px);
  display: grid;
  gap: clamp(24px, 4vw, 40px);
}
@media (min-width: 820px) { .games { grid-template-columns: 1fr 1fr; padding-inline: 32px; } }

/* Desktop: everything fits one screen (no scroll) and is centred vertically.
   Card width follows the screen height, so 720p and 1080p both fit. */
@media (min-width: 820px) and (min-height: 560px) and (hover: hover) and (pointer: fine) {
  body { height: 100vh; height: 100dvh; overflow: hidden; }
  /* free space goes above the logo and below the cards, so they sit centred above the footer */
  .top { margin-top: auto; padding: 0 16px 18px; }
  .games { margin-bottom: auto; }
  .games {
    padding: 0;
    gap: 28px;
    width: min(1120px, calc(100% - 64px), calc(2 * ((100dvh - 510px) * 1.7778 + 28px) + 28px));
  }
  body .bottom { padding: 12px 16px 16px; }
}

.game {
  background: var(--card);
  border-radius: 22px;
  padding: 14px 14px 22px;
  text-align: center;
  box-shadow: 0 2px 0 #f1dcc2, 0 14px 34px rgba(64, 28, 8, .1);
  transition: transform .2s, box-shadow .2s;
}
.game:hover { transform: translateY(-4px); box-shadow: 0 2px 0 #f1dcc2, 0 20px 40px rgba(64, 28, 8, .14); }
.thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; background: #f3e6d6; }
.game h2 { margin: 18px 0 4px; font-size: clamp(1.5rem, 4vw, 1.9rem); font-weight: 700; line-height: 1.2; }
.game p { margin: 0 auto; max-width: 40ch; color: var(--muted); }

/* Store icons */
.stores { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.stores a {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg); color: var(--icon);
  border: 2px solid #f1dcc2;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.stores svg { width: 24px; height: 24px; fill: currentColor; }
.stores a:hover, .stores a:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.stores a:not([href]) { opacity: .6; }
.stores a:not([href]):hover { opacity: 1; }

/* Footer */
.bottom { margin-top: auto; text-align: center; padding: 28px 16px 24px; color: var(--muted); font-size: .95rem; }
.bottom p { margin: 4px 0; }
.email { font-weight: 600; color: var(--accent-dark); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
