/* boyplaymj 官網 —— 16bit 娃娃機外觀＋両雀的網點粗線框（設計冊「🎨 視覺規格 v1.2」，2026-11-08）
 * 顏色只用 palette.css 的 --hh-*（由 tools/design-refs/happyhues-17/tokens.css 產生，不手抄）；
 *   --p-*（PALETTE16）只給娃娃機與像素圖，這支不直接用（禁做清單「寫死顏色」會擋）。
 * 鐵律：不用圓角、不用模糊陰影、不用半透明、不用平滑緩動；點陣字只用 24／36／48 px。
 */
@font-face { font-family: 'Cubic11'; src: url('fonts/Cubic_11.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'FusionPixel'; src: url('fonts/fusion-pixel-12px-proportional-zh_hant.woff2') format('woff2'); font-display: swap; }

:root {
  --bg: var(--hh-bg);                     /* 奶油紙 */
  --ink: var(--hh-stroke);                /* 深藍：全系統描邊、網點、深色標題列 */
  --on-ink: var(--hh-card-headline-dark); /* 深藍底上的字（白） */
  --text: var(--hh-headline);             /* 標題、主要文字 */
  --muted: var(--hh-paragraph);           /* 內文與次要文字（這套配色不用灰，靠字級分層） */
  --paper: var(--hh-card-headline-dark);  /* 白卡底（#fffffe） */
  --cab: var(--hh-main);                  /* 機台本體（蜜桃） */
  --cab-hi: var(--hh-bg);
  --cab-lo: var(--hh-secondary);          /* 頁尾控制台、操作面板（水藍） */
  --marquee: var(--hh-button);            /* 招牌、「點牌拿」（粉） */
  --marquee-lo: var(--hh-stroke);
  --on-marquee: var(--hh-button-text);    /* 粉底上的字（深藍，不是白字） */
  --bulb-on: var(--hh-bg);
  --bulb-off: var(--hh-secondary);
  --panel: var(--paper);                  /* 像素視窗底 */
  --panel-text: var(--muted);
  --accent: var(--hh-secondary);          /* 一般按鈕（水藍） */
  --hover: var(--hh-main);                /* 卡片、按鈕滑過（蜜桃） */
  --soft: var(--hh-bg);                   /* 標籤、程式碼、停用的按鈕（奶油） */
  --mis-a: var(--hh-tertiary);            /* 套色錯位：粉 */
  --mis-b: var(--hh-secondary);           /* 套色錯位：水藍 */
  --mis: 3px 2px 0 var(--mis-a), -2px -1px 0 var(--mis-b);
  --extrude: 1px 1px 0 var(--ink), 2px 2px 0 var(--ink), 3px 3px 0 var(--ink), 4px 4px 0 var(--ink), 5px 5px 0 var(--ink);
  --px: 4px;                 /* 一個「像素」= 4 CSS px（整數倍） */
  --pixel-font: 'Cubic11', 'FusionPixel', monospace;
  --body-font: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

* { box-sizing: border-box; border-radius: 0 !important; }
html { background: var(--bg); color: var(--text); font: 16px/1.7 var(--body-font); }
body { margin: 0; }
a { color: inherit; }
img { image-rendering: pixelated; }

.px24, .px36, .px48 { font-family: var(--pixel-font); -webkit-font-smoothing: none; font-smooth: never; font-weight: normal; letter-spacing: 0; }
.px24 { font-size: 24px; line-height: 36px; }
.px36 { font-size: 36px; line-height: 48px; }
.px48 { font-size: 48px; line-height: 60px; }

/* ── 機台（視覺規格 v1.4，2026-11-10：照 GPT 版面包拼；設計冊「🎨 v1.4」）──────────────────────────
 *   分件與九宮格的圖、尺寸寫在 cab.css（art/import_page_layout.py 產生，不要手改）；這裡只管「放在哪裡」。
 *   座標＝版面包座標表（桌機 1280×900／手機 390×844 的 CSS px）：靠左的件用 left、靠右用 right（＝基準寬−右緣）、
 *   拉長的件左右都給、置中的件用 50% ± 位移 —— 機台寬一律偶數 px，所以每個座標都落在偶數 px（1 格＝2px）。
 *   一般文件捲動：頂冠跟著捲走；軌道組（.rail）與底座組（.base）是 sticky ⇒ 天然就是規格的
 *   「軌道頂＝max(初始−捲動量, 0)」與「底組底緣＝min(視窗高, 機台末端−捲動量)」，整組一起動、不會散開。 */
.mb { display: none !important; }
html { scroll-padding-top: 130px; }
.cab { position: relative; z-index: 0; display: flow-root; overflow: clip; width: min(100%, 1280px); width: round(down, min(100%, 1280px), 2px);
       margin: 0 auto; margin-left: max(0px, round(down, calc((100% - 1280px) / 2), 2px)); }
.cab i { font-style: normal; }
.walls > i, .crown > i, .crown > .n9, .rail > i, .base .bk > i, .base .fr > i { position: absolute; display: block; }
/* 底座組分兩層（.bk 地板／取物口／牆腳在牌堆畫布底下、.fr 立面／面板／操作器在上面）；桌機兩層都不建疊層，子元素照舊用自己的 z */
.base > .bk, .base > .fr { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
/* 側柱／側牆／頂蓋：.walls 一層，跟軌道組一起停在頂端（2026-11-13 起；舊版跟著內容捲，頂端與頂蓋下緣會露出花紋切口）。高度一個視窗、從左上角開始貼；頁尾那端由 .cab 的 overflow: clip 裁掉 */
.walls { position: sticky; top: 0; height: 0; margin-top: 146px; z-index: 30; pointer-events: none; }
.pil { top: -2px; height: calc(100vh + 4px); width: 32px; z-index: 15; } .pil.l { left: 52px; } .pil.r { right: 50px; }
.wal { top: 150px; height: 100vh; width: 76px; z-index: 14; } .wal.l { left: 82px; } .wal.r { right: 82px; }
.cap { top: 0; width: 76px; height: 152px; z-index: 16; } .cap.l { left: 82px; } .cap.r { right: 82px; }
/* 頂冠：跟著捲走。v2（2026-11-12）起 z 低於軌道組：天花板壓在燈條最下面 2px 上（GPT v2 的 layout.md：top 組 z≥50、頂冠 40～43；v1.4 是反過來）；
   標準字在頂冠裡，捲動時它整個在軌道組上緣之上，碰不到軌道組，所以不必另外拉高 */
.crown { position: absolute; left: 0; right: 0; top: 0; height: 148px; z-index: 60; pointer-events: none; }
.crown .cf { left: 46px; right: 42px; top: 8px; height: 88px; z-index: 1; }
.crown .lb { left: 46px; right: 42px; top: 96px; height: 52px; z-index: 2; }
.vent { top: 48px; width: 104px; height: 36px; z-index: 3; } .vent.l { left: 254px; } .vent.r { right: 254px; }
.bulbs { position: absolute; left: 116px; right: 104px; top: 106px; height: 24px; z-index: 3; }
.bulb { position: absolute; display: block; top: 0; width: 24px; height: 24px; left: round(down, calc((100% - 24px) * var(--i) / 14 + 0.01px), 2px); }   /* +0.01px：浮點誤差會讓 74 算成 73.99… 再往下取成 72 */
@media (prefers-reduced-motion: no-preference) {
  .bulb.dk:nth-child(odd) { animation: bulb 1s steps(1) infinite; }
  .bulb.mb:nth-child(odd) { animation: bulb-m 1s steps(1) infinite; }
  .bulbs.paused .bulb { animation-play-state: paused; }
}
@keyframes bulb { 50% { background-image: url('cab/crown_bulb_off.webp'); } }
@keyframes bulb-m { 50% { background-image: url('cab/crown_bulb_off_mobile.webp'); } }
.logo { position: absolute; top: 0; left: calc(50% - 256px); z-index: 70; display: block; pointer-events: auto; }
.logo img { display: block; image-rendering: auto; }   /* v2 全彩 @3x：平滑縮放，不是像素圖 */
/* 軌道組：天花板＋軌道＋端座＋滑車／伸縮桿／爪子（爪子是網頁元素，claw.js 只改 --cx 與 --dy） */
.rail { position: sticky; top: 0; margin-top: 0; height: 98px; z-index: 61; pointer-events: none; }
.rail .ceil { left: 82px; right: 82px; top: 0; height: 76px; }
.rail .trk { left: 150px; right: 150px; top: 62px; height: 36px; z-index: 1; }
.rail .re { top: 50px; width: 36px; height: 60px; z-index: 2; } .rail .re.l { left: 126px; } .rail .re.r { right: 124px; }
.clawset { position: absolute; display: block; top: 0; left: var(--cx, calc(100% - 314px)); width: 0; height: 0; z-index: 3; }
.clawset > i { position: absolute; display: block; }
.clawset .rod { left: 34px; top: 110px; width: 20px; height: calc(48px + var(--dy, 0px)); z-index: 1; }
.clawset .tro { left: 0; top: 46px; width: 88px; height: 72px; z-index: 2; }
.clawset .cl { left: -12px; top: calc(152px + var(--dy, 0px)); width: 112px; height: 80px; z-index: 3; }
.clawset .cl.c, .clawset.shut .cl.o { visibility: hidden; } .clawset.shut .cl.c { visibility: visible; }
/* 掛吊導覽：每牌兩條鏈＋牌框，文字是 HTML；整組的轉軸在兩鏈上端中點 */
.hang { position: absolute; top: 246px; left: max(174px, calc(50% - 392px)); width: min(712px, calc(100% - 348px)); height: 80px; z-index: 31; }
.hang > .hb { left: 0; right: 0; top: 0; height: 16px; }
/* 牌寬照 9 格算；骨架頁從導覽藏起來時（--n＜9，2026-11-19）整排置中在同一套格子上 ⇒ n＝9 時位置與以前逐像素相同 */
.sign { position: absolute; display: block; top: 12px; height: 68px; color: var(--ink); text-decoration: none; z-index: 1;
        --w: round(down, calc((100% - 64px) / 9 + 0.01px), 2px);
        width: var(--w); left: calc((9 - var(--n, 9)) * (var(--w) + 8px) / 2 + var(--k) * (var(--w) + 8px)); }
.sign > i { position: absolute; display: block; }
.sign > .ch { top: 0; width: 16px; height: 30px; } .sign > .ch.a { left: 14px; } .sign > .ch.b { right: 14px; }
.sign > .n9 { left: 0; right: 0; top: 24px; height: 44px; }
.sign > .lab { position: absolute; left: 0; right: 0; top: 24px; height: 38px; font: 700 20px/38px var(--body-font); text-align: center; }
.sign > .pr { visibility: hidden; }
.sign:active > .pr { visibility: visible; } .sign:active > .nm, .sign:active > .sel { visibility: hidden; }
.msigns { display: none; }
/* 加入 Discord／加入會員（cta_frame） */
.cta { position: absolute; top: 338px; left: calc(50% - 162px); width: 294px; height: 40px; z-index: 32; }
.cta .btn { position: absolute; top: 0; height: 40px; padding: 0; font: 700 21px/36px var(--body-font); text-align: center; }
.cta .btn:first-child { left: 0; width: 164px; } .cta .btn:last-child { left: 168px; width: 126px; }
/* 按鈕：九宮格框（平常／按下兩張同尺寸，按下即換圖、字往下 2px） */
.btn { position: relative; z-index: 0; display: inline-block; color: var(--ink); text-decoration: none; background: none; border: 0;
       padding: 0 16px; height: 40px; font: 700 18px/36px var(--body-font); cursor: pointer; }
.btn > .n9 { left: 0; top: 0; right: 0; bottom: 0; z-index: -1; }
.btn > .bp { visibility: hidden; }
.btn:active > .bp { visibility: visible; } .btn:active > .bf { visibility: hidden; } .btn:active { padding-top: 2px; }
.btn[disabled] { cursor: default; color: var(--muted); }
/* 內容區的按鈕：両雀的 x-btn（水藍底、粗框、擠出厚度；按下整顆沉進厚度裡） */
.win .btn { background: var(--accent); border: var(--px) solid var(--ink); box-shadow: var(--extrude); height: auto; padding: 0 12px; line-height: 36px; }
.win .btn:hover { background: var(--hover); }
.win .btn:active { transform: translate(5px, 5px); box-shadow: none; padding-top: 0; }
.win .btn[disabled] { background: var(--soft); box-shadow: none; }

/* 網站內容：玻璃箱裡（內容起點桌機 214,380；寬＝機台寬−424） */
.body { position: relative; z-index: 20; margin: 136px 210px 0 214px; }
.menu { display: none; }
/* 頁尾：機台的下方立面一路延伸到頁面最底（使用者 2026-11-10：「下面應該是機台的圖延伸，不要留白」）——
 *   用同一張 apron_frame 的左、中、右往下重複，不畫上緣（上緣在底座組裡那一段已經畫過了）。
 *   v2 起重複的是立面**最底下 2px**（.ext，匯入工具另切的）：全彩版中段是上深下淺的漸層，整段重複會每 20px 一條橫紋（2026-11-13 使用者：「像是破圖」） */
.cab-foot { position: relative; z-index: 0; width: min(100%, 1280px); width: round(down, min(100%, 1280px), 2px);
            margin: 0 auto; margin-left: max(0px, round(down, calc((100% - 1280px) / 2), 2px));
            padding: 40px 48px 64px; text-align: center; font-size: 14px; color: var(--ink); }
.cab-foot .contact { margin: 0; } .cab-foot a { white-space: nowrap; }
.cab-foot > .apr { left: 20px; right: 20px; top: 0; bottom: 0; z-index: -1; }
.cab-foot > .apr > .tl, .cab-foot > .apr > .t, .cab-foot > .apr > .tr { display: none; }
.cab-foot > .apr > .l, .cab-foot > .apr > .c, .cab-foot > .apr > .r { top: 0; }

/* 底座組：地板、取物口、牆腳、牌堆畫布、操作台、下方立面、操作器 —— 貼著視窗底，受機台末端約束 */
.base { position: sticky; bottom: 0; margin-top: 280px; height: 222px; z-index: 60; }
.base .flr { left: 82px; right: 82px; top: 0; height: 60px; z-index: 42; }
/* 側柱沿整台機台往下延伸 ⇒ 操作台的階梯角（透明）會透出側柱；對照圖裡側柱在這裡就結束了（桌機 144+596＝740、手機 96+526＝622）⇒ 墊一塊底色 */
.base::before { content: ''; position: absolute; left: 0; right: 0; top: 62px; bottom: -60px; z-index: 1; background: var(--bg); }
.base .chu { right: 158px; top: -4px; width: 176px; height: 64px; z-index: 48; }
.base .ft { top: -38px; width: 76px; height: 96px; z-index: 41; }   /* 牆腳在地板底下（2026-11-13）：牆腳圖畫的地板線跟地板圖差幾 px，蓋在上面會在牆腳右緣斷一截 */ .base .ft.l { left: 82px; } .base .ft.r { right: 82px; }
.base .apr { left: 20px; right: 20px; top: 194px; height: 80px; z-index: 59; }
.base .dck { left: 8px; right: 8px; top: 58px; height: 140px; z-index: 60; }
.play { position: absolute; left: 158px; right: 158px; bottom: 174px; height: calc(100vh - 174px); z-index: 49;   /* 比牌站立基線多 8px：牌的網點影子畫在基線下面的地板上 */ pointer-events: none; }

/* nav.keys（手機選單裡的 3×3 吊牌 .ksign）的樣式在窄版殼那段；桌機用掛吊導覽 .hang，不顯示選單 */

/* ── 像素視窗（內容一律放這裡，HTML 文字） ── */
/* 內容視窗：両雀主視覺的粗線方框（v1.2）—— 2026-11-10 使用者看了 GPT 的 win_frame 說「很像破圖，改成簡單的方框線條」 */
.win { --face: var(--panel); color: var(--panel-text); border: var(--px) solid var(--ink); margin: 0 0 56px; }
.win:last-child { margin-bottom: 0; }
.win > h2 { margin: 0; background: var(--ink); color: var(--on-ink); padding: 0 16px; font: 700 23px/40px var(--body-font); }
.win h1 { color: var(--text); text-shadow: var(--mis); }
.win > .in { padding: calc(var(--px) * 3) calc(var(--px) * 4); }
.win .note { font-size: 14px; color: var(--muted); }

/* ── 網點陰影（視覺規格 v1.2，照両雀 c2 的 slab：面底下一層網點往右下偏 8px，面本身不動）──
 *   元素自己不畫底色：面（--face）畫在 ::after、網點畫在 ::before，isolation 讓兩層留在元素自己的疊層裡、壓在內容底下。
 *   描邊留在元素上 —— 網點與描邊同一色，疊在描邊上看不出來。網點圖磚是 palette.css 產生的硬邊 SVG（不用 gradient）。 */
.win, .card, .post-card, .links a { position: relative; isolation: isolate; background: transparent; }
.win::before, .card::before, .post-card::before, .links a::before {
  content: ''; position: absolute; inset: calc(var(--px) * -1); z-index: -2; pointer-events: none;
  transform: translate(calc(var(--px) * 2), calc(var(--px) * 2)); background: var(--hh-dots) 0 0 / 6px 6px; image-rendering: pixelated; }
.win::after, .card::after, .post-card::after, .links a::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--face, var(--paper)); }
.card:hover, .post-card:hover, .links a:hover { --face: var(--hover); }

/* ── 影片卡 ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: calc(var(--px) * 4); }
.card { display: block; text-decoration: none; border: var(--px) solid var(--ink); color: var(--text); }
.card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: var(--px) solid var(--ink); image-rendering: auto; }
.card .t { padding: calc(var(--px) * 2) calc(var(--px) * 2) 0; font-size: 15px; line-height: 1.5; display: -webkit-box;
           -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .m { padding: 0 calc(var(--px) * 2) calc(var(--px) * 2); font-size: 13px; color: var(--muted); }
.tag { display: inline-block; border: 2px solid var(--ink); padding: 0 6px; margin-right: 4px; font-size: 12px; line-height: 18px; background: var(--soft); color: var(--ink); }
.tag.live { background: var(--hh-tertiary); } .tag.short { background: var(--hh-secondary); } .tag.video { background: var(--hh-main); }

/* ── 週行事曆（設計冊 §4.7；每一類都配文字標籤，不只靠顏色；v1.2 起分類色改用 #17 的粉／水藍／蜜桃／深藍） ── */
.cal-nav { display: flex; align-items: center; justify-content: center; gap: calc(var(--px) * 3); margin-bottom: calc(var(--px) * 3); }
.cal-nav .btn { width: 52px; padding: 0; font: 700 21px/30px var(--body-font); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: calc(var(--px) * 2); }
.cal-week[hidden] { display: none; }
.cal-day { background: var(--paper); border: var(--px) solid var(--ink); min-height: 140px; }
.cal-day.today { background: var(--hh-main); box-shadow: inset 0 0 0 var(--px) var(--marquee); }
.cal-d { margin: 0; padding: 2px calc(var(--px) * 2); font-size: 14px; background: var(--ink); color: var(--on-ink); font-weight: bold; }
.cal-day.today .cal-d { background: var(--marquee); color: var(--on-marquee); }
.cal-d span { font-weight: normal; color: var(--mis-b); }
.cal-day.today .cal-d span { color: var(--on-marquee); }
.cal-day ul { list-style: none; margin: 0; padding: calc(var(--px) * 1); }
.cal-day li { font-size: 13px; line-height: 1.45; margin: 0 0 calc(var(--px) * 1); overflow-wrap: anywhere; }
.cal-day li a { color: var(--text); }
.cal-empty { color: var(--muted); text-align: center; }
.ev .tag { border: 2px solid var(--ink); margin-right: 4px; }
.ev.k-live .tag { background: var(--hh-tertiary); } .ev.k-video .tag { background: var(--hh-secondary); }
.ev.k-event .tag { background: var(--hh-main); } .ev.k-match .tag { background: var(--ink); color: var(--on-ink); }
.ev time { font-weight: bold; margin-right: 2px; }
.ev .st { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* 給螢幕閱讀器：預計／已完成／取消 */
.ev .mk { font-weight: bold; margin-right: 2px; }
.ev.s-done .mk { color: var(--ink); }
.ev.s-cancelled, .ev.s-cancelled a { color: var(--muted); }
.cal-legend { font-size: 13px; color: var(--muted); margin: calc(var(--px) * 3) 0 0; }
.cal-legend .ev { margin-right: calc(var(--px) * 2); }
@media (max-width: 720px) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; }
}

/* ── 網誌（設計冊 §4.8「網誌文章版面」：內文欄寬 680px、18px／1.8；文章內標題用內文字體，點陣字只用 24／36／48） ── */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: calc(var(--px) * 4); }
.post-card { display: block; text-decoration: none; border: var(--px) solid var(--ink); color: var(--text); }
.post-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: var(--px) solid var(--ink); image-rendering: auto; }
.post-card b { display: block; padding: calc(var(--px) * 2) calc(var(--px) * 2) 0; font-size: 17px; line-height: 1.5; }
.post-card .m { display: block; padding: 0 calc(var(--px) * 2); font-size: 13px; color: var(--muted); }
.post-card .s { display: block; padding: calc(var(--px) * 1) calc(var(--px) * 2) calc(var(--px) * 2); font-size: 14px; color: var(--muted); }
.post .in { max-width: 760px; margin: 0 auto; }
.post h1 { margin: calc(var(--px) * 2) 0; }
.crumb { margin: 0; font-size: 14px; }
.post-meta { color: var(--muted); font-size: 14px; }
.ptag { display: inline-block; margin-right: 6px; color: var(--ink); text-decoration: none; font-weight: bold; }
.ptag:hover { text-decoration: underline; }
.cover { margin: calc(var(--px) * 4) 0; }
.cover img, .article figure img, .article p img { max-width: 100%; height: auto; border: var(--px) solid var(--ink); image-rendering: auto; }
.article { max-width: 680px; font-size: 18px; line-height: 1.8; overflow-wrap: anywhere; }
.article h2 { font-size: 26px; line-height: 1.4; margin: 1.6em 0 0.6em; }
.article h3 { font-size: 21px; line-height: 1.4; margin: 1.4em 0 0.5em; }
.article h4 { font-size: 18px; margin: 1.2em 0 0.4em; }
.article blockquote { margin: 1em 0; padding: 0 0 0 calc(var(--px) * 3); border-left: var(--px) solid var(--marquee); color: var(--muted); }
.article pre { background: var(--soft); border: var(--px) solid var(--ink); padding: calc(var(--px) * 2); overflow-x: auto; font-size: 15px; line-height: 1.5; }
.article code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--soft); padding: 0 3px; }
.article pre code { background: none; padding: 0; }
.article hr { border: 0; border-top: var(--px) solid var(--ink); margin: 2em 0; }
.article figure { margin: 1.2em 0; }
.article figcaption { font-size: 14px; color: var(--muted); }
.article a { color: var(--ink); }
.md-blocked { color: var(--ink); background: var(--soft); font-size: 14px; }
.yt { position: relative; max-width: 640px; margin: 1.2em 0; border: var(--px) solid var(--ink); background: var(--ink); aspect-ratio: 16 / 9; }
.yt a { display: block; width: 100%; height: 100%; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: auto; }
.yt-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--marquee); color: var(--on-marquee);
           border: var(--px) solid var(--ink); padding: calc(var(--px) * 1) calc(var(--px) * 3); font-weight: bold; }
