/* ─── VARIABLES ─────────────────────────────────────────────────────────── */
:root {
  --bg:        #07080f;
  --bg2:       #0d0f1a;
  --bg3:       #131629;
  --border:    #1e2340;
  --accent:    #00ffe1;
  --accent2:   #ff3a6e;
  --accent3:   #ffe100;
  --text:      #c8cce8;
  --text-dim:  #545878;
  --radius:    4px;
  --font-head: 'Orbitron', monospace;
  --font-body: 'Space Mono', monospace;
}

/* ─── RESET ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── SCANLINES & NOISE ─────────────────────────────────────────────────── */
.scanlines {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
}

.noise {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 998;
  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: 256px 256px;
}

/* ─── ACCENT ─────────────────────────────────────────────────────────────── */
.accent { color: var(--accent); }

/* ─── HEADER ─────────────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(7,8,15,0.92);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #fff;
}
.logo-bracket { color: var(--text-dim); font-weight: 400; }
.logo-accent  { color: var(--accent); }

.nav-links { margin-left: auto; display: flex; gap: 24px; }
.nav-links a {
  font-family: var(--font-head);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

.header-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-dim);
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.dot.online {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ─── HERO ───────────────────────────────────────────────────────────────── */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 32px 60px;
  display: flex;
  align-items: center;
  gap: 64px;
  position: relative;
}

.hero-text h1 {
  font-family: var(--font-head);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  color: #fff;
  letter-spacing: -0.01em;
}
.hero-text p {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-dim);
  max-width: 340px;
}

.hero-decoration {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 160px;
}

.hex-grid {
  width: 260px; height: 160px;
  background:
    radial-gradient(ellipse at 60% 50%, rgba(0,255,225,0.07) 0%, transparent 70%);
  border: 1px solid var(--border);
  position: relative;
  clip-path: polygon(8% 0%, 92% 0%, 100% 50%, 92% 100%, 8% 100%, 0% 50%);
  animation: hexpulse 4s ease-in-out infinite;
}
@keyframes hexpulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,255,225,0); }
  50%      { box-shadow: 0 0 40px 10px rgba(0,255,225,0.08); }
}

/* ─── GAMES SECTION ─────────────────────────────────────────────────────── */
.games-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.section-header h2 {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  white-space: nowrap;
}
.section-header .line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* ─── GAME CARD ─────────────────────────────────────────────────────────── */
.game-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(0,255,225,0.12);
}
.game-card:hover .card-play {
  opacity: 1;
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: var(--bg3);
}
.card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  font-size: 48px;
}

.card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,255,225,0.08);
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 36px;
}

.card-body {
  padding: 14px 16px;
}
.card-title {
  font-family: var(--font-head);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #fff;
  margin-bottom: 4px;
}
.card-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}
.card-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.tag.multi { border-color: var(--accent); color: var(--accent); }

/* ─── LOADING ────────────────────────────────────────────────────────────── */
.loading-placeholder {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px;
  color: var(--text-dim);
}
.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── EMPTY STATE ────────────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1/-1;
  padding: 60px 32px;
  text-align: center;
  color: var(--text-dim);
}
.empty-state .big-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 {
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state code {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--accent);
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-success {
  border-color: #00ff88;
  color: #00ff88;
}
.btn-success:hover, .btn-success.active {
  background: #00ff88;
  color: #000;
}
.btn-danger {
  border-color: var(--accent2);
  color: var(--accent2);
}
.btn-danger:hover { background: var(--accent2); color: #fff; }
.btn-small {
  padding: 6px 10px;
  font-size: 11px;
}

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 32px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
}

/* ─── HIDDEN ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
