/* ============================================================
   Damjan Games — homepage
   Theme: "night atlas" (shared design language with the games,
   tokens copied — each game ships its own self-contained CSS).
   Mobile-first: base rules target phone portrait; wider
   viewports switch the game list to a multi-column grid at the
   same 641px breakpoint the games use. Hover effects live under
   @media (hover: hover) so taps never stick.
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #0F172A;
  --surface: #1E293B;
  --border: #334155;
  --text: #F1F5F9;
  --muted: #94A3B8;
  --accent: #F59E0B;
  --good: #34D399;
  --bad: #F87171;
  --radius: 16px;
  --font-display: 'Archivo Black', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(1200px 700px at 50% -10%, #1a2745 0%, var(--bg) 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  display: flex;
  justify-content: center;
  padding: max(10px, env(safe-area-inset-top))
           max(14px, env(safe-area-inset-right))
           max(10px, env(safe-area-inset-bottom))
           max(14px, env(safe-area-inset-left));
}

.site {
  width: min(960px, 100%);
  display: flex;
  flex-direction: column;
}

/* ============ Header ============ */

.site-header {
  text-align: center;
  margin: 24px 0 28px;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.brand-accent {
  color: var(--accent);
}

.tagline {
  color: var(--muted);
  margin-top: 8px;
  font-size: 1rem;
}

/* ============ Games list ============ */

.site-main {
  flex: 1;
}

.games {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.game-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.game-card:active {
  transform: scale(0.98);
}

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

.game-thumb {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.game-info {
  display: block;
  padding: 14px 16px 16px;
}

.game-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.3px;
}

.game-desc {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.noscript {
  text-align: center;
  padding: 20px 0;
}

.noscript a {
  color: var(--accent);
}

/* ============ Footer ============ */

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 32px;
  padding-bottom: 6px;
}

/* ============ Wider viewports ============ */

@media (min-width: 641px) {
  .site-header {
    margin: clamp(28px, 6vh, 64px) 0 36px;
  }

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

  .game-thumb {
    height: 150px;
  }
}

@media (hover: hover) {
  .game-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.18);
  }
}
