/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --ink:       #0a0a0f;
  --surface:   #10101a;
  --card:      #14141f;
  --card-hov:  #1a1a28;
  --border:    rgba(255,255,255,0.07);
  --border-hi: rgba(45,226,230,0.5);
  --cyan:      #2de2e6;
  --pink:      #ff57ff;
  --purple:    #a855f7;
  --purple-d:  #7c3aed;
  --glow-c:    rgba(45,226,230,0.35);
  --glow-p:    rgba(168,85,247,0.35);
  --text:      #f0f0f8;
  --muted:     #6b7280;
  --ff-pixel:  'Press Start 2P', monospace;
  --ff-vt:     'VT323', monospace;
  --ff-body:   'Inter', sans-serif;
  --r:         12px;
}

html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* noise texture overlay */
.noise {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #2a2a3d; border-radius: 3px; }

.container { max-width: 1360px; margin: 0 auto; padding: 0 24px; }

/* ─── Beta banner ────────────────────────────────────────────────────────── */
.beta-banner {
  background: linear-gradient(90deg, rgba(168,85,247,0.12) 0%, rgba(45,226,230,0.08) 100%);
  border-bottom: 1px solid rgba(168,85,247,0.2);
  color: var(--muted);
  font-family: var(--ff-vt);
  font-size: 17px;
  text-align: center;
  padding: 8px 16px;
  letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.beta-badge {
  font-family: var(--ff-pixel);
  font-size: 7px;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--purple-d), var(--purple));
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(168,85,247,0.4);
}
.beta-banner a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(45,226,230,0.4);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.beta-banner a:hover {
  color: #fff;
  text-decoration-color: var(--cyan);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; padding-top: 14px; padding-bottom: 14px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--ff-pixel);
  font-size: clamp(12px, 2vw, 17px);
  color: var(--text);
  text-decoration: none;
  letter-spacing: 1px;
}
.logo-icon {
  color: var(--pink);
  animation: blink 1.3s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.logo-accent { color: var(--cyan); }

.header-right { display: flex; align-items: center; }

.search-box {
  position: relative;
  display: flex; align-items: center;
}
.search-ico {
  position: absolute; left: 12px;
  width: 15px; height: 15px;
  color: var(--muted); pointer-events: none;
  transition: color 0.15s;
}
.search-box:focus-within .search-ico { color: var(--cyan); }

#search {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 13px;
  padding: 8px 16px 8px 36px;
  width: min(300px, 50vw);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#search:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(45,226,230,0.12);
}
#search::placeholder { color: var(--muted); }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 100px 0 90px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(168,85,247,0.22) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 100%, rgba(45,226,230,0.12) 0%, transparent 60%),
    linear-gradient(180deg, rgba(13,13,24,0.82) 0%, rgba(10,10,15,0.95) 100%),
    url("images/bg_1.jpg") center / cover no-repeat;
}

.hero-scanlines {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.12) 3px,
    rgba(0,0,0,0.12) 4px
  );
}

.hero-body {
  position: relative; z-index: 2;
}

.hero-eyebrow {
  font-family: var(--ff-pixel);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--pink);
  text-shadow: 0 0 12px rgba(255,87,255,0.6);
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--ff-pixel);
  font-size: clamp(22px, 5vw, 50px);
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-title-glow {
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(45,226,230,0.55), 0 0 60px rgba(45,226,230,0.25);
}

.hero-sub {
  font-family: var(--ff-vt);
  font-size: clamp(20px, 3vw, 28px);
  color: var(--muted);
  margin-bottom: 40px;
  letter-spacing: 0.03em;
}

.btn-primary {
  display: inline-block;
  font-family: var(--ff-pixel);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-d), var(--purple));
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 0 24px var(--glow-p);
  transition: box-shadow 0.2s, transform 0.15s;
}
.btn-primary:hover {
  box-shadow: 0 0 40px var(--glow-p);
  transform: translateY(-2px);
  text-decoration: none;
  color: #fff;
}

.hero-scroll-hint {
  position: absolute; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--ff-vt);
  font-size: 24px;
  color: var(--muted);
  opacity: 0.5;
  animation: bounce 2s ease-in-out infinite;
  z-index: 2;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ─── Catalog ────────────────────────────────────────────────────────────── */
.catalog {
  padding: 72px 0 100px;
  background: linear-gradient(180deg, var(--ink) 0%, #0c0c14 100%);
}

.catalog-head {
  display: flex; flex-wrap: wrap; gap: 24px;
  align-items: flex-start; justify-content: space-between;
  margin-bottom: 40px;
}

.catalog-title {
  font-family: var(--ff-pixel);
  font-size: clamp(14px, 2.5vw, 22px);
  color: var(--text);
  margin-bottom: 10px;
  text-shadow: 0 0 20px var(--glow-c);
}

.catalog-sub {
  font-family: var(--ff-vt);
  font-size: 20px;
  color: var(--muted);
}

/* ─── Genre bar ──────────────────────────────────────────────────────────── */
.genre-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: 700px;
}

.genre-pill {
  font-family: var(--ff-pixel);
  font-size: 8px;
  letter-spacing: 0.04em;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}
.genre-pill:hover {
  border-color: var(--border-hi);
  color: var(--cyan);
  box-shadow: 0 0 10px var(--glow-c);
}
.genre-pill.active {
  background: var(--purple-d);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 0 16px var(--glow-p);
}
.pill-count { font-size: 7px; opacity: 0.65; }

