:root {
  --bg: #f7f1e8;
  --card: #fffaf2;
  --text: #2b2118;
  --muted: #6b5b4b;
  --primary: #c2562f;
  --accent: #e0a03a;
  --deep-rust: #973f24;
  --line: #ddcfbd;
  --radius: 12px;
  --title: "DM Serif Text", Georgia, serif;
  --body: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

p, li, summary, td, th, label, figcaption, .cover-description { font-family: var(--body); }

[hidden] { display: none !important; }
a { color: var(--deep-rust); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--deep-rust); outline-offset: 4px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--title); font-weight: 400; line-height: 1.15; }
h1 { margin: 0 0 24px; font-size: 48px; letter-spacing: -.025em; }
h2 { margin: 0 0 16px; font-size: 28px; }
h3 { margin: 24px 0 8px; font-size: 22px; }
p { max-width: 70ch; }
.wrap { max-width: 1168px; margin-inline: auto; padding-inline: 24px; }
.skip { position: absolute; top: 12px; left: 16px; z-index: 3; padding: 8px 12px; background: var(--card); transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; line-height: 1.2; }
.wordmark em { font-style: normal; color: var(--deep-rust); }
.wordmark-tile { display: grid; place-items: center; width: 32px; aspect-ratio: 1; border-radius: 8px; background: var(--deep-rust); color: var(--card); font-family: var(--title); font-size: 22px; }
.masthead nav { display: flex; align-items: center; gap: 24px; }
.masthead nav a { display: grid; align-items: center; min-height: 44px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.masthead nav a:hover { color: var(--deep-rust); text-decoration: underline; }

.play-section { padding-top: 32px; }
.stage {
  position: relative;
  height: clamp(420px, 44vw, 520px);
  overflow: hidden;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  isolation: isolate;
  background: var(--text);
}
.stage iframe { display: block; width: 100%; height: 100%; border: 0; }
.stage :focus-visible { outline-color: var(--accent); }
.stage:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; }
.cover, .stage-loader { position: absolute; inset: 0; }
.cover {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  align-items: center;
  gap: 32px;
  padding: 32px 48px;
  color: var(--card);
  background: var(--text);
}
.cover-rule { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: #efdfca; font: 700 14px/1.3 var(--body); letter-spacing: .12em; }
.cover-rule span:nth-child(2) { color: var(--accent); }
.cover-rule b { color: var(--accent); }
.cover-line { margin: 0; font: 400 clamp(36px, 5vw, 64px)/.98 var(--title); letter-spacing: -.025em; }
.cover-description { margin: 16px 0 24px; max-width: 32ch; color: #efdfca; }
.cover-mobile { margin: 12px 0 0; }
.cover-mobile a { color: #efdfca; }
.cover-preview { margin: 0; height: clamp(260px, 30vw, 378px); padding: 8px; overflow: hidden; border: 1px solid var(--muted); border-radius: var(--radius); background: var(--text); transform: rotate(-2deg); opacity: .93; box-shadow: 0 22px 44px -20px rgb(43 33 24 / .45); }
.cover-preview img { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 50% 29%; border-radius: 8px; }
.start-button, .primary, .action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
}
.start-button { min-height: 52px; padding: 12px 24px; background: var(--accent); color: var(--text); }
.start-button:hover { background: #f0bb63; }
.start-button span { font-size: 14px; }
.stage-loader { display: none; place-content: center; justify-items: center; color: var(--card); background: var(--text); text-align: center; }
.stage[data-gf-state="loading"] .stage-loader:not([hidden]) { display: grid; }
.stage-loader p { margin: 16px 0 0; }
.loader-tiles { display: flex; gap: 8px; }
.loader-tiles span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--card); color: var(--text); font: 400 28px/1 var(--title); animation: pass-letter 1.4s ease-in-out infinite; }
.loader-tiles span:nth-child(2) { animation-delay: .14s; }
.loader-tiles span:nth-child(3) { animation-delay: .28s; }
.loader-tiles span:nth-child(4) { animation-delay: .42s; }
@keyframes pass-letter { 28% { transform: translateY(-8px); background: var(--accent); } }

.player-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); align-items: center; }
.action { background: var(--card); color: var(--text); border-color: var(--line); font-size: 14px; }
.action:hover, .action[data-gf-liked] { border-color: var(--deep-rust); color: var(--deep-rust); }
.action[data-gf-liked] { background: #fbe5d6; }
.action-icon { color: var(--deep-rust); font-size: 18px; }
.fullscreen { margin-left: auto; }
.share-feedback { color: var(--muted); font-size: 14px; }
.share-feedback:empty, .count:empty { display: none; }

.reading-grid { display: grid; grid-template-columns: minmax(200px, 278px) minmax(0, 1fr); align-items: start; gap: 48px; margin: 64px 0; padding-top: 48px; border-top: 1px solid var(--line); }
.rule-card { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); padding: 24px; }
.rule-card h2 { font-size: 22px; }
.rule-card p { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.chain-example { display: grid; justify-items: start; gap: 4px; list-style: none; margin: 0; padding: 0; }
.chain-example li { display: flex; align-items: center; gap: 8px; color: var(--text); font: 700 16px/1 var(--body); }
.chain-example li + li::before { content: "↓"; position: absolute; transform: translateX(-18px); color: var(--deep-rust); }
.chain-example li:nth-child(2) { margin-left: 16px; }
.chain-example li:nth-child(3) { margin-left: 32px; }
.chain-example strong { padding: 8px; border-radius: 4px; background: #f3dba9; }
.guide-copy { min-width: 0; }
.guide-page { max-width: 72ch; margin: 32px auto 64px; }
.guide-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 20px; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.guide-breadcrumb li + li::before { content: "/"; margin-inline-end: 8px; }
.guide-article td { overflow-wrap: anywhere; }
.guide-copy.guide-article tbody td:first-child { width: auto; font: inherit; }
.guide-copy h2:not(:first-child) { margin-top: 32px; }
.guide-copy p, .guide-copy ul, .guide-copy ol { margin: 0 0 16px; }
.guide-copy li + li { margin-top: 8px; }
.guide-copy blockquote { margin: 0 0 24px; padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 8px 8px 0; }
.guide-copy blockquote p { margin: 0; }
.guide-copy table { width: 100%; margin: 0 0 28px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.guide-copy thead th { padding: 8px 12px; border-bottom: 2px solid var(--text); text-align: left; font: 700 12px/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.guide-copy tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guide-copy tbody td:first-child { width: 3.5rem; font: 400 20px/1.2 var(--title); color: var(--deep-rust); }
.guide-copy tbody tr:last-child td { border-bottom: 0; }
.guide-copy ul, .guide-copy ol { padding-left: 22px; }
.guide-copy ol li { line-height: 1.75; margin-bottom: 6px; }
.guide-copy p { line-height: 1.72; margin: 0 0 20px; }
.guide-copy h2 { margin: 44px 0 14px; }
.guide-copy h3 { margin: 28px 0 8px; }
.masthead nav { display: flex; gap: 4px; }
.masthead nav a { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600; transition: background-color 180ms ease, color 180ms ease; }
.masthead nav a:hover { background: var(--line); color: var(--text); }
.rule-card { background: var(--card); box-shadow: 0 14px 30px -22px rgb(43 33 24 / .45); }
.masthead nav a { white-space: nowrap; }
.wordmark { white-space: nowrap; }
.cover-copy .start-button { margin-top: 22px; }
.guide-copy h2 { padding-top: 20px; border-top: 1px solid var(--line); }
.guide-copy h3 + p, .guide-copy h2 + p { margin-top: 0; }
.not-found { padding: 88px 0 72px; max-width: 640px; }
.not-found .eyebrow { margin: 0 0 14px; font: 700 12px/1.3 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--deep-rust); }
.not-found h1 { margin: 0 0 16px; font-size: clamp(32px, 5vw, 46px); }
.not-found-lede { margin: 0 0 28px; color: var(--muted); font-size: 17px; }
.not-found .start-button { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.not-found-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 44px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); font-size: 15px; }
.not-found-links li { margin: 0; }

.faq-section, .discussion { max-width: 780px; margin: 0 auto 64px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { padding: 16px 8px; cursor: pointer; font-weight: 700; }
.faq-list summary:hover { color: var(--deep-rust); }
.faq-list summary::marker { color: var(--deep-rust); }
.faq-list p { margin: 0; padding: 0 8px 16px 24px; }
.discussion { border: 1px solid var(--line); padding: 24px; border-radius: var(--radius); background: var(--card); }
.discussion h2 { margin-bottom: 8px; }
.discussion p { margin-top: 0; }
.comment-form { display: grid; gap: 16px; }
.comment-form label { display: block; margin-bottom: 4px; color: var(--text); font-size: 14px; font-weight: 600; }
.comment-form label span { color: var(--muted); font-weight: 400; }
.comment-form input, .comment-form textarea { display: block; width: 100%; padding: 8px 12px; border: 1px solid #a89682; border-radius: 8px; background: #fff; color: var(--text); }
.comment-form input { max-width: 320px; }
.comment-form textarea { resize: vertical; }
.comment-submit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.primary { color: white; background: var(--deep-rust); }
.primary:hover { background: #78321b; }
.comment-list[data-gf-empty]::before { content: "No comments yet."; display: block; color: var(--muted); margin-top: 16px; }
.comment { padding: 16px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.comment:first-of-type { margin-top: 24px; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-meta time, .reply-name { color: var(--muted); font-size: 14px; }
.comment[data-gf-owner] { border-top-color: var(--deep-rust); }
.owner { color: var(--deep-rust); font-size: 12px; font-weight: 700; }
.replies { padding-left: 16px; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--deep-rust); text-decoration: underline; text-underline-offset: 4px; }
.count { font: 600 14px/1.2 var(--body); color: var(--muted); }

.legal-copy { max-width: 70ch; min-height: 65vh; margin: 48px auto 64px; }
.legal-copy h2 { margin-top: 32px; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 88px; padding-block: 12px; flex-wrap: wrap; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 16px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }

@media (max-width: 800px) {
  .cover { padding: 24px 32px; gap: 24px; }
  .reading-grid { gap: 24px; }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .masthead nav { gap: 12px; }
  .masthead-inner, .footer-inner { gap: 8px; }
  .masthead-inner { min-height: 56px; }
  h1 { font-size: 32px; margin-bottom: 16px; }
  .play-section { padding-top: 24px; }
  .stage { height: clamp(460px, 115vw, 565px); }
  .cover { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 16px; padding: 20px; }
  .cover-rule { margin-bottom: 12px; }
  .cover-line { font-size: 36px; }
  .cover-description { margin: 8px 0 12px; }
  .cover-preview { justify-self: center; align-self: stretch; width: 100%; max-width: 360px; height: auto; max-height: 232px; min-height: 0; transform: none; box-shadow: none; }
  .cover-preview img { object-position: 50% 22%; }
  .player-bar { margin-top: 22px; padding-top: 14px; }
  .action { background: transparent; }
  .guide-copy table { font-size: 14px; }
  .guide-copy thead th, .guide-copy tbody td { padding: 8px 6px; }
  .masthead-inner { gap: 8px; }
  .wordmark { font-size: 14px; gap: 6px; }
  .wordmark-tile { width: 26px; border-radius: 6px; }
  .masthead nav { gap: 2px; }
  .masthead nav a { padding: 6px 8px; font-size: 13px; }
  .play-section h1 { font-size: clamp(30px, 8.4vw, 40px); margin-bottom: 18px; }
  .start-button, .primary { width: 100%; }
  .player-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .action { padding-inline: 4px; }
  .fullscreen { margin-left: 0; }
  .share-feedback { grid-column: 1 / -1; }
  .reading-grid { grid-template-columns: minmax(0, 1fr); margin: 48px 0; padding-top: 32px; }
  .faq-section, .discussion { margin-bottom: 48px; }
  .discussion { padding: 16px; }
}
@media (max-width: 350px) {
  .masthead-inner { flex-wrap: wrap; gap: 0 8px; }
  .masthead nav { flex-wrap: wrap; gap: 0 4px; }
  .guide-article th { overflow-wrap: anywhere; }
  .wordmark, .masthead nav a { font-size: 13px; }
  .wordmark-tile { width: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .loader-tiles span { animation: none; }
}
