/* Existing palette, exact-value aliases only; no visual redesign. */
:root{
  --rchs-bg:#0f0f13;
  --rchs-text:#e8e8f0;
  --rchs-primary:#4ade80;
  --rchs-surface:#18181f;
  --rchs-border:#2a2a38;
  --rchs-text-strong:#fff;
  --rchs-muted:#aaa;
  --rchs-muted-deep:#888;
  --rchs-hero-end:#1a1f2e;
  --rchs-surface-inset:#111118;
  --rchs-primary-hover:#22c55e;
  --rchs-code-bg:#1a1a28;
  --rchs-placeholder-end:#2a1a38;
  --rchs-badge-bg:#1a2a1a;
  --rchs-badge-border:#2a4a2a;
  --rchs-copy:#bbb;
  --rchs-control-border:#777;
  --rchs-ad-label:#999;
  --rchs-panel-border:#555;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:var(--rchs-bg);color:var(--rchs-text);line-height:1.6}
a{color:var(--rchs-primary);text-decoration:none}a:hover{text-decoration:underline}
.wrap{max-width:960px;margin:0 auto;padding:0 1rem}
.hdr{background:var(--rchs-surface);border-bottom:1px solid var(--rchs-border);position:sticky;top:0;z-index:100}
.hdr .wrap{display:flex;align-items:center;justify-content:space-between;height:52px;gap:1rem}
.brand{font-weight:700;font-size:1.1rem;color:var(--rchs-text-strong);white-space:nowrap}
nav{display:flex;gap:1.2rem;font-size:.88rem;flex-wrap:wrap}
nav a{color:var(--rchs-muted)}nav a:hover{color:var(--rchs-primary)}
.ftr{background:var(--rchs-surface);border-top:1px solid var(--rchs-border);padding:1.5rem 0;text-align:center;font-size:.85rem;color:var(--rchs-muted-deep)}
.ftr a{color:var(--rchs-muted);text-decoration:underline}
/* Hero tool section */
.hero{padding:2.5rem 1rem 2rem;background:linear-gradient(160deg,var(--rchs-surface) 0%,var(--rchs-hero-end) 100%)}
.hero-inner{display:grid;grid-template-columns:1fr 1fr;gap:2rem;align-items:start;max-width:900px;margin:0 auto}
@media(max-width:640px){.hero-inner{grid-template-columns:1fr}}
.hero-left h1{font-size:clamp(1.5rem,3.5vw,2.1rem);font-weight:800;line-height:1.2;margin-bottom:.6rem}
.hero-left h1 span{color:var(--rchs-primary)}
.hero-left p{color:var(--rchs-muted);font-size:.95rem;margin-bottom:1.2rem}
.tool-box{background:var(--rchs-surface-inset);border:1px solid var(--rchs-border);border-radius:12px;padding:1.25rem}
.tool-box label{font-size:.82rem;color:var(--rchs-muted-deep);display:block;margin-bottom:.4rem}
.tool-box textarea{width:100%;background:var(--rchs-bg);border:1px solid var(--rchs-border);border-radius:8px;color:var(--rchs-text);padding:.65rem;font-size:.92rem;resize:vertical;min-height:72px;font-family:inherit}
.tool-box textarea:focus{outline:none;border-color:var(--rchs-primary)}
.tool-actions{display:flex;gap:.6rem;margin-top:.7rem;align-items:center;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;gap:.35rem;padding:.55rem 1.1rem;border-radius:8px;font-weight:600;font-size:.9rem;cursor:pointer;border:none;transition:.15s;text-decoration:none}
.btn-primary{background:var(--rchs-primary);color:var(--rchs-bg)}.btn-primary:hover{background:var(--rchs-primary-hover)}
.btn-outline{background:transparent;border:1px solid var(--rchs-border);color:var(--rchs-muted)}.btn-outline:hover{border-color:var(--rchs-primary);color:var(--rchs-primary)}
.preview-box{background:var(--rchs-surface-inset);border:1px solid var(--rchs-border);border-radius:12px;padding:1.25rem;min-height:200px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem}
.preview-placeholder{text-align:center;color:var(--rchs-muted-deep);font-size:.88rem}
.preview-placeholder svg{opacity:.3;margin-bottom:.5rem}
/* Game section */
.game-section{background:var(--rchs-surface-inset);border-top:1px solid var(--rchs-border);border-bottom:1px solid var(--rchs-border);padding:2.5rem 1rem}
.game-section h2{font-size:1.4rem;font-weight:700;text-align:center;margin-bottom:.4rem}
.game-section .sub{text-align:center;color:var(--rchs-muted-deep);font-size:.9rem;margin-bottom:1.5rem}
.game-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1rem;max-width:860px;margin:0 auto}
.game-card{background:var(--rchs-surface);border:1px solid var(--rchs-border);border-radius:12px;overflow:hidden;transition:.15s}
.game-card:hover{border-color:var(--rchs-primary);transform:translateY(-2px)}
.game-card-cover{width:100%;height:140px;object-fit:cover;background:var(--rchs-code-bg)}
.game-card-cover-placeholder{width:100%;height:140px;background:linear-gradient(135deg,var(--rchs-code-bg),var(--rchs-placeholder-end));display:flex;align-items:center;justify-content:center;font-size:2.5rem}
.game-card-body{padding:1rem}
.game-card-body h3{font-size:.98rem;font-weight:600;margin-bottom:.3rem}
.game-card-body p{font-size:.82rem;color:var(--rchs-muted-deep);margin-bottom:.75rem}
.game-card-badge{display:inline-block;background:var(--rchs-badge-bg);color:var(--rchs-primary);border:1px solid var(--rchs-badge-border);border-radius:4px;font-size:.75rem;padding:.15rem .5rem;margin-bottom:.5rem}
/* Sections */
.section{padding:2.5rem 1rem}
.section h2{font-size:1.4rem;font-weight:700;margin-bottom:1.25rem;text-align:center}
.section .sub{text-align:center;color:var(--rchs-muted-deep);font-size:.9rem;margin-bottom:1.5rem}
.tools-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;max-width:800px;margin:0 auto}
.tool-card{background:var(--rchs-surface);border:1px solid var(--rchs-border);border-radius:10px;padding:1.25rem;display:block;color:inherit;transition:.15s}
.tool-card:hover{border-color:var(--rchs-primary);text-decoration:none}
.tool-card .icon{font-size:1.6rem;margin-bottom:.5rem}
.tool-card h3{font-size:.95rem;font-weight:600;margin-bottom:.3rem}
.tool-card p{font-size:.83rem;color:var(--rchs-muted-deep)}
.steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;max-width:720px;margin:0 auto}
.step{background:var(--rchs-surface);border:1px solid var(--rchs-border);border-radius:10px;padding:1.25rem}
.step-n{font-size:1.4rem;font-weight:800;color:var(--rchs-primary);margin-bottom:.35rem}
.step h3{font-size:.95rem;font-weight:600;margin-bottom:.3rem}
.step p{font-size:.85rem;color:var(--rchs-muted)}
.faqs{max-width:680px;margin:0 auto;display:grid;gap:.75rem}
.faq{background:var(--rchs-surface);border:1px solid var(--rchs-border);border-radius:10px;padding:1rem 1.25rem}
.faq h3{font-size:.95rem;font-weight:600;margin-bottom:.35rem}
.faq p{font-size:.85rem;color:var(--rchs-muted)}
.page-content{max-width:760px;margin:0 auto;padding:2rem 1rem}
.page-content h1{font-size:1.8rem;margin-bottom:1rem}
.page-content h2{font-size:1.25rem;margin:1.5rem 0 .6rem;color:var(--rchs-primary)}
.page-content h3{font-size:1.05rem;margin:1.2rem 0 .4rem}
.page-content p{color:var(--rchs-copy);margin-bottom:.85rem}
.page-content ul,.page-content ol{color:var(--rchs-copy);padding-left:1.4rem;margin-bottom:.85rem}
.page-content li{margin-bottom:.35rem}
.page-content a{color:var(--rchs-primary);text-decoration:underline}
.page-content code{background:var(--rchs-code-bg);padding:.1rem .35rem;border-radius:4px;font-size:.88rem}
.page-content hr{border:none;border-top:1px solid var(--rchs-border);margin:1.5rem 0}
/* Keep every table column readable without widening the whole mobile page. */
.page-content table{display:block;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.ad-notice{max-width:760px;margin:0 auto 1rem;padding-bottom:1rem;border-bottom:1px solid var(--rchs-border);color:var(--rchs-copy)}
.ad-notice p{margin-bottom:.5rem}
.ad-toggle{min-height:44px;border:1px solid var(--rchs-control-border);border-radius:6px;padding:.45rem .8rem;background:var(--rchs-surface);color:var(--rchs-text);font:inherit;cursor:pointer}
.ad-toggle[hidden]{display:none}
.ad-toggle:disabled{cursor:default}
[data-adsterra-status]{display:block;margin-top:.3rem}
/* 无障碍增强 */
:focus-visible{outline:2px solid var(--rchs-primary);outline-offset:2px}
a:focus-visible{outline:2px solid var(--rchs-primary)}
button:focus-visible{outline:2px solid var(--rchs-primary)}
/* 链接颜色辨识 */
.page-content a{text-decoration:underline}
nav a:hover{text-decoration:underline}
/* Game-first hero */
.hero-game{padding:3rem 1rem 2.5rem;background:linear-gradient(160deg,var(--rchs-surface) 0%,var(--rchs-hero-end) 100%);text-align:center}
.hero-game h1{font-size:clamp(1.8rem,4vw,2.6rem);font-weight:800;margin-bottom:.6rem}
.hero-game h1 span{color:var(--rchs-primary)}
.hero-game p{color:var(--rchs-muted);font-size:1rem;max-width:520px;margin:0 auto 1.5rem}
.hero-btns{display:flex;gap:.75rem;justify-content:center;flex-wrap:wrap}
/* Codes grid */
.codes-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:.75rem;max-width:900px;margin:0 auto}
.code-card{background:var(--rchs-surface);border:1px solid var(--rchs-border);border-radius:10px;padding:1rem 1.25rem;display:flex;align-items:center;gap:.85rem;color:inherit;text-decoration:none;transition:.15s}
.code-card:hover{border-color:var(--rchs-primary);text-decoration:none}
.code-card-emoji{font-size:1.6rem;flex-shrink:0}
.code-card h3{font-size:.92rem;font-weight:600;margin-bottom:.2rem}
.code-card p{font-size:.8rem;color:var(--rchs-muted-deep);margin:0}
.code-card-arrow{margin-left:auto;color:var(--rchs-primary);font-size:1.1rem;flex-shrink:0}
/* Nav codes link */
.nav-codes{color:var(--rchs-primary) !important;font-weight:600}
/* Game cards layout */
.game-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.75rem}

