:root {
  color-scheme:light;
  --bg:#f7f5ed;
  --surface:#fffefa;
  --ink:#222d27;
  --muted:#4e5b50;
  --forest:#244a38;
  --forest-dark:#173b2b;
  --line:#c1c6b9;
  --content:74rem;
  font:100%/1.6 system-ui,"Noto Sans TC",sans-serif;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; font-size:1.12rem; background:var(--bg); color:var(--ink); }
body.large { font-size:1.39rem; }
button { font:inherit; }
a { color:inherit; }
:focus-visible { outline:3px solid #295aac; outline-offset:4px; }
.frame { width:min(100% - 2.4rem,var(--content)); margin-inline:auto; }
.skip { position:absolute; left:1rem; top:.5rem; padding:.5rem .8rem; background:white; transform:translateY(-160%); z-index:2; }
.skip:focus { transform:none; }
.site-header { color:var(--forest-dark); border-bottom:1px solid #dbddcf; background:#fbfaf4; }
.header-content { display:flex; justify-content:flex-end; align-items:center; padding-block:.45rem; }
.button { min-height:52px; display:inline-flex; align-items:center; justify-content:center; padding:.52em .88em; text-align:center; border:2px solid transparent; border-radius:10px; text-decoration:none; font-weight:800; line-height:1.28; cursor:pointer; }
.primary { color:white; background:var(--forest); }
.primary:hover { background:var(--forest-dark); }
.outline { color:var(--forest-dark); background:var(--surface); border-color:#61776a; }
.outline:hover,.filter:hover { background:#e5eee2; }
.hero { margin-top:clamp(1rem,3vw,2rem); min-height:330px; display:grid; grid-template-columns:1fr 1.05fr; overflow:hidden; border:1px solid #a3b39c; border-radius:22px; background:#dee9d9; }
.hero-copy { align-self:center; min-width:0; padding:clamp(1.25rem,4.5vw,3.35rem); }
h1,h2,h3 { line-height:1.18; margin:0; overflow-wrap:anywhere; }
.hero h1 { color:var(--forest-dark); font-size:clamp(2.55em,5.8vw,4.1em); letter-spacing:.005em; }
.hero p { margin:1em 0 1.35em; color:#36473a; max-width:28em; }
.hero .button { margin:0 .45rem .35rem 0; }
.hero-photo { display:block; width:100%; height:100%; min-width:0; max-height:100%; object-fit:cover; object-position:50% 47%; }
.directory { scroll-margin-top:1.2rem; margin:clamp(1.9rem,5vw,3.5rem) 0 clamp(1.8rem,5vw,3rem); }
.section-top { display:flex; align-items:baseline; justify-content:space-between; gap:.75rem; margin-bottom:.8rem; }
.section-top h2 { font-size:clamp(1.55em,3.5vw,2.15em); }
#count { color:var(--muted); white-space:nowrap; }
.filters { display:flex; flex-wrap:wrap; gap:.55rem; margin-bottom:1rem; }
.filter { color:var(--forest-dark); background:var(--surface); border-color:#899d8d; }
.filter[aria-pressed="true"] { background:var(--forest); color:white; border-color:var(--forest); }
.games { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr)); gap:.9rem; }
.game-card { display:grid; grid-template-rows:auto 1fr; overflow:hidden; border:1px solid #b8c4b7; border-radius:15px; background:var(--surface); color:var(--ink); text-decoration:none; }
.game-card:hover { border-color:var(--forest); box-shadow:0 7px 20px #244a3819; }
.card-art {
  --paper:#f7efdb; --border-ink:#b69862; --plate:#fff9ed;
  position:relative; isolation:isolate; display:grid; place-items:center;
  height:clamp(152px,17vw,200px); overflow:hidden;
  background:linear-gradient(125deg,#ffffff1a,#ffffff00 50%,#37271b18),var(--backdrop,none) center/cover,var(--paper);
}
.cover-memory { --backdrop:url("./art/covers/memory.webp"); }
.cover-numbers { --backdrop:url("./art/covers/numbers.webp"); }
.cover-life { --backdrop:url("./art/covers/life.webp"); }
.palette-leaf { --paper:#dce9d8; --border-ink:#7a9b78; --plate:#f0f7e7; }
.palette-gold { --paper:#f5e9bb; --border-ink:#bd9347; --plate:#fff4d3; }
.palette-plum { --paper:#eee2ef; --border-ink:#a080a3; --plate:#f8edf8; }
.palette-clay { --paper:#f1ded3; --border-ink:#b57c65; --plate:#fbede2; }
.card-art::before {
  content:""; position:absolute; z-index:-1; inset:10px; border:1px solid var(--border-ink);
  border-radius:11px; opacity:.65;
}
.cover-main,.cover-detail {
  display:grid; place-items:center; aspect-ratio:1; line-height:1;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  background:var(--plate); border:1px solid var(--border-ink);
  box-shadow:0 5px 0 #60433120,0 8px 16px #2822181a;
}
.cover-main {
  width:clamp(5.25rem,8vw,6.65rem); border-radius:30%;
  font-size:clamp(2.6rem,4.4vw,3.8rem); transform:rotate(-5deg);
}
.cover-detail {
  position:absolute; width:clamp(2.55rem,4.5vw,3.45rem); border-radius:26%;
  font-size:clamp(1.35rem,2.3vw,1.9rem);
}
.detail-1 { left:14%; top:19%; transform:rotate(-12deg); }
.detail-2 { right:13%; bottom:17%; transform:rotate(10deg); }
.cover-numbers .detail-1 { top:auto; bottom:15%; }
.cover-numbers .detail-2 { top:17%; bottom:auto; }
.cover-life .cover-main { transform:rotate(6deg); }
.card-copy { display:grid; grid-template-rows:auto auto 1fr auto; align-items:start; padding:.9rem 1.05rem 1rem; }
.card-copy h3 { font-size:1.22em; color:#253c30; }
.card-copy p { margin:.38rem 0 .85rem; color:var(--muted); }
.card-copy .game-edition { margin:.32rem 0 .05rem; color:var(--forest-dark); font-size:.86em; font-weight:750; }
.play-label { justify-self:start; display:inline-flex; align-items:center; min-height:44px; color:var(--forest-dark); padding:.25rem .65rem; border:1px solid #748d78; border-radius:8px; font-weight:800; }
.game-card:hover .play-label { color:white; background:var(--forest); border-color:var(--forest); }
.footer { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.45rem 1.2rem; border-top:1px solid var(--line); padding:1rem 0 1.45rem; color:var(--muted); font-size:.9em; }
@media (max-width:680px) {
  .frame { width:calc(100% - 1.3rem); }
  .hero { grid-template-columns:minmax(0,1fr); }
  .hero-photo { width:100%; height:clamp(160px,56vw,295px); }
}
@media (max-width:420px) {
  .filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .filter { padding-inline:.3em; }
  .header-content { padding-block:.35rem; }
}

.filter { gap:.48em; }
.filter-count,.game-number {
  display:inline-flex; align-items:center; justify-content:center; min-width:2em; padding:.1em .3em;
  border-radius:6px; color:var(--forest-dark); background:#e4ebdc;
  font-size:.84em; font-variant-numeric:tabular-nums; line-height:1.3;
}
.filter[aria-pressed="true"] .filter-count { background:#e3eddd; }
.game-number { margin-inline-start:.5em; vertical-align:baseline; }
.search { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem; margin-bottom:1rem; font-weight:750; }
.search input { font:inherit; width:min(100%,22rem); min-height:52px; padding:.45em .65em; color:var(--ink); background:var(--surface); border:2px solid #758779; border-radius:9px; }
.load-more { display:flex; margin:1.2rem auto 0; }
#count { white-space:normal; text-align:right; }

.overview-label { display:block; margin-bottom:.1rem; color:var(--forest-dark); font-size:.94em; }
