/* Standalone rulebook; shared palette from base.css. */
.rules-page{--rules-head:72px; background:#08080a;color:var(--text)}
.rules-page::before{display:none}
.rules-page [hidden]{display:none!important}
.rules-top{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:var(--rules-head);padding:10px clamp(16px,5vw,72px);background:rgba(9,9,12,.95);border-bottom:1px solid var(--hairline);backdrop-filter:blur(16px)}
.rules-brand,.rules-top nav{display:flex;align-items:center;gap:14px}.rules-brand{white-space:nowrap;letter-spacing:.09em}.rules-brand img{object-fit:contain}.rules-brand em,.rules-hero em{font-style:normal;color:var(--red-2)}
.rules-top nav{font-size:13px;color:var(--muted);flex-wrap:wrap;justify-content:flex-end}.rules-top a:hover,.rules-footer a:hover{color:#fff}.rules-apply{border:1px solid var(--line);border-radius:999px;padding:7px 13px;color:var(--text)}
.rules-progress{position:fixed;top:var(--rules-head);height:3px;left:0;right:0;z-index:11;pointer-events:none}.rules-progress i{display:block;height:100%;width:0;background:var(--red-2)}
.rules-shell{max-width:1320px;margin:auto;padding:0 clamp(16px,4vw,56px) 64px}.rules-hero{position:relative;isolation:isolate;overflow:hidden;margin:28px 0 30px;padding:clamp(26px,5vw,64px);border:1px solid var(--hairline);border-radius:18px;background:linear-gradient(90deg,rgba(9,9,12,.98) 5%,rgba(9,9,12,.85) 50%,rgba(9,9,12,.56)),url('../assets/bg/bg-01.jpg') center 42%/cover}
.rules-eyebrow,.rule-en{font-size:11px;font-weight:750;letter-spacing:.16em;text-transform:uppercase;color:var(--red-3)}.rules-hero h1{font-size:clamp(38px,6.2vw,76px);line-height:1.2;font-weight:900;letter-spacing:-.035em;margin:10px 0 14px}.rules-intro{font-size:clamp(15px,2vw,19px);max-width:36em;color:#e4e4e8}.rules-tags{display:flex;flex-wrap:wrap;gap:8px;margin:24px 0 12px}.rules-tags span{font-size:12px;color:#e4e4e8;padding:5px 11px;border:1px solid rgba(255,255,255,.17);border-radius:999px;background:rgba(10,10,14,.74)}.rules-tags span:first-child{color:#ffadb3;border-color:var(--line-strong)}.rules-hero-note{font-size:13px;color:#bcbcc4}
.rules-layout{display:grid;grid-template-columns:minmax(220px,275px) minmax(0,1fr);gap:24px;align-items:start}.rules-sidebar,.rule-section,.rules-search,.rules-bottom,.rules-empty{border:1px solid var(--hairline);border-radius:14px;background:linear-gradient(145deg,rgba(26,26,32,.88),rgba(13,13,17,.95))}.rules-sidebar{position:sticky;top:calc(var(--rules-head) + 22px);max-height:calc(100vh - var(--rules-head) - 44px);overflow:auto;padding:16px 12px}.rules-side-head{display:flex;justify-content:space-between;align-items:center;padding:2px 8px 12px;border-bottom:1px solid var(--hairline);margin-bottom:8px}.rules-side-head span{font-size:11px;color:var(--muted);letter-spacing:.12em}.rules-toc{display:grid;gap:3px}.rules-toc a{display:flex;align-items:baseline;gap:9px;padding:8px 10px;border-radius:7px;font-size:13px;line-height:1.55;color:#c3c3cb;border-left:2px solid transparent;overflow-wrap:anywhere}.rules-toc a span{font-size:11px;color:var(--red-3);font-variant-numeric:tabular-nums}.rules-toc a:hover,.rules-toc a[aria-current]{background:var(--red-soft);color:white;border-left-color:var(--red-2)}
.rules-content{min-width:0;display:grid;gap:16px;scroll-margin-top:calc(var(--rules-head) + 20px)}.rule-section{scroll-margin-top:calc(var(--rules-head) + 18px);padding:clamp(18px,3vw,32px)}.rule-heading{display:flex;align-items:center;gap:14px;padding-bottom:18px;border-bottom:1px solid var(--hairline);margin-bottom:18px}.rule-number{display:grid;place-items:center;flex:none;width:45px;height:45px;font-size:19px;font-weight:800;letter-spacing:.03em;color:var(--red-3);background:var(--red-soft);border:1px solid var(--line);border-radius:10px}.rule-heading h2{font-size:clamp(18px,2.6vw,25px);line-height:1.4}.rule-heading .rule-anchor{margin-left:auto;color:var(--muted);padding:5px;flex:none}.rule-body{color:#d3d3da;font-size:15px;line-height:1.95;overflow-wrap:anywhere}.rule-body p{margin:0 0 14px}.rule-body p:last-child{margin-bottom:0}.rules-list{padding-left:1.7em;margin:0}.rules-list li{padding-left:.3em;margin:0 0 11px}.rules-list li:last-child{margin-bottom:0}.rules-list li::marker{color:var(--red-3);font-weight:750}.rule-body .rules-note,.rule-body .rules-warning{margin:18px 0 0;padding:13px 16px;border-left:3px solid var(--red);background:var(--red-soft);border-radius:0 8px 8px 0}.rule-body .rules-warning{margin:0 0 18px;color:#ffe2e4}.rules-warning strong{color:#ffacb2}
.table-wrap{overflow:auto;margin:16px 0 0;border:1px solid var(--hairline);border-radius:8px}.table-wrap table{width:100%;border-collapse:collapse;font-size:14px;min-width:0}.table-wrap th,.table-wrap td{padding:10px 12px;text-align:left;vertical-align:top;border-bottom:1px solid var(--hairline);overflow-wrap:anywhere}.table-wrap th{background:#25252d;color:#f4f4f5;font-weight:700}.table-wrap td:first-child{color:var(--red-3);font-weight:700;white-space:nowrap}.table-wrap tr:last-child td{border-bottom:0}.table-wrap table:has(th:nth-child(4)){min-width:540px}
.rules-search{padding:16px 20px}.rules-search label{font-size:13px;font-weight:700;display:block;margin-bottom:7px}.rules-search-row{display:flex;gap:8px}.rules-search input{flex:1;min-width:0;padding:11px 12px;border:1px solid var(--hairline);border-radius:8px;background:#0c0c10;color:var(--text);font:inherit;font-size:14px}.rules-search button{border:1px solid var(--hairline);border-radius:8px;padding:6px 14px;color:var(--muted)}.rules-search p{color:var(--muted);font-size:12px;margin-top:7px}.rules-search mark,.rule-section mark{background:#ffcb74;color:#20140b;border-radius:2px}.rules-empty,.rules-bottom{padding:22px;text-align:center;color:var(--muted)}.rules-bottom .btn{margin-top:15px;width:auto}.rules-footer{border-top:1px solid var(--hairline);padding:22px clamp(16px,5vw,72px);display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted)}.rules-skip{position:absolute;left:12px;top:-100px;background:#fff;color:#111;padding:10px;z-index:99}.rules-skip:focus{top:8px}.rules-page :focus-visible{outline:2px solid #ff9099;outline-offset:3px}
@media(max-width:800px){.rules-page{--rules-head:64px}.rules-layout{grid-template-columns:1fr;gap:14px}.rules-sidebar{position:static;max-height:none;overflow:visible}.rules-toc{grid-template-columns:repeat(2,minmax(0,1fr))}.rules-hero{margin-top:16px}.rules-brand img{width:32px;height:32px}.rule-heading{gap:10px}.rule-number{width:39px;height:39px}.rule-body{font-size:14px}.rules-top nav{gap:8px;font-size:12px}.rules-apply{padding:5px 9px}.rules-content{gap:12px}}
@media(max-width:360px){.rules-top{gap:5px;padding-inline:9px}.rules-brand{gap:5px;font-size:13px}.rules-toc{grid-template-columns:1fr}.rules-hero{padding:20px}.rule-section{padding:15px}.rules-footer{flex-wrap:wrap}}
@media print{.rules-top,.rules-sidebar,.rules-search,.rules-progress,.rules-bottom,.rules-footer,.rules-tags,.rule-anchor,.rules-skip{display:none!important}.rules-page,.rules-hero,.rule-section{background:#fff!important;color:#111!important;border:0}.rules-shell{padding:0}.rules-layout{display:block}.rule-body,.rules-hero-note,.rules-intro,.rule-heading h2{color:#111}.rules-hero,.rule-section{padding:10px 0}.rule-heading{break-after:avoid}.rules-list li{break-inside:avoid}.table-wrap{overflow:visible}.table-wrap th{background:#eee;color:#111}}
/* Constrain long table content to its own scroll area on small screens. */
.rules-content{grid-template-columns:minmax(0,1fr)}
.rule-section,.table-wrap{min-width:0;max-width:100%}
@media(max-width:800px){.rules-layout{grid-template-columns:minmax(0,1fr)}}

/* Character creation guide: shares the rulebook palette and responsive layout. */
.guide-body h3{margin:26px 0 12px;font-size:17px;line-height:1.5;color:var(--text);border-bottom:1px solid var(--hairline);padding-bottom:8px}
.guide-body strong,.guide-example h4{color:var(--text)}.guide-link{color:var(--red-3);text-decoration:underline;text-underline-offset:3px}
.guide-table td:first-child{white-space:normal;width:27%}.guide-example{padding:clamp(14px,3vw,22px);border:1px solid var(--hairline);border-radius:10px;background:rgba(0,0,0,.22)}
.guide-example h4{font-size:22px;margin:6px 0}.guide-example .guide-meta{font-size:13px;color:var(--muted)}.guide-example dl{margin:14px 0}.guide-example dt{font-weight:700;color:var(--red-3);margin-top:10px}.guide-example dd{margin:0 0 10px}.guide-checklist{padding-left:1.4em;list-style:disc}.guide-checklist li{margin:5px 0}.guide-checklist li::marker{color:var(--red-3)}.guide-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}.guide-actions .btn{width:auto}
@media print{.guide-actions{display:none!important}.guide-example{background:#fff}.guide-body h3,.guide-body strong,.guide-example h4,.guide-example .guide-meta{color:#111}.guide-body h3{break-after:avoid}}
