/* 小雞快玩 — 純 CSS，無框架 */
/* 預設：米黃白版型；[data-theme="dark"]：深色版型 */
:root {
  --bg: #f7f1e3;
  --bg2: #efe7d2;
  --card: #fffdf5;
  --card2: #f4ecd9;
  --line: #e4d9bd;
  --text: #3b3527;
  --muted: #625947;
  --acc: #6c5ce7;
  --acc2: #ff7eb3;
  --acc-strong: #5b46b8;
  --btn-grad: linear-gradient(135deg, var(--acc-strong), #7a3f9d);
  --gold: #ffe066;
  --link: #c2255c;
  --kicker: #7a5606;
  --sub: #6d54c8;
  --threads-ink: #d6336c;
  --warm: #b85c11;
  --top-bg: #f7f1e3e6;
  --glow: #f2e0b466;
  --shadow-c: #8c74423d;
  --glow-acc: #6c5ce72e;
  --radius: 14px;
  /* 捲軸：暖灰砂色，hover 轉品牌紫 */
  --sb-thumb: #b5a789;
  --sb-thumb-hover: #8f80bd;
  --sb-track: transparent;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e0f1a;
  --bg2: #151729;
  --card: #1a1d33;
  --card2: #222644;
  --line: #2a2e52;
  --text: #eef0ff;
  --muted: #9aa0c3;
  --acc: #6c5ce7;
  --acc2: #ff7eb3;
  --gold: #ffe066;
  --link: #ff7eb3;
  --kicker: #ffe066;
  --sub: #b9a6ff;
  --threads-ink: #ff8ba0;
  --warm: #ffb066;
  --top-bg: #0e0f1adf;
  --glow: #232a5c66;
  --shadow-c: #0006;
  --glow-acc: #6c5ce755;
  --sb-thumb: #3f466f;
  --sb-thumb-hover: #8a7be8;
  --sb-track: transparent;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* 防止 display 覆寫 hidden 屬性 */
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, var(--glow), transparent), var(--bg);
  color: var(--text);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--acc); padding: 6px 12px; border-radius: 8px; z-index: 99; }

/* ---- 頂欄 ---- */
.top { position: sticky; top: 0; z-index: 50; background: var(--top-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { position: relative; max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 6px 16px; }
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-copy b { font-size: 1.08rem; letter-spacing: .5px; display: block; line-height: 1.2; }
.brand-copy span { display: block; font-size: .72rem; line-height: 1.3; color: var(--muted); }
.search { position: relative; flex: 1; min-width: 0; max-width: 460px; display: flex; }
.search input {
  flex: 1; min-width: 0; padding: 7px 12px; border: 1px solid var(--line); border-right: 0;
  border-radius: 10px 0 0 10px; background: var(--bg2); color: var(--text); font-size: .9rem; outline: none;
}
.search input:focus { border-color: var(--acc); }
.search input::placeholder { color: var(--muted); opacity: .9; }
.search button {
  padding: 7px 14px; border: 0; border-radius: 0 10px 10px 0; cursor: pointer;
  background: var(--btn-grad); color: #fff; font-weight: 700; font-size: .9rem;
}
.suggest {
  position: absolute; top: 100%; left: 0; right: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 0 0 12px 12px; overflow: hidden; box-shadow: 0 12px 30px var(--shadow-c);
  z-index: 10;
}
.suggest a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.suggest a:last-child { border-bottom: 0; }
.suggest img { width: 44px; height: 28px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.suggest .s-tile { width: 44px; height: 28px; display: inline-grid; place-items: center; background: var(--card2); border-radius: 4px; font-weight: 800; flex-shrink: 0; }
.suggest .s-cat { margin-left: auto; color: var(--muted); font-size: .8125rem; flex-shrink: 0; }
.top-links { display: flex; gap: 8px; flex-shrink: 0; }
.pill {
  padding: 5px 11px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line);
  font-size: .85rem; white-space: nowrap; color: var(--text); font-family: inherit;
}
.pill:hover { border-color: var(--acc); background: var(--card); }
/* ---- 語言選擇器 ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lang-picker { position: relative; flex-shrink: 0; }
.lang-trigger {
  display: flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg2); color: var(--text);
  font: inherit; font-size: .85rem; font-weight: 700; line-height: 1.4; cursor: pointer;
}
.lang-trigger:hover { border-color: var(--acc); }
.lang-trigger:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.lang-globe { flex-shrink: 0; opacity: .75; }
.lang-trigger-name { max-width: 13ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-trigger-short { display: none; }
.lang-caret { font-size: .68rem; opacity: .7; transition: transform .16s ease; }
.lang-trigger[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
/* 沒有 JS 時改用 <noscript> 的原生 details 清單，不顯示無作用的按鈕 */
.no-js .lang-trigger { display: none; }

.lang-plain { position: relative; font-size: .85rem; }
.lang-plain summary {
  list-style: none; cursor: pointer; padding: 7px 11px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg2); font-weight: 700;
}
.lang-plain summary::-webkit-details-marker { display: none; }
.lang-plain-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 180px;
  display: grid; gap: 2px; padding: 6px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px var(--shadow-c);
}
.lang-plain-list a { padding: 7px 9px; border-radius: 7px; }
.lang-plain-list a:hover { background: var(--bg2); }

