.rules-shell {
  padding-top: clamp(28px, 7vh, 86px);
  gap: clamp(22px, 4vw, 42px);
}

/* Setup uses real card backs; empty zones stay visibly empty. */
.setup-guide { min-width: 0; }
.setup-heading h2 { margin-bottom: 10px; }
.setup-heading > p:last-child { margin-bottom: 0; }
.setup-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.setup-table { margin: 0; padding: clamp(16px, 2.5vw, 28px); min-width: 0; border: 1px solid #405970; border-radius: 16px; background: radial-gradient(ellipse at 50% 70%, #1a3448, transparent 70%), #0b1521; }
.setup-table-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding-bottom: 24px; }
.setup-table-heading strong { color: #eef7ff; }
.setup-table-heading > span { color: #aebed0; font-size: .8rem; }
.setup-cycle { display: block; width: 100%; height: auto; overflow: visible; }
.setup-cycle-flow path { fill: none; stroke: #f0d397; stroke-width: 2; marker-end: url(#setup-cycle-arrow); }
.setup-cycle-labels { fill: #f0d397; font-size: 14px; }
.setup-cycle-empty { fill: #0b1521; stroke: #718ba4; stroke-dasharray: 4 3; }
.setup-cycle-zero { fill: #b8c9d9; font-size: 30px; }
.setup-cycle-small { fill: #b9c9d9; font-size: 12px; }
.setup-cycle-name { fill: #f1e4c5; font-size: 16px; font-weight: 700; }
.setup-piles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; text-align: center; }
.setup-pile { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.setup-pile > strong { color: #f1e4c5; font-size: .9rem; margin-top: 10px; }
.setup-pile > span { color: #b9c9d9; font-size: .75rem; line-height: 1.5; }
.setup-deck, .setup-empty { width: min(100%, 100px); aspect-ratio: 5 / 7; border-radius: 7px; }
.setup-deck { box-shadow: 3px 3px 0 #506477, 6px 6px 0 #263c50, 9px 9px 0 #506477; }
.setup-deck img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.setup-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #607991; background: rgba(8, 16, 26, .4); color: #b8c9d9; }
.setup-empty > span { font-size: 2rem; font-weight: 400; }
.setup-empty small { font-size: .68rem; }
.setup-draw-note { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 26px 0 20px; color: #f0d397; font-size: .8rem; text-align: center; }
.setup-draw-note > span { font-size: 1.5rem; }
.setup-hand { display: flex; justify-content: center; padding: 12px 12px 18px 0; }
.setup-hand img { width: 22%; max-width: 90px; aspect-ratio: 5 / 7; border-radius: 6px; border: 1px solid #7b8b9d; box-shadow: -3px 3px 10px #060b13; object-fit: cover; transform: rotate(-12deg) translateY(8px); }
.setup-hand img + img { margin-left: -7%; }
.setup-hand img:nth-child(2) { transform: rotate(-6deg); }
.setup-hand img:nth-child(3) { transform: translateY(-4px); }
.setup-hand img:nth-child(4) { transform: rotate(6deg); }
.setup-hand img:nth-child(5) { transform: rotate(12deg) translateY(8px); }
.setup-hand-label { display: grid; gap: 5px; text-align: center; color: #edf6ff; }
.setup-hand-label span { color: #b9c9d9; font-size: .8rem; }
.setup-table figcaption { border-top: 1px solid #344a5f; padding-top: 16px; margin-top: 22px; color: #aebed0; font-size: .75rem; line-height: 1.6; }
.setup-steps { list-style: none; counter-reset: setup; margin: 0; padding: 0; display: grid; gap: 22px; }
.setup-steps > li { counter-increment: setup; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; }
.setup-steps > li::before { content: counter(setup, decimal-leading-zero); color: #f0d397; border-top: 2px solid #94784a; padding-top: 5px; font-size: .85rem; font-weight: 800; }
.setup-steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.setup-steps p { margin: 0; font-size: .9rem; line-height: 1.65; }
.setup-steps ul { padding-left: 18px; margin: 8px 0 0; color: #bdcada; font-size: .85rem; line-height: 1.8; }
.setup-steps .setup-tip { margin-top: 10px; padding-left: 12px; border-left: 2px solid #486781; font-size: .8rem; color: #b9c9d9; }
.setup-ready { display: flex; align-items: baseline; gap: 16px; padding: 16px 20px; border: 1px solid #665837; border-radius: 8px; background: rgba(240, 195, 106, .07); }
.setup-ready strong { flex-shrink: 0; color: #f0d397; }
.setup-ready span { color: #c7d4e1; font-size: .88rem; line-height: 1.6; }
.setup-deck-rules { color: #b9c9d9; font-size: .85rem; }
.setup-deck-rules summary { cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.setup-deck-rules p { margin-top: 12px; }
@media (max-width: 850px) {
  .setup-layout { grid-template-columns: minmax(0, 1fr); }
  .setup-table { width: 100%; max-width: 540px; justify-self: center; box-sizing: border-box; }
  .setup-ready { flex-direction: column; gap: 6px; }
}
@media print {
  .setup-table { break-inside: avoid; }
  .setup-steps { break-inside: avoid; }
}

.ship-site-guide { border: 1px solid #405970; border-radius: 10px; background: #0b1521; }
.ship-site-guide > summary { cursor: pointer; padding: 16px 20px; color: #e4effa; }
.ship-site-guide > summary > span { margin-left: 14px; color: #aebed0; font-size: .8rem; }
.ship-site-guide > summary:focus-visible { outline: 2px solid #f0c36a; outline-offset: 4px; }
.ship-site-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 12px 24px 24px; align-items: center; }
.ship-site-figure { margin: 0; min-width: 0; }
.ship-site-diagram { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); align-items: end; gap: 22px; padding: 24px 16px; border: 1px solid #344a5f; border-radius: 10px; background: radial-gradient(ellipse at center, #223a50, #101b28); }
.ship-site-crew, .ship-site-host { display: grid; gap: 8px; min-width: 0; text-align: center; }
.ship-site-diagram { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr); align-items: start; }
.ship-site-host { grid-column: 1; grid-row: 1; }
.ship-site-crew { grid-column: 2; grid-row: 1; margin-top: 110px; }
.ship-site-stack { position: relative; width: 100%; aspect-ratio: 1 / 1.55; }
.ship-site-stack img { position: absolute; width: 80%; height: auto; border-radius: 4px; box-shadow: 0 3px 12px #0009; }
.ship-site-stack img:first-child { top: 0; left: 0; }
.ship-site-stack img:last-child { bottom: 0; right: 0; }
.ship-site-diagram b { color: #f0d397; font-size: .85rem; }
.ship-site-diagram small { color: #bdcada; font-size: .72rem; }
.ship-site-figure figcaption { margin-top: 12px; color: #aebed0; font-size: .8rem; line-height: 1.6; }
.ship-site-copy h3 { margin-top: 0; }
.ship-site-copy p, .ship-site-copy li { font-size: .88rem; line-height: 1.65; color: #c7d4e1; }
.ship-site-copy ul { padding-left: 18px; display: grid; gap: 12px; }
.ship-site-copy .ship-site-note { border-left: 2px solid #94784a; padding-left: 12px; font-size: .8rem; }
@media (max-width: 850px) {
  .ship-site-content { grid-template-columns: minmax(0, 1fr); padding: 8px 16px 20px; }
  .ship-site-figure { max-width: 480px; justify-self: center; }
  .ship-site-guide > summary > span { display: block; margin: 6px 0 0 18px; }
  .ship-site-diagram { gap: 14px; padding: 18px 12px; }
}

/* Quick Play's three visual lessons use the shipped card art, not mock cards. */
.visual-lesson { min-width: 0; gap: 18px; }
.guide-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.guide-heading h2 { max-width: 820px; }
.guide-tag { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #52616d; border-radius: 20px; color: #d9e3f0; font-size: .75rem; }
.guide-figure, .guide-type-gallery figure { margin: 0; min-width: 0; }
.guide-figure figcaption { margin-top: 12px; color: #c2ccda; font-size: .88rem; line-height: 1.55; }
.guide-figure a { color: #98e0ff; }
.guide-note { font-size: .88rem; }
.guide-board-scroll { overflow-x: auto; border: 1px solid #41556a; border-radius: 12px; background: #090e17; scrollbar-color: #6485a3 #111b29; }
.guide-board-scroll:focus-visible { outline: 2px solid #f0c36a; outline-offset: 3px; }
.guide-scroll-hint { display: none; font-size: .8rem; }
.guide-board { min-width: 820px; padding: 14px; }
.guide-player-rail { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 16px; background: #122435; border-radius: 6px; }
.guide-opponent-rail { background: #30202a; }
.guide-player-rail > strong { width: 78px; color: #9be3ff; font-size: .8rem; letter-spacing: .1em; }
.guide-opponent-rail > strong { color: #ffc2c2; }
.guide-hand { display: flex; align-items: center; padding-left: 18px; }
.guide-hand img { width: 36px; height: 51px; margin-left: -12px; border: 1px solid #71849a; border-radius: 3px; transform: rotate(-8deg); }
.guide-hand img:nth-child(2) { transform: rotate(-4deg); }
.guide-hand img:nth-child(3) { transform: none; }
.guide-hand img:nth-child(4) { transform: rotate(4deg); }
.guide-hand img:nth-child(5) { transform: rotate(8deg); }
.guide-piles { display: flex; align-items: end; gap: 16px; }
.guide-piles > span { display: grid; justify-items: center; align-content: end; position: relative; min-width: 47px; gap: 3px; }
.guide-piles img { width: 30px; height: 42px; box-shadow: 2px 1px #6e7c91, 4px 2px #273648; }
.guide-piles b, .guide-planet b { font-size: .67rem; color: #cfdaea; font-weight: 600; }
.guide-empty-pile::before { content: ''; display: block; width: 30px; height: 42px; border: 1px dashed #7d8da4; border-radius: 3px; }
.guide-planet { display: flex; align-items: center; gap: 8px; }
.guide-planet img { display: block; width: 42px; height: 59px; object-fit: contain; }
.guide-opponent-rail .guide-planet img, .guide-opponent-rail .guide-hand img { rotate: 180deg; }
.guide-territories { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 0 4px; font-size: .75rem; text-align: center; color: #e6b6bc; }
.guide-territories span:last-child { color: #9be3ff; }
.guide-lanes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.guide-lane { display: grid; grid-template-rows: 24px 115px auto 115px; gap: 7px; padding: 8px 5px; border: 1px solid #3f3544; border-radius: 6px; background: linear-gradient(#25192366, #101623); }
.guide-lane.your-lane { border-color: #2b485c; background: linear-gradient(#14263888, #101623); }
.guide-lane.example-battleground { border: 2px solid #f0c36a; background: #342b174d; }
.guide-lane-name { text-align: center; color: #dbe3ef; font-size: .75rem; }
.guide-unit-slot { display: flex; align-items: center; justify-content: center; }
.guide-board-unit { display: grid; gap: 4px; justify-items: center; width: 100%; }
.guide-board-unit img { display: block; width: 53px; height: 74px; object-fit: contain; border-radius: 3px; }
.guide-board-unit b { text-align: center; font-weight: 600; font-size: .62rem; line-height: 1.3; color: #c9eaff; }
.opponent-slot img { transform: rotate(180deg); }
.opponent-slot b { color: #ffbec4; }
.guide-site { display: grid; gap: 7px; justify-items: center; align-content: center; }
.guide-site > span:last-child { min-height: 2.6em; color: #d5deec; font-size: .65rem; line-height: 1.3; text-align: center; }
.guide-site-art { display: block; position: relative; width: 100%; aspect-ratio: 3.5 / 2.5; }
.guide-site-art > img { display: block; position: absolute; top: 50%; left: 50%; width: 71.4286%; height: 140%; object-fit: fill; transform: translate(-50%, -50%) rotate(90deg); }
.opponent-site .guide-site-art { transform: rotate(180deg); }
.guide-anatomy-layout { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(0, 1.1fr); gap: clamp(20px, 5vw, 80px); align-items: center; }
.guide-anatomy { text-align: center; }
.guide-anatomy-card { position: relative; width: min(100%, 330px); margin: 0 auto; }
.guide-anatomy-card > img { display: block; width: 100%; height: auto; }
.anatomy-pin { position: absolute; display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #fff0c2; border-radius: 50%; background: #162536; color: #fff0c2; box-shadow: 0 2px 8px #000b; font-size: .8rem; font-weight: 900; transform: translate(-50%, -50%); }
.pin-name { left: 2.5%; top: 10%; }
.pin-cost { left: 93%; top: 11%; }
.pin-alignment { left: 93%; top: 18%; }
.pin-traits { left: 8%; top: 22%; }
.pin-stats { left: 8%; top: 68%; }
.pin-ability { left: 8%; top: 75%; }
.pin-blackwake { left: 8%; top: 87%; border-color: #c7bdff; color: #e7e1ff; background: #30234c; }
.guide-anatomy-key { list-style: none; counter-reset: anatomy; display: grid; gap: 14px; padding: 0; margin: 0; }
.guide-anatomy-key li:last-child::before { border-color: #c7bdff; color: #e7e1ff; background: #30234c; }
.guide-anatomy-key li { counter-increment: anatomy; position: relative; padding-left: 43px; display: grid; gap: 5px; line-height: 1.5; }
.guide-anatomy-key li::before { content: counter(anatomy); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #c6a966; border-radius: 50%; color: #ffe5a3; font-weight: 800; }
.guide-anatomy-key li > span { color: #b8c4d5; font-size: .92rem; }
.guide-type-gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding-top: 24px; border-top: 1px solid #ffffff21; }
.guide-type-gallery figure { display: grid; grid-template-rows: 130px auto; gap: 10px; align-items: center; justify-items: center; padding: 12px 6px; background: #ffffff05; border-radius: 6px; }
.guide-type-gallery figure > img { height: 125px; max-width: 100%; object-fit: contain; }
.guide-type-gallery .guide-site-art { width: min(100%, 130px); }
.guide-type-gallery figcaption { display: grid; gap: 5px; text-align: center; line-height: 1.35; align-self: start; }
.guide-type-gallery figcaption strong { font-size: .88rem; }
.guide-type-gallery figcaption span { font-size: .75rem; color: #b8c4d5; }
.guide-planet-pair { position: relative; display: block; width: 100px; height: 130px; }
.guide-planet-pair img { position: absolute; width: 65px; height: 91px; object-fit: contain; top: 10px; left: 0; transform: rotate(-7deg); }
.guide-planet-pair img + img { top: 29px; left: 33px; transform: rotate(7deg); }
.combat-demo { padding: clamp(12px, 2vw, 22px); border: 1px solid #485569; border-radius: 10px; background: #090f18; }
.combat-scenario-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.combat-demo button { min-height: 44px; padding: 10px 14px; border: 1px solid #4e6177; border-radius: 6px; background: #172131; color: #d2ddea; font: inherit; font-size: .86rem; cursor: pointer; }
.combat-demo button:hover { background: #263b50; }
.combat-demo button:focus-visible, .rules-advanced summary:focus-visible { outline: 2px solid #f0c36a; outline-offset: 3px; }
.combat-demo button[aria-pressed="true"] { background: #59451f; color: #fff0c2; border-color: #f0c36a; }
.combat-step-controls { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.combat-step-controls button { display: grid; justify-items: center; align-content: center; gap: 6px; padding: 9px 4px; font-size: .75rem; }
.combat-step-controls button > span { font-size: .95rem; font-weight: 800; }
.combat-step-controls button { overflow-wrap: anywhere; line-height: 1.35; }
.combat-step-controls .combat-reaction-step { border-top: 3px solid #74d4ff; }
.combat-window-label { color: #d1dbe8; font-size: .75rem !important; font-weight: 800; margin-bottom: 8px !important; }
.combat-window-label.reaction-window-open { color: #98e1ff; }
.combat-reaction-example { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; margin-top: 18px; padding: 16px; border: 1px solid #5486a5; border-radius: 6px; background: #142a3b; }
.combat-reaction-example[hidden] { display: none; }
.combat-reaction-example > img { width: 88px; height: auto; }
.combat-reaction-example h4 { margin: 0 0 8px; color: #b4eaff; }
.combat-reaction-example p { font-size: .88rem; margin: 0 0 10px; }
.combat-reaction-example button[hidden] { display: none; }
.combat-reaction-example button:disabled { cursor: default; opacity: .7; }
.combat-stage-copy { max-width: 760px; min-height: 118px; margin: 22px auto 0; }
.combat-stage-copy h3 { margin: 0 0 8px; font-size: 1.2rem; }
.combat-stage-copy p { margin: 0; font-size: .94rem; }
.combat-table { position: relative; width: min(100%, 680px); height: 365px; margin: 0 auto; }
.combat-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.combat-attack-arrow, .combat-block-arrow { stroke: #f0c36a; stroke-width: 3; fill: none; }
.combat-block-arrow { stroke: #74d4ff; display: none; }
.combat-demo[data-scenario="blocked"]:not([data-step="0"]):not([data-step="1"]) .combat-block-arrow { display: block; }
.combat-demo[data-scenario="blocked"]:not([data-step="0"]):not([data-step="1"]) .combat-attack-arrow { opacity: .2; stroke-dasharray: 6 4; }
.combat-site-token { position: absolute; top: 0; left: 50%; width: 144px; max-width: 38%; transform: translateX(-50%); text-align: center; }
.combat-site-token strong { display: block; margin-top: 6px; font-size: .75rem; color: #ffe6a5; }
.combat-unit-token { position: absolute; top: 142px; width: 40%; max-width: 210px; display: grid; justify-items: center; gap: 5px; text-align: center; }
.combat-attacker { left: 0; }
.combat-defender { right: 0; }
.combat-unit-token > strong { font-size: .83rem; }
.combat-unit-token > span:not(.combat-owner) { color: #c0ccdf; font-size: .76rem; }
.combat-unit-art { width: 80px; height: 112px; position: relative; margin: 13px 0; }
.combat-unit-art img { width: 100%; height: 100%; object-fit: contain; }
.combat-wound-marker { position: absolute; right: -14px; top: -8px; display: grid; place-items: center; width: 27px; height: 27px; border: 2px solid #ffd3d3; border-radius: 50%; color: #fff; background: #a01f33; box-shadow: 0 2px 6px #0009; font-size: .85rem; font-weight: 900; }
.combat-wound-marker[hidden], .guide-print-only { display: none; }
.combat-attacker .combat-unit-art img { transform: rotate(90deg); }
.combat-demo[data-scenario="blocked"]:not([data-step="0"]):not([data-step="1"]) .combat-defender .combat-unit-art img { transform: rotate(90deg); }
.combat-owner { color: #9bdefb; font-size: .68rem; letter-spacing: .02em; }
.combat-attacker .combat-owner { color: #ffc7cd; }
.combat-status { display: inline-flex; justify-content: center; border: 1px solid #4a627c; border-radius: 4px; padding: 4px 6px; font-size: .7rem; color: #d2e6ff; }
.combat-demo[data-scenario="blocked"][data-step="4"] .combat-defender .combat-status,
.combat-demo[data-scenario="blocked"][data-step="5"] .combat-defender .combat-status,
.combat-demo[data-scenario="blocked"][data-step="6"] .combat-defender .combat-status { border-color: #e68b8b; color: #ffc3c3; }
.combat-demo[data-scenario="blocked"][data-step="5"] .combat-defender .combat-unit-art,
.combat-demo[data-scenario="blocked"][data-step="6"] .combat-defender .combat-unit-art { opacity: .35; }
.combat-demo figcaption { padding: 12px 14px; border-left: 3px solid #f0c36a; border-radius: 3px; background: #f0c36a12; color: #ffedbd; }
.combat-demo .guide-note { margin: 14px 0 0; color: #b4c4d9; font-size: .8rem; }
.combat-takeaways { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.combat-takeaways p { margin: 0; font-size: .9rem; }
.rules-advanced { padding: 14px; border: 1px solid #ffffff2c; border-radius: 6px; }
.rules-advanced summary { cursor: pointer; font-weight: 700; color: #bce7ff; line-height: 1.5; }
.rules-advanced > div { padding-top: 18px; display: grid; gap: 18px; }
.guide-advanced-section { display: grid; gap: 12px; }
@media (max-width: 980px) {
  .guide-type-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guide-tag { display: none; }
  .guide-scroll-hint { display: block; }
}
@media (max-width: 600px) {
  .guide-anatomy-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .guide-anatomy-card { width: 250px; max-width: 100%; }
  .guide-anatomy-key { gap: 15px; }
  .guide-type-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .combat-step-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .combat-stage-copy { min-height: 160px; }
  .combat-table { height: 350px; }
  .combat-unit-token { top: 134px; width: 43%; }
  .combat-unit-art { width: 66px; height: 93px; }
  .combat-unit-token > strong { font-size: .7rem; }
  .combat-unit-token > span:not(.combat-owner) { font-size: .7rem; }
  .combat-owner { font-size: .6rem; }
  .combat-takeaways { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media print {
  .guide-print-only { display: block; }
  .guide-scroll-hint, .combat-step-controls, .combat-scenario-controls { display: none; }
  .guide-board { min-width: 0; }
  .guide-board-scroll { overflow: visible; }
  .guide-figure, .guide-anatomy-layout, .guide-type-gallery { break-inside: avoid; }
  .combat-demo, .guide-board { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

.rules-hero {
  grid-template-columns: minmax(0, 1.04fr) minmax(290px, 0.96fr);
  align-items: center;
  min-height: 430px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(116, 212, 255, 0.16), transparent 42%),
    linear-gradient(315deg, rgba(209, 79, 109, 0.13), transparent 52%),
    linear-gradient(135deg, rgba(17, 22, 31, 0.9), rgba(9, 13, 22, 0.78));
}

.rules-hero h1 {
  max-width: 780px;
  font-size: clamp(2.8rem, 6.4vw, 5.8rem);
}

.rules-hero .section-copy p:last-child {
  max-width: 740px;
  color: #dbe5f4;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.rules-hero-art {
  min-height: 320px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
}

.rules-hero-art img {
  width: 132%;
  max-width: none;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.rules-hero-art img:nth-child(1) {
  transform: translateX(12%) rotate(-7deg);
}

.rules-hero-art img:nth-child(2) {
  position: relative;
  z-index: 2;
  transform: translateY(-18px) scale(1.06);
}

.rules-hero-art img:nth-child(3) {
  transform: translateX(-12%) rotate(7deg);
}

.rules-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.rules-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035)),
    rgba(10, 14, 23, 0.72);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.26);
}

.rules-card h2 {
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.05;
}

.rules-card h3 {
  color: var(--text);
}

.rules-card p,
.rules-list,
.summary-grid,
.rules-mini-list {
  color: var(--muted);
  line-height: 1.58;
}

.rules-card p:last-child,
.rules-list:last-child,
.summary-grid:last-child {
  margin-bottom: 0;
}

.rules-wide,
.attack-battle-card {
  grid-column: 1 / -1;
}

.rules-mini-list,
.phase-grid,
.compare-grid,
.summary-grid {
  display: grid;
  gap: 10px;
}

.rules-mini-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rules-mini-list span,
.phase-grid section,
.compare-grid section,
.summary-grid li {
  padding: 13px;
  border: 1px solid rgba(116, 212, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.rules-mini-list strong,
.rules-list strong,
.rules-card p strong {
  color: var(--text);
}

.rules-mini-list strong {
  display: block;
  margin-bottom: 4px;
}

.rules-list {
  display: grid;
  gap: 9px;
  padding-left: 1.15rem;
  margin: 0;
}

.rules-list.numbered {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style-position: inside;
  padding-left: 0;
}

.phase-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.phase-track span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.4rem 0.68rem;
  border: 1px solid rgba(240, 195, 106, 0.3);
  border-radius: 8px;
  color: #ffe7a8;
  background: rgba(240, 195, 106, 0.1);
  font-weight: 800;
  font-size: 0.92rem;
}

.phase-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.phase-grid p,
.compare-grid p {
  margin-bottom: 0;
}

.compare-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rules-callout {
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  color: #eef7ff;
  background: rgba(116, 212, 255, 0.12);
  font-weight: 900;
}

.quick-summary {
  background:
    linear-gradient(135deg, rgba(116, 212, 255, 0.13), transparent 42%),
    linear-gradient(315deg, rgba(240, 195, 106, 0.13), transparent 52%),
    rgba(10, 14, 23, 0.78);
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  margin: 0;
  list-style: none;
}

@media (max-width: 980px) {
  .rules-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .rules-hero-art {
    min-height: 250px;
    width: min(560px, 92%);
    margin: 0 auto;
  }

  .rules-guide-grid,
  .phase-grid,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .rules-shell {
    width: min(100vw - 22px, 1220px);
    padding-top: 72px;
  }

  .rules-hero {
    min-height: 0;
  }

  .rules-hero-art {
    min-height: 210px;
  }

  .rules-guide-grid,
  .rules-mini-list,
  .phase-grid,
  .compare-grid,
  .rules-list.numbered,
  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rules-page-tabs,
.rules-footer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rules-page-tabs { margin-top: 24px; }
.rules-page-tabs a { border: 1px solid rgba(116,212,255,.28); border-radius: 999px; padding: 9px 14px; color: #dbe5f4; background: rgba(255,255,255,.04); font-weight: 850; text-decoration: none; }
.rules-page-tabs a:hover, .rules-page-tabs a:focus-visible, .rules-page-tabs a.active { border-color: rgba(240,195,106,.58); color: #fff2c7; background: rgba(240,195,106,.12); }
.comprehensive-shell { width: min(1440px, calc(100vw - 38px)); }
.comprehensive-hero { min-height: 0; }
.comprehensive-hero h1 { max-width: 1040px; font-size: clamp(2.6rem,5.8vw,5.25rem); }
.rules-meta { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 18px; color: #aebacc; font-size: .88rem; }
.rules-meta strong { color: #eef7ff; }
.rules-originality-note { border-left: 3px solid rgba(240,195,106,.7); padding-left: 13px; }
.rules-tools { position: sticky; z-index: 30; top: 8px; display: grid; grid-template-columns: auto minmax(220px,1fr) auto; gap: 10px; padding: 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(8,12,20,.94); box-shadow: 0 12px 42px rgba(0,0,0,.34); backdrop-filter: blur(12px); }
.rules-tools button, .rules-tools input { min-height: 42px; border: 1px solid rgba(116,212,255,.28); border-radius: 7px; padding: 9px 12px; color: #eef7ff; background: rgba(255,255,255,.055); font: inherit; }
.rules-tools button { cursor: pointer; font-weight: 850; }
.rules-tools input:focus, .rules-tools button:focus-visible { border-color: #74d4ff; outline: 2px solid rgba(116,212,255,.16); }
.rules-search-wrap { display: grid; gap: 4px; }
.rules-search-wrap small { color: #91a0b5; font-size: .72rem; }
.comprehensive-layout { display: grid; grid-template-columns: minmax(220px,285px) minmax(0,1fr); gap: 22px; align-items: start; }
.rules-contents { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; border: 1px solid rgba(255,255,255,.13); border-radius: 9px; padding: 17px; background: rgba(10,14,23,.78); }
.rules-contents h2 { margin: 0 0 12px; font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; }
.rules-contents ol { display: grid; gap: 7px; padding-left: 1.25rem; margin: 0; }
.rules-contents a { color: #c6d6ea; text-decoration: none; }
.rules-contents a:hover, .rules-contents a:focus-visible { color: #74d4ff; text-decoration: underline; }
.rules-document { display: grid; gap: 17px; min-width: 0; }
.comprehensive-section { scroll-margin-top: 92px; border: 1px solid rgba(255,255,255,.13); border-radius: 9px; padding: clamp(18px,3vw,30px); background: linear-gradient(135deg,rgba(255,255,255,.055),rgba(255,255,255,.025)),rgba(8,12,20,.82); }
.section-heading { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: start; margin-bottom: 18px; }
.section-number { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid rgba(240,195,106,.43); border-radius: 50%; color: #ffe6a5; font-weight: 950; }
.section-heading h2 { margin: 0; font-size: clamp(1.55rem,3vw,2.4rem); }
.section-heading p { margin: 4px 0 0; color: #91a0b5; }
.rule-list { display: grid; gap: 3px; }
.comp-rule { scroll-margin-top: 92px; display: grid; grid-template-columns: 4.4rem minmax(0,1fr); gap: 12px; padding: 11px 5px; border-top: 1px solid rgba(255,255,255,.075); }
.comp-rule:first-child { border-top: 0; }
.rule-number { color: #74d4ff; font-weight: 900; font-variant-numeric: tabular-nums; }
.comp-rule p { margin: 0; color: #c7d2e2; line-height: 1.62; }
.comp-rule strong { color: #f2f7ff; }
.comp-rule[hidden], .comprehensive-section[hidden] { display: none; }
.rules-desktop-return { position: fixed; z-index: 100; top: 14px; left: 14px; border: 1px solid rgba(240,195,106,.44); border-radius: 7px; padding: 9px 13px; color: #fff0c5; background: rgba(8,12,20,.92); text-decoration: none; font-weight: 850; }
.desktop-rules-runtime .rules-shell { padding-top: 66px; }

@media (max-width: 900px) {
  .comprehensive-layout { grid-template-columns: minmax(0,1fr); }
  .rules-contents { position: static; display: none; max-height: none; }
  .rules-contents.contents-open { display: block; }
}

@media (max-width: 720px) {
  .comprehensive-shell { width: min(100vw - 22px,1220px); }
  .rules-tools { position: static; grid-template-columns: 1fr 1fr; }
  .rules-search-wrap { grid-column: 1 / -1; grid-row: 1; }
  .comp-rule { grid-template-columns: 3.7rem minmax(0,1fr); gap: 8px; }
  .rules-desktop-return { position: absolute; }
}

@media print {
  .m9-global-nav, [data-account-menu-root], .rules-tools, .rules-page-tabs, .rules-footer-actions, .rules-desktop-return, .landing-footer { display: none !important; }
  body, .landing-page { color: #111 !important; background: #fff !important; }
  .rules-shell, .comprehensive-shell { width: 100%; padding: 0; }
  .rules-hero, .comprehensive-section { break-inside: avoid; border-color: #bbb; color: #111; background: #fff; box-shadow: none; }
  .comprehensive-layout { display: block; }
  .rules-contents { display: none; }
  .comp-rule p, .section-heading p, .rules-hero .section-copy p { color: #222 !important; }
  .rule-number { color: #075b7d; }
}
