/* DaoYi Studio games hub. Warm neutral page; each game card wears its own game's palette
   (Bellguard: navy, wood and gold from its site.css; Paw Pop Match: pink, cream and plum from its style.css;
   Cutie Blocks: its pink accent on the pastel blue of its art). Coming-soon cards take their games' site colours,
   darkened where needed for text contrast. */
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("../fonts/nunito_extrabold.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url("../fonts/nunito_semibold.ttf") format("truetype"); }

:root {
  color-scheme: light dark;
  --bg: #fff8ee;
  --bg-deep: #fbeede;
  --surface: #ffffff;
  --ink: #2b2134;
  --ink-soft: #6a5866;
  --line: #eadccd;
  --accent: #c23a72;
  --accent-ink: #ffffff;
  --gold: #c9951e;
  --shadow: 0 14px 36px rgba(74, 42, 79, .12);
  --radius: 22px;
  --maxw: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17141c;
    --bg-deep: #1f1a26;
    --surface: #241e2c;
    --ink: #f6efe6;
    --ink-soft: #c2b6c3;
    --line: #3b3245;
    --accent: #ff8fbe;
    --accent-ink: #2b1424;
    --gold: #f2c53d;
    --shadow: 0 14px 36px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: break-word;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-weight: 800; line-height: 1.2; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.1rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); }
h1, h3 { text-wrap: balance; }
/* Keep Chinese words whole in headings: break at spaces and punctuation, not between characters. */
:lang(zh-Hant) :is(h1, h2, h3) { word-break: keep-all; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(var(--maxw), 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); color: var(--ink); padding: .5rem 1rem; border-radius: 10px; z-index: 10; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: .5rem 1.2rem; min-height: 64px; flex-wrap: wrap; padding-block: .4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; }
.brand img { width: 36px; height: 36px; }
.nav { display: flex; gap: .2rem 1rem; flex-wrap: wrap; margin-left: auto; font-size: .95rem; }
.nav a { color: var(--ink-soft); text-decoration: none; padding: .3rem .1rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.lang { font-size: .9rem; border: 1px solid var(--line); border-radius: 999px; padding: .25rem .85rem; color: var(--ink); text-decoration: none; white-space: nowrap; background: var(--surface); }
.lang:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 560px) {
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; }
  .lang { margin-left: auto; }
}

