:root { --cream:#FFF5E9; --dot:#F2DCC4; --ink:#3B2B33; --sub:#6B5560; --card:#FFFFFF; --berry:#9C1F45; --butter:#FFD45C; }
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
body { color:var(--ink); background:var(--cream); font-family:-apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent; }
a:focus-visible { outline:3px solid var(--berry); outline-offset:3px; }

/* 介绍页 */
.doc { min-height:100dvh; display:flex; flex-direction:column; align-items:center; padding:32px 20px 24px; background:var(--cream) radial-gradient(var(--dot) 1.5px, transparent 2px) 0 0 / 22px 22px; font-size:16px; line-height:1.75; }
.doc main { width:100%; max-width:720px; }
.doc h1 { font-size:40px; line-height:1.2; }
.doc h2 { margin-bottom:10px; font-size:22px; line-height:1.4; }
.doc h3 { margin-top:16px; font-size:17px; }
.doc .lead { margin:12px 0 20px; color:var(--sub); }
.doc section { margin-top:28px; padding:22px 24px; background:var(--card); border:3px solid var(--ink); border-radius:22px; }
.doc section.hero { display:flex; align-items:center; gap:28px; margin-top:16px; padding:24px; border-width:4px; box-shadow:0 6px 0 var(--ink); }
.hero .copy { flex:1; min-width:0; }
.hero .shot { width:200px; height:auto; flex:none; border:3px solid var(--ink); border-radius:18px; }
.doc ol, .doc ul { padding-left:1.4em; }
.doc li { margin:6px 0; }
.doc p + p, .doc p + .scroll, .scroll + p { margin-top:12px; }
.scroll { overflow-x:auto; }
.doc table { width:100%; border-collapse:collapse; font-size:15px; }
.doc th, .doc td { padding:8px 10px; border-bottom:2px solid var(--dot); text-align:left; white-space:nowrap; }
.start { display:inline-block; padding:12px 36px; color:var(--ink); background:var(--butter); border:4px solid var(--ink); border-radius:18px; box-shadow:0 5px 0 var(--ink); font-size:20px; font-weight:800; text-decoration:none; }
.start:active { transform:translateY(4px); box-shadow:0 1px 0 var(--ink); }
.start.wide { display:block; margin-top:32px; text-align:center; }
.note { margin-top:14px; color:var(--sub); font-size:14px; }
.trailer { display:block; width:min(100%, 320px); height:auto; margin:0 auto; border:3px solid var(--ink); border-radius:18px; background:var(--cream); }
.crumbs { display:flex; gap:8px; color:var(--sub); font-size:14px; }
.crumbs a { color:var(--sub); }
.crumbs span::before { content:"/"; margin-right:8px; }
.doc footer { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 20px; margin-top:auto; padding-top:36px; font-size:13px; }
.doc footer a { color:var(--sub); padding:8px 0; }
.card { display:flex; gap:18px; align-items:center; margin-top:12px; padding:16px; color:inherit; background:var(--card); border:4px solid var(--ink); border-radius:24px; box-shadow:0 6px 0 var(--ink); text-decoration:none; }
.card + .card { margin-top:22px; }
.card:active { transform:translateY(4px); box-shadow:0 2px 0 var(--ink); }
.card img { width:112px; height:112px; flex:none; border-radius:18px; }
.card .txt { display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.card b { font-size:20px; line-height:1.4; }
.card .txt > span { color:var(--sub); font-size:14px; line-height:1.6; }
.card i { margin-top:4px; padding:4px 14px; background:var(--butter); border:3px solid var(--ink); border-radius:12px; font-size:14px; font-style:normal; font-weight:700; }
.doc section.wechat { display:flex; align-items:center; gap:22px; }
.wechat img { width:140px; height:140px; flex:none; border:3px solid var(--ink); border-radius:14px; background:#fff; }
.wechat h2 { margin-bottom:4px; }
@media (max-width:560px) {
  .wechat img { width:112px; height:112px; }
  .doc section.wechat { gap:16px; padding:18px; }
  .doc section.hero { flex-direction:column; align-items:stretch; }
  .hero .shot { width:180px; align-self:center; }
  .hero .start { display:block; text-align:center; }
  .card img { width:84px; height:84px; }
  .card { gap:14px; }
}

/* 游戏中：禁止滚动、缩放、长按选中 */
.back { display:none; position:fixed; z-index:2; left:16px; top:16px; padding:10px 14px; color:var(--ink); background:var(--card); border:3px solid var(--ink); border-radius:14px; box-shadow:0 3px 0 var(--ink); font-size:14px; font-weight:700; line-height:1.3; text-decoration:none; }
.playing { height:100%; overflow:hidden; background:var(--cream); overscroll-behavior:none; }
.playing body { position:fixed; left:0; top:0; width:100%; height:100%; min-height:0; padding:0; overflow:hidden; background:var(--cream); touch-action:none; overscroll-behavior:none; -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; }
.playing main, .playing footer { display:none; }
.playing:not(.ready) body::after { content:"正在加载…"; position:fixed; left:0; right:0; top:46%; text-align:center; color:var(--sub); font-size:17px; font-weight:700; }
.playing.failed body::after { content:"没加载出来，点一下重试"; }
.playing canvas { touch-action:none; }
.playing.boxed body { background:var(--cream) radial-gradient(var(--dot) 1.5px, transparent 2px) 0 0 / 22px 22px; }
.playing.boxed canvas { box-shadow:0 0 0 3px var(--ink); }
/* 微信版入口：右上角小按钮 + 二维码弹层 */
.wx-btn { display:none; position:fixed; z-index:2; right:12px; top:6px; padding:3px 10px; color:var(--ink); background:var(--card); border:2px solid var(--ink); border-radius:12px; box-shadow:0 2px 0 var(--ink); font:inherit; font-size:12px; font-weight:700; line-height:1.4; cursor:pointer; }
.playing .wx-btn { display:block; }
/* 合合右上角有三个游戏按钮和分数条，挪到它们下面、「下一个」上面 */
[data-game="tuanzi-hehe"] .wx-btn { top:52px; }
@media (min-width:960px) { .wx-btn, [data-game="tuanzi-hehe"] .wx-btn { right:16px; top:16px; padding:10px 14px; border-width:3px; box-shadow:0 3px 0 var(--ink); font-size:14px; } }
.wx-pop { position:fixed; z-index:5; inset:0; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(59,43,51,.55); }
.wx-pop[hidden] { display:none; }
.wx-card { width:min(100%, 320px); padding:18px; text-align:center; background:var(--card); border:4px solid var(--ink); border-radius:22px; box-shadow:0 6px 0 var(--ink); }
.wx-card img { display:block; width:200px; max-width:100%; height:auto; margin:0 auto 12px; border:3px solid var(--ink); border-radius:12px; }
.wx-card p { margin-bottom:14px; font-size:14px; line-height:1.6; }
.wx-close { min-width:120px; min-height:44px; padding:8px 20px; color:var(--ink); background:var(--butter); border:3px solid var(--ink); border-radius:14px; box-shadow:0 3px 0 var(--ink); font:inherit; font-size:15px; font-weight:800; cursor:pointer; }
.wx-btn:focus-visible, .wx-close:focus-visible { outline:3px solid var(--berry); outline-offset:3px; }
/* 手机上左上角是游戏自己的按钮，只在左右有空的宽屏显示 */
@media (min-width:960px) { .playing .back { display:block; } }

/* 全站统计同意条（只在欧盟等地区出现） */
.consent-banner { position:fixed; z-index:4; left:0; right:0; bottom:0; padding:12px 20px calc(12px + env(safe-area-inset-bottom)); background:var(--card); border-top:3px solid var(--ink); text-align:center; font-size:13px; }
.consent-banner p { margin-bottom:8px; }
.consent-actions { display:flex; justify-content:center; gap:8px; margin-bottom:6px; }
.consent-actions button { flex:1; max-width:180px; min-height:40px; color:inherit; background:var(--cream); border:2px solid var(--ink); border-radius:12px; font:inherit; font-weight:700; }
.consent-banner a { color:var(--sub); }

.alias { color:var(--sub); font-size:14px; line-height:1.4; }
.languages { display:flex; flex-wrap:wrap; gap:6px; margin-top:16px; }
.languages button { padding:5px 10px; font:inherit; font-size:14px; color:var(--ink); background:var(--card); border:2px solid var(--dot); border-radius:12px; cursor:pointer; }
.languages button[aria-pressed="true"] { border-color:var(--ink); background:var(--butter); font-weight:700; }
.languages button:focus-visible { outline:3px solid var(--berry); outline-offset:2px; }
html[data-ui="en"].playing:not(.ready) body::after { content:"Loading…"; }
html[data-ui="ja"].playing:not(.ready) body::after { content:"読み込み中…"; }
html[data-ui="en"].playing.failed body::after { content:"Couldn't load the game. Tap to retry."; }
html[data-ui="ja"].playing.failed body::after { content:"読み込めませんでした。タップして再試行"; }
