/* ============================================================
   Game Rules — a clean, friendly rulebook look. Each game sets
   --accent / --accent-2 on <main> for its own colour.
   ============================================================ */
:root {
  --bg: #f5f1ea;
  --paper: #fffdf9;
  --ink: #1f2a37;
  --muted: #5d6877;
  --line: #e6dfd3;
  --accent: #2f7d6d;
  --accent-2: #e07a5f;
  --soft: #eef6f3;
  --shadow: 0 1px 0 rgba(31,42,55,0.04), 0 8px 24px rgba(31,42,55,0.07);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --sans: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0; }
b, strong { font-weight: 650; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: rgba(31,42,55,0.96); color: #fff; backdrop-filter: blur(8px); }
.brand { font-family: var(--display); font-weight: 800; font-size: 20px; color: #fff; text-decoration: none; white-space: nowrap; }
.brand span { color: #ffcf70; }
.gamenav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.gamenav::-webkit-scrollbar { display: none; }
.gamenav a { color: #cfd6df; text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.gamenav a.on, .gamenav a:hover { background: rgba(255,255,255,0.12); color: #fff; }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 60px; }
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 16px 40px; max-width: 720px; margin: 0 auto; }

/* ---------- hub ---------- */
.hub-hero { padding: 48px 0 24px; }
.hub-hero h1 { font-size: clamp(38px, 7vw, 64px); font-weight: 800; letter-spacing: -0.02em; }
.hub-hero h1 em { font-style: normal; color: var(--accent-2); }
.hub-hero p { font-size: 19px; color: var(--muted); max-width: 640px; margin: 12px 0 0; }
.hub-how { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.hub-how span { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; }
.gamegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 28px; }
.gamecard { background: var(--paper); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: transform 0.15s, box-shadow 0.15s; }
.gamecard:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(31,42,55,0.13); }
.gamecard .art { aspect-ratio: 16/9; background: #ddd center/cover; position: relative; }
.gamecard .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,0.35)); }
.gamecard .body { padding: 16px 18px 18px; border-top: 5px solid var(--c); }
.gamecard h3 { font-size: 24px; }
.gamecard p { margin: 4px 0 10px; color: var(--muted); font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta span { font-size: 12.5px; font-weight: 600; background: var(--bg); border-radius: 999px; padding: 3px 10px; color: var(--ink); }
.gamecard.soon { opacity: 0.6; pointer-events: none; }

/* ---------- game page ---------- */
.ghero { margin: 20px 0 0; border-radius: 24px; overflow: hidden; position: relative; min-height: 260px; background: #333 center/cover; display: flex; align-items: flex-end; box-shadow: var(--shadow); }
.ghero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 20%, rgba(10,14,20,0.82)); }
.ghero .in { position: relative; padding: 24px; color: #fff; width: 100%; }
.ghero h1 { font-size: clamp(36px, 7vw, 60px); font-weight: 800; letter-spacing: -0.02em; }
.ghero p { margin: 6px 0 12px; font-size: 18px; max-width: 620px; opacity: 0.92; }
.ghero .meta span { background: rgba(255,255,255,0.16); color: #fff; backdrop-filter: blur(4px); }

.tabs { position: sticky; top: 52px; z-index: 10; display: flex; gap: 6px; margin: 16px 0 6px; padding: 6px; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); }
.tab { flex: 1; border: none; background: none; padding: 12px 8px; border-radius: 11px; font-weight: 700; font-size: 15px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; }
.tab .n { font-family: var(--display); font-size: 18px; }
.tab.on { background: var(--accent); color: #fff; }
@media (max-width: 520px) { .tab { font-size: 13px; flex-direction: column; gap: 2px; padding: 9px 4px; } }

.panel { animation: in 0.3s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
.sec { margin: 34px 0 0; }
.sec > h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.sec > h2 .ic { font-size: 0.9em; }
.lead { font-size: 18px; color: #39434f; max-width: 760px; }
.prose { font-size: 16.5px; max-width: 780px; }
.prose p { margin: 0 0 10px; }

.figure { background: var(--paper); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); margin: 16px 0; }
.figure img { width: 100%; }
.figure figcaption { padding: 12px 16px; font-size: 14.5px; color: var(--muted); }
.figrow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; }
.figrow .figure { margin: 0; }
@media (max-width: 760px) { .figrow { grid-template-columns: 1fr; } }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 14px 0; }
.card { background: var(--paper); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--cc, var(--accent)); }
.card .vis { min-height: 70px; display: flex; align-items: center; justify-content: center; background: var(--soft); border-radius: 12px; padding: 10px; }
.card .vis img { border-radius: 10px; }
.card h4 { font-size: 18px; }
.card p { margin: 0; font-size: 15px; color: #39434f; }
.card .tag { align-self: flex-start; font-size: 12px; font-weight: 700; background: var(--bg); padding: 2px 9px; border-radius: 999px; color: var(--muted); }

/* numbered steps (turn tab) */
.steps { counter-reset: st; display: flex; flex-direction: column; gap: 14px; margin: 14px 0; }
.step { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); padding: 18px 18px 18px 74px; position: relative; }
.step::before { counter-increment: st; content: counter(st); position: absolute; left: 18px; top: 18px; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; font-family: var(--display); font-weight: 800; font-size: 22px; display: grid; place-items: center; }
.step h3 { font-size: 21px; }
.step .sub { color: var(--muted); font-size: 14.5px; margin: 2px 0 8px; }
.step p { margin: 6px 0; }
.step .stepart { margin-top: 12px; }
.step ul { margin: 6px 0; padding-left: 20px; }
.step li { margin: 3px 0; }
@media (max-width: 520px) { .step { padding: 64px 16px 16px; } .step::before { top: 14px; left: 16px; } }

