@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(/fonts/playfair.woff2) format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap; src: url(/fonts/playfair-italic.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(/fonts/sourcesans3.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: italic; font-weight: 200 900; font-display: swap; src: url(/fonts/sourcesans3-italic.woff2) format('woff2'); }

:root {
  --amber-50: #fffbeb;
  --orange-50: #fff7ed;
  --red-50: #fef2f2;
  --amber-100: #fef3c7;
  --orange-100: #ffedd5;
  --title: #78350f;
  --sub: #b45309;
  --accent: #ea580c;
  --accent-dark: #c2410c;
  --text: #3a2618;
  --muted: #86654a;
  --line: #f0dcc0;
  --line-soft: #f6e8d4;
  --card: #fffdf9;
  --shadow: 0 1px 2px rgba(120, 53, 15, .06), 0 8px 24px -12px rgba(120, 53, 15, .18);
  --shadow-lg: 0 2px 4px rgba(120, 53, 15, .05), 0 24px 48px -20px rgba(120, 53, 15, .28);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 18px;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--orange-50); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  background: linear-gradient(170deg, var(--amber-50) 0, var(--orange-50) 900px, var(--orange-50) 60%, var(--red-50) 100%);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; outline: none; }
h1, h2, h3 { font-family: var(--serif); color: var(--title); line-height: 1.12; margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent-dark); }
button, input, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(234, 88, 12, .45); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 251, 235, .82); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid rgba(240, 220, 192, .7); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 800; font-size: 24px; color: var(--title); letter-spacing: -.015em; }
.brand-mark { width: 32px; height: 32px; }
.header-nav { display: flex; align-items: center; gap: 22px; }
.nav-link { display: none; color: var(--title); text-decoration: none; font-weight: 600; }
.nav-link:hover { color: var(--accent-dark); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease, color .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px rgba(234, 88, 12, .6); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { background: #fff; color: var(--title); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 16px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent-dark); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Home */
.hero { padding-top: 44px; padding-bottom: 30px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: clamp(40px, 10.5vw, 84px); font-weight: 800; margin: 14px auto 0; max-width: 13ch; letter-spacing: -.025em; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 700; }
.hero-sub { margin: 18px auto 0; max-width: 34ch; font-size: clamp(19px, 2.2vw, 23px); color: var(--muted); line-height: 1.45; }
.search { position: relative; max-width: 640px; margin: 30px auto 0; }
.search svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; color: var(--sub); pointer-events: none; }
.search input { width: 100%; height: 64px; padding: 0 20px 0 56px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-size: 20px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: #b8987a; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 5px rgba(234, 88, 12, .12), var(--shadow); }
.promises { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 22px auto 0; padding: 0; list-style: none; color: var(--title); font-weight: 600; font-size: 16px; }
.promises li { display: flex; align-items: center; gap: 7px; }
.promises svg { width: 18px; height: 18px; color: var(--accent); }

.section { padding-top: 34px; padding-bottom: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(28px, 4vw, 38px); }
.section-head .count { color: var(--muted); font-weight: 600; }

.games { display: grid; grid-template-columns: 1fr; gap: 14px; }
.game-card { display: flex; gap: 16px; align-items: center; padding: 16px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line); }
.monogram { flex: none; width: 68px; height: 68px; border-radius: 16px; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: 36px; color: #fff; position: relative; overflow: hidden; }
.monogram::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.28), transparent 55%), repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 6px, transparent 6px 12px); }
.game-card-body { min-width: 0; flex: 1; }
.game-card h3 { font-size: 26px; }
.game-meta { color: var(--muted); font-size: 16px; margin-top: 2px; }
.game-card-foot { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--title); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--orange-100); color: var(--accent-dark); font-size: 14px; font-weight: 700; }
.votes-mini { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.votes-mini svg { width: 14px; height: 14px; }
.game-card.add-card { grid-column: 1 / -1; border: 2px dashed var(--line); background: rgba(255, 255, 255, .45); box-shadow: none; }
.game-card.add-card .monogram { background: var(--orange-100); color: var(--accent); }
.game-card.add-card .monogram::after { display: none; }
.empty { padding: 28px; text-align: center; background: rgba(255,255,255,.6); border: 2px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.empty strong { display: block; color: var(--title); font-family: var(--serif); font-size: 24px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

.how { display: grid; grid-template-columns: 1fr; gap: 14px; counter-reset: how; padding: 0; margin: 0; }
.how li { list-style: none; padding: 22px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line-soft); border-radius: var(--r); counter-increment: how; }
.how li::before { content: counter(how); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; margin-bottom: 12px; }
.how h3 { font-size: 23px; margin-bottom: 6px; }
.how p { color: var(--muted); }

/* Game page */
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; color: var(--sub); font-weight: 600; text-decoration: none; }
.crumb:hover { color: var(--accent-dark); }
.game-head { padding: 12px 0 22px; }
.game-head h1 { font-size: clamp(46px, 12vw, 80px); font-weight: 800; letter-spacing: -.025em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .75); border: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--title); }
.chip svg { width: 16px; height: 16px; color: var(--sub); }
.chip.hot { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.hot svg { color: #fff; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "rules" "ref" "book" "vote" "comments" "others"; gap: 20px; padding-bottom: 40px; }
.g-rules { grid-area: rules; }
.g-aside { display: contents; }
.g-ref { grid-area: ref; }
.g-vote { grid-area: vote; }
.g-book { grid-area: book; }
.g-comments { grid-area: comments; }
.g-others { grid-area: others; }

.rules-card { position: relative; overflow: hidden; background: #fff; border-radius: 26px; padding: 28px 20px 30px; box-shadow: var(--shadow-lg); border: 1px solid var(--line-soft); }
.rules-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--accent), #f59e0b); }
.rules-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 15px; color: var(--muted); font-weight: 600; }
.rules-byline .badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--amber-100); color: var(--title); border-radius: 999px; font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.rules-byline .badge svg { width: 14px; height: 14px; color: var(--accent); }
.rules-title { font-size: clamp(27px, 6.5vw, 38px); margin-top: 12px; font-weight: 700; }
.setup { margin-top: 20px; padding: 16px 18px; background: var(--amber-50); border-radius: 14px; border: 1px solid var(--amber-100); font-size: 19px; }
.setup-label { display: block; font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--sub); margin-bottom: 4px; }