.no-results {
  text-align: center;
  font-family: var(--ff-vt);
  font-size: 26px;
  color: var(--muted);
  padding: 80px 0;
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-5px) scale(1.015);
  border-color: var(--border-hi);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(45,226,230,0.15);
}
.game-card:hover .cover-overlay,
.game-card:focus-visible .cover-overlay { opacity: 1; }
.game-card:hover .game-cover img { transform: scale(1.08); filter: brightness(0.5); }

.game-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #07070f;
  overflow: hidden;
}
.game-cover img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}

/* CRT lines */
.game-cover::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px
  );
}

.cover-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-family: var(--ff-pixel);
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0;
  transition: opacity 0.2s;
}
.cover-overlay svg { width: 28px; height: 28px; }
@media (hover: none) { .cover-overlay { opacity: 0.8; } }

/* LIVE badge */
.card-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  background: var(--cyan);
  color: #000;
  font-family: var(--ff-pixel);
  font-size: 7px;
  letter-spacing: 0.1em;
  padding: 3px 7px;
  border-radius: 4px;
}

.game-info { padding: 10px 12px 13px; flex: 1; }
.game-title {
  font-family: var(--ff-vt);
  font-size: 17px;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}
.game-meta { display: flex; gap: 8px; align-items: center; }
.game-genre {
  font-family: var(--ff-pixel);
  font-size: 7px;
  background: rgba(168,85,247,0.13);
  color: #c084fc;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(168,85,247,0.22);
  white-space: nowrap;
}
.game-year {
  font-family: var(--ff-vt);
  font-size: 16px;
  color: var(--muted);
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(10px) saturate(140%);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-inner {
  width: min(1000px, 100%);
  height: min(660px, 92vh);
  background: #0d0d16;
  border: 1px solid rgba(168,85,247,0.4);
  border-radius: 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 0 0 1px rgba(168,85,247,0.1), 0 40px 120px rgba(0,0,0,0.8);
}

.modal-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid rgba(168,85,247,0.2);
  flex-shrink: 0;
}
.modal-header-info { display: flex; align-items: baseline; gap: 10px; overflow: hidden; }
.modal-title {
  font-family: var(--ff-pixel);
  font-size: clamp(9px, 1.5vw, 13px);
  color: #e9d5ff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modal-year {
  font-family: var(--ff-vt);
  font-size: 18px;
  color: var(--muted);
  white-space: nowrap;
}

.close-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  line-height: 1;
}
.close-btn:hover { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }

#dos-container {
  flex: 1; min-height: 0;
  background: #000; position: relative;
}
#dos-container > * { width: 100% !important; height: 100% !important; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  background: var(--ink);
}
.footer-inner {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 12px;
}
.footer-copy, .footer-powered {
  font-family: var(--ff-vt);
  font-size: 17px;
  color: var(--muted);
}

/* ─── Hero decorative floating images ────────────────────────────────────── */
.hero-decor {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none; overflow: hidden;
}

.hero-decor-img {
  position: absolute;
  border-radius: 10px;
  object-fit: cover;
  opacity: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06);
  animation: hero-img-in 0.8s ease forwards, hero-float 8s ease-in-out infinite;
}

@keyframes hero-img-in {
  from { opacity: 0; transform: translateY(20px) var(--base-transform, rotate(0deg)); }
  to   { opacity: var(--target-opacity, 0.22); transform: translateY(0) var(--base-transform, rotate(0deg)); }
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0px) var(--base-transform, rotate(0deg)); }
  50%       { transform: translateY(-10px) var(--base-transform, rotate(0deg)); }
}

.hero-decor-1 {
  width: 200px; height: 140px;
  left: 3%; top: 15%;
  --base-transform: rotate(-8deg);
  --target-opacity: 0.28;
  animation-delay: 0.2s, 0.2s;
  animation-duration: 0.8s, 9s;
  filter: brightness(0.75) saturate(1.1);
}
.hero-decor-2 {
  width: 170px; height: 120px;
  left: 5%; bottom: 20%;
  --base-transform: rotate(6deg);
  --target-opacity: 0.2;
  animation-delay: 0.5s, 0.5s;
  animation-duration: 0.8s, 11s;
  filter: brightness(0.65) saturate(1.0);
}
.hero-decor-3 {
  width: 210px; height: 145px;
  right: 3%; top: 12%;
  --base-transform: rotate(7deg);
  --target-opacity: 0.28;
  animation-delay: 0.35s, 0.35s;
  animation-duration: 0.8s, 10s;
  filter: brightness(0.75) saturate(1.1);
}
.hero-decor-4 {
  width: 175px; height: 125px;
  right: 5%; bottom: 18%;
  --base-transform: rotate(-5deg);
  --target-opacity: 0.2;
  animation-delay: 0.6s, 0.6s;
  animation-duration: 0.8s, 12s;
  filter: brightness(0.65) saturate(1.0);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-decor-1, .hero-decor-2 { left: -2%; }
  .hero-decor-3, .hero-decor-4 { right: -2%; }
  .hero-decor-1, .hero-decor-3 { width: 155px; height: 110px; }
  .hero-decor-2, .hero-decor-4 { width: 130px; height: 95px; }
}

@media (max-width: 640px) {
  .hero { padding: 64px 0 56px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
  .modal-inner { height: 95vh; border-radius: 12px; }
  #search { width: 160px; }
  .catalog-head { flex-direction: column; }
  .hero-decor { display: none; }
}