.yt iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ── 社群入口 ── */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: calc(var(--px) * 3); }
.links a { display: block; text-decoration: none; border: var(--px) solid var(--ink); padding: calc(var(--px) * 2) calc(var(--px) * 3); color: var(--text); }
.links b { display: block; }
.links span { font-size: 13px; color: var(--muted); }

/* ── 片庫的篩選列 ── */
.filters { display: flex; flex-wrap: wrap; gap: calc(var(--px) * 2); align-items: center; margin-bottom: calc(var(--px) * 3); }
.filters input, .filters select { font: 16px var(--body-font); border: var(--px) solid var(--ink); background: var(--hh-input-bg); color: var(--hh-input-text); padding: 4px 8px; }
.filters input { flex: 1 1 260px; }
.count { margin: 0 0 calc(var(--px) * 3); color: var(--muted); }
.more { text-align: center; margin-top: calc(var(--px) * 4); }


@media (max-width: 640px) {
  .px48 { font-size: 36px; line-height: 48px; }
  .win > .in { padding: calc(var(--px) * 2) calc(var(--px) * 3); }
  .grid { grid-template-columns: repeat(2, 1fr); gap: calc(var(--px) * 2); }
}

/* ── 娃娃機操作器（v1.4：放在底座組裡，座標照版面包；牌堆畫布 .play、爪子 .clawset 由 claw.js 接線）── */
.claw-stage { position: absolute; left: 0; top: 0; pointer-events: none; image-rendering: pixelated; }
.claw-stage.pick { pointer-events: auto; cursor: pointer; }
.claw-panel { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 63; color: var(--ink); pointer-events: none; }
.claw-panel > * { pointer-events: auto; }
.claw-card { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* ↑ 訊息格整個拿掉（2026-11-13 使用者）：夾到牌／胡了／牌堆滿的句子只留給螢幕閱讀器（aria-live），畫面上不顯示 */
.tray-box { position: absolute; left: 154px; top: 112px; width: calc(100% - 872px); height: 48px; }   /* 訊息格拿掉後跟左右鍵同一條中線 */
.tray-box > .n9 { left: 0; top: 0; right: 0; bottom: 0; }
.tray { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
        padding: 0 14px; overflow-x: auto; overflow-y: hidden; }
.cbtn { position: absolute; z-index: 0; border: 0; padding: 0; margin: 0; background: none; color: var(--ink); cursor: pointer; font-family: var(--body-font); font-weight: 700; }
.cbtn > .n9 { left: 0; top: 0; right: 0; bottom: 0; z-index: -1; }
.cbtn > .dn { visibility: hidden; }
.cbtn:active > .dn, .cbtn.is-down > .dn { visibility: visible; } .cbtn:active > .up, .cbtn.is-down > .up { visibility: hidden; }
.cbtn > .lb { position: absolute; left: 0; right: 0; top: 0; text-align: center; display: flex; align-items: center; justify-content: center; }
/* 按鈕上是深藍單色圖示（SVG，currentColor；2026-11-13 使用者要求取代文字），高度照按鈕分三級 */
.cbtn .ic { display: block; width: auto; height: 22px; } .drop .ic { height: 28px; } .clear .ic, .again .ic { height: 20px; }
.cbtn:active > .lb, .cbtn.is-down > .lb { transform: translateY(2px); }
.cbtn[hidden] { display: none; }
.mv { top: 112px; width: 72px; height: 48px; } .mv.l { right: 626px; } .mv.r { right: 462px; }
.mv > .lb { height: 34px; font-size: 24px; line-height: 34px; }
.stick { position: absolute; top: 72px; right: 530px; width: 92px; height: 92px; pointer-events: none; }
.claw-ctl[data-tilt="-1"] .stick { background-image: url('cab/joystick_left.webp'); } .claw-ctl[data-tilt="1"] .stick { background-image: url('cab/joystick_right.webp'); }
.drop { top: 110px; right: 284px; width: 164px; height: 52px; }
.drop > .lb { top: -2px; height: 42px; font-size: 30px; line-height: 42px; }
.drop[aria-pressed="true"] > .dn { visibility: visible; } .drop[aria-pressed="true"] > .up { visibility: hidden; }
.clear, .again { right: 138px; width: 132px; height: 36px; } .clear { top: 90px; } .again { top: 130px; }
.clear > .lb, .again > .lb { height: 26px; font-size: 18px; line-height: 26px; }

/* ── 窄版殼 v2（<1024；2026-11-12 照 GPT boyplaymj-mobile-v2 的手機座標，390 是基準，600–1023 置中、最寬 600）──
 *   座標＝v2 layout.md 的 mobile 場景（CSS px）；M＝機台寬。固定：側柱 14、側牆 24、標準字 274×66、爪子 64×48、取物口 80×26。
 *   改寬：頂冠、燈條、天花板、軌道、地板、操作台、托盤、內容窗；右側件照「M − 原右距」；標準字、吊牌列置中。
 *   底部操作台照使用者排的 boyplaymj-panel-exact（390×164，地板在組內 y0；2026-11-12 使用者要求左右鍵對調成 ◀ 搖桿 ▶）：
 *   ≥390 寬時外框跟著變寬、按鈕群置中；<390 寬時整組等比縮小（--k，四段），不改任何一件的尺寸或相對位置。 */
@media (max-width: 1023px) {
  .dk { display: none !important; } .mb { display: block !important; }
  html { scroll-padding-top: 116px; }
  .cab, .cab-foot { width: min(100%, 600px); width: round(down, min(100%, 600px), 2px); margin-left: max(0px, round(down, calc((100% - 600px) / 2), 2px)); }
  .cab-foot { padding: 32px 40px 48px; line-height: 1.8; margin-top: calc(-27px * var(--k)); } .cab-foot > .apr { left: 12px; right: 12px; }   /* 文字要留在水藍那段裡，窄螢幕讓它換行；頁尾往上補進操作台原稿 y137～164 的留白（機台結尾不留白，使用者 2026-11-10） */
  /* 側柱、側牆、牆帽（跟著捲、沿整台重複） */
  .walls { margin-top: 108px; }
  .pil { top: 0; width: 14px; } .pil.l { left: 10px; } .pil.r { right: 10px; }
  .wal { top: 40px; width: 24px; } .wal.l { left: 24px; } .wal.r { right: 24px; }
  .cap { top: 0; width: 24px; height: 40px; } .cap.l { left: 24px; } .cap.r { right: 24px; }
  /* 頂冠（跟著捲走） */
  .crown { height: 110px; }
  .crown .cf { left: 8px; right: 8px; top: 8px; height: 80px; }
  .crown .lb { left: 8px; right: 8px; top: 84px; height: 26px; }
  .bulbs { left: 34px; right: 34px; top: 90px; height: 16px; }
  .bulb { width: 16px; height: 16px; left: round(down, calc((100% - 16px) * var(--i) / 7 + 0.01px), 1px); }
  .logo { left: round(down, calc(50% - 137px), 1px); }
  /* 軌道組（停頂，高 108）：滑車、伸縮桿、爪子共用中心 C＝滑車左緣＋22 */
  .rail { margin-top: 0; height: 108px; }
  .rail .ceil { left: 24px; right: 24px; top: 0; height: 24px; }
  .rail .trk { left: 36px; right: 36px; top: 24px; height: 18px; }
  .rail .re { top: 14px; width: 20px; height: 36px; } .rail .re.l { left: 24px; } .rail .re.r { right: 24px; }
  .clawset { left: var(--cx, calc(100% - 102px)); }
  .clawset .tro { left: 0; top: 12px; width: 44px; height: 36px; }
  .clawset .rod { left: 16px; top: 44px; width: 12px; height: calc(16px + var(--dy, 0px)); }
  .clawset .cl { left: -10px; top: calc(58px + var(--dy, 0px)); width: 64px; height: 48px; }
  .hang { display: none; }
  /* 首屏吊牌：首頁／影音／活動＋選單鍵；每塊寬 floor((M−114)/4)、間距 6、整列置中 */
  .msigns { display: grid; grid-template-columns: repeat(4, round(down, calc((100% - 18px) / 4), 1px)); column-gap: 6px; justify-content: center;
            position: absolute; top: 216px; left: 48px; right: 48px; height: 62px; z-index: 31; }
  .msigns > .hb { left: 0; right: 0; top: 0; height: 8px; }
  .msigns .sign { position: relative; left: auto; top: auto; width: auto; height: 58px; margin-top: 4px;
                  font: inherit; padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink); }
  .msigns .sign > .ch { top: 0; width: 8px; height: 14px; } .msigns .sign > .ch.a { left: 14px; } .msigns .sign > .ch.b { right: 14px; }
  .msigns .sign > .n9 { top: 14px; height: 44px; }
  .msigns .sign > .lab { top: 14px; height: 36px; font: 600 18px/36px var(--body-font); }
  /* 加入 Discord／加入會員：寬照 162：124 分、中間 8 */
  .cta { top: 290px; left: 48px; right: 48px; width: auto; height: 44px; display: flex; gap: 8px; }
  .cta .btn { position: relative; left: auto; width: auto; height: 44px; flex: 162 1 0; font: 600 16px/36px var(--body-font); }
  .cta .btn:last-child { left: auto; width: auto; flex: 124 1 0; }
  .body { margin: 128px 48px 0; }
  .cal-nav { gap: 6px; } .cal-nav .btn { width: 44px; } .cal-range { white-space: nowrap; }   /* 內容寬 M−96：日期不換行 */
  /* 底座組：後層（地板、取物口、牆腳）＜牌堆畫布＜前層（立面、面板、操作器）；兩層各自 scale(--k)，畫布不縮 */
  :root { --k: 1; }
  .base { --fy: 14px; height: calc(164px * var(--k)); }
  .base::before { top: calc(26px * var(--k)); left: 24px; right: 24px; }   /* 只墊兩側牆之間：最外側的米色柱子一路往下、接進面板的階梯外框（2026-11-13 使用者：要和面板的米色線條連在一起） */
  .base > .bk, .base > .fr { right: auto; bottom: auto; width: calc(100% / var(--k)); height: 164px; transform: scale(var(--k)); transform-origin: 0 0; }
  .base > .bk { z-index: 42; } .base > .fr { z-index: 60; }
  .base .flr { left: 24px; right: 24px; top: 0; height: 28px; }
  .base .chu { right: 48px; top: 2px; width: 80px; height: 26px; }   /* 使用者原稿 y2（2026-11-13 試過下移 6px，使用者選回原本） */
  .base .ft { top: -18px; width: 24px; height: 40px; z-index: 45; } .base .ft.l { left: 24px; } .base .ft.r { right: 24px; }   /* 手機牆腳要在地板上面（地板兩端有收邊小方塊，牆腳在底下會露出來；桌機才放到地板底下） */
  .base .apr { left: 12px; right: 12px; top: 129px; height: 8px; }
  .base .dck { left: 8px; right: -2px; top: 20px; height: 109px; }     /* 使用者原稿：x8、寬 384，在 390 畫布右邊裁掉 2px —— 照原稿 */
  /* 牌堆畫布：可玩區 x48～M−48；牌站立基線＝組內 y --fy（被面板上緣擋住一點，影子落在地板上） */
  .play { --tile-s: 1; left: 48px; right: 48px; bottom: calc((164px - var(--fy)) * var(--k) - 8px); height: calc(100vh - (164px - var(--fy)) * var(--k) + 8px); }
  /* 操作台（組內座標＝使用者排的 390 版；按鈕群以 50% 為中心，390 寬時就是原座標） */
  .claw-card { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* 使用者把提示文字刪了；留給螢幕閱讀器 */
  .tray-box { left: 46px; right: 38px; width: auto; top: 38px; height: 26px; }
  .tcount { position: absolute; left: 8px; top: 6px; width: 40px; height: 14px; color: var(--on-ink); font: 600 11px/14px var(--body-font); white-space: nowrap; text-align: center; }
  .tray { left: 54px; right: 12px; top: 6px; bottom: auto; height: 14px; padding: 0; gap: 4px; align-items: flex-start; }
  .tray .chip { width: 10.5px; height: 14px; background-size: 441px 14px; background-position: calc(var(--t, 0) * -10.5px) 0; image-rendering: auto; }
  .tray .meld { border-width: 1px; }
  .cbtn > .lb { left: 12px; right: 12px; top: 4px; height: calc(100% - 18px); font-weight: 600; }
  .mv { top: 72px; width: 48px; height: 35px; right: auto; } .mv.l { left: calc(50% - 165px); right: auto; } .mv.r { left: calc(50% - 75px); right: auto; }
  .mv > .lb { font-size: 14px; line-height: 17px; height: 17px; }
  .stick { top: 56px; left: calc(50% - 119px); right: auto; width: 44px; height: 48px;
           background-image: url('cab/joystick_mobile.webp'); background-size: contain; background-position: 50% 100%; background-repeat: no-repeat; }
  .claw-ctl[data-tilt="-1"] .stick { background-image: url('cab/joystick_left_mobile.webp'); } .claw-ctl[data-tilt="1"] .stick { background-image: url('cab/joystick_right_mobile.webp'); }
  .drop { top: 66px; left: calc(50% - 25px); right: auto; width: 72px; height: 39px; } .drop > .lb { top: 4px; height: 21px; font-size: 15px; line-height: 21px; }
  .clear, .again { top: 70px; right: auto; height: 37px; } .clear { left: calc(50% + 51px); width: 62px; } .again { left: calc(50% + 113px); width: 64px; }
  .clear > .lb, .again > .lb { top: 4px; height: 19px; font-size: 12px; line-height: 19px; }
  .cbtn .ic { height: 15px; } .drop .ic { height: 14px; } .clear .ic, .again .ic { height: 15px; }
  .cbtn:active > .lb, .cbtn.is-down > .lb { transform: translateY(4px); }   /* 手機按下態的圓頂壓得比桌機低（GPT v3 按鈕）：圖示跟著多下移，才不會壓到上緣的框 */
  /* 選單（v2）：網點遮罩＋置中的「機台選單」（框用両雀的粗線方框，跟內容視窗同一套 —— 使用者 2026-11-10 說 GPT 的視窗框像破圖）；
     3×3 吊牌、每塊寬 floor((M−104)/3)。JS 沒載到時整塊照樣排在內容最上面（導覽看得到）。 */
  .menu { display: block; margin: 0 0 32px; }
  .js .menu { display: none; }
  .js.menu-open .menu { display: block; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 90; margin: 0; overflow-y: auto;
                        background: var(--hh-dots) 0 0 / 6px 6px; image-rendering: pixelated; }
  .mbox { position: relative; background: var(--paper); border: var(--px) solid var(--ink); padding: 12px 16px 16px; color: var(--ink); }
  .js.menu-open .mbox { width: min(calc(100% - 56px), 544px); margin: 122px auto 24px; }
  .mtitle { margin: 0; height: 40px; font: 600 24px/40px var(--body-font); }
  .menu-close { position: absolute; top: 10px; right: 8px; width: 44px; height: 44px; padding: 0; font: 600 28px/40px var(--body-font); }
  html:not(.js) .menu-close, html:not(.js) .mhint { display: none; }
  nav.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 4px; margin-top: 20px; }
  .ksign { position: relative; display: block; height: 66px; color: var(--ink); text-decoration: none; }
  .ksign > i { position: absolute; display: block; }
  .ksign > .ch { top: 0; width: 8px; height: 14px; } .ksign > .ch.a { left: 16px; } .ksign > .ch.b { right: 16px; }
  .ksign > .n9 { left: 0; right: 0; top: 14px; height: 52px; }
  .ksign > .lab { position: absolute; left: 0; right: 0; top: 14px; height: 44px; font: 600 19px/44px var(--body-font); text-align: center; }
  .ksign > .pr { visibility: hidden; } .ksign:active > .pr { visibility: visible; } .ksign:active > .nm, .ksign:active > .sel { visibility: hidden; }
  .msearch { display: block; margin-top: 40px; height: 48px; padding: 0; text-align: center; font: 600 18px/44px var(--body-font); }
  .mhint { margin: 12px 0 0; font-size: 12px; line-height: 16px; text-align: center; }
  .js.menu-open body { overflow: hidden; }
}
/* 比 390 窄：操作台整組等比縮小（使用者排的是 390 寬的定稿）；分四段，每段取下限寬度的比例（不會比畫面寬） */
@media (max-width: 389px) { :root { --k: 0.961538; } }
@media (max-width: 374px) { :root { --k: 0.923077; } }
@media (max-width: 359px) { :root { --k: 0.871795; } }
@media (max-width: 339px) { :root { --k: 0.820513; } }

