:root {
  --ink: #0b1220;
  --ink-soft: #1e293b;
  --muted: #64748b;
  --paper: #e8eef4;
  --paper-deep: #dce5ee;
  --surface: #f8fafc;
  --line: #c5d0dc;
  --accent: #b45309;
  --accent-hot: #d97706;
  --accent-soft: #fde68a;
  --mark: #0369a1;
  --mark-soft: #bae6fd;
  --shadow: 0 18px 40px rgba(11, 18, 32, 0.09);
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Outfit", "Trebuchet MS", "Segoe UI", sans-serif;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 90% 55% at 0% -5%, rgba(3, 105, 161, 0.14), transparent 52%),
    radial-gradient(ellipse 70% 45% at 100% 5%, rgba(180, 83, 9, 0.12), transparent 48%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 11px,
      rgba(11, 18, 32, 0.02) 11px,
      rgba(11, 18, 32, 0.02) 12px
    );
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-hot); }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h1 { font-size: clamp(2.35rem, 5.2vw, 3.6rem); margin: 0 0 0.8rem; font-optical-sizing: auto; }
h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.12rem; 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: 30; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(232, 238, 244, 0.88);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(11, 18, 32, 0.08);
}
.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: 700;
}
.logo-mark {
  width: 2.35rem; height: 2.35rem; display: grid; place-items: center;
  background: var(--ink); color: #fef3c7;
  font-family: var(--display); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.04em;
  clip-path: polygon(12% 0, 100% 0, 100% 88%, 88% 100%, 0 100%, 0 12%);
  transition: transform 0.35s var(--ease), background 0.25s ease;
}
.logo:hover .logo-mark {
  background: var(--accent);
  color: #fffbeb;
  transform: rotate(-4deg) scale(1.04);
}
.logo-text {
  font-size: 0.95rem; font-weight: 650; letter-spacing: -0.01em;
}
.site-nav { display: flex; gap: 0.35rem 1.35rem; align-items: center; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none;
  font-weight: 560; font-size: 0.94rem;
  position: relative; padding: 0.2rem 0;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 2px; background: var(--accent);
  transition: right 0.3s var(--ease);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { right: 0; }

/* Intro / hero */
.intro {
  padding: 3.4rem 0 1.6rem;
  position: relative;
  overflow: hidden;
}
.intro-grid, .layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem; align-items: start;
}
.intro-copy {
  animation: rise-in 0.7s var(--ease) both;
}
.eyebrow {
  margin: 0 0 0.65rem;
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--mark);
  font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 1.1rem; height: 2px; background: var(--accent);
}
.lede { font-size: 1.14rem; color: var(--ink-soft); max-width: 38rem; }
.intro-note {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.25rem 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  position: relative;
  animation: rise-in 0.7s 0.12s var(--ease) both;
}
.intro-note::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--mark));
}
.intro-note h2 {
  font-size: 1.15rem; margin-bottom: 0.55rem;
}
.intro-note ol, .rail-card ul { margin: 0.35rem 0 0; padding-left: 1.15rem; }
.intro-note li, .rail-card li { margin: 0.45rem 0; }
.intro-note a { font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(180, 83, 9, 0.4); }
.intro-note a:hover { border-bottom-color: var(--accent-hot); }

/* Catalog */
.catalog, .guide { padding: 0.5rem 0 3.2rem; }
.section-head { margin-bottom: 1.2rem; }
.section-head p { color: var(--muted); max-width: 34rem; }
.cat-title {
  margin: 1.7rem 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--ink);
  display: flex; align-items: baseline; gap: 0.65rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--sans);
  font-weight: 700;
}
.game-list { display: grid; gap: 0.75rem; }
.game-row {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 1rem;
  padding: 0.55rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit; text-decoration: none;
  box-shadow: 0 1px 0 rgba(28, 25, 23, 0.04);
  transition: transform 0.35s var(--ease), border-color 0.25s ease, box-shadow 0.35s var(--ease);
}
.game-row:hover {
  border-color: var(--ink);
  transform: translateX(4px);
  box-shadow: var(--shadow);
}
.game-row img {
  width: 100%; height: 104px; object-fit: cover;
  background: #cbd5e1;
  filter: saturate(0.92) contrast(1.02);
  transition: filter 0.35s ease;
}
.game-row:hover img { filter: saturate(1.05) contrast(1.05); }
.game-row strong {
  display: block; font-size: 1.08rem; color: var(--ink);
  font-family: var(--display); font-weight: 600; letter-spacing: -0.015em;
}
.game-row em {
  display: inline-block; margin: 0.2rem 0 0.35rem;
  color: var(--accent); font-style: normal;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.game-row span span { color: var(--muted); font-size: 0.94rem; }

.rail { display: grid; gap: 0.95rem; position: sticky; top: 5.2rem; }
.rail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem;
}
.rail-card h2 { font-size: 1.05rem; }
.rail-card a { text-decoration: none; font-weight: 560; }
.prose { max-width: 46rem; }
.prose ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.prose li { margin: 0.35rem 0; }

