/* TasGame 外壳样式：首页、播放页、鸣谢页共用 */
:root {
  --bg: #f3eee4;
  --bg-2: #ebe4d6;
  --surface: #fffdf8;
  --surface-2: #f8f4ec;
  --ink: #1e1c17;
  --muted: #6b665b;
  --line: #e3dccd;
  --brand: #1f5f4a;
  --brand-ink: #ffffff;
  --gold: #c8962a;
  --shadow: 0 1px 2px rgba(40, 32, 16, .06), 0 6px 18px rgba(40, 32, 16, .07);
  --shadow-hover: 0 2px 4px rgba(40, 32, 16, .08), 0 14px 32px rgba(40, 32, 16, .14);
  --radius: 16px;
  --c-board: #2f6f5e;
  --c-cards: #8a2d3b;
  --c-casino: #a87412;
  --c-puzzle: #3a5aa6;
  --c-arcade: #6a3fa0;
  --c-retro: #c2410c;
  --c-strategy: #7a4b2a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11130f;
    --bg-2: #181b16;
    --surface: #1b1f1a;
    --surface-2: #222720;
    --ink: #ece8de;
    --muted: #a39e92;
    --line: #2c312a;
    --brand: #3f9d7c;
    --gold: #e0b04a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 32px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11130f;
  --bg-2: #181b16;
  --surface: #1b1f1a;
  --surface-2: #222720;
  --ink: #ece8de;
  --muted: #a39e92;
  --line: #2c312a;
  --brand: #3f9d7c;
  --gold: #e0b04a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 32px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: .01em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.logo-mark svg { width: 22px; height: 22px; }
.logo small { font-weight: 600; color: var(--muted); font-size: 13px; margin-left: 2px; }
.spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 14px; height: 38px; width: min(320px, 40vw);
}
.search svg { width: 16px; height: 16px; opacity: .55; flex: none; }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); width: 100%; font: inherit; }
.iconbtn {
  height: 38px; min-width: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 13px;
}
.iconbtn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
a.iconbtn { text-decoration: none; }
.iconbtn { white-space: nowrap; flex: none; }
@media (max-width: 420px) { .topbar .wrap { gap: 8px; } .iconbtn { padding: 0 10px; } }
.iconbtn svg { width: 17px; height: 17px; }

/* 首屏 */
.hero { padding: 36px 0 8px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; margin: 0 0 12px; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { margin: 0; color: var(--muted); font-size: 16px; max-width: 34em; }
.hero-stats { display: flex; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.hero-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.hero-stats b { font-size: 20px; display: block; line-height: 1.2; }
.hero-stats span { color: var(--muted); font-size: 12px; }
.lucky {
  display: inline-flex; align-items: center; gap: 8px; align-self: center; text-decoration: none;
  background: var(--brand); color: var(--brand-ink); font-weight: 800; border-radius: 12px; padding: 10px 16px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); transition: transform .15s;
}
.lucky:hover { transform: translateY(-2px); }
.lucky span { display: inline-flex; }
.lucky svg { width: 20px; height: 20px; }
.hero-art { justify-self: end; width: min(420px, 100%); }
.hero-art svg { width: 100%; height: auto; display: block; }

/* 分区 */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 20px; margin: 0; }
.section-head .sub { color: var(--muted); font-size: 13px; }
.section-head .more { margin-left: auto; font-size: 13px; color: var(--muted); }

