:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0e14;
  --surface: #141c27;
  --surface-hover: #1a2433;
  --line: #2a3544;
  --text: #e8edf4;
  --muted: #aeb8c7;
  --accent: #e87722;
  --accent-light: #f59e3a;
  --accent-dark: #b85417;
  --green: #69d7a0;
  --white: #fff;
  --max: 1200px;
  --page: #0a0e14;
  --section: #111821;
  --field: #1a2230;
  --nav-bg: rgba(10, 14, 20, .88);
  --shadow: 0 4px 24px rgba(0, 0, 0, .35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #fff;
  --surface-hover: #f0f2f5;
  --line: #dce1e7;
  --text: #1a1a2e;
  --muted: #525d6d;
  --accent: #a9480d;
  --accent-light: #be601b;
  --accent-dark: #963d0a;
  --green: #17784b;
  --page: #f5f6f8;
  --section: #fff;
  --field: #eef0f3;
  --nav-bg: rgba(255, 255, 255, .9);
  --shadow: 0 4px 20px rgba(24, 34, 48, .07);
}

html { scroll-padding-top: 80px; }
body {
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}
.wrap { width: min(var(--max), calc(100% - 48px)); }
.skip-link { background: var(--accent-light); color: #171b21; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--nav-bg);
  border-color: var(--line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.header-inner { height: 64px; }
.brand-logo { flex: 0 1 auto; min-width: 0; }
.logo { width: 150px; max-width: 100%; height: auto; }
.logo-on-light { display: none; }
[data-theme="light"] .logo-on-dark { display: none; }
[data-theme="light"] .logo-on-light { display: block; }
.nav a { color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; }
.nav a:visited { color: var(--muted); }
.nav a:hover, .nav a:focus-visible { color: var(--text); background: transparent; border-bottom-color: var(--accent); }
.nav-actions { gap: 10px; }
.theme-switcher { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: color .2s, background-color .2s; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn:hover:not(.active) { color: var(--text); background: var(--surface-hover); }
.theme-btn.active { background: var(--accent); color: #fff; }
.theme-btn:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.lang-btn { height: 32px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--field); color: var(--text); font-size: 13px; font-weight: 500; }
.lang-btn .lang-icon { font-size: 14px; }
.lang-btn:hover { background: var(--surface-hover); border-color: var(--accent); }
.lang-btn:focus-visible { outline-offset: 2px; }
.lang-dropdown { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.lang-dropdown button[data-lang] { color: var(--muted); }
.lang-dropdown button[data-lang]:hover { background: var(--surface-hover); color: var(--text); }
.lang-dropdown button[data-lang].active { background: rgba(232, 119, 34, .13); color: var(--text); }
.lang-dropdown button[data-lang] .lang-check { color: var(--accent); }

.hero { position: relative; isolation: isolate; padding: 0; min-height: 480px; overflow: hidden; color: #fff; background: #111821; }
.hero-media { position: absolute; inset: 0; z-index: -2; background: url('/assets/site-hero.webp') center top / auto 175% no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 12, 18, .92) 0%, rgba(8, 12, 18, .68) 38%, rgba(8, 12, 18, .14) 78%), linear-gradient(0deg, #0a0e14 0%, transparent 44%); }
.hero-grid { display: flex; align-items: center; min-height: 480px; max-width: var(--max); }
.hero-grid > div { width: min(680px, 100%); padding: 46px 0 40px; }
.service-state { color: #e8edf4; }
.state-dot { background: #69d7a0; box-shadow: none; }
h1 { max-width: 680px; margin: 17px 0 16px; font-size: 58px; font-weight: 800; line-height: 1.12; letter-spacing: 0; }
.hero-copy { color: #e1e6ed; font-size: 16px; }
.hero-actions { margin-top: 25px; gap: 10px; }
.hero-actions .btn { min-width: 150px; }
.stats { margin-top: 35px; gap: 28px; }
.stat strong { font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1.3; }
.stat span { color: #cbd4df; }
.btn { min-height: 46px; border-radius: 7px; border-color: var(--line); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; }
.btn:hover { border-color: var(--accent); background: var(--surface-hover); }
.btn.primary { border-color: #ad4d15; background: linear-gradient(135deg, #c15a19, #a74410); color: #fff; }
.btn.primary:hover { border-color: #dc762d; background: linear-gradient(135deg, #d46a1d, #b75113); box-shadow: 0 6px 20px rgba(232, 119, 34, .18); }
.hero .btn:not(.primary) { background: rgba(16, 23, 33, .78); border-color: rgba(232, 237, 244, .38); color: #fff; }
.hero .btn:not(.primary):hover { border-color: #f59e3a; background: rgba(20, 28, 39, .94); }
.btn.disabled { border-color: var(--line); background: var(--field); color: var(--muted); opacity: .7; }
.nav a:focus-visible, .btn:focus-visible, .modal button:focus-visible, .lang-btn:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 3px; }

.first-use-band { background: var(--section); border-bottom: 1px solid var(--line); }
.first-use { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 20px 0; border: 0; background: transparent; }
.first-use-label { color: var(--accent); font-size: 12px; font-weight: 700; }
.first-use h2 { margin: 2px 0 2px; font-size: 19px; line-height: 1.35; }
.first-use p { color: var(--muted); }
.first-use .btn { flex: none; }

.catalog { padding: 38px 0 0; scroll-margin-top: 80px; }
.games { gap: 16px; }
.game { padding: 23px; border-radius: 8px; border-color: var(--line); background: var(--surface); box-shadow: var(--shadow); transition: transform .2s, border-color .2s, background-color .2s; }
.game:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--surface-hover); }
.game-code { color: var(--accent-light); font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1.2; }
[data-theme="light"] .game-code { color: var(--accent); }
.availability { color: var(--muted); }
.availability.ready { color: var(--green); }
.game h2 { margin: 24px 0 4px; font-size: 22px; font-weight: 700; line-height: 1.3; }
.actions { margin-top: 22px; }

.help { width: 100vw; margin: 45px 0 0 calc(50% - 50vw); padding: 40px max(24px, calc((100vw - 1200px) / 2)); background: var(--section); color: var(--text); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scroll-margin-top: 64px; }
.help h2 { font-size: 24px; }
.help p { color: var(--muted); }
.help .btn { border-color: var(--line); color: var(--text); background: var(--surface); }
.help .btn:hover { border-color: var(--accent); background: var(--surface-hover); }
.site-footer { border-color: var(--line); background: var(--page); }
.footer-inner { min-height: 76px; color: var(--muted); }
.modal { border-color: var(--line); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 18px 64px rgba(0, 0, 0, .45); }
.modal::backdrop { background: rgba(4, 8, 13, .78); }
.choice-option { border-radius: 7px; border-color: var(--line); background: var(--field); color: var(--text); }
.choice-option:hover { border-color: var(--accent); background: var(--surface-hover); }
.choice-option:disabled { border-color: var(--line); background: var(--field); color: var(--muted); opacity: .6; }
.choice-option:not(:disabled) .drive-state { color: var(--accent-light); }
.modal-footer button { border-radius: 7px; border-color: var(--line); color: var(--text); }
.modal-footer button:hover { border-color: var(--accent); background: var(--surface-hover); }

@media (min-width: 1600px) {
  .hero-media { background-size: cover; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { height: 60px; gap: 10px; }
  .logo { width: min(150px, 42vw); }
  .nav { display: none; }
  .nav-actions { gap: 8px; }
  .hero { min-height: 430px; }
  .hero-grid { min-height: 430px; }
  .hero-grid > div { padding: 40px 0 32px; }
  .hero-media { background-position: 53% top; }
  .hero::before { background: linear-gradient(90deg, rgba(8, 12, 18, .88), rgba(8, 12, 18, .48)), linear-gradient(0deg, #0a0e14, transparent 58%); }
  h1 { font-size: 39px; }
  .hero-copy { font-size: 15px; }
  .stats { gap: 18px; margin-top: 24px; }
  .first-use { flex-wrap: wrap; gap: 12px; padding: 19px 0; }
  .first-use .btn { min-height: 42px; }
  .catalog { padding-top: 28px; }
  .games { grid-template-columns: 1fr; }
  .game { padding: 20px; }
  .game h2 { margin: 19px 0 4px; }
  .actions { grid-template-columns: minmax(0, 1fr) auto; }
  .help { padding: 32px 16px; }
}
@media (max-width: 420px) {
  .logo { width: min(140px, 38vw); }
  .lang-btn { padding-inline: 7px; }
  h1 { font-size: 35px; }
  .hero-actions .btn { min-width: 0; }
  .stats { gap: 13px; }
  .actions { grid-template-columns: 1fr; }
  .game:has(.availability:not(.ready)) .actions { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .logo { width: 110px; }
  .nav-actions { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .game, .theme-btn, .lang-dropdown, .lang-caret { transition: none; }
  .game:hover { transform: none; }
}