.check { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.step.done { opacity: 0.55; }
.turnbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 16px; margin: 16px 0 0; }
.turnbar b { font-family: var(--display); font-size: 17px; }
.turnbar button { margin-left: auto; border: none; background: #ffcf70; color: var(--ink); font-weight: 700; padding: 8px 14px; border-radius: 10px; }

/* actions list */
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 10px 0; }
.act { display: flex; gap: 12px; align-items: flex-start; background: var(--soft); border-radius: 14px; padding: 12px; }
.act .ai { flex-shrink: 0; width: 48px; height: 48px; border-radius: 12px; background: #fff; display: grid; place-items: center; font-size: 24px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.act .ai svg { width: 40px; height: 40px; }
.act h4 { font-size: 16px; }
.act p { margin: 2px 0 0; font-size: 14px; color: #39434f; }
.act .cost { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--accent-2); }

.callout { border-radius: 16px; padding: 14px 16px 14px 52px; position: relative; margin: 14px 0; font-size: 15.5px; max-width: 820px; }
.callout::before { position: absolute; left: 16px; top: 13px; font-size: 22px; }
.callout.tip { background: #eaf6ee; } .callout.tip::before { content: '💡'; }
.callout.warn { background: #fdecea; } .callout.warn::before { content: '⚠️'; }
.callout.win { background: #fff6dc; } .callout.win::before { content: '🏆'; }
.callout.info { background: #e9f1fb; } .callout.info::before { content: 'ℹ️'; }

.tbl { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); margin: 12px 0; font-size: 15px; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { background: var(--ink); color: #fff; font-weight: 600; }
.tbl tr:last-child td { border-bottom: none; }

.faq details { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); margin: 8px 0; }
.faq summary { padding: 14px 16px; font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: '+'; font-size: 20px; color: var(--accent); }
.faq details[open] summary::after { content: '–'; }
.faq details > div { padding: 0 16px 14px; color: #39434f; }

.svgrow { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; }
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.glossary div { background: var(--paper); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 14.5px; }
.glossary b { display: block; font-family: var(--display); font-size: 16px; }

.nextbar { display: flex; justify-content: space-between; gap: 10px; margin: 36px 0 0; }
.nextbar a { flex: 1; text-decoration: none; background: var(--paper); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); font-weight: 700; color: var(--ink); }
.nextbar a span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.nextbar a.r { text-align: right; }