/* 對話框：桌機貼齊入口按鈕，手機（.is-sheet）變成底部面板 */
.lang-dialog {
  position: fixed; inset: 0 0 auto auto; margin: 0; padding: 0;
  width: min(92vw, 380px); max-height: min(72dvh, 560px);
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); color: var(--text);
  box-shadow: 0 24px 60px var(--shadow-c); overflow: hidden;
}
.lang-dialog[open] { display: flex; flex-direction: column; }
.lang-dialog::backdrop { background: #16130b66; }
@supports (backdrop-filter: blur(2px)) { .lang-dialog::backdrop { backdrop-filter: blur(2px); } }
.lang-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.lang-head h2 { margin: 0; flex: 1; font-size: 1rem; line-height: 1.3; }
.lang-close {
  flex-shrink: 0; width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg2); color: var(--muted);
  font-family: inherit; cursor: pointer;
}
.lang-close:hover { border-color: var(--acc); color: var(--text); }
.lang-close:focus-visible, .lang-clear:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.lang-search { position: relative; padding: 0 14px 10px; }
.lang-search input {
  width: 100%; padding: 9px 36px 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg2); color: var(--text); font: inherit; font-size: .9rem; outline: none;
}
.lang-search input:focus { border-color: var(--acc); }
.lang-search input::placeholder { color: var(--muted); opacity: .9; }
/* 隱藏 WebKit 原生的搜尋清除鈕，統一用我們自己的（Firefox 沒有原生鈕） */
.lang-search input::-webkit-search-cancel-button,
.lang-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.lang-clear {
  position: absolute; right: 20px; top: 6px; width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-family: inherit; cursor: pointer;
}
.lang-clear:hover { color: var(--text); background: var(--card2); }
.lang-list-wrap {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding: 0 8px 10px;
}
.lang-list { list-style: none; margin: 0; padding: 0; }
.lang-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 10px; }
a.lang-item:hover { background: var(--bg2); }
a.lang-item:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.is-current .lang-item { background: var(--bg2); }
.lang-item-copy { display: grid; gap: 1px; min-width: 0; }
.lang-item-copy b { font-size: .92rem; font-weight: 700; overflow-wrap: anywhere; }
.lang-item-copy small { color: var(--muted); font-size: .78rem; }
.lang-check { margin-left: auto; flex-shrink: 0; color: var(--sub); font-weight: 800; opacity: 0; }
.is-current .lang-check { opacity: 1; }
.lang-empty { margin: 18px 10px; color: var(--muted); font-size: .88rem; text-align: center; }
body.lang-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
@keyframes lang-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes lang-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.lang-dialog[open]:not(.is-sheet) { animation: lang-pop .16s ease-out; }
.lang-dialog[open].is-sheet { animation: lang-rise .2s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .lang-dialog[open] { animation: none; }
  .lang-caret { transition: none; }
}
.theme-toggle {
  flex-shrink: 0; width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  font-size: 1rem; line-height: 1; cursor: pointer; font-family: inherit;
}
.theme-toggle:hover { border-color: var(--acc); }
/* ---- 分類下拉（整合在頂欄，不另佔一列） ---- */
.cat-menu { flex-shrink: 0; }
/* 頂欄只留圖示＋箭頭，不再顯示「分類」文字（aria-label 仍完整） */
.cat-menu-label { display: none; }
.cat-menu-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  font-size: .85rem; line-height: 1.4; white-space: nowrap; cursor: pointer; list-style: none; user-select: none;
}
.cat-menu-btn::-webkit-details-marker { display: none; }
.cat-menu-btn:hover,
.cat-menu[open] .cat-menu-btn { border-color: var(--acc); background: var(--card); }
.cat-caret { font-size: .8em; transition: transform .18s ease; }
.cat-menu[open] .cat-caret { transform: rotate(180deg); }
.cat-menu-panel {
  position: absolute; left: 16px; top: calc(100% + 2px); z-index: 5;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 2px;
  width: min(calc(100vw - 32px), 780px); max-height: min(60vh, 440px); overflow: auto;
  padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 50px var(--shadow-c);
}
.cat-menu-item { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 9px; font-size: .9rem; white-space: nowrap; }
.cat-menu-item:hover { background: var(--bg2); }
.cat-menu-item .n { margin-left: auto; color: var(--muted); font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { .cat-caret { transition: none; } }

/* ---- 版面：桌機左側分類導覽＋主要內容 ---- */
.layout { max-width: 1200px; margin: 0 auto; padding: 18px 16px 40px; }
main { min-width: 0; }
.side { display: none; }
.side-cats { display: flex; flex-direction: column; gap: 2px; }
.side-cats .cat {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 10px; font-size: .925rem; line-height: 1.4; min-height: 36px;
}
.side-cats .cat:hover { background: var(--bg2); }
.side-cats .cat.on { background: var(--bg2); color: var(--acc); font-weight: 700; }
.side-cats .ico { flex: 0 0 1.35em; text-align: center; }
.side-cats .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-cats .n { margin-left: auto; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
@media (min-width: 1000px) {
  /* 分類已固定在左側，頂欄不再重複顯示分類選單（手機仍保留） */
  .cat-menu { display: none; }
  .layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 24px; align-items: start; }
  .side {
    display: block; position: sticky; top: 68px; align-self: start;
    max-height: calc(100vh - 88px); overflow-y: auto; overscroll-behavior: contain;
    padding-right: 2px;
  }
  /* 分類已固定在左側，首頁手機版的分類雲在桌機不重複顯示 */
  .home-cats { display: none; }
}
.block { margin: 26px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head h1, .block-head h2 { margin: 0; font-size: 1.25rem; }
.h-count { font-size: .95rem; font-weight: 400; }
.more { color: var(--link); font-size: .88rem; white-space: nowrap; }
.crumbs { color: var(--muted); font-size: .875rem; margin: 10px 0 4px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* 只給螢幕閱讀器（首頁 h1） */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- 首頁推薦（Hero）：一列固定 3 款小封面，可滑動、桌機左右箭頭 ---- */
/* 列本體用 margin 內縮，箭頭放在兩側留白不壓住封面；第四款起在列邊緣
   完全裁掉，只能滑動或按箭頭查看。要不要顯示箭頭由 JS 依「實際是否
   超出容器」決定（.is-static 收起），手機隱藏箭頭、只靠滑動。 */
.hero-block { margin: 8px 0; }
.hero-block .block-head { margin-bottom: 8px; }
.hero-shell { position: relative; }
.hero {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 2px 46px 4px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hero::-webkit-scrollbar { display: none; }
.hero:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 10px; }
.hero.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.hero-card { position: relative; flex: 0 0 calc((100% - 24px) / 3); min-width: 0; scroll-snap-align: start; }
.hero-card-link { display: block; }
.hero-card .thumb { aspect-ratio: 16/9; border-radius: 10px; }
.hero-card .thumb img { transition: transform .35s ease; user-select: none; -webkit-user-drag: none; }
.hero-card:hover .thumb img { transform: scale(1.04); }
.hero-name {
  display: block; margin: 4px 1px 0; font-size: .875rem; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-user-drag: none;
}
.hero-card-link:hover .hero-name { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  box-shadow: 0 4px 14px var(--shadow-c);
  transition: opacity .18s ease, border-color .18s ease, color .18s ease;
}
.hero-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-arrow:hover:not(:disabled) { border-color: var(--warm); color: var(--warm); }
.hero-arrow:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.hero-arrow:disabled { opacity: 0; pointer-events: none; }
.hero-arrow-prev { left: 4px; }
.hero-arrow-next { right: 4px; }
.hero-block.is-static .hero-arrow { display: none; }

/* ---- 卡片 ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 16px; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--acc); box-shadow: 0 14px 30px var(--shadow-c); }
.card-link { display: flex; flex-direction: column; gap: 6px; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.thumb {
  position: relative; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h, 220) 62% 46%), hsl(calc(var(--h, 220) + 42) 66% 34%));
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; position: absolute; inset: 0; }
.tile {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 3rem; font-weight: 900; color: #ffffffd9; text-shadow: 0 4px 18px #0006;
}
.badge {
  position: absolute; top: 8px; left: 8px; z-index: 2; padding: 3px 9px; border-radius: 999px;
  font-size: .8125rem; font-weight: 800; letter-spacing: .4px;
}
.b-new { background: var(--gold); color: #333; }
.b-threads { background: #d61f45; color: #fff; }
.card-title { margin: 2px 2px 0; font-size: 1rem; font-weight: 700; line-height: 1.35; letter-spacing: -.005em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { margin: 0 2px; color: var(--muted); font-size: .8125rem; font-weight: 500; line-height: 1.35; letter-spacing: .005em; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card-desc { margin: 0 2px; color: var(--muted); font-size: .9375rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.card-meta { margin: 0 2px 2px; display: flex; gap: 3px 8px; align-items: center; flex-wrap: wrap; font-size: .875rem; position: relative; z-index: 1; }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--bg2);
  border: 1px solid var(--line); color: var(--muted); font-size: .875rem; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--acc); position: relative; z-index: 2; }

/* ---- 分類雲 ---- */
.cat-cloud { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.cat-card:hover { border-color: var(--acc); transform: translateY(-3px); }
.cc-emoji { font-size: 1.6rem; }
.cc-name { font-weight: 700; font-size: .95rem; }
.cc-n { color: var(--muted); font-size: .875rem; }

/* ---- 遊戲頁 ---- */
/* 單一主欄：標題 → 遊戲 → 評分 → 介紹 → 推薦，全部對齊同一條中線 */
.game-wrap { max-width: 900px; margin: 0 auto; display: grid; gap: 16px; }
.game-wrap .crumbs { margin: 8px 0 0; }
.game-head { display: grid; gap: 7px; }
.game-title { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 1.95rem); line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.game-meta { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; margin: 0; font-size: .875rem; }
.meta-sep { color: var(--line); font-size: .8em; }
.meta-group { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.play-col { width: 100%; }
.play-zone { position: relative; }
.play-placeholder { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); border: 1px solid var(--line); background: #0b0b12; }
.play-preview {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h, 220) 62% 40%), hsl(calc(var(--h, 220) + 42) 66% 28%));
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px -28px var(--shadow-c);
}
.play-preview img { width: 100%; height: 100%; object-fit: cover; }
.play-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-start; padding: 18px;
  background: linear-gradient(180deg, #0000000a 42%, #000000a8);
  border: 0; cursor: pointer; color: #fff; width: 100%; font-family: inherit;
}
.po-cta {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 18px 7px 7px;
  border-radius: 999px; background: #17130bd9; border: 1px solid #ffffff2e;
  box-shadow: 0 10px 30px #00000059;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .18s ease;
}
.play-overlay:hover .po-cta { transform: translateY(-1px); }
.play-overlay:hover .po-circle { transform: scale(1.06); }
.play-overlay:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.po-circle {
  width: 42px; height: 42px; padding-left: 3px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem;
  background: var(--btn-grad);
  transition: transform .18s ease;
}
.po-txt { font-size: 1rem; font-weight: 800; letter-spacing: .02em; text-shadow: none; }
.play-foot { display: grid; gap: 3px; margin-top: 9px; }
.play-links { display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: center; margin: 0; font-size: .9rem; }
.play-links a { color: var(--link); }
.play-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.play-stage { position: relative; }
.play-frame { display: block; width: 100%; aspect-ratio: 16/9; border: 1px solid var(--line); border-radius: var(--radius); background: #000; }
/* 全螢幕：只放大遊戲區塊（.play-stage），右上角保留「退出全螢幕」按鈕 */
.play-stage:fullscreen,
.play-stage:-webkit-full-screen { width: 100%; height: 100%; background: #000; }
.play-stage:fullscreen::backdrop { background: #000; }
.play-stage:fullscreen .play-frame,
.play-stage:-webkit-full-screen .play-frame {
  width: 100%; height: 100%; aspect-ratio: auto;
  border: 0; border-radius: 0; background: #000;
}
.fs-exit {
  position: absolute; top: 14px; right: 14px; z-index: 2; display: none;
  align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid #ffffff45; background: #000000b3; color: #fff;
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.fs-exit:hover { background: #000000e0; }
.play-stage:fullscreen .fs-exit,
.play-stage:-webkit-full-screen .fs-exit { display: inline-flex; }
.play-toolbar { display: flex; gap: 10px; margin-top: 8px; }
.play-note { margin: 0; font-size: .8rem; line-height: 1.55; }

/* 評分：遊戲正下方的精簡操作列（保留 JS 需要的節點與 data 屬性） */
.rating-box h2 { margin: 0; font-size: .82rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); order: 1; }
.rating-box .rating-actions { margin: 0; order: 2; }
.rating-box .rating-btn { padding: 6px 14px; font-size: .88rem; }
.rating-box .rating-summary { margin: 0 0 0 auto; order: 4; }
.rating-box .rating-score { font-size: 1.15rem; }
.rating-box .rating-count { font-size: .78rem; }
.rating-box .rating-hint { order: 3; flex: 1 1 120px; margin: 0 0 0 6px; font-size: .78rem; min-height: 0; }
.rating-box .rating-hint:empty { display: none; }

/* 介紹：左側小標、右側正文，正文控制在易讀行寬 */
.game-desc {
  display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 6px 28px;
  padding-top: 20px; border-top: 1px solid var(--line);
}
.game-desc > h2 { margin: 0; padding-top: 4px; font-size: .82rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.game-desc-body { min-width: 0; }
.game-desc-body p { margin: 0 0 14px; font-size: 1rem; line-height: 1.85; }
.game-desc-body p:last-child { margin-bottom: 0; }
.game-desc-body .small { font-size: .85rem; line-height: 1.6; }
.game-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.threads-box { border: 1px dashed #ff3d5e88; background: #ff3d5e14; border-radius: 10px; padding: 10px 14px; margin: 18px 0 0; }
.threads-box h2 { font-size: 1rem; margin: 0 0 4px; color: var(--threads-ink); }
.threads-box p { margin: 0 0 4px; font-size: .95rem; line-height: 1.65; }

/* 推薦：同分類卡片，收掉重複的分類 chip 與長介紹，以圖＋名稱為主 */
.game-related { margin: 16px 0 0; }
.game-related .block-head { margin-bottom: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.game-related .block-head h2 { font-size: 1.02rem; }
.game-related .card { padding: 8px; gap: 4px; }
.game-related .card-desc,
.game-related .card-meta .chip { display: none; }
.game-related .card-title { font-size: .95rem; }
.game-related .card-sub { font-size: .8rem; }
.game-related .card-meta { margin-top: auto; font-size: .8rem; }

/* ---- 評分 ---- */
.rating-box {
  margin: 0; padding: 10px 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.rating-summary { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.rating-score { font-size: 1.35rem; font-weight: 900; letter-spacing: -.02em; }
.rating-score.is-empty { font-size: .95rem; font-weight: 700; color: var(--muted); }
.rating-count { font-size: .82rem; }
.rating-count.is-empty { display: none; }
.rating-actions, .rr-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rating-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  font-family: inherit; font-size: .95rem; font-weight: 700; cursor: pointer;
  transition: transform .12s ease, background .18s ease, border-color .18s ease;
}
.rating-btn:hover:not(:disabled) { border-color: var(--acc); transform: translateY(-1px); }
.rating-btn[aria-pressed="true"] { background: var(--btn-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px var(--glow-acc); }
.rating-btn:disabled { opacity: .65; cursor: wait; }
.rating-btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.rating-hint { margin: 8px 0 0; font-size: .82rem; min-height: 1.3em; }
.r-n { font-size: .82em; opacity: .85; }
.rating-reminder {
  position: fixed; z-index: 80; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(560px, calc(100vw - 24px));
  padding: 12px 14px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--card); box-shadow: 0 18px 50px var(--shadow-c);
  animation: rr-in .22s ease-out;
}
@keyframes rr-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.rr-head { display: flex; align-items: flex-start; gap: 10px; }
.rr-title { margin: 0; flex: 1; font-weight: 800; font-size: .98rem; line-height: 1.45; overflow-wrap: anywhere; }
.rr-close {
  flex-shrink: 0; width: 36px; height: 36px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg2); color: var(--muted);
  font-family: inherit; cursor: pointer;
}
.rr-close:hover { border-color: var(--acc); color: var(--text); }
.rr-close:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.rr-hint { margin: 6px 0 0; font-size: .82rem; min-height: 1.2em; }
body.rating-open { padding-bottom: 150px; }
@media (prefers-reduced-motion: reduce) {
  .rating-reminder { animation: none; }
  .rating-btn { transition: none; }
}
@media (max-width: 560px) {
  .rating-btn { flex: 1; justify-content: center; padding: 9px 10px; }
  .rating-reminder { padding: 10px 12px 12px; }
  body.rating-open { padding-bottom: 190px; }
}

/* ---- 排序/分頁/日期 ---- */
.sorts { display: flex; gap: 8px; margin: 10px 0 16px; }
.sorts a { padding: 5px 14px; border-radius: 999px; background: var(--bg2); color: var(--muted); font-size: .88rem; }
.sorts a.on { background: var(--acc-strong); color: #fff; font-weight: 700; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; font-size: .92rem; }
.pager a { color: var(--link); }
.day-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; }
.day-tabs a { white-space: nowrap; padding: 5px 13px; border-radius: 999px; background: var(--bg2); font-size: .875rem; color: var(--muted); }
.day-tabs a.on { background: var(--acc-strong); color: #fff; }
.day-tabs .n { margin-left: 6px; opacity: .85; font-size: .82em; }
.day-h { font-size: 1.05rem; margin: 14px 0 12px; }

/* ---- 頁尾 ---- */
.foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 22px 16px 34px; }
.foot p { max-width: 900px; margin: 6px auto; color: var(--muted); font-size: .875rem; line-height: 1.7; text-align: center; }
.foot a { color: var(--link); }
.prose { max-width: 760px; }
.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.1rem; margin-top: 26px; }
.prose a { color: var(--link); }

/* ---- RWD ---- */
@media (max-width: 1200px) {
  /* 頂欄塞不下品牌標語：讓分類選單與搜尋保有可用寬度 */
  .brand-copy span { display: none; }
}
@media (max-width: 1100px) {
  /* 分類下拉進駐頂欄後空間變緊：先收起次要導覽（每日新遊戲／Threads） */
  .top-links { display: none; }
}
@media (max-width: 700px) {
  /* 手機一樣一列 3 款；箭頭收起，只靠滑動 */
  .hero { margin-inline: 0; }
  .hero-arrow { display: none; }
  /* 頂欄改成兩排：品牌＋語系／主題，搜尋獨占第二排。
     避免內容撐寬 layout viewport，讓 fixed 評分提醒能貼齊可視底部。 */
  .top-in { flex-wrap: wrap; gap: 6px; padding: 6px 12px; }
  .brand-copy span { display: none; }
  .search { order: 3; flex: 1 0 100%; max-width: none; }
  .lang-picker { margin-left: auto; }
  .lang-trigger { gap: 5px; padding: 5px 9px; }
  .lang-trigger-name { display: none; }
  .lang-trigger-short { display: inline; }
  /* 手機改成底部面板，單手可選、長清單在面板內捲動 */
  .lang-dialog.is-sheet {
    top: auto; right: 0; bottom: 0; left: 0; width: 100%;
    max-height: 82dvh; border-radius: 20px 20px 0 0; border-bottom: 0;
  }
  .lang-dialog.is-sheet .lang-head { position: relative; padding-top: 20px; }
  .lang-dialog.is-sheet .lang-head::before {
    content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 99px; background: var(--line);
  }
  .lang-dialog.is-sheet .lang-list-wrap { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .cat-menu-panel { left: 12px; width: calc(100vw - 24px); }
  /* 遊戲頁：介紹改為上下堆疊，正文行寬回到容器寬 */
  .game-wrap { gap: 14px; }
  .game-desc { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 16px; }
  .game-desc > h2 { padding-top: 0; font-size: .95rem; letter-spacing: 0; }
  .game-desc-body p { font-size: .97rem; line-height: 1.8; }
  .game-related .block-head h2 { font-size: .98rem; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card { padding: 8px; }
  .card-title { font-size: .95rem; }
  .card-sub { font-size: .78rem; }
  .card-desc { display: none; }
  .search button { display: none; }
  .search input { border-radius: 10px; border-right: 1px solid var(--line); }
  /* 評分列：標題單獨一行，按鈕獨占一列比較好按 */
  .rating-box { gap: 8px 10px; }
  .rating-box .rating-actions { flex: 0 0 100%; }
  .game-head .game-title { font-size: 1.45rem; }
  .play-overlay { padding: 12px; }
  .po-cta { padding: 6px 14px 6px 6px; gap: 8px; }
  .po-circle { width: 36px; height: 36px; font-size: 1rem; }
  .po-txt { font-size: .92rem; }
}
@media (max-width: 380px) {
  /* 320–380px：再壓縮品牌與語系切換，讓第一排仍能完整放入。 */
  .top-in { gap: 6px; padding: 6px 8px; }
  .brand { gap: 8px; }
  .brand-copy b { font-size: 1rem; }
  .lang-trigger { gap: 4px; padding: 5px 7px; }
  .theme-toggle { width: 30px; height: 30px; }
}

/* ---- 主題合集（/t）---- */

.topic-hub-intro { color: var(--muted); margin: -4px 0 18px; }
.topic-hub { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.topic-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  background: var(--card, var(--bg)); transition: border-color .2s ease;
}
.topic-card:hover { border-color: var(--brand, #f59e42); }
.topic-card-link { display: block; text-decoration: none; color: inherit; }
.topic-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.topic-card-head strong { font-size: 1.08rem; }
.topic-card-head .small { font-size: .85rem; white-space: nowrap; }
.topic-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.topic-thumbs .thumb {
  position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden;
  background: hsl(var(--h, 210) 45% 42%);
}
.topic-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.topic-thumbs .tile {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 1.3rem; color: #fff; opacity: .9;
}
.topic-card-desc { margin: 10px 0 0; line-height: 1.6; }
.chip-topic { background: rgba(245, 158, 66, .12); border-color: rgba(245, 158, 66, .45); }
@media (max-width: 560px) {
  .topic-thumbs { grid-template-columns: repeat(2, 1fr); }
}

/* ---- 捲軸 ---- */
/* 頁面捲軸：細長、圓角、浮在背景上；hover 轉品牌紫。Chromium／Safari 用
   ::-webkit-scrollbar（透明邊框做出內縮的藥丸形）；標準屬性只在沒有
   ::-webkit-scrollbar 的瀏覽器（Firefox）啟用——Chrome 121+ 一旦設了
   scrollbar-color／scrollbar-width 就會蓋掉 WebKit 樣式。 */
html::-webkit-scrollbar { width: 12px; height: 12px; }
html::-webkit-scrollbar-track { background: var(--sb-track); }
html::-webkit-scrollbar-thumb {
  background-color: var(--sb-thumb);
  border: 3px solid transparent; border-radius: 999px;
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover { background-color: var(--sb-thumb-hover); }
html::-webkit-scrollbar-corner { background: transparent; }

/* 面板內捲軸（側欄、語言清單、分類選單）：比頁面更細，不干擾內容。 */
.side::-webkit-scrollbar,
.lang-list-wrap::-webkit-scrollbar,
.cat-menu-panel::-webkit-scrollbar,
.day-tabs::-webkit-scrollbar { width: 8px; height: 8px; }
.side::-webkit-scrollbar-track,
.lang-list-wrap::-webkit-scrollbar-track,
.cat-menu-panel::-webkit-scrollbar-track,
.day-tabs::-webkit-scrollbar-track { background: transparent; }
.lang-list-wrap::-webkit-scrollbar-thumb,
.cat-menu-panel::-webkit-scrollbar-thumb,
.day-tabs::-webkit-scrollbar-thumb {
  background-color: var(--sb-thumb);
  border: 2px solid transparent; border-radius: 999px;
  background-clip: padding-box;
}
.lang-list-wrap::-webkit-scrollbar-thumb:hover,
.cat-menu-panel::-webkit-scrollbar-thumb:hover,
.day-tabs::-webkit-scrollbar-thumb:hover { background-color: var(--sb-thumb-hover); }

/* 左側分類：平常隱形，滑過或鍵盤聚焦時才浮出，避免一條灰線一直掛在旁邊。 */
.side::-webkit-scrollbar-thumb {
  background-color: transparent;
  border: 2px solid transparent; border-radius: 999px;
  background-clip: padding-box;
}
.side:hover::-webkit-scrollbar-thumb,
.side:focus-within::-webkit-scrollbar-thumb { background-color: var(--sb-thumb); }
.side::-webkit-scrollbar-thumb:hover { background-color: var(--sb-thumb-hover); }

/* Firefox（不支援 ::-webkit-scrollbar）：改用標準屬性；Chrome 121+ 若同時
   宣告會蓋掉上面的藥丸樣式，因此用 @supports 排除。 */
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) var(--sb-track); }
  .side,
  .lang-list-wrap,
  .cat-menu-panel,
  .day-tabs { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
  .side { scrollbar-color: transparent transparent; }
  .side:hover,
  .side:focus-within { scrollbar-color: var(--sb-thumb) transparent; }
}
