/* PicoChest Home — Game Center Top v1 (Human-approved design, 2026-10-17). Loaded only by /ja/ and /en/, after
   styles.css; everything here is in the hm- namespace so no other page changes. Above: a storybook Hero (the three
   cats and the treasure chest, Hero Candidate A). Below: a plain, easy game centre, then the tools. */
:root {
  --hm-cream: #fffaf1;
  --hm-sky: #e3f1fb;
  --hm-meadow: #dcefd3;
  --hm-peach: #fde7d8;
  --hm-wood: #b9824f;
  --hm-coral: #c4473a;
  --hm-coral-dark: #a33a2f;
  --hm-gold: #f2b544;
  --hm-shadow: 0 8px 22px rgba(16, 35, 63, .08);
}
.hm-body { background: var(--hm-cream); }
.hm-main { padding-block: clamp(.75rem, 2vw, 1.25rem) clamp(2.5rem, 6vw, 4rem); }

/* header: two small in-page links on wider screens only */
.hm-header-nav { display: none; margin-left: auto; gap: .25rem; }
.hm-header-nav a { min-height: 2.75rem; display: inline-flex; align-items: center; padding: .35rem .7rem; color: var(--ink); font-weight: 650; text-decoration: none; border-radius: .5rem; }
.hm-header-nav a:hover { background: var(--soft); }
@media (min-width: 46rem) { .hm-header-nav { display: flex; } .hm-header-nav + .language-link { margin-left: .25rem; } }

