/* The hub: a sheet of glossy die-cut stickers. Each game is a sticker (white die-cut edge, ink outline,
   its drawing on its own colour, a gloss streak); the logo, coins, gift and tools are stickers too.
   Approved by the owner 2026-10-12: "we like A · Recommended Sticker sheet". */

@font-face {
  font-family: "Bagel Fat One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/bagel-fat-one-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

/* The sheet takes the theme's ground; classic in light mode is the pink vinyl sheet. */
:root { --sheet: var(--bg); --dot: var(--line); }
@media (prefers-color-scheme: light) {
  :root[data-theme="classic"] { --sheet: #fff3f7; --dot: #ffd6e4; }
}

body[data-screen="hub"] {
  background:
    radial-gradient(circle at 12px 12px, var(--dot) 2px, transparent 2.5px) 0 0 / 24px 24px,
    var(--sheet);
}
body[data-screen="hub"] main { width: min(1160px, 100% - 32px); margin-top: 0; padding: 18px 0 28px; }

.hub {
  --ink: #1d1a2e;
  --ol: #1d1a2e;
  --olw: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "logo coins" "acts ctrl" "grid grid" "tools tools";
  align-items: center;
  gap: 12px 10px;
  text-align: left;
  color: var(--ink);
  font: 500 15px/1.35 "Bricolage Grotesque", system-ui, sans-serif;
}

/* The logo: a sticker of its own. */
.logo {
  grid-area: logo;
  justify-self: start;
  display: inline-flex;
  margin: 0;
  padding: 9px 14px 11px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 0 0 3px var(--ink), 0 8px 0 -1px rgb(29 26 46 / 0.18);
  font: 400 clamp(22px, 7vw, 29px)/1 "Bagel Fat One", system-ui, sans-serif;
  letter-spacing: 0.5px;
  transform: rotate(-3deg);
}
.logo .l1 { color: #ff4f8b; }
.logo .l2 { color: #3b6cff; }
.logo .l3 { color: #ffb703; -webkit-text-stroke: 1.5px var(--ink); }

/* Round sticker chips: coins, sound, fullscreen, gift, continue. */
.hub .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  box-shadow: 0 0 0 3px var(--ink), 0 4px 0 0 var(--ink);
  font: 800 17px/1 "Bricolage Grotesque", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.hub button.chip { cursor: pointer; transition: transform 0.08s; }
.hub button.chip:active { transform: translateY(3px); box-shadow: 0 0 0 3px var(--ink), 0 1px 0 0 var(--ink); }
.hub .coins { grid-area: coins; justify-self: end; }
.hub .coin { width: 22px; height: 22px; }
.hub .ctrl { grid-area: ctrl; justify-self: end; display: flex; gap: 10px; }
.hub .ctrl .chip { padding: 0; width: 44px; font-size: 18px; }

.hub-actions { grid-area: acts; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.hub .gift { background: #c9f7df; font: 400 15px/1 "Bagel Fat One", system-ui, sans-serif; padding: 0 12px 0 6px; rotate: 3deg; animation: gift-wiggle 2.4s ease-in-out infinite; }
.hub .gift svg { width: 32px; height: 32px; }
.hub .gift:active { animation: none; }
@keyframes gift-wiggle {
  0%, 80%, 100% { rotate: 3deg; scale: 1; }
  84% { rotate: -3deg; scale: 1.04; }
  88% { rotate: 8deg; scale: 1.04; }
  92% { rotate: 0deg; scale: 1; }
}
.hub .continue { background: #ffe14d; font: 400 15px/1 "Bagel Fat One", system-ui, sans-serif; rotate: -2deg; max-width: 100%; min-width: 0; }
.hub .continue span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The game stickers. */
.game-cards { grid-area: grid; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; margin-top: 6px; }
.sticker {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  rotate: var(--r, 0deg);
  transition: scale 0.18s cubic-bezier(0.3, 1.6, 0.6, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.sticker:active { scale: 0.97; }
.die {
  position: relative;
  display: block;
  height: 100%;
  padding: 6px 6px 10px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 0 0 3px var(--ink), 0 7px 0 -1px rgb(29 26 46 / 0.22);
}
.art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border-radius: 20px;
  background: var(--g);
}
.art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(125deg, rgb(255 255 255 / 0.55) 0 18%, rgb(255 255 255 / 0) 30% 100%);
  pointer-events: none;
}
.art svg { width: 88%; height: auto; }
.card-title { display: block; margin: 10px 4px 2px; font: 400 21px/1.05 "Bagel Fat One", system-ui, sans-serif; }
.card-sub { display: block; margin: 0 4px; font-size: 13.5px; color: #4a4560; }
.card-best { display: block; margin: 4px 4px 0; font-size: 13px; font-weight: 800; color: #b45309; }
.card-best:empty { display: none; }
.feature { grid-column: 1 / -1; }
.feature .art { aspect-ratio: 16 / 9; }
.feature .card-title { font-size: 28px; }
.feature .card-sub { font-size: 15px; }
.new {
  position: absolute;
  top: -12px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  background: #ffe14d;
  clip-path: polygon(50% 0, 61% 13%, 77% 6%, 80% 22%, 96% 24%, 90% 39%, 100% 50%, 90% 61%, 96% 76%, 80% 78%, 77% 94%, 61% 87%, 50% 100%, 39% 87%, 23% 94%, 20% 78%, 4% 76%, 10% 61%, 0 50%, 10% 39%, 4% 24%, 20% 22%, 23% 6%, 39% 13%);
  color: var(--ink);
  font: 400 18px/1 "Bagel Fat One", system-ui, sans-serif;
  rotate: 12deg;
}

/* The peel: pressing (or pointing at) a sticker lifts its corner. */
.sticker .die::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  z-index: 3;
  width: 0;
  height: 0;
  border-bottom-right-radius: 26px;
  background: linear-gradient(315deg, #fff 0 30%, #e8e4f0 50%, var(--sheet) 51% 100%);
  box-shadow: 3px 3px 0 0 var(--ink), 6px 6px 10px rgb(0 0 0 / 0.18);
  opacity: 0;
  transition: width 0.16s ease-out, height 0.16s ease-out, opacity 0.1s;
}
.sticker:active .die::before,
.sticker:focus-visible .die::before { width: 44px; height: 44px; opacity: 1; }
@media (hover: hover) {
  .sticker:hover .die::before { width: 44px; height: 44px; opacity: 1; }
}
.sticker:focus-visible { outline: 3px solid #3b6cff; outline-offset: 6px; border-radius: 28px; }

/* Shop, High scores, Settings. */
.tools { grid-area: tools; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.tool {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 3px var(--ink), 0 5px 0 0 var(--ink);
  font: 400 15px/1 "Bagel Fat One", system-ui, sans-serif;
  cursor: pointer;
  transition: transform 0.08s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tool:active { transform: translateY(4px); box-shadow: 0 0 0 3px var(--ink), 0 1px 0 0 var(--ink); }
.tool svg { width: 40px; height: 40px; }
.tool:focus-visible, .hub .chip:focus-visible { outline: 3px solid #3b6cff; outline-offset: 4px; }

/* A sticker dropping onto the sheet as the hub opens (a drop, never a grow: a wider page zooms a phone out). */
.screen.enter .sticker { animation: drop-on 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.25) backwards; animation-delay: calc(var(--i, 0) * 0.05s); }
@keyframes drop-on { from { opacity: 0; translate: 0 -10px; } }
.sticker.boing, .tool.boing, .hub .chip.boing { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .hub .gift, .screen.enter .sticker { animation: none; }
}

/* Computers: the logo, gift, tools and coins share the top row; the new game takes a 2x2 corner. */
@media (min-width: 900px) {
  body[data-screen="hub"] main { width: min(1160px, 100% - 80px); padding-top: 28px; }
  .hub { grid-template-columns: auto auto 1fr auto auto; grid-template-areas: "logo acts tools ctrl coins" "grid grid grid grid grid"; column-gap: 16px; }
  .logo { font-size: 46px; padding: 10px 18px 13px; }
  .tools { display: flex; justify-self: end; gap: 10px; margin: 0; }
  .tool { flex-direction: row; gap: 6px; padding: 6px 14px 6px 8px; }
  .tool svg { width: 30px; height: 30px; }
  .game-cards { grid-template-columns: repeat(4, 1fr); gap: 26px 22px; margin-top: 24px; }
  .feature { grid-column: span 2; grid-row: span 2; }
  .feature .die { display: flex; flex-direction: column; }
  .feature .art { flex: 1; aspect-ratio: auto; min-height: 0; }
  .feature .card-title { font-size: 36px; }
  .card-title { font-size: 22px; }
}
