/* The arcade front page — a jungle clearing full of colour-block game tiles. */

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--s4); }

/* Canopy lives in core/hero.css now — it is built from real leaf elements so
   each one can move in the wind, which a repeating background image cannot do. */

/* ---------- Masthead ---------- */

.masthead { position: relative; padding: var(--s6) 0 var(--s5); text-align: center; }

.masthead__logo { margin: 0; line-height: 0; }
.masthead__img {
  width: min(620px, 92vw); height: auto; margin: 0 auto;
  filter: drop-shadow(0 6px 10px rgba(10,39,84,.22));
}

.masthead__tag {
  margin: var(--s4) auto 0; max-width: 44ch;
  font-size: var(--t-md); font-weight: 600; color: var(--ink-soft);
}
.masthead__badges {
  display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center;
  margin-top: var(--s4);
}
.pill {
  padding: 7px var(--s4);
  font-size: var(--t-xs); font-weight: 800;
  color: var(--ink); background: var(--surface);
  border: var(--bd) solid var(--stroke); border-radius: var(--r-pill);
  box-shadow: 0 3px 0 var(--stroke);
}

/* Animals peeking in from the edges. Decorative only, and the first to go when
   the screen gets narrow. */
.critter {
  position: absolute; font-size: 44px; line-height: 1;
  pointer-events: none; user-select: none;
  filter: drop-shadow(0 4px 6px rgba(15,48,33,.22));
}
.critter--monkey { left: 2%;  top: 4px;   transform: rotate(-12deg); animation: sway 5s ease-in-out infinite; transform-origin: 50% 0; }
.critter--parrot { right: 3%; top: 10px;  transform: rotate(10deg);  animation: sway 6s ease-in-out infinite reverse; transform-origin: 50% 0; }
.critter--tiger  { left: 1%;  bottom: 4px; font-size: 38px; }
.critter--toucan { right: 2%; bottom: 6px; font-size: 38px; transform: scaleX(-1); }
@media (max-width: 860px) { .critter { display: none; } }

/* ---------- Filters ---------- */

.filters {
  position: sticky; top: 0; z-index: 10;
  padding: var(--s3) 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--line);
}
/* Centred, and wrapping rather than scrolling sideways: a child will never
   discover a horizontal scroll, so a chip that only exists off-screen may as
   well not exist. */
.filterrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s2);
  padding: 3px 0 5px;
}
.filterrow__label {
  flex: none; font-size: var(--t-xs); font-weight: 900; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); padding-right: var(--s2);
}
.chip {
  flex: none;
  min-height: 42px; padding: var(--s2) var(--s4);
  font-size: var(--t-sm); font-weight: 800; white-space: nowrap;
  color: var(--ink); background: var(--surface);
  border: var(--bd) solid var(--stroke); border-radius: var(--r-pill);
  box-shadow: 0 3px 0 var(--stroke);
  transition: transform var(--dur) var(--ease), border-color var(--dur), background var(--dur), color var(--dur), box-shadow var(--dur);
}
.chip:hover { transform: translateY(-2px); background: var(--primary-soft); box-shadow: 0 5px 0 var(--stroke); }
.chip[aria-pressed="true"] {
  color: var(--on-color); background: var(--primary);
  box-shadow: 0 3px 0 var(--stroke);
}

/* ---------- Cards: candy stickers ---------- */

.grid {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: var(--s5);
  padding: var(--s6) 0 var(--s7);
}

.card {
  --accent: var(--primary);
  --accent-dark: var(--primary-dark);
  --accent-on: #fff;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--s4);
  padding: var(--s6);
  text-align: left; text-decoration: none;
  color: var(--accent-on);
  background: var(--accent);
  border: var(--bd) solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--ring), 0 6px 0 var(--stroke), var(--shadow-md);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* A big translucent leaf watermark in the corner of every tile. */
.card::before {
  content: ''; position: absolute; right: -30px; top: -26px;
  width: 165px; height: 165px; pointer-events: none;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-40 -40 80 80'%3E%3Cg fill='%23ffffff' fill-opacity='0.16'%3E%3Cpath d='M0,-36 C20,-16 20,20 0,36 C-20,20 -20,-16 0,-36 Z'/%3E%3C/g%3E%3C/svg%3E");
  transform: rotate(24deg);
}
.card:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: var(--ring), 0 12px 0 var(--stroke), var(--shadow-lg); }
.card:active { transform: translateY(-1px); box-shadow: var(--ring), 0 3px 0 var(--stroke), var(--shadow-md); }

