:root {
  color-scheme: light;
  --ink: #18231e;
  --ink-soft: #526059;
  --paper: #f7f6f0;
  --paper-strong: #ffffff;
  --line: #d9ded8;
  --brand: #134f3d;
  --brand-strong: #0b382b;
  --brand-soft: #dcebe4;
  --accent: #d19a39;
  --danger: #b43232;
  --success: #176b4c;
  --focus: #1677ff;
  --shadow-sm: 0 1px 2px rgba(13, 31, 23, 0.08), 0 5px 20px rgba(13, 31, 23, 0.06);
  --shadow-lg: 0 24px 70px rgba(10, 29, 21, 0.22);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --content: 1180px;
  --header-height: 70px;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --user-card-scale: 1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, select, input { min-height: 44px; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--brand-strong);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  min-height: var(--header-height);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(16px);
}
.header-inner {
  width: min(calc(100% - 32px), var(--content));
  min-height: var(--header-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 780;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid var(--brand);
  border-radius: 8px;
  color: var(--brand);
  background: var(--paper-strong);
  font-family: var(--font-display);
  font-size: 21px;
  box-shadow: 3px 3px 0 var(--brand-soft);
}
.brand-word { font-size: 18px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a,
.nav-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.site-nav a:hover, .nav-button:hover { color: var(--ink); background: var(--brand-soft); }
.menu-toggle { display: none; }

main { min-height: 65vh; }
.content-shell { width: min(calc(100% - 32px), var(--content)); margin: 0 auto; }
.narrow-shell { width: min(calc(100% - 32px), 780px); margin: 0 auto; }
.page-hero {
  padding: clamp(48px, 8vw, 96px) 0 40px;
  text-align: center;
}
.page-hero h1,
.editorial h1,
.editorial h2,
.editorial h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.06;
}
.page-hero h1 { max-width: 900px; margin: 0 auto 18px; font-size: clamp(42px, 7vw, 76px); }
.page-hero p { max-width: 710px; margin: 0 auto; color: var(--ink-soft); font-size: clamp(18px, 2.2vw, 22px); }

.breadcrumbs { margin: 20px 0 0; color: var(--ink-soft); font-size: 14px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 8px; color: #94a198; }

.button,
.icon-button,
.control-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper-strong);
  font-weight: 720;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(13, 31, 23, 0.05);
}
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; text-decoration: none; }
.button-primary { border-color: var(--brand); color: #fff; background: var(--brand); }
.button-primary:hover { color: #fff; background: var(--brand-strong); }
.button-secondary:hover, .icon-button:hover, .control-button:hover { border-color: #a7b4ab; background: #f1f4f1; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

.editorial {
  padding: 60px 0 90px;
  font-size: 17px;
}
.editorial > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.editorial h2 { margin-top: 56px; font-size: clamp(30px, 4vw, 44px); }
.editorial h3 { margin-top: 36px; font-size: 25px; }
.editorial p, .editorial li { color: #35433c; }
.editorial ul, .editorial ol { padding-left: 1.35em; }
.editorial li + li { margin-top: 10px; }
.editorial .wide { max-width: 1100px; }
.callout {
  margin-top: 32px;
  padding: 24px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: #fff9eb;
}

.section-band { padding: 72px 0; border-top: 1px solid var(--line); }
.section-heading { max-width: 700px; margin-bottom: 32px; }
.section-heading h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.035em; }
.section-heading p { margin: 0; color: var(--ink-soft); font-size: 18px; }

.game-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.game-card {
  min-height: 220px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-strong);
  box-shadow: var(--shadow-sm);
}
.game-card h2, .game-card h3 { margin: 12px 0 8px; font-family: var(--font-display); font-size: 28px; line-height: 1.08; }
.game-card p { margin: 0 0 20px; color: var(--ink-soft); }
.game-card a { margin-top: auto; font-weight: 760; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--ink-soft); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.catalog-controls {
  position: sticky;
  z-index: 20;
  top: calc(var(--header-height) + 12px);
  margin-bottom: 24px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(145px, auto));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
}
.catalog-controls input, .catalog-controls select,
.form-control {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #bfc8c1;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}
.catalog-status { margin: 0 0 18px; color: var(--ink-soft); font-weight: 700; }

.site-footer { padding: 56px 0 28px; color: #dbe7df; background: #102d24; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.footer-brand { max-width: 420px; }
.footer-brand strong { font-size: 20px; }
.footer-brand p { color: #b8cbbf; }
.footer-column strong { display: block; margin-bottom: 12px; color: #fff; }
.footer-column a { display: block; width: fit-content; padding: 5px 0; color: #cce0d3; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.15); color: #a9c0b2; font-size: 14px; }

.dialog {
  width: min(calc(100% - 28px), 540px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(5, 18, 13, 0.58); backdrop-filter: blur(5px); }
.dialog-inner { padding: 26px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-header h2 { margin: 0; font-family: var(--font-display); font-size: 32px; }
.dialog-close { width: 44px; padding: 0; border: 0; border-radius: 50%; background: #edf1ee; cursor: pointer; }
.dialog-actions { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.setting-list { margin: 22px 0 0; display: grid; gap: 14px; }
.setting-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; }
.setting-row label { font-weight: 700; }
.setting-row small { display: block; color: var(--ink-soft); font-weight: 400; }
.setting-row input[type="checkbox"] { width: 24px; min-height: 24px; height: 24px; accent-color: var(--brand); }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; width: 44px; align-items: center; justify-content: center; }
  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    width: min(300px, calc(100vw - 32px));
    padding: 10px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper-strong);
    box-shadow: var(--shadow-lg);
  }
  .site-nav[data-open] { display: flex; }
  .site-nav a, .nav-button { justify-content: flex-start; }
  .game-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-controls { grid-template-columns: 1fr 1fr; }
  .catalog-controls input { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  :root { --header-height: 62px; }
  .header-inner, .content-shell, .narrow-shell { width: min(calc(100% - 24px), var(--content)); }
  .brand-word { font-size: 16px; }
  .page-hero { padding: 38px 0 28px; text-align: left; }
  .page-hero h1 { font-size: clamp(38px, 12vw, 56px); }
  .page-hero p { font-size: 18px; }
  .game-card-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 190px; }
  .catalog-controls { position: static; grid-template-columns: 1fr; }
  .catalog-controls input { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .dialog-inner { padding: 20px; }
  .dialog-actions { flex-direction: column; }
  .dialog-actions .button { width: 100%; }
}