/* Respect runtime hidden state despite inline display:flex. */
[data-gf-loading][hidden],[data-gf-cover][hidden]{display:none!important}
.game-start{font:inherit}
.skip-link{position:fixed;left:1rem;top:-5rem;z-index:200;background:var(--rchs-primary);color:var(--rchs-bg);padding:.7rem 1rem}
.skip-link:focus{top:.5rem}
/* Keep in-page directory headings below the sticky navigation. */
#play,#codes,#tier-lists,#wikis{scroll-margin-top:4.5rem}
@media(max-width:640px){
  #play,#codes,#tier-lists,#wikis{scroll-margin-top:8rem}
  .hdr .wrap{height:auto;min-height:52px;flex-wrap:wrap;padding-top:.65rem;padding-bottom:.65rem;gap:.35rem}
  .hdr nav{width:100%;gap:.15rem .85rem;align-items:center}
  .hdr nav a{display:inline-flex;align-items:center;min-height:44px}
  .codes-grid{grid-template-columns:minmax(0,1fr)}
  [data-gf-frame]{aspect-ratio:auto!important;height:360px;min-width:0}
  [data-gf-cover]{padding:1rem;text-align:center}
  [data-gf-fullscreen]{top:.75rem;bottom:auto!important}
}
@media(prefers-reduced-motion:reduce){[data-gf-loading] *{animation:none!important}}