.chip { display: inline-block; width: 24px; height: 32px; background: url('tiles_mini.webp') 0 0 / 1008px 32px no-repeat; background-position: calc(var(--t, 0) * -24px) 0; image-rendering: auto; }   /* 全彩小牌 @3x（2026-11-13，tiles-v3） */
.chip.loose { cursor: pointer; }
.chip.loose:hover, .chip.loose:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.meld { display: inline-flex; gap: 0; border: 2px solid var(--accent); background: var(--accent); }
.meld.flowers { border-color: var(--hh-tertiary); background: var(--hh-tertiary); }
.tray .cnt { color: var(--on-ink); font-size: 14px; margin-left: calc(var(--px) * 1); white-space: nowrap; }
.meld, .chip { flex: none; }

/* ── 遊戲說明＋更新紀錄（B4-d2）── */
.game-card .m { padding-top: calc(var(--px) * 1); }
.tag.st-live { background: var(--hh-secondary); } .tag.st-soon { background: var(--soft); } .tag.st-seasonal { background: var(--hh-main); }
.tag.st-admin { background: var(--paper); } .tag.st-maintenance { background: var(--hh-tertiary); } .tag.st-retired { background: var(--soft); color: var(--muted); }
.tag.ut-feature { background: var(--hh-secondary); } .tag.ut-tweak { background: var(--hh-main); } .tag.ut-fix { background: var(--hh-tertiary); } .tag.ut-event { background: var(--soft); }
.tag.vipb { background: var(--hh-tertiary); }
code.cmd { display: inline-block; border: 2px solid var(--ink); padding: 0 6px; margin: 0 4px 4px 0; background: var(--soft); color: var(--text); font-size: 14px; line-height: 22px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 calc(var(--px) * 3); }
dl.gmeta { display: grid; grid-template-columns: max-content 1fr; gap: calc(var(--px) * 1) calc(var(--px) * 4); margin: 0 0 calc(var(--px) * 4); font-size: 15px; }
dl.gmeta dt { color: var(--muted); } dl.gmeta dd { margin: 0; }
.tbl { overflow-x: auto; }
table.vip { border-collapse: collapse; min-width: 420px; font-size: 15px; }
table.vip th, table.vip td { border: 2px solid var(--ink); padding: calc(var(--px) * 1) calc(var(--px) * 2); text-align: left; vertical-align: top; }
table.vip thead th { background: var(--hh-tertiary); }
.upd-list { list-style: none; margin: 0; padding: 0; }
.upd-list li { border-bottom: 2px solid var(--ink); }
.upd-list a { display: block; padding: calc(var(--px) * 2) 0; text-decoration: none; }
.upd-list a:hover { text-decoration: underline; }
.upd-list .d { font-family: var(--pixel-font); font-size: 24px; line-height: 36px; -webkit-font-smoothing: none; margin-right: 6px; }
.upd { border-top: var(--px) solid var(--ink); padding-top: calc(var(--px) * 3); margin-top: calc(var(--px) * 4); }
.upd h3 { margin: 0; font-size: 21px; }

