/* ==========================================================================
   Apollo Games — общий стиль
   ========================================================================== */

:root {
  --bg: #0D0E10;
  --fg: #ECE8E0;
  --mute: #A29E96;
  --line: rgba(236, 232, 224, .12);
  --line2: rgba(236, 232, 224, .28);
  --signal: #FF5320;
  --on-signal: #0D0E10;
  --mint: #BFD9C7;

  /* тёмные карточки — одинаковые в обеих темах */
  --c-bg: #08090A;
  --c-art: #121417;
  --c-fg: #ECE8E0;
  --c-mute: #A29E96;
  --c-line: rgba(236, 232, 224, .14);

  --f-disp: "Chakra Petch", "Arial Narrow", Arial, sans-serif;
  --f-body: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --cut: 10px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ECE9E3;
  --fg: #131416;
  --mute: #5C5852;
  --line: rgba(19, 20, 22, .12);
  --line2: rgba(19, 20, 22, .3);
  --signal: #E8440F;
  --on-signal: #FFFFFF;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s, color .4s;
}

a { color: inherit; }
a:hover { color: var(--signal); }
img { display: block; max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ---------- утилиты ---------- */
.mono { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.mute { color: var(--mute); }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 56px); position: relative; }
.ln { height: 1px; background: var(--line); width: 100%; }
.led { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--mute); }
.led.mint { background: #5DAA6B; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 18px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; color: var(--fg); background: transparent;
  border: 1px solid var(--line2); cursor: pointer;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { color: var(--bg); background: var(--fg); }
.btn-sig { background: var(--signal); border-color: var(--signal); color: var(--on-signal); font-weight: 700; }
.btn-sig:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.icon-btn { width: 44px; padding: 0; justify-content: center; border-color: transparent; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

/* ---------- шапка ---------- */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg); }
.logo:hover { color: var(--fg); }
.logo svg { stroke: var(--fg); }
.logo-word { font-family: var(--f-disp); font-weight: 700; font-size: 20px; letter-spacing: .04em; line-height: 1; }
.hdr-r { display: flex; gap: 8px; align-items: center; }

/* ---------- hero (компактный) ---------- */
.hero { padding: 40px 0 56px; }
.hero-grid { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.hero-title {
  font-family: var(--f-disp); font-weight: 700; text-transform: uppercase;
  font-size: clamp(48px, 7vw, 120px); line-height: .86; letter-spacing: -.02em; margin: 0;
}
.hero-side { display: flex; align-items: center; gap: 40px; }
.sphere { width: 200px; aspect-ratio: 1; flex: none; }
.sphere svg { width: 100%; height: 100%; display: block; overflow: visible; }
.s-ln { fill: none; stroke: var(--fg); }
.count { display: flex; flex-direction: column; gap: 10px; min-width: 200px; text-decoration: none; color: inherit; }
.count:hover { color: inherit; }
.count-big { font-family: var(--f-disp); font-weight: 700; font-size: 64px; line-height: .8; letter-spacing: -.03em; }

/* ---------- каталог ---------- */
.sec { padding: 0; }
.sec-head { display: flex; justify-content: space-between; gap: 24px; align-items: center; flex-wrap: wrap; padding: 24px 0; border-top: 1px solid var(--line); }
.sec-title { font-family: var(--f-disp); font-weight: 700; font-size: 28px; line-height: 1; letter-spacing: -.01em; margin: 0; text-transform: uppercase; }

.cards { display: grid; gap: 24px; padding-top: 8px; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
.cards-empty { padding: 56px 0; color: var(--mute); }
.card {
  display: flex; flex-direction: column;
  text-decoration: none; color: var(--c-fg); background: var(--c-bg);
  clip-path: polygon(0 18px, 18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
.card:hover { color: var(--c-fg); }
.card .mute { color: var(--c-mute); }
.card-art { aspect-ratio: 16 / 10; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--c-art); }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.card:hover .card-art img { transform: scale(1.03); }
.card-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card h3 { margin: 4px 0 0; font-family: var(--f-disp); font-weight: 700; font-size: 26px; line-height: 1.05; letter-spacing: -.01em; text-transform: uppercase; }
.card p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--c-mute); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: auto; padding-top: 16px; }
.go { display: inline-flex; align-items: center; gap: 10px; color: var(--c-fg); transition: color .2s; }
.go svg { transition: transform .3s; }
.card:hover .go { color: #FF5320; }
.card:hover .go svg { transform: translateX(4px); }
.card.locked .go { color: var(--c-mute); }

/* ---------- контакты / подвал ---------- */
.contacts { margin-top: 140px; padding: 32px 0; border-top: 1px solid var(--line); display: flex; gap: 16px 48px; flex-wrap: wrap; }
.contacts a { font-size: clamp(20px, 2vw, 26px); font-weight: 500; letter-spacing: -.01em; text-decoration: none; }
.ftr { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 0 32px; border-top: 1px solid var(--line); }
.ftr a { text-decoration: none; }

/* ==========================================================================
   Страница игры
   ========================================================================== */
.g-head { display: grid; gap: 32px; align-items: end; padding: 48px 0 32px; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); }
.g-title {
  font-family: var(--f-disp); font-weight: 700; text-transform: uppercase;
  font-size: clamp(40px, 5.6vw, 92px); line-height: .9; letter-spacing: -.02em; margin: 14px 0 0;
}
.g-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.g-specs div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }

