:root {
  --ink: #1b2430;
  --muted: #5c6570;
  --paper: #f6f3ee;
  --card: #fffdf9;
  --line: #e3dcd0;
  --rust: #9a3e24;
  --rust-dark: #7c311c;
  --shadow: 0 10px 30px rgba(27, 36, 48, 0.06);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: var(--rust); }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 0; }
p { margin: 0 0 1rem; }

.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.skip-link {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--ink); color: #fff; padding: 0.5rem 0.8rem;
}
.skip-link:focus { left: 0.5rem; z-index: 20; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 243, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.logo { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.logo-mark {
  width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
  background: var(--ink); color: #f3efe6; border-radius: 8px;
  font-family: var(--serif); font-size: 0.85rem;
}
.site-nav { display: flex; gap: 1.1rem; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--rust); }

.intro { padding: 3.2rem 0 1rem; }
.intro-grid, .layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.eyebrow { margin: 0 0 0.6rem; color: var(--rust); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.lede { font-size: 1.15rem; }
.intro-note, .rail-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.15rem 1.2rem; box-shadow: var(--shadow);
}
.intro-note ol, .rail-card ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.intro-note li, .rail-card li { margin: 0.45rem 0; }

.catalog, .guide { padding: 0.5rem 0 3rem; }
.section-head { margin-bottom: 1.25rem; }
.cat-title { margin: 1.6rem 0 0.8rem; }
.game-list { display: grid; gap: 0.8rem; }
.game-row {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 0.9rem;
  padding: 0.55rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; color: inherit; text-decoration: none; box-shadow: var(--shadow);
}
.game-row:hover { border-color: #c9b8a4; }
.game-row img { width: 100%; height: 104px; object-fit: cover; border-radius: 11px; background: #ddd; }
.game-row strong { display: block; font-size: 1.05rem; }
.game-row em { display: block; margin: 0.15rem 0 0.3rem; color: var(--muted); font-style: normal; font-size: 0.85rem; }
.game-row span span { color: var(--muted); }

.rail { display: grid; gap: 1rem; position: sticky; top: 5.2rem; }
.prose { max-width: 46rem; }
.prose ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.prose li { margin: 0.35rem 0; }

.game-page { padding: 2rem 0 3.5rem; }
.breadcrumb { color: var(--muted); font-size: 0.92rem; }
.game-head { max-width: 42rem; margin-bottom: 1rem; }
.player {
  background: #11161d; border-radius: 18px; overflow: hidden;
  border: 1px solid #11161d;
}
.player iframe { width: 100%; height: min(68vh, 620px); border: 0; display: block; background: #11161d; }
.player-actions { margin: 0.9rem 0 1.4rem; }

.btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--rust); color: #fff; text-decoration: none;
  font: inherit; font-weight: 600; border-radius: 999px;
  padding: 0.7rem 1.15rem;
}
.btn:hover { background: var(--rust-dark); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: #fff; }

.ad-slot {
  margin: 1.5rem 0;
  padding: 0.7rem 0.8rem 0.85rem;
  border: 1px dashed #d5cdc2;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
}
.ad-slot__label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ad-slot__unit { min-height: 90px; }
.ad-slot--rail { margin: 0; }
.ad-slot--rail .ad-slot__unit { min-height: 250px; }
.player-actions + .prose .ad-slot,
.game-row + .ad-slot { margin-top: 2rem; }

.contact-form { display: grid; gap: 0.85rem; margin-top: 1rem; }
.contact-form label { display: grid; gap: 0.35rem; font-weight: 600; }
.contact-form input, .contact-form textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.8rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid #e7c3b6; border-color: var(--rust); }

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.4rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
.footer-brand { display: block; color: var(--ink); margin-bottom: 0.4rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-content: start; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-copy { width: min(1120px, calc(100% - 2rem)); margin: 1.2rem auto 0; font-size: 0.9rem; }

.cookie-banner {
  position: relative; z-index: 30;
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  width: min(1120px, calc(100% - 2rem)); margin: 0.75rem auto 0;
  background: var(--ink); color: #f6f3ee; border-radius: 16px; padding: 0.9rem 1rem;
}
.cookie-banner a { color: #f0c7b8; }
.cookie-banner p { margin: 0; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cookie-banner .btn { background: #f3efe6; color: var(--ink); }
.cookie-banner .btn--ghost { color: #f6f3ee; border-color: rgba(255,255,255,0.25); background: transparent; }

.cookie-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; }
.cookie-modal[hidden] { display: none; }
.cookie-modal__backdrop { position: absolute; inset: 0; background: rgba(17, 22, 29, 0.55); }
.cookie-modal__card {
  position: relative; width: min(520px, 100%); max-height: min(86vh, 720px); overflow: auto;
  background: var(--card); border-radius: 18px; padding: 1.1rem 1.15rem 1.2rem;
}
.cookie-modal__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cookie-cat { border-top: 1px solid var(--line); padding: 0.75rem 0; }
.cookie-cat p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.95rem; }
.cookie-cat__head { display: flex; justify-content: space-between; align-items: center; }
.switch { position: relative; width: 2.6rem; height: 1.5rem; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d9d1c6; border-radius: 999px; }
.switch span::after {
  content: ""; position: absolute; top: 0.18rem; left: 0.18rem;
  width: 1.14rem; height: 1.14rem; background: #fff; border-radius: 50%;
}
.switch input:checked + span { background: var(--rust); }
.switch input:checked + span::after { transform: translateX(1.05rem); }
.switch input:disabled + span { opacity: 0.7; }

.game-modal { position: fixed; inset: 0; z-index: 60; background: rgba(17, 22, 29, 0.88); padding: 0.8rem; }
.game-modal[hidden] { display: none; }
.game-modal__panel { height: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.game-modal__bar { display: flex; justify-content: space-between; align-items: center; color: #fff; }
.game-modal__frame { flex: 1; width: 100%; border: 0; background: #000; border-radius: 12px; }
.game-modal__close {
  width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 0; cursor: pointer;
  background: #fff; color: var(--ink); font-size: 1.4rem; line-height: 1;
}

@media (max-width: 860px) {
  .intro-grid, .layout, .footer-grid, .game-row { grid-template-columns: 1fr; }
  .rail { position: static; }
  .game-row img { height: 180px; }
  .cookie-banner { flex-direction: column; align-items: stretch; }
  .header-bar { min-height: 3.6rem; }
  .logo-text { font-size: 0.98rem; }
}