/* ── 影片登錄：其他平台的卡片、IG 專區（B4-e2）── */
.card .noimg { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; background: var(--soft); border-bottom: var(--px) solid var(--ink); color: var(--muted); }
.tag.plat { background: var(--soft); }
.card.plat-ig .tag.plat { background: var(--hh-tertiary); } .card.plat-tiktok .tag.plat { background: var(--hh-secondary); }
.grid.ig { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid.ig .card img, .grid.ig .card .noimg { aspect-ratio: 9 / 16; }

/* ── 抽獎頁：名單＋幸運輪盤（設計冊 §4.18，2026-11-10；主持人抽，noindex） ── */
.lottery .lt-src { margin: 0 0 calc(var(--px) * 3); color: var(--muted); font-size: 14px; }
.lt-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: calc(var(--px) * 6); align-items: start; }
.lt-stage { position: relative; }
.lt-wheel { display: block; width: 100%; height: auto; }
.lt-fx { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; }
.lt-slice path { stroke: var(--ink); stroke-width: 3; }
.lt-c0 path { fill: var(--hh-tertiary); } .lt-c1 path { fill: var(--hh-secondary); } .lt-c2 path { fill: var(--hh-main); } .lt-c3 path { fill: var(--hh-bg); }
.lt-slice text { fill: var(--ink); font-family: var(--body-font); font-weight: 700; }
.lt-slice.flash path, .lt-slice.won path { fill: var(--paper); }
.lt-slice.flash text { fill: var(--marquee); }
.lt-rim { fill: none; stroke: var(--ink); stroke-width: 8; }
.lt-hub { fill: var(--marquee); stroke: var(--ink); stroke-width: 6; }
.lt-stand { fill: var(--hh-main); }
.lt-stand-line { stroke: var(--ink); stroke-width: 8; }
.lt-stand-t { fill: var(--ink); font-family: var(--pixel-font); font-size: 24px; }
.lt-pointer path { fill: var(--marquee); stroke: var(--ink); stroke-width: 5; stroke-linejoin: miter; }
.lt-pointer.tick { transform: translate(0, 4px); }
.lt-banner { min-height: 56px; margin: 0 0 calc(var(--px) * 3); font: 700 22px/1.4 var(--body-font); color: var(--ink); }
.lt-banner.on { background: var(--marquee); border: var(--px) solid var(--ink); padding: calc(var(--px) * 2) calc(var(--px) * 3); font-size: 30px; overflow-wrap: anywhere; }
.lt-start { font-size: 24px; padding: 4px 28px; }
.lt-opt { display: block; margin: 0 0 calc(var(--px) * 2); font-size: 15px; }
.lt-side h3 { margin: calc(var(--px) * 4) 0 calc(var(--px) * 1); font-size: 18px; }
.lt-records { margin: 0 0 calc(var(--px) * 2); padding-left: 1.6em; font-size: 15px; }
.lt-list { margin-top: calc(var(--px) * 4); }
.lt-list summary { cursor: pointer; font-weight: 700; }
.lt-names { columns: 4 160px; margin: calc(var(--px) * 2) 0 0; padding-left: 2.4em; font-size: 14px; }
.lt-names li.won { text-decoration: line-through; color: var(--muted); }
@media (max-width: 720px) { .lt-grid { grid-template-columns: 1fr; } .lt-banner.on { font-size: 24px; } }