.guide .prose {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: var(--shadow);
}

/* Game page */
.game-page { padding: 1.9rem 0 3.4rem; }
.breadcrumb { color: var(--muted); font-size: 0.9rem; }
.breadcrumb a { text-decoration: none; font-weight: 560; }
.game-head { max-width: 42rem; margin-bottom: 1.15rem; }
.player {
  background: #0c0a09;
  overflow: hidden;
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
}
.player iframe {
  width: 100%; height: min(68vh, 620px); border: 0;
  display: block; background: #0c0a09;
}
.player-actions { margin: 0.95rem 0 1.4rem; }

.btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--ink); color: #fef3c7;
  text-decoration: none; font: inherit; font-weight: 700;
  padding: 0.72rem 1.2rem;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, transform 0.2s var(--ease);
}
.btn:hover { background: var(--accent); color: #fffbeb; transform: translateY(-1px); }
.btn--ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover { background: var(--surface); border-color: var(--ink); transform: none; }

.ad-slot {
  margin: 1.4rem 0;
  padding: 0.7rem 0.8rem 0.85rem;
  border: 1px dashed #94a3b8;
  background: rgba(248, 250, 252, 0.7);
}
.ad-slot__label {
  margin: 0 0 0.4rem; color: var(--muted);
  font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 700;
}
.ad-slot__unit { min-height: 90px; }
.ad-slot--rail { margin: 0; }
.ad-slot--rail .ad-slot__unit { min-height: 250px; }

.contact-form { display: grid; gap: 0.85rem; margin-top: 1rem; }
.contact-form label { display: grid; gap: 0.3rem; font-weight: 700; }
.contact-form input, .contact-form textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); padding: 0.7rem 0.8rem;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 4px solid var(--ink);
  padding: 2.3rem 0 2.4rem;
  color: #94a3b8;
  background: linear-gradient(180deg, #0b1220 0%, #020617 100%);
}
.site-footer a { color: #fbbf24; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; }
.footer-brand {
  display: block; color: #f8fafc; margin-bottom: 0.45rem;
  font-size: 1.15rem; font-family: var(--display); font-weight: 600;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.7rem 1.1rem; align-content: start; }
.footer-links a { color: #cbd5e1; text-decoration: none; font-weight: 560; }
.footer-links a:hover { color: #fbbf24; }
.footer-copy {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.25rem auto 0;
  font-size: 0.88rem; color: #64748b;
}

/* Cookies */
.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: #e2e8f0;
  padding: 0.9rem 1.05rem;
  border-left: 4px solid var(--accent);
}
.cookie-banner a { color: #fbbf24; }
.cookie-banner p { margin: 0; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cookie-banner .btn { background: var(--accent); color: #fffbeb; }
.cookie-banner .btn:hover { background: var(--accent-hot); }
.cookie-banner .btn--ghost {
  color: #e2e8f0; border-color: rgba(255,255,255,0.22); 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(12, 10, 9, 0.68); }
.cookie-modal__card {
  position: relative; width: min(520px, 100%); max-height: min(86vh, 720px); overflow: auto;
  background: var(--surface); padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.cookie-modal__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cookie-cat { border-top: 1px solid var(--line); padding: 0.7rem 0; }
.cookie-cat p { margin: 0.28rem 0 0; color: var(--muted); font-size: 0.94rem; }
.cookie-cat__head { display: flex; justify-content: space-between; align-items: center; }
.switch { position: relative; width: 2.55rem; height: 1.45rem; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #94a3b8; border-radius: 999px; }
.switch span::after {
  content: ""; position: absolute; top: 0.16rem; left: 0.16rem;
  width: 1.12rem; height: 1.12rem; background: #fff; border-radius: 50%;
  transition: transform 0.2s ease;
}
.switch input:checked + span { background: var(--accent); }
.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(12, 10, 9, 0.94); padding: 0.75rem; }
.game-modal[hidden] { display: none; }
.game-modal__panel { height: 100%; display: flex; flex-direction: column; gap: 0.45rem; }
.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; }
.game-modal__close {
  width: 2.4rem; height: 2.4rem; border: 0; cursor: pointer;
  background: var(--accent); color: #fffbeb; font-size: 1.35rem; line-height: 1; font-weight: 700;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@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; }
  .intro { padding-top: 2.4rem; }
  .guide .prose { padding: 1.2rem 1rem; }
}