.card__top { position: relative; display: flex; align-items: flex-start; gap: var(--s3); }
.card__emoji {
  flex: none; display: grid; place-items: center;
  width: 86px; height: 86px; font-size: 48px;
  background: rgba(255,255,255,.55);
  border: 2px solid var(--stroke);
  border-radius: 50%;
}
.card__title { font-size: var(--t-xl); font-weight: 900; line-height: 1.1; color: inherit; }
.card__subject {
  font-size: var(--t-xs); font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
  color: inherit; opacity: .85;
}
.card__blurb { position: relative; font-size: var(--t-md); font-weight: 700; line-height: 1.4; color: inherit; opacity: .96; flex: 1; }

.card__skills { position: relative; display: flex; flex-wrap: wrap; gap: 6px; }
.skill {
  padding: 5px 12px; font-size: var(--t-xs); font-weight: 800;
  color: inherit; background: color-mix(in srgb, var(--accent-on) 16%, transparent); border-radius: var(--r-pill);
}

.card__foot {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding-top: var(--s3); border-top: 2px solid color-mix(in srgb, var(--accent-on) 30%, transparent);
}
.card__grades {
  font-size: var(--t-sm); font-weight: 900; color: inherit;
  background: color-mix(in srgb, var(--accent-on) 18%, transparent);
  padding: 4px 12px; border-radius: var(--r-pill);
}
.card__stars { font-size: var(--t-lg); letter-spacing: 2px; }
.card__stars .star--off { opacity: .35; filter: grayscale(1) brightness(2); }

.empty { padding: var(--s8) var(--s4); text-align: center; color: var(--ink-soft); grid-column: 1 / -1; }
.empty__emoji { font-size: var(--t-3xl); }

/* ---------- Footer ---------- */

.foot {
  position: relative;
  padding: var(--s6) 0 var(--s8);
  padding-bottom: max(var(--s8), calc(env(safe-area-inset-bottom) + var(--s6)));
  border-top: 3px solid var(--line);
  text-align: center;
}
.foot__critters { font-size: 30px; letter-spacing: 8px; margin-bottom: var(--s4); }
.foot__note { font-size: var(--t-sm); color: var(--ink-soft); max-width: 56ch; margin: 0 auto var(--s4); }
.foot__actions { display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; }


/* ---------- Read-aloud settings ---------- */

.voicebar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: var(--s2) var(--s3);
  max-width: 720px; margin: 0 auto var(--s5);
  padding: var(--s4);
  background: var(--surface);
  border: var(--bd) solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 0 var(--stroke);
}
.voicebar__label { font-size: var(--t-sm); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.select {
  min-height: 50px; max-width: 260px; padding: var(--s2) var(--s4);
  font-weight: 700; color: var(--ink);
  background: var(--surface-2);
  border: 2px solid var(--stroke); border-radius: var(--r-md);
}
.slider { width: 130px; accent-color: var(--go); }
.btn--sm { min-height: 44px; padding: var(--s2) var(--s4); font-size: var(--t-sm); }

/* A catalogued game whose code has not shipped yet. */
.card--soon { opacity: .55; cursor: default; filter: saturate(.7); }
.card--soon:hover { transform: none; box-shadow: var(--ring), 0 6px 0 var(--stroke), var(--shadow-md); }
.card__soon {
  font-size: var(--t-xs); font-weight: 900; letter-spacing: .04em;
  color: inherit;
  background: color-mix(in srgb, var(--accent-on) 22%, transparent);
  padding: 4px 12px; border-radius: var(--r-pill);
}

/* A quiet route to the standards index, aimed at the grown-up rather than the child. */
.teacherbar {
  display: flex; align-items: center; gap: var(--s3);
  margin: var(--s5) 0 0;
  padding: var(--s3) var(--s5);
  font-size: var(--t-sm); font-weight: 700;
  color: var(--ink); text-decoration: none;
  background: var(--surface);
  border: var(--bd) solid var(--stroke);
  border-radius: var(--r-pill);
  box-shadow: 0 4px 0 var(--stroke);
  transition: transform var(--dur) var(--ease);
}
.teacherbar:hover { transform: translateY(-2px); }
.teacherbar__icon { font-size: 22px; line-height: 1; flex: none; }
.teacherbar__go { margin-left: auto; font-weight: 900; color: var(--primary); flex: none; }
@media (max-width: 560px) { .teacherbar { font-size: var(--t-xs); } }

.card__std {
  font-size: var(--t-xs); font-weight: 900; color: inherit;
  background: color-mix(in srgb, var(--accent-on) 18%, transparent);
  padding: 4px 10px; border-radius: var(--r-pill);
}
