:root {
  color-scheme: dark;
  --gold: #d4a653;
  --cream: #efe0bd;
  --poster: "Copperplate Gothic Bold", "Copperplate Gothic", Georgia, serif;
  --story: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  background: #0e0a0f;
  color: var(--cream);
  font-family: var(--story);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 122px; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 50% -8%, #563951 0, #251822 30%, #0d090e 72%); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.rules-header { position: sticky; z-index: 20; top: 0; min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px clamp(18px, 5vw, 72px); border-bottom: 1px solid #80663e; background: #100b11f2; box-shadow: 0 7px 18px #0009; backdrop-filter: blur(12px); }
.rules-logo { display: grid; font-family: var(--poster); line-height: .78; filter: drop-shadow(0 3px 3px #000); }
.rules-logo span { color: #c7a261; font-size: 9px; letter-spacing: .08em; }
.rules-logo strong { color: #f0d598; font-size: 24px; }
.rules-header nav { display: flex; gap: 7px; }
.rules-header nav a { padding: 8px 11px; border: 1px solid #6f5943; border-radius: 5px; color: #d6bd8c; font: 800 8px var(--poster); letter-spacing: .08em; }
.rules-header nav a:hover { border-color: var(--gold); }
.rules-header nav .play-link { background: #4c282a; }
.chapter-nav { position: sticky; z-index: 18; top: 67px; display: flex; justify-content: center; gap: 2px; overflow-x: auto; padding: 6px 12px; border-bottom: 1px solid #5e4935; background: #1a1219ed; }
.chapter-nav a { flex: 0 0 auto; padding: 6px 10px; color: #a99a82; font: 800 7px var(--poster); letter-spacing: .08em; }
.chapter-nav a:hover { color: #efcf8d; }
.rules-page { width: min(1180px, calc(100% - 26px)); margin: 24px auto 60px; }

.rules-hero { min-height: 460px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); align-items: center; gap: 20px; overflow: hidden; padding: clamp(28px, 5vw, 64px); border: 2px solid #a8753c; border-radius: 15px; background: radial-gradient(circle at 82% 44%, #b2834d35, transparent 28%), linear-gradient(135deg, #4b2e45, #21131d 60%, #0f0b0f); box-shadow: inset 0 0 0 4px #130d13, inset 0 0 0 5px #8a653d55, 0 20px 40px #000b; }
.hero-copy small, .section-heading small, .example-copy > small, .year-example small, .event-example > small { color: #c3a46d; font: 800 8px var(--poster); letter-spacing: .17em; }
.hero-copy h1 { margin: 10px 0 20px; color: #f0d89f; font: 800 clamp(34px, 5.3vw, 68px)/.98 var(--poster); letter-spacing: -.035em; text-shadow: 0 3px #65401f, 0 7px 12px #000; }
.hero-copy h1 em { color: #dca854; font-style: normal; }
.hero-copy > p { max-width: 640px; color: #cbbca3; font-size: clamp(14px, 1.5vw, 18px); line-height: 1.55; }
.hero-copy > p strong { color: #efcd84; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.hero-facts span { display: flex; align-items: baseline; gap: 6px; padding: 7px 10px; border: 1px solid #76593c; border-radius: 5px; background: #181117aa; color: #a89a85; font: 800 7px var(--poster); letter-spacing: .08em; }
.hero-facts b { color: #e0b868; font-size: 15px; }
.hero-cards { position: relative; min-height: 365px; }
.hero-cards img { position: absolute; bottom: 0; width: min(43%, 190px); filter: drop-shadow(0 19px 15px #000d); }
.hero-cards img:first-child { left: 15%; rotate: -9deg; }
.hero-cards img:last-child { right: 11%; bottom: 10px; rotate: 8deg; }

.resource-legend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 10px 0 28px; }
.resource-legend article { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border: 1px solid #604b37; border-radius: 7px; background: #1d151c; }
.resource-legend img { width: 38px; height: 38px; flex: 0 0 38px; object-fit: contain; }
.resource-legend span { min-width: 0; display: grid; gap: 2px; }
.resource-legend b { color: #e5c27c; font: 800 8px var(--poster); letter-spacing: .06em; }
.resource-legend small { color: #938875; font-size: 9px; }

.rule-section { margin: 27px 0; padding: clamp(22px, 4vw, 44px); border: 1px solid #785c3b; border-radius: 13px; background: linear-gradient(145deg, #2d202c, #171117 72%); box-shadow: inset 0 0 0 3px #0e0a0e, inset 0 0 28px #714b3515, 0 14px 28px #0008; }
.section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 23px; }
.section-heading > span { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 48px; border: 1px solid #a8783c; border-radius: 50%; background: #171017; color: #d6a653; font: 800 15px var(--poster); box-shadow: inset 0 0 0 3px #36222d; }
.section-heading h2 { margin: 3px 0 0; color: #efd39a; font: 800 clamp(24px, 3.4vw, 39px) var(--poster); letter-spacing: -.025em; }
.section-heading.compact { margin-bottom: 17px; }
.section-intro { max-width: 930px; margin: -4px 0 22px; color: #c2b49c; font-size: 14px; line-height: 1.55; }
.section-intro b { color: #e4bd72; }

.setup-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 17px; }
.numbered-rules { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: setup; }
.numbered-rules li { counter-increment: setup; display: grid; grid-template-columns: 32px 145px 1fr; align-items: center; gap: 10px; padding: 10px; border: 1px solid #584638; border-radius: 7px; background: #191319; }
.numbered-rules li::before { content: counter(setup); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #9b6a30; color: #1b1015; font-weight: 900; }
.numbered-rules b { color: #ddbd7f; font: 800 10px var(--poster); }
.numbered-rules span { color: #ada18f; font-size: 12px; line-height: 1.4; }
.capacity-card { padding: 17px; border: 1px solid #a4763d; border-radius: 8px; background: linear-gradient(145deg, #4a2a35, #21151d); }
.capacity-card > small { color: #c2a369; font: 800 7px var(--poster); letter-spacing: .13em; }
.capacity-card h3 { margin: 6px 0 13px; color: #ead09b; font: 800 17px var(--poster); }
.capacity-card > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.capacity-card > div span { display: grid; gap: 2px; padding: 8px 4px; border: 1px solid #6f553c; border-radius: 5px; background: #171117; text-align: center; }
.capacity-card b { color: #e0ac51; font-size: 22px; }
.capacity-card span { color: #a9977d; font: 800 7px var(--poster); }
.capacity-card em { color: #b8b094; font-size: 9px; font-style: normal; }
.capacity-card p { color: #aa9f8d; font-size: 11px; line-height: 1.45; }

.action-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; }
.action-flow > strong { color: #b37e3a; font-size: 35px; }
.action-flow article { position: relative; min-height: 118px; display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 12px; padding: 12px; border: 1px solid #65503c; border-radius: 8px; background: #191319; }
.action-flow article > i { position: absolute; left: 5px; top: 5px; width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: #a97533; color: #171017; font: normal 900 9px sans-serif; }
.action-flow img { width: 70px; max-height: 93px; object-fit: contain; filter: drop-shadow(0 6px 4px #000a); }
.action-flow b { color: #e3bf77; font: 800 10px var(--poster); letter-spacing: .08em; }
.action-flow p { margin: 5px 0 0; color: #a89d8c; font-size: 11px; line-height: 1.4; }
.golden-rule, .limit-rule { display: flex; align-items: center; gap: 12px; margin: 16px 0 10px; padding: 12px 15px; border: 1px solid #bb843b; border-radius: 6px; background: #3a2327; }
.golden-rule b, .limit-rule b { flex: 0 0 auto; color: #f0c66c; font: 800 10px var(--poster); }
.golden-rule span, .limit-rule span { color: #c2b39b; font-size: 12px; }

details { margin-top: 9px; border: 1px solid #544438; border-radius: 6px; background: #171217; }
summary { padding: 11px 13px; color: #d2b477; font: 800 9px var(--poster); letter-spacing: .04em; cursor: pointer; }
details > p, details > div { margin: 0; padding: 0 14px 13px; color: #aaa08f; font-size: 12px; line-height: 1.5; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-columns p { margin: 0; padding: 9px; border: 1px solid #4d4037; border-radius: 5px; }
.detail-columns b { color: #d8b673; }

.zone-rules-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.zone-rules-grid article { min-width: 0; display: grid; align-content: start; justify-items: center; padding: 12px 9px; border: 1px solid #5e4937; border-radius: 8px; background: #181218; text-align: center; }
.zone-rules-grid img { width: 70px; height: 70px; object-fit: contain; filter: drop-shadow(0 6px 5px #000a); }
.zone-rules-grid h3 { margin: 8px 0 7px; color: #e0bd76; font: 800 10px var(--poster); }
.zone-rules-grid p { margin: 0; color: #b4aa98; font-size: 10px; line-height: 1.45; }
.zone-rules-grid p b { color: #ddc089; }
.zone-rules-grid small { align-self: end; margin-top: 10px; color: #81b591; font: 800 6px var(--poster); line-height: 1.35; }

.token-layout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 11px; }
.token-bag { padding: 14px; border: 1px solid #65503b; border-radius: 8px; background: #181218; }
.token-bag h3 { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 12px; color: #dfbd7c; font: 800 10px var(--poster); }
.token-bag h3 em { color: #8fa68d; font-size: 7px; font-style: normal; }
.token-bag > div { display: flex; justify-content: space-around; gap: 6px; }
.token-bag > div span { min-width: 0; display: grid; justify-items: center; gap: 4px; color: #aaa08d; font: 800 6px var(--poster); }
.token-bag img { width: 45px; height: 45px; object-fit: contain; }
.token-bag p { margin: 10px 0 0; color: #998f80; font-size: 10px; text-align: center; }

.production-example { display: grid; grid-template-columns: minmax(300px, .95fr) minmax(0, 1.05fr); align-items: center; gap: 20px; }
.production-card-real { width: 100%; filter: drop-shadow(0 13px 10px #000b); }
.example-copy h3 { margin: 6px 0 13px; color: #e7c88e; font: 800 22px var(--poster); }
.cast-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cast-comparison article { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 8px; padding: 8px; border: 1px solid #554337; border-radius: 6px; background: #171217; }
.cast-comparison img { width: 62px; max-height: 97px; object-fit: contain; }
.cast-comparison p { margin: 0; color: #a9a08f; font-size: 10px; line-height: 1.4; }
.cast-comparison b { color: #dabe82; }
.cast-comparison strong { color: #d27d5f; }
.example-result { padding: 11px; border: 1px solid #765b3e; border-radius: 6px; background: #33202a; color: #bdb09a; font-size: 12px; line-height: 1.45; }
.example-result b { color: #efc874; }
.compact-rules { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 18px 0 0; padding: 0; list-style: none; }
.compact-rules li { padding: 8px; border: 1px solid #4e4036; border-radius: 5px; background: #171217; color: #a49b8d; font-size: 9px; line-height: 1.35; text-align: center; }

.chaos-formula { display: grid; grid-template-columns: repeat(7, auto); align-items: center; justify-content: center; gap: 10px; }
.chaos-formula > div { min-width: 125px; display: flex; align-items: center; gap: 6px; padding: 10px; border: 1px solid #6c4d3a; border-radius: 7px; background: #1a1318; }
.chaos-formula img { width: 38px; height: 38px; object-fit: contain; }
.chaos-formula b { color: #dfb877; font: 800 8px var(--poster); }
.chaos-formula > strong { color: #b4773d; font-size: 22px; }
.hype-save { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid #7e6840; border-radius: 7px; background: #282036; }
.hype-save img { width: 51px; height: 51px; flex: 0 0 51px; object-fit: contain; }
.hype-save p { margin: 0; color: #bcb09d; font-size: 12px; line-height: 1.5; }
.hype-save b { color: #e4c17e; }

.year-example { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 20px; }
.year-example > img { width: 170px; filter: drop-shadow(0 11px 8px #000b); }
.year-example h3 { margin: 6px 0 12px; color: #e5c585; font: 800 22px var(--poster); }
.year-example ol { display: grid; gap: 8px; margin: 0; padding-left: 19px; color: #aaa18f; font-size: 12px; }
.year-example b { color: #d9b878; }
.event-example { margin-top: 18px; padding: 14px; border: 1px solid #7b5a3c; border-radius: 8px; background: #1a1419; }
.event-example > small { display: block; margin-bottom: 4px; }
.event-example p { display: inline-block; width: calc(50% - 5px); margin: 9px 0; color: #b8ae9c; font-size: 12px; }
.event-example p strong { color: #e8bc67; font-size: 17px; }
.event-example > div { display: flex; gap: 7px; }
.event-example > div span { flex: 1; padding: 8px; border: 1px solid #5d4c3d; border-radius: 5px; color: #9e9586; font-size: 11px; }
.event-example > div b { color: #e0b663; font: 800 10px var(--poster); }
.all-years-title { margin: 26px 0 10px; color: #d9b773; font: 800 11px var(--poster); letter-spacing: .1em; }
.year-card-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.year-card-grid article { min-width: 0; display: grid; align-content: start; padding: 6px; border: 1px solid #554438; border-radius: 6px; background: #171217; }
.year-card-grid img { width: 100%; filter: drop-shadow(0 5px 4px #0009); transition: transform .15s ease; }
.year-card-grid a:hover img { transform: translateY(-3px); }
.year-card-grid p { display: grid; gap: 3px; margin: 7px 2px 2px; }
.year-card-grid b { color: #d8b675; font: 800 6px var(--poster); line-height: 1.3; }
.year-card-grid span { color: #958c7e; font-size: 8px; line-height: 1.35; }

.end-year-flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: endyear; }
.end-year-flow li { counter-increment: endyear; position: relative; min-height: 102px; display: grid; align-content: center; gap: 5px; padding: 13px; border: 1px solid #5d4938; border-radius: 7px; background: #181218; }
.end-year-flow li::before { content: counter(endyear); position: absolute; right: 7px; top: 4px; color: #a2763e; font: 800 19px var(--poster); opacity: .4; }
.end-year-flow b { color: #deb975; font: 800 8px var(--poster); }
.end-year-flow span { color: #9e9586; font-size: 10px; line-height: 1.35; }
.salary-example { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.salary-example > div { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 10px; padding: 9px; border: 1px solid #614a38; border-radius: 7px; background: #1a1419; }
.salary-example img { width: 72px; max-height: 108px; object-fit: contain; }
.salary-example p { display: grid; gap: 3px; margin: 0; }
.salary-example b { color: #ddba7a; font: 800 10px var(--poster); }
.salary-example span { color: #9f9789; font-size: 10px; }

.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.score-grid article { min-height: 190px; display: grid; align-content: center; justify-items: center; gap: 7px; padding: 14px; border: 1px solid #5d4938; border-radius: 8px; background: #181218; text-align: center; }
.score-grid article > img { width: 75px; height: 75px; object-fit: contain; }
.score-grid b { color: #dfba71; font: 800 10px var(--poster); }
.score-grid p { margin: 0; color: #aaa08f; font-size: 11px; line-height: 1.5; }
.production-fan { position: relative; width: 130px; height: 88px; }
.production-fan img { position: absolute; top: 5px; width: 105px; filter: drop-shadow(0 5px 4px #000a); }
.production-fan img:first-child { left: 0; rotate: -6deg; }
.production-fan img:last-child { right: 0; rotate: 6deg; }
.final-example { display: flex; gap: 12px; margin-top: 11px; padding: 12px 15px; border: 1px solid #936a36; border-radius: 6px; background: #3a2327; }
.final-example b { color: #f0c66d; font: 800 9px var(--poster); }
.final-example span { color: #bcb19e; font-size: 12px; }
.final-example strong { color: #edc876; }
.tie-break { color: #978e80; font-size: 11px; text-align: center; }
.rules-footer { display: flex; justify-content: center; gap: 8px; padding: 18px 0; }
.rules-footer a { padding: 11px 16px; border: 1px solid #70543a; border-radius: 6px; color: #bba989; font: 800 8px var(--poster); letter-spacing: .08em; }
.rules-footer .footer-play { border-color: #bf8438; background: #8c5127; color: #1a1015; }

@media (max-width: 900px) {
  .resource-legend { grid-template-columns: repeat(3, 1fr); }
  .setup-grid, .production-example { grid-template-columns: 1fr; }
  .zone-rules-grid { grid-template-columns: repeat(3, 1fr); }
  .year-card-grid { grid-template-columns: repeat(4, 1fr); }
  .compact-rules { grid-template-columns: repeat(3, 1fr); }
  .chaos-formula { grid-template-columns: 1fr auto 1fr; }
  .chaos-formula > div { min-width: 0; }
  .end-year-flow { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  html { scroll-padding-top: 105px; }
  .rules-header { min-height: 60px; }
  .rules-logo strong { font-size: 19px; }
  .chapter-nav { top: 60px; justify-content: flex-start; }
  .rules-hero { grid-template-columns: 1fr; min-height: 0; padding: 28px 22px; }
  .hero-cards { min-height: 275px; }
  .hero-cards img { width: 145px; }
  .resource-legend { grid-template-columns: 1fr 1fr; }
  .rule-section { padding: 22px 15px; }
  .numbered-rules li { grid-template-columns: 30px 1fr; }
  .numbered-rules li span { grid-column: 2; }
  .action-flow { grid-template-columns: 1fr; }
  .action-flow > strong { rotate: 90deg; text-align: center; }
  .zone-rules-grid { grid-template-columns: 1fr 1fr; }
  .token-layout, .cast-comparison, .salary-example, .score-grid { grid-template-columns: 1fr; }
  .detail-columns { grid-template-columns: 1fr; }
  .golden-rule, .limit-rule, .final-example { align-items: flex-start; flex-direction: column; }
  .compact-rules { grid-template-columns: 1fr 1fr; }
  .year-example { grid-template-columns: 120px 1fr; }
  .year-example > img { width: 115px; }
  .event-example p { display: block; width: 100%; }
  .year-card-grid { grid-template-columns: repeat(2, 1fr); }
  .end-year-flow { grid-template-columns: 1fr 1fr; }
  .chaos-formula { grid-template-columns: 1fr; }
  .chaos-formula > strong { rotate: 90deg; text-align: center; }
}