/* ---------- Hero: copy above the art (phones, tablets) or beside it (desktop) ---------- */
.hm-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.hm-hero-copy { position: relative; z-index: 1; }
.hm-hero h1 { margin: 0; font-size: clamp(1.7rem, 6.2vw, 2.75rem); line-height: 1.25; letter-spacing: -.02em; color: #3a2a1f; }
.hm-hero h1 span { display: inline-block; }
.hm-lede { max-width: 30rem; margin: .6rem 0 0; color: #5a4636; font-size: clamp(.98rem, 2.2vw, 1.12rem); line-height: 1.6; }
.hm-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; margin: 1rem 0 0; }
.hm-cta { min-height: 3rem; display: inline-flex; align-items: center; gap: .4rem; padding: 0 1.4rem; border-radius: 999px; background: var(--hm-coral); color: #fff; font-weight: 800; text-decoration: none; box-shadow: 0 6px 16px rgba(196, 71, 58, .25); }
.hm-cta:hover { background: var(--hm-coral-dark); }
.hm-tools-link { min-height: 2.75rem; display: inline-flex; align-items: center; color: var(--accent-dark); font-weight: 680; }
/* the art: its box is reserved before the picture loads (no layout shift). Phones get the 16:9 crop around the three
   cats and the chest; from 46rem the <picture> source is the whole 2:1 picture, so a phone never loads it. */
.hm-hero-art { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 1.25rem; background: linear-gradient(180deg, var(--hm-sky) 0 55%, var(--hm-meadow) 55% 100%); }
.hm-hero-art picture { display: block; height: 100%; }
.hm-hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* tablets: the whole picture, below the copy */
@media (min-width: 46rem) and (max-width: 61.99rem) { .hm-hero-art { aspect-ratio: 2 / 1; } }
/* desktop: one 12:5 panel, capped so the games stay in the first view. The copy sits on a plain sky-to-meadow wash
   at the left; the art fills the right 70% and fades into the wash (only faintly behind the copy's line ends, fully
   opaque from 26% so every cat stays whole and solid). */
@media (min-width: 62rem) {
  .hm-hero { display: block; aspect-ratio: 12 / 5; max-height: 26rem; width: 100%; border-radius: 1.5rem; overflow: hidden; background: linear-gradient(180deg, #ddf0fd 0%, #eef8fd 58%, #eef6df 100%); }
  .hm-hero-art { position: absolute; inset: 0 0 0 auto; width: 70%; aspect-ratio: auto; border-radius: 0; background: none; -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .35) 17%, #000 26%); mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .35) 17%, #000 26%); }
  .hm-hero-art img { object-position: 100% 50%; }
  .hm-hero-copy { width: 42%; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 0 0 clamp(1.5rem, 4vw, 3rem); }
  .hm-hero h1 { font-size: clamp(2rem, 3.6vw, 2.75rem); }
  .hm-hero h1, .hm-lede { text-shadow: 0 1px 0 rgba(255, 255, 255, .55); }
}

/* ---------- sections ---------- */
.hm-section { margin-top: clamp(1.5rem, 4vw, 2.25rem); }
.hm-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: .9rem; }
.hm-section-head h2 { margin: 0; font-size: clamp(1.35rem, 4vw, 1.75rem); letter-spacing: -.02em; color: #3a2a1f; }
.hm-section-head p { margin: 0; color: var(--muted); }
.hm-section-head a { min-height: 2.75rem; display: inline-flex; align-items: center; font-weight: 680; }

/* ---------- games: rows on phones, vertical cards from 46rem ---------- */
.hm-game-list, .hm-tool-list { margin: 0; padding: 0; list-style: none; }
.hm-game-list { display: grid; gap: .7rem; }
.hm-game { position: relative; display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: center; gap: .9rem; padding: .6rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--hm-shadow); }
.hm-game:hover { border-color: var(--hm-coral); }
.hm-game-art { position: relative; width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; border-radius: .75rem; background: var(--hm-peach); color: #6b4a2e; }
.hm-game-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hm-game-art svg { width: 42%; height: 42%; }
.hm-art-logic { background: #e7eef9; color: #2c3e66; }
.hm-art-sort { background: #f6ead9; color: var(--hm-wood); }
.hm-art-merge { background: #fdecc8; color: #8a5a30; }
.hm-art-memory { background: #f8e8d2; color: #8a5a30; }
.hm-art-ten { background: #fff1c9; color: #8a5a10; }
.hm-game-body { min-width: 0; display: grid; gap: .2rem; }
.hm-game-title { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: 1.08rem; font-weight: 800; line-height: 1.35; }
.hm-game-text { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.hm-game-cta { justify-self: start; color: var(--hm-coral); font-weight: 800; }
.hm-badge { display: inline-block; padding: 0 .45rem; border-radius: 999px; background: var(--hm-coral); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .04em; line-height: 1.6; }
@media (min-width: 46rem) {
  .hm-game-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .hm-game { grid-template-columns: 1fr; align-items: stretch; padding: 0; overflow: hidden; }
  .hm-game-art { aspect-ratio: 16 / 10; border-radius: 0; }
  .hm-game-body { padding: .85rem 1rem 1rem; gap: .35rem; }
  .hm-game-cta { margin-top: .35rem; padding: .35rem .95rem; border-radius: 999px; background: var(--hm-coral); color: #fff; }
}
@media (min-width: 46rem) and (max-width: 61.99rem) { .hm-game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hm-game-art { aspect-ratio: 16 / 9; } }
/* PC: three cards a row; every card in a row is as tall as the tallest, with its button on the bottom line */
@media (min-width: 62rem) {
  .hm-game-list > li { display: grid; }
  .hm-game { grid-template-rows: auto 1fr; }
  .hm-game-body { grid-template-rows: auto 1fr auto; }
}

/* ---------- tools: compact, below the games ---------- */
.hm-tools { padding: clamp(1rem, 3vw, 1.4rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.hm-tool-list { display: grid; gap: .25rem; }
@media (min-width: 46rem) { .hm-tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1.25rem; } }
.hm-tool { min-height: 3rem; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); align-items: center; gap: .7rem; padding: .45rem .5rem; border-radius: .6rem; color: var(--ink); text-decoration: none; }
.hm-tool:hover { background: var(--soft); }
.hm-tool-icon { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: .6rem; background: var(--soft); color: var(--accent-dark); }
.hm-tool-icon svg { width: 1.25rem; height: 1.25rem; }
.hm-tool strong { display: block; font-size: .98rem; line-height: 1.35; }
.hm-tool strong + span { display: block; color: var(--muted); font-size: .84rem; line-height: 1.45; }

/* the newest game (one slot, swapped when a new game launches): a slim row after the four game cards */
.hm-new { margin-top: .8rem; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .5rem .9rem .5rem .5rem; border: 1px dashed var(--hm-coral); border-radius: 1rem; background: #fff; color: var(--ink); text-decoration: none; }
.hm-new:hover { border-style: solid; }
.hm-new-art { width: 3.5rem; aspect-ratio: 1 / 1; overflow: hidden; border-radius: .7rem; background: var(--hm-peach); }
.hm-new-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hm-new-body { min-width: 0; display: grid; gap: .1rem; }
.hm-new-title { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-weight: 800; line-height: 1.35; }
.hm-new-text { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.hm-new-cta { color: var(--hm-coral); font-weight: 800; white-space: nowrap; }
.hm-game:focus-visible, .hm-tool:focus-visible, .hm-cta:focus-visible, .hm-new:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