.stages { list-style: none; margin: 26px 0 0; padding: 0; }
.stage { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 12px; align-items: start; padding-bottom: 30px; }
.stage:last-child { padding-bottom: 0; }
.stage-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 4px 10px -4px rgba(234, 88, 12, .7); }
.stage.aside .stage-num { width: 26px; height: 26px; margin: 4px; background: transparent; color: var(--sub); border: 1.5px dashed #e8b47a; box-shadow: none; }
.stage.aside .stage-num svg { width: 14px; height: 14px; }
.stage.aside h3 { font-size: clamp(19px, 4.8vw, 22px); font-style: italic; font-weight: 600; color: var(--sub); padding-top: 4px; }
.stage.aside .stage-body { margin-top: 8px; padding: 12px 16px; border-radius: 14px; background: var(--amber-50); border: 1px dashed var(--line); }
.stage.aside .md { color: var(--muted); font-size: 19px; }
.stage h3 { font-size: clamp(22px, 5.6vw, 27px); padding-top: 2px; }
.stage-body { grid-column: 1 / -1; margin-top: 12px; }

.md { font-size: clamp(20px, 4.9vw, 23px); line-height: 1.5; }
.md > :not(:first-child) { margin-top: 12px; }
.md ul, .md ol { margin: 0; padding: 0; list-style: none; }
.md li { position: relative; padding-left: 24px; }
.md li + li { margin-top: 14px; }
.md ul > li::before { content: ''; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.md ol { counter-reset: md; }
.md ol > li { counter-increment: md; padding-left: 32px; }
.md ol > li::before { content: counter(md); position: absolute; left: 0; top: .2em; width: 22px; height: 22px; border-radius: 50%; background: var(--orange-100); color: var(--accent-dark); font-size: 14px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.md strong { color: #2a1a0e; font-weight: 700; }
.md .more { display: block; margin-top: 4px; color: var(--muted); }
.md em { font-style: italic; }

.book-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: var(--r); }
.book-card h2 { font-size: 24px; }
.book-card p { color: var(--muted); }
.book-card .btn { align-self: flex-start; }
.book-card .src { font-size: 14px; color: var(--muted); }

.ref-card { background: #fff7ed; border-radius: var(--r); border: 2px solid var(--title); overflow: hidden; box-shadow: var(--shadow); }
.ref-card h2 { font-size: 21px; color: #fff; background: var(--title); padding: 12px 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.ref-card h2 svg { width: 20px; height: 20px; color: #fdba74; }
.ref-card .md { font-size: 19px; padding: 16px 18px 18px; }
.ref-card .md li + li { margin-top: 8px; }

.vote-box { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: #fff; border-radius: var(--r); border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.vote-btn { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 18px; border: 2px solid var(--line); background: var(--orange-50); color: var(--title); cursor: pointer; transition: all .18s ease; }
.vote-btn svg { width: 24px; height: 24px; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.vote-btn .n { font-weight: 800; font-size: 21px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vote-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.vote-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 18px -8px rgba(234, 88, 12, .8); }
.vote-btn.on svg { transform: translateY(-2px); }
.vote-btn.pop { animation: pop .4s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop { 40% { transform: scale(1.12); } }
.vote-copy strong { display: block; color: var(--title); font-size: 18px; }
.vote-copy span { color: var(--muted); font-size: 15px; }
.vote-btn.small { width: 56px; height: 56px; border-radius: 14px; }
.vote-btn.small .n { font-size: 17px; }
.vote-btn.small svg { width: 18px; height: 18px; }

.side-cta { padding: 18px; border-radius: var(--r); border: 2px dashed var(--line); text-align: left; background: rgba(255,255,255,.4); }
.side-cta p { color: var(--muted); font-size: 16px; margin: 4px 0 12px; }
.side-cta strong { color: var(--title); font-family: var(--serif); font-size: 20px; }

.panel { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.panel > h2 { font-size: 26px; }
.panel-sub { color: var(--muted); margin-top: 4px; font-size: 16px; }
.comments { list-style: none; margin: 16px 0 0; padding: 0; }
.comment { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.comment-head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex: none; }
.comment-head b { color: var(--title); }
.comment-head time { color: var(--muted); }
.comment-body { margin: 6px 0 0 42px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; }
.no-comments { margin-top: 14px; color: var(--muted); font-style: italic; }
.comment-new { animation: fadein .5s ease; background: linear-gradient(90deg, rgba(255, 237, 213, .7), transparent); border-radius: 10px; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

/* Forms */
.form { display: grid; gap: 16px; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-weight: 700; color: var(--title); font-size: 16px; }
.field small, .hint { color: var(--muted); font-size: 14.5px; font-weight: 400; }
.input, .textarea { width: 100%; border: 1.5px solid var(--line); background: #fffdfa; border-radius: 12px; padding: 12px 14px; font-size: 17px; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.input::-webkit-calendar-picker-indicator { display: none !important; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(234, 88, 12, .12); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: #b91c1c; font-weight: 600; font-size: 16px; min-height: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.others { display: grid; gap: 14px; }
.others > h2 { font-size: clamp(26px, 4vw, 32px); }
.other { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.other-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.other-head button.toggle { flex: 1; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
.other-head h3 { font-size: 22px; }
.other-head .meta { color: var(--muted); font-size: 15px; }
.other-body { padding: 0 18px 22px; border-top: 1px solid var(--line-soft); }
.other-body .stages { margin-top: 20px; }
.other-body .panel { box-shadow: none; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; margin-top: 22px; }

/* Add page */
.add-head { padding: 26px 0 18px; }
.add-head h1 { font-size: clamp(38px, 9vw, 64px); font-weight: 800; letter-spacing: -.02em; }
.add-head p { color: var(--muted); font-size: 20px; margin-top: 10px; max-width: 46ch; }
.add-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-bottom: 48px; }
.form-card { background: #fff; border-radius: 24px; padding: 22px; border: 1px solid var(--line-soft); box-shadow: var(--shadow-lg); }
.form-section + .form-section { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.form-section > h2 { font-size: 25px; display: flex; align-items: center; gap: 10px; }
.form-section > h2 .num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--sans); font-size: 16px; font-weight: 800; display: grid; place-items: center; flex: none; }
.form-section > p { color: var(--muted); margin-top: 4px; font-size: 16px; }
.step-edit { position: relative; padding: 16px; border-radius: 16px; background: var(--amber-50); border: 1px solid var(--amber-100); display: grid; gap: 10px; }
.step-edit-head { display: flex; align-items: center; gap: 10px; }
.step-edit-head .stage-num { width: 30px; height: 30px; font-size: 15px; flex: none; }
.step-edit-head .input { flex: 1; font-weight: 700; color: var(--title); }
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: #b91c1c; border-color: #fca5a5; }
.icon-btn svg { width: 18px; height: 18px; }
.existing-note { padding: 12px 14px; border-radius: 12px; background: var(--orange-100); color: var(--accent-dark); font-weight: 600; font-size: 16px; }
.existing-note a { font-weight: 700; }
.add-aside { display: none; }
.tips { padding: 22px; border-radius: var(--r); background: rgba(255, 255, 255, .65); border: 1px solid var(--line); }
.tips h2 { font-size: 24px; }
.tips ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.tips li { padding-left: 30px; position: relative; color: var(--text); font-size: 16.5px; }
.tips li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; margin-top: 2px; }
.tips li b { color: var(--title); }
.preview { margin-top: 16px; }
.preview-label { font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--sub); margin: 0 0 10px 4px; }
.preview .rules-card { padding: 22px 20px; }
.preview .md { font-size: 18px; }
.preview .stage h3 { font-size: 20px; }
.preview .rules-title { font-size: 26px; }
.preview-empty { color: var(--muted); font-style: italic; }

/* Misc */
.loading { padding-top: 80px; padding-bottom: 80px; text-align: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { margin: 40px 0; padding: 20px; background: #fff; border-radius: var(--r); border: 1px solid var(--line); }
.error-page { text-align: center; padding-top: 70px; padding-bottom: 70px; }
.error-page h1 { font-size: 46px; }
.error-page p { color: var(--muted); margin: 10px 0 20px; font-size: 19px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); background: var(--title); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow-lg); transition: transform .3s cubic-bezier(.34, 1.4, .64, 1); z-index: 50; max-width: calc(100vw - 32px); text-align: center; opacity: 0; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.admin-bar { background: #7f1d1d; color: #fff; text-align: center; font-size: 14px; font-weight: 700; padding: 6px; }
.admin-del { margin-left: auto; background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* Footer */
.site-footer { margin-top: 30px; background: var(--title); color: #fde8c8; }
.footer-grid { display: grid; gap: 22px; padding-top: 38px; padding-bottom: 28px; }
.footer-big { font-family: var(--serif); font-size: 34px; font-weight: 700; color: #fff; line-height: 1.1; }
.footer-sub { margin-top: 8px; color: #f5cfa0; }
.footer-cta p { font-size: 18px; margin-bottom: 14px; max-width: 40ch; }
.footer-cta .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.footer-cta .btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .08); }
.footer-base { padding-bottom: 30px; font-size: 14px; color: #e9b98a; }
.footer-base > span { display: block; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .16); }

@media (min-width: 640px) {
  .wrap { padding-left: 32px; padding-right: 32px; }
  .games { grid-template-columns: 1fr 1fr; }
  .how { grid-template-columns: repeat(3, 1fr); }
  .rules-card { padding: 34px 36px 38px; }
  .nav-link { display: inline; }
  .form-card { padding: 30px; }
}

@media (min-width: 1024px) {
  body { font-size: 19px; }
  .header-row { height: 76px; }
  .brand { font-size: 28px; }
  .brand-mark { width: 36px; height: 36px; }
  .hero { padding-top: 92px; padding-bottom: 56px; }
  .hero-sub { max-width: 40ch; }
  .search input { height: 72px; font-size: 22px; }
  .games { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .game-card { padding: 22px; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas: "rules aside" "book aside" "comments aside" "others aside";
    grid-template-rows: auto auto auto 1fr;
    column-gap: 40px; row-gap: 24px;
  }
  .g-aside { display: flex; flex-direction: column; gap: 20px; grid-area: aside; position: sticky; top: 100px; align-self: start; }
  .rules-card { padding: 44px 52px 50px; }
  .stage { grid-template-columns: 42px minmax(0, 1fr); column-gap: 20px; padding-bottom: 36px; }
  .stage-num { width: 42px; height: 42px; font-size: 20px; }
  .stage.aside .stage-num { width: 30px; height: 30px; margin: 6px; }
  .stage.aside .md { font-size: 21px; }
  .stage.aside h3 { font-size: 24px; }
  .stage-body { grid-column: 2; }
  .stage::before { content: ''; position: absolute; left: 20px; top: 50px; bottom: 8px; border-left: 2px dashed #f3c99a; }
  .stage:last-child::before { display: none; }
  .md { font-size: 24px; }
  .game-head { padding-top: 16px; padding-bottom: 28px; }
  .add-layout { grid-template-columns: minmax(0, 1fr) 420px; gap: 40px; }
  .add-aside { display: flex; flex-direction: column; gap: 0; position: sticky; top: 100px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; }
  .form-card { padding: 36px 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; align-items: end; padding-top: 52px; }
  .footer-cta { justify-self: end; text-align: right; }
  .footer-cta p { margin-left: auto; }
}

@media (min-width: 1600px) {
  :root { --wrap: 1320px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 420px; column-gap: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
