:root {
  --bg: #0a0a0f;
  --bg-elev: #14141c;
  --bg-sunk: #06060a;
  --line: #262633;
  --line-soft: #1c1c26;
  --text: #e8e8f0;
  --muted: #9a9aae;
  --accent: #ff2e88;
  --accent-soft: rgba(255, 46, 136, 0.12);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(900px 500px at 50% -10%, rgba(255, 46, 136, 0.07), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- шапка ---------- */

.site-head {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--line-soft);
}

.site-head h1 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: clamp(30px, 6vw, 46px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 26px rgba(255, 46, 136, 0.45);
}

.site-head .tagline {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 17px;
}

.intro {
  margin: 28px 0 0;
  max-width: 68ch;
  color: var(--muted);
}

.intro strong { color: var(--text); font-weight: 600; }

/* ---------- галерея ---------- */

.section-title {
  margin: 48px 0 20px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  padding-bottom: 8px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  text-decoration: none;
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card-shot {
  position: relative;
  aspect-ratio: 256 / 240;
  background: var(--bg-sunk);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.card-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

/* мягкие развёртки поверх скриншота */
.card-shot::after,
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.55;
}

.card-body { padding: 18px 18px 20px; }

.card-body h3 {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.06em;
}

.genre {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.card-body p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }

.card-test {
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--muted);
}

.card-test b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- страница игры ---------- */

.back {
  display: inline-block;
  margin: 28px 0 22px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.back:hover { color: var(--accent); }

.game-head { margin-bottom: 26px; }

.game-head h1 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: clamp(24px, 5vw, 34px);
  letter-spacing: 0.1em;
  text-shadow: 0 0 22px rgba(255, 46, 136, 0.35);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

/* корпус экрана */
.screen-shell {
  padding: 14px;
  background: #101018;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.7);
}

.screen {
  position: relative;
  aspect-ratio: 256 / 240;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}

.screen canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(6, 6, 10, 0.88);
}

.screen-overlay[hidden] { display: none; }

.screen-overlay .status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 34ch;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn-ghost {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }

.screen-tools {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* правая колонка */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.panel h2 {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel p { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.panel p:last-child { margin-bottom: 0; }

.keys { display: grid; gap: 9px; }

.keyrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

kbd {
  flex: none;
  min-width: 62px;
  padding: 5px 9px;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

.notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: 14px;
  color: var(--text);
}

.notice[hidden] { display: none; }

/* ---------- подвал ---------- */

.site-foot {
  margin-top: 60px;
  padding: 26px 0 46px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 14px;
}

.site-foot p { margin: 0 0 6px; }

/* ---------- адаптив ---------- */

@media (max-width: 820px) {
  .game-layout { grid-template-columns: 1fr; gap: 22px; }
  .site-head { padding: 40px 0 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
