/* ---------------------------------------------------------------------------
   tan9z1han.dpdns.org - shared stylesheet
   Four pages share this: / (home), /about/, /apps/, /apps/party-games/
   Keep the accent family in sync with the app's boot splash (#D4E3FF).

   NOTE: Cloudflare Pages caches /assets/* in the browser for 4 hours and the
   _headers Cache-Control is ignored for those files, so every page links this
   file as /assets/style.css?v=N. Bump N in all four pages whenever this file
   changes, otherwise returning visitors keep the old copy for hours.
--------------------------------------------------------------------------- */

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f1218;
  --body: #3a4252;
  --muted: #6b7280;
  --line: #e8ebf2;
  --line-strong: #d8dde8;
  --accent: #2563eb;
  --accent-soft: #d4e3ff;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(17, 24, 39, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --card: #171b22;
    --text: #f2f4f8;
    --body: #c3cad6;
    --muted: #98a2b3;
    --line: #232833;
    --line-strong: #333a47;
    --accent: #8ab4ff;
    --accent-soft: #1b2942;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { text-decoration: underline; }

/* Cross-fade between pages where the browser supports it - these are separate
   documents, so this is a navigation transition rather than a JS router. */
@view-transition { navigation: auto; }

/* ---------- page entrance ---------- */

/* Content rises into place on every page. The pieces are listed individually
   (and the delays below put them in reading order) because a page made of two
   or three big blocks would otherwise fade in as one lump and the effect would
   not be visible at all. */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.topbar,
.wrap > .brand,
.hero,
.section > h2,
.cards,
.section-foot,
.panel,
footer {
  animation: rise 0.5s cubic-bezier(0.22, 0.68, 0.31, 1) both;
}

/* the order they arrive in */
.topbar,
.wrap > .brand { animation-delay: 0.02s; }
.hero { animation-delay: 0.1s; }
.section > h2 { animation-delay: 0.13s; }
.panel { animation-delay: 0.18s; }
.cards { animation-delay: 0.21s; }
.section-foot { animation-delay: 0.3s; }
footer { animation-delay: 0.34s; }

h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 650; }
h1 { font-size: 34px; letter-spacing: -0.01em; }
h2 { font-size: 17px; letter-spacing: 0.01em; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

code {
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  word-break: break-all;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
  font-size: 14px;
}
.topbar .brand { color: var(--text); font-weight: 600; letter-spacing: 0.01em; }
.topbar .brand:hover { text-decoration: none; color: var(--accent); }
.topbar .back { color: var(--muted); }

/* ---------- home ---------- */

.hero { margin: 8px 0 44px; }
.hero .name {
  font-size: clamp(34px, 9vw, 44px);
  font-weight: 680;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.hero .tagline {
  font-size: 17px;
  color: var(--muted);
  margin: 0;
  max-width: 30em;
}

.section { margin: 0 0 36px; }
.section > h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.section-foot { margin-top: 14px; font-size: 14px; }

/* ---------- app cards ---------- */

.cards { display: grid; gap: 12px; }

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.card:hover {
  text-decoration: none;
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.card img { width: 52px; height: 52px; border-radius: 13px; flex: 0 0 auto; }
.card .body { min-width: 0; flex: 1 1 auto; }
.card .title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 620; }
.card .desc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .arrow { flex: 0 0 auto; color: var(--muted); font-size: 18px; line-height: 1; }

.tag {
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.tag.plain { background: var(--line); color: var(--muted); }

/* ---------- panels (download page) ---------- */

section.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 18px 0;
}
section.panel > h2 { margin-bottom: 14px; }
section.panel > p { color: var(--body); }

ol.steps, ul.plain { margin: 0; padding-left: 1.35em; color: var(--body); }
ol.steps li, ul.plain li { margin: 0 0 10px; }
ol.steps li:last-child, ul.plain li:last-child { margin-bottom: 0; }
strong { color: var(--text); font-weight: 620; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } }
.feat { background: var(--bg); border-radius: 14px; padding: 14px 16px; }
.feat b { display: block; font-size: 14px; margin-bottom: 4px; }
.feat span { font-size: 13px; color: var(--muted); line-height: 1.6; }

.games { list-style: none; margin: 0; padding: 0; }
.games li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.games li:last-child { border-bottom: 0; padding-bottom: 0; }
.games .name { font-weight: 620; flex: 0 0 auto; }
.games .spec { font-size: 13px; color: var(--muted); flex: 1 1 auto; min-width: 0; }
/* Narrow screens: the name and the badge share the first line, the spec gets
   its own line underneath - otherwise a long spec wraps under the name and
   leaves an orphaned word hanging in the middle column. */
@media (max-width: 480px) {
  .games li { flex-wrap: wrap; row-gap: 2px; }
  .games .spec { order: 2; flex: 1 1 100%; }
  .games .tag { order: 1; margin-left: auto; }
}

details { border-bottom: 1px dashed var(--line); padding: 12px 0; }
details:last-of-type { border-bottom: 0; padding-bottom: 0; }
details summary { cursor: pointer; font-weight: 620; font-size: 15px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; color: var(--muted); font-weight: 400; }
details[open] summary::before { content: "- "; }
details p { margin: 10px 0 0; font-size: 14.5px; color: var(--body); }

/* ---------- download page hero ---------- */

.app-hero { text-align: center; padding: 4px 0 8px; }
.app-hero img.icon {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.app-hero h1 { font-size: 32px; margin: 18px 0 6px; }
.app-hero .en {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.app-hero .status {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.app-hero .lead { margin: 0 auto 26px; color: var(--body); max-width: 34em; }

.btn {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 15px 30px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 620;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
  transition: transform 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn small { font-weight: 400; font-size: 12px; opacity: 0.85; }
.btn.is-off {
  background: var(--line);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.meta { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.mirror { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.notice {
  display: none;
  margin: 16px auto 0;
  max-width: 34em;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  text-align: left;
}

.hash { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.hash code {
  flex: 1 1 260px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
.hash button {
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- footer ---------- */

footer {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
