:root {
  --cream: #fff5ef;
  --white: #ffffff;
  --berry: #e8364f;
  --berry-dark: #b81f3a;
  --berry-soft: #ffd9de;
  --leaf: #3fae5a;
  --seed: #ffd75e;
  --ink: #2b0f17;
  --muted: #7d5862;
  --line: 3px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: var(--cream);
  background-image: radial-gradient(var(--berry-soft) 1.6px, transparent 1.8px);
  background-size: 26px 26px;
  min-height: 100vh;
}
a { color: inherit; }

/* ---------- Top bar ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--white);
  border-bottom: var(--line);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex: 1 1 auto; min-width: 0;
}
.logo-berry {
  font-size: 30px; display: inline-block;
  transition: transform .25s;
}
.logo:hover .logo-berry { transform: rotate(-15deg) scale(1.1); }
.logo-text { font-size: 22px; font-weight: 600; white-space: nowrap; }
.logo-text b { color: var(--berry); font-weight: 700; }

.search {
  display: flex; align-items: center; gap: 8px;
  flex: 0 1 300px; min-width: 0;
  padding: 8px 14px; border-radius: 999px;
  background: var(--cream); border: var(--line);
}
.search:focus-within { box-shadow: 0 0 0 4px var(--berry-soft); }
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-linecap: round; }
#search {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background-color: var(--berry);
  border-bottom: var(--line);
  color: var(--white);
}
/* strawberry seeds – faded out behind the words so the text stays easy to read */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--seed) 2px, transparent 2.4px);
  background-size: 34px 34px;
  background-position: 8px 8px;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 42%, #000 62%);
          mask-image: linear-gradient(to right, transparent 0%, transparent 42%, #000 62%);
}
.hero-inner {
  position: relative;
  max-width: 1200px; margin: 0 auto; padding: 40px 24px 44px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center;
}
.tag {
  display: inline-block; margin: 0 0 14px; padding: 6px 14px;
  background: var(--white); color: var(--berry-dark);
  border: var(--line); border-radius: 999px; box-shadow: var(--pop);
  font-weight: 600; font-size: 14px;
}
.hero h1 {
  margin: 0; font-size: clamp(34px, 5vw, 54px); line-height: 1.05; font-weight: 700;
  text-shadow: 3px 3px 0 var(--berry-dark);
}
.hero-sub { margin: 14px 0 0; font-size: 18px; max-width: 30em; opacity: .95; }

.featured {
  position: relative; display: block; text-decoration: none;
  border: var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--white); color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.featured:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.featured .art { aspect-ratio: 16 / 9; border-bottom: var(--line); }
.featured .art .emoji { font-size: 96px; }
.featured-label {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--seed); border: var(--line); font-weight: 600; font-size: 14px;
}
.featured-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
}
.featured-title { font-size: 22px; font-weight: 700; }

/* ---------- Game grid ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 8px 24px 48px; }
h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 24px; margin: 32px 0 16px;
}
.pill {
  font-size: 14px; font-weight: 600; padding: 2px 10px;
  background: var(--berry); color: var(--white); border-radius: 999px;
}
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.card {
  display: block; text-decoration: none;
  background: var(--white); border: var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--pop);
  transition: transform .15s, box-shadow .15s;
}
.card:hover, .card:focus-visible {
  transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--ink); outline: none;
}
.card:active, .featured:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.art {
  position: relative; aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  border-bottom: var(--line);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 55%),
    linear-gradient(135deg, hsl(var(--hue) 80% 62%), hsl(calc(var(--hue) + 40) 75% 48%));
}
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art .emoji { font-size: 64px; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.18)); transition: transform .2s; }
.card:hover .emoji, .featured:hover .emoji { transform: scale(1.12) rotate(-6deg); }
.play-badge {
  position: absolute; right: 10px; bottom: 10px;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding-left: 3px;
  background: var(--white); color: var(--berry); border: var(--line);
  font-size: 16px; opacity: 0; transform: scale(.6);
  transition: opacity .15s, transform .15s;
}
.card:hover .play-badge, .card:focus-visible .play-badge,
.featured:hover .play-badge { opacity: 1; transform: scale(1); }

.info { padding: 12px 14px 14px; }
.name { font-weight: 700; font-size: 18px; }
.by { font-size: 14px; color: var(--muted); margin-top: 2px; }
.empty { color: var(--muted); font-size: 18px; text-align: center; padding: 24px 0; }

.foot {
  text-align: center; padding: 24px; color: var(--muted); font-weight: 500;
  border-top: var(--line); background: var(--white);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 12px; border: var(--line);
  background: var(--white); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--berry); color: var(--white); }

/* ---------- Play page ---------- */
body.play { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: var(--white); border-bottom: var(--line); flex: none;
}
.bar .logo { flex: none; }
.bar .logo-berry { font-size: 24px; }
.bar .title {
  flex: 1; min-width: 0; font-weight: 700; font-size: 18px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#frame { flex: 1; width: 100%; border: 0; background: var(--ink); }
.missing { padding: 60px 24px; text-align: center; font-size: 20px; }
.missing a { color: var(--berry); font-weight: 600; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; padding: 28px 16px 32px; }
  .hero::before {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 38%, #000 52%);
            mask-image: linear-gradient(to bottom, transparent 0%, transparent 38%, #000 52%);
  }
  .nav, main { padding-left: 16px; padding-right: 16px; }
  .search { flex-basis: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
  .bar .btn { padding: 6px 10px; font-size: 14px; }
  .bar .btn .label { display: none; }
}