.bay {
  padding: 12px; background: var(--c-bg); color: var(--c-fg);
  clip-path: polygon(0 20px, 20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}
.bay .mute { color: var(--c-mute); }
.bay .btn { border-color: rgba(236, 232, 224, .28); color: var(--c-fg); }
.bay .btn:hover { background: var(--c-fg); color: #0D0E10; }
.bay .btn-sig { background: #FF5320; border-color: #FF5320; color: #0D0E10; }
.bay .btn[disabled] { opacity: .4; pointer-events: none; }
.screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #0A0B0C; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 4; background: #000; }
.screen:fullscreen { aspect-ratio: auto; }
.idle { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; padding: 24px; }
.cover-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .3; }
.play {
  width: 96px; height: 96px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #ECE8E0; border: 1px solid rgba(236, 232, 224, .3); background: transparent;
  transition: background-color .2s, color .2s, border-color .2s;
}
.play:hover { background: #FF5320; color: #0D0E10; border-color: #FF5320; }
.play[disabled] { opacity: .35; cursor: not-allowed; }
.play[disabled]:hover { background: transparent; color: #ECE8E0; border-color: rgba(236, 232, 224, .3); }
.boot { position: absolute; inset: 0; z-index: 5; padding: clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; background: #0A0B0C; }
.boot-lines { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.boot .ok { color: #FF5320; }
.bar { height: 2px; background: rgba(236, 232, 224, .12); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: #FF5320; transform-origin: 0 50%; transform: scaleX(0); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 4px 2px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.info { padding: 80px 0 0; max-width: 720px; }
.h2 { font-family: var(--f-disp); font-weight: 700; text-transform: uppercase; font-size: 28px; line-height: 1; letter-spacing: -.01em; margin: 0 0 20px; }
.body { font-size: 19px; line-height: 1.55; margin: 0; text-wrap: pretty; }
.body + .body { margin-top: 1em; }

.feats { padding: 80px 0 0; }
.feat-list { margin: 0; display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.feat-list div { padding: 16px 0; border-top: 1px solid var(--line); }
.feat-list dt { font-family: var(--f-disp); font-weight: 700; font-size: 18px; text-transform: uppercase; margin-bottom: 6px; }
.feat-list dd { margin: 0; font-size: 15px; line-height: 1.45; color: var(--mute); }

.shots { padding: 80px 0 0; }
.shot-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(480px, 100%), 1fr)); }
.shot { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shot a { display: block; aspect-ratio: 2 / 1; overflow: hidden; background: var(--c-art); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.shot a:hover img { transform: scale(1.02); }

.more { padding: 120px 0 0; }
.more-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 24px 0; }
.mini-row { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.mini {
  display: grid; grid-template-columns: 112px 1fr auto; gap: 18px; align-items: center; padding: 12px;
  text-decoration: none; color: var(--c-fg); background: var(--c-bg);
  clip-path: polygon(0 12px, 12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.mini:hover { color: var(--c-fg); }
.mini:hover .go { color: #FF5320; }
.mini .mute { color: var(--c-mute); }
.mini-art { aspect-ratio: 4 / 3; position: relative; overflow: hidden; background: var(--c-art); }
.mini-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini strong { display: block; font-family: var(--f-disp); font-weight: 700; font-size: 18px; text-transform: uppercase; margin-bottom: 6px; }

.notfound { padding: 120px 0; display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }

/* ---------- адаптив ---------- */
@media (max-width: 720px) {
  .hero-side { width: 100%; justify-content: space-between; gap: 24px; }
  .sphere { width: 120px; }
  .count { min-width: 0; flex: 1; }
  .g-specs { grid-template-columns: minmax(0, 1fr); }
  .mini { grid-template-columns: 80px 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card:hover .go svg, .card:hover .card-art img, .shot a:hover img { transform: none; }
}