/* Hero */
.hero { text-align: center; padding: clamp(3rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3rem); }
.eyebrow { display: inline-block; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .8rem; }
.hero h1 { max-width: 18ch; margin-inline: auto; }
.lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--ink-soft); max-width: 58ch; margin: 0 auto 1.8rem; }
.jump { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; padding: 0; margin: 0; list-style: none; }
.jump a { display: flex; align-items: center; gap: .6rem; padding: .45rem 1.1rem .45rem .45rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.jump a:hover { transform: translateY(-2px); border-color: var(--accent); }
.jump img { width: 40px; height: 40px; border-radius: 12px; }

/* Sections */
section { margin: clamp(2.5rem, 6vw, 4.5rem) auto; scroll-margin-top: 80px; }
.section-head { text-align: center; margin-bottom: 1.8rem; }
.section-head p { color: var(--ink-soft); margin: 0 auto; max-width: 60ch; }

/* Game cards: each sets the --g-* palette of its own game. */
.games { display: grid; gap: clamp(1rem, 2.5vw, 1.8rem); grid-template-columns: 1fr; align-items: stretch; }
/* Two columns on tablets, where an odd last card spans the row as a wider banner; three on desktop. */
@media (min-width: 720px) and (max-width: 1059px) {
  .games { grid-template-columns: 1fr 1fr; }
  .game:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .game:last-child:nth-child(odd) .game-cover { aspect-ratio: 1024 / 360; }
}
@media (min-width: 1060px) {
  .games { grid-template-columns: repeat(3, 1fr); }
  /* A lone card on the last desktop row sits in the middle column. */
  .game:last-child:nth-child(3n + 1) { grid-column: 2; }
}
.game {
  display: flex; flex-direction: column;
  background: var(--g-bg); color: var(--g-ink);
  border: 2px solid var(--g-border); border-radius: var(--radius);
  box-shadow: var(--g-ring, 0 0 0 0 transparent), var(--shadow);
  overflow: hidden; scroll-margin-top: 80px;
}
.game-cover { position: relative; aspect-ratio: 1024 / 500; background: var(--g-border); }
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-body { display: flex; flex-direction: column; gap: 1rem; padding: clamp(1.2rem, 3vw, 1.8rem); flex: 1; }
.game-head { display: flex; align-items: center; gap: .9rem; }
.game-icon { width: 64px; height: 64px; border-radius: 16px; flex: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.game-head h3 { margin: 0; }
.genre { display: inline-block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--g-accent); background: var(--g-tag); border-radius: 999px; padding: .1rem .65rem; margin-bottom: .35rem; }
.game .tagline { font-size: 1.08rem; margin: 0; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.facts li { display: flex; gap: .65rem; align-items: baseline; color: var(--g-dim); }
.facts li span { flex: none; width: 1.4em; text-align: center; }
.game .meta { font-size: .9rem; color: var(--g-dim); margin: 0; padding-top: .9rem; border-top: 1px solid var(--g-line); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: auto; padding-top: .4rem; }
.actions > * { flex: 1 1 auto; justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: .55rem 1.3rem; border-radius: 12px; font-weight: 800; text-decoration: none; background: var(--g-btn); color: var(--g-btn-ink); border: 2px solid var(--g-btn); transition: transform .15s ease, filter .15s ease; }
.btn:hover { transform: translateY(-2px); color: var(--g-btn-ink); filter: brightness(1.06); }

.game--bellguard {
  --g-bg: #1b2130; --g-ink: #fff8e7; --g-dim: #d6cfbf; --g-accent: #f2c53d; --g-border: #5a3a1e;
  --g-tag: rgba(242, 197, 61, .14); --g-line: rgba(242, 197, 61, .25);
  --g-btn: #f2c53d; --g-btn-ink: #2b1a08;
  --g-ring: inset 0 0 0 1px rgba(242, 197, 61, .35);
}
.game--bellguard :focus-visible { outline-color: #f2c53d; }
.game--pawpop {
  --g-bg: #fff3f8; --g-ink: #4a2a4f; --g-dim: #6e4f72; --g-accent: #c23a72; --g-border: #f6cfe0;
  --g-tag: rgba(255, 143, 190, .2); --g-line: #f6cfe0;
  --g-btn: #c23a72; --g-btn-ink: #ffffff;
}
.game--pawpop :focus-visible { outline-color: #c23a72; }
.game--cutieblocks {
  --g-bg: #f4fafd; --g-ink: #2b2330; --g-dim: #6d5a72; --g-accent: #b83a6e; --g-border: #bfe0ee;
  --g-tag: rgba(244, 182, 210, .4); --g-line: #d5ebf4;
  --g-btn: #b83a6e; --g-btn-ink: #ffffff;
}
.game--cutieblocks :focus-visible { outline-color: #b83a6e; }

/* Coming soon: same card, with a badge on the cover and a Play placeholder instead of the store link. */
.soon-badge { position: absolute; top: .8rem; left: .8rem; padding: .2rem .75rem; border-radius: 999px; background: rgba(24, 18, 32, .8); color: #fff; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.soon-pill { display: inline-flex; align-items: center; gap: .55rem; min-height: 50px; padding: .4rem 1rem; border: 1.5px dashed var(--g-dim); border-radius: 10px; color: var(--g-dim); font-size: .95rem; }
.soon-pill svg { width: 20px; height: 22px; flex: none; opacity: .55; filter: grayscale(1); }
.game--colordoku {
  --g-bg: #f4f8ff; --g-ink: #2f3a56; --g-dim: #56617d; --g-accent: #2f6fd6; --g-border: #d0def5;
  --g-tag: rgba(74, 141, 245, .14); --g-line: #dce5f5;
  --g-btn: #2f6fd6; --g-btn-ink: #ffffff;
}
.game--colordoku :focus-visible { outline-color: #2f6fd6; }
.game--colorbloom {
  --g-bg: #fff8f6; --g-ink: #4a4458; --g-dim: #6e6680; --g-accent: #c2456a; --g-border: #f3d9df;
  --g-tag: rgba(255, 181, 186, .35); --g-line: #efe3e6;
  --g-btn: #c2456a; --g-btn-ink: #ffffff;
}
.game--colorbloom :focus-visible { outline-color: #c2456a; }
.game--catarrows {
  --g-bg: #f5f8ff; --g-ink: #2f3a56; --g-dim: #56617d; --g-accent: #a8500f; --g-border: #cfdcf3;
  --g-tag: rgba(244, 162, 97, .22); --g-line: #dce5f5;
  --g-btn: #b85412; --g-btn-ink: #ffffff;
}
.game--catarrows :focus-visible { outline-color: #b85412; }
.game--fireflyjar {
  --g-bg: #121838; --g-ink: #eef2ff; --g-dim: #c3cceb; --g-accent: #ffe066; --g-border: #2c3670;
  --g-tag: rgba(255, 224, 102, .14); --g-line: rgba(255, 224, 102, .22);
  --g-btn: #ffe066; --g-btn-ink: #0b1026;
  --g-ring: inset 0 0 0 1px rgba(255, 224, 102, .3);
}
.game--fireflyjar :focus-visible { outline-color: #ffe066; }

/* Google Play button (same drawing as the Bellguard site) */
.play-btn { display: inline-flex; align-items: center; gap: .6rem; min-height: 50px; background: #000; color: #fff; border: 1.5px solid #a6a6a6; border-radius: 10px; padding: .4rem 1rem .4rem .75rem; text-decoration: none; line-height: 1.1; transition: transform .15s ease; }
.play-btn:hover { transform: translateY(-2px); color: #fff; }
.play-btn svg { width: 26px; height: 29px; flex: none; }
.play-btn small { display: block; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.play-btn b { display: block; font-size: 1.1rem; font-weight: 800; }

/* About / contact */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.4rem, 4vw, 2.4rem); }
.split { display: grid; gap: clamp(1rem, 3vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.split h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); }
.split p { color: var(--ink-soft); }
.split p:last-child { margin-bottom: 0; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 1em; list-style: none; }
.pills li { font-size: .9rem; padding: .2rem .8rem; border-radius: 999px; background: var(--bg-deep); color: var(--ink); }
.mail { font-size: 1.1rem; font-weight: 800; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; color: var(--ink-soft); font-size: .9rem; }
.site-footer .wrap { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.site-footer h2 { font-size: .95rem; color: var(--ink); margin-bottom: .4rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--accent); }
.legal { grid-column: 1 / -1; margin: .4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.nowrap { white-space: nowrap; }