/* 分类标签 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip .n { color: var(--muted); font-weight: 500; font-size: 12px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: color-mix(in srgb, var(--bg) 70%, transparent); }

/* 卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.row > * { scroll-snap-align: start; }
.card {
  position: relative; display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.thumb { position: relative; aspect-ratio: 16 / 10; background: var(--c, var(--brand)); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .art { position: absolute; inset: 0; display: grid; place-items: center; }
.thumb .art::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,.22), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(0,0,0,.28), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 10px, transparent 10px 20px);
}
.thumb .art svg { position: relative; width: 38%; height: auto; color: rgba(255,255,255,.92); filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.thumb .art .glyph { position: relative; font-size: 46px; font-weight: 800; color: rgba(255,255,255,.95); text-shadow: 0 4px 14px rgba(0,0,0,.3); letter-spacing: .02em; }
.badge-cat {
  position: absolute; left: 10px; top: 10px; z-index: 1;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(4px);
}
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-title b { font-size: 16px; }
.card-title span { color: var(--muted); font-size: 12.5px; }
.card-blurb { color: var(--muted); font-size: 13px; line-height: 1.45; flex: 1; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.tag.local { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); color: color-mix(in srgb, var(--gold) 70%, var(--ink)); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.cat-block { margin-top: 18px; }
.cat-block:first-child { margin-top: 6px; }
.cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cat-head .cat-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.cat-head .cat-ico svg { width: 17px; height: 17px; }
.cat-head h3 { margin: 0; font-size: 17px; }
.cat-head .n { color: var(--muted); font-size: 13px; }
.cat-head .more { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px 2px; }
.cat-head .more:hover { color: var(--ink); text-decoration: underline; }
.row.picks { grid-auto-columns: minmax(260px, 1fr); }
@media (max-width: 760px) { .row.picks { grid-auto-columns: 78%; } }
.notice {
  margin-top: 14px; padding: 10px 14px; border-radius: 12px; font-size: 13px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line);
}

/* 页脚 */
.footer { margin: 48px 0 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* 鸣谢页 */
.doc { max-width: 900px; }
.doc h1 { font-size: 28px; margin: 28px 0 8px; }
.doc p { color: var(--muted); }
.credits { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; background: var(--surface); border-radius: 12px; overflow: hidden; }
.credits th, .credits td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.credits th { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 700; }
.credits td small { color: var(--muted); display: block; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 22px; }
  .hero-art { display: none; }
  .search { width: auto; flex: 1; }
  .topbar .logo small { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-blurb { display: none; }
  .row { grid-auto-columns: 46%; gap: 12px; }
}
@media (max-width: 380px) {
  .logo span.word { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}

/* 「仅自己」：站长账号才看得到的游戏 */
.badge-lock {
  position: absolute; right: 10px; top: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(20, 16, 4, .72); color: #f3cf6b; font-size: 11px; font-weight: 700;
  padding: 3px 8px 3px 6px; border-radius: 999px; backdrop-filter: blur(4px);
}
.badge-lock svg { width: 12px; height: 12px; }
.me-btn { gap: 6px; }
.me-btn svg { width: 16px; height: 16px; }
.me-btn.in { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* 今天的题、签到 */
.dailies { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.daily {
  position: relative; display: flex; align-items: center; gap: 12px; text-align: left; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow);
  font: inherit; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.daily:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.daily .d-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--c, var(--brand)); color: #fff; }
.daily .d-ico svg { width: 22px; height: 22px; }
.daily .d-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.daily .d-txt b { font-size: 15px; }
.daily .d-txt small { color: var(--muted); font-size: 12.5px; }
.daily .d-streak { font-weight: 800; font-size: 14px; color: var(--gold); }
.daily.done .d-ico { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); color: var(--brand); }
.daily.checkin { --c: var(--gold); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.daily.checkin .d-ico { color: #fff8e6; }
.daily.checkin.done { background: var(--surface); }
.daily.checkin.done .d-ico { color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }
.daily.pop { animation: pop .5s ease; }
@keyframes pop { 40% { transform: scale(1.04); } }
.daily .fly { position: absolute; right: 18px; top: 4px; font-weight: 900; color: var(--gold); font-size: 20px; pointer-events: none; animation: fly 1.4s ease-out forwards; }
@keyframes fly { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-36px); } }
.chips.mood { margin-bottom: 4px; }
@media (max-width: 560px) {
  .dailies { grid-template-columns: 1fr 1fr; gap: 8px; }
  .daily { padding: 10px; gap: 9px; }
  .daily .d-ico { width: 34px; height: 34px; border-radius: 10px; }
  .daily .d-ico svg { width: 19px; height: 19px; }
  .daily .d-txt b { font-size: 14px; }
  .daily .d-txt small { font-size: 11.5px; }
  .daily .d-streak { position: absolute; right: 8px; top: 6px; font-size: 12px; }
  .daily.checkin { grid-column: 1 / -1; }
}