/* Additive, in-flow Adsterra placements; existing site styles stay unchanged. */
.adsterra-inline{width:100%;max-width:1100px;margin:1.5rem auto;text-align:center;min-height:78px}
.adsterra-inline[hidden]{display:none}
.adsterra-inline__label{font-size:.7rem;line-height:1.4;color:var(--rchs-ad-label);letter-spacing:.06em;text-transform:uppercase;margin-bottom:.5rem}
.adsterra-inline__mount{max-width:100%;margin:0 auto}
.adsterra-inline__mount>iframe{display:block;border:0;margin:0 auto}
.adsterra-inline[data-adsterra-size="300"]{min-height:278px}
.adsterra-inline--native{min-height:310px}
.adsterra-inline--native .adsterra-inline__mount{width:calc(100% - 2rem);min-height:280px}


/* Optional analytics only; no ad placement or existing layout changes. */
.rchs-analytics{max-width:760px;margin:1rem auto;padding:.75rem;border:1px solid var(--rchs-panel-border);border-radius:6px;text-align:left;overflow-wrap:anywhere}
.rchs-analytics summary{cursor:pointer;min-height:44px;display:list-item;padding:.5rem}
.rchs-analytics p{margin:.5rem 0}
.rchs-analytics button{margin:.25rem;max-width:100%;white-space:normal}
.rchs-analytics summary:focus-visible{outline:2px solid var(--rchs-primary);outline-offset:2px}
