:root {
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --ink: #23233a;
  --muted: #6b6b8a;
  --card: #ffffff;
  --bg: #f4f5ff;
  --border: #e3e4f5;
  --pill-bg: #eef0ff;
  --shadow: 0 12px 32px rgba(79, 70, 229, 0.14);
  color-scheme: light;
}

[data-theme="dark"] {
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --ink: #eef0ff;
  --muted: #a3aac8;
  --card: #23263b;
  --bg: #141627;
  --border: #33385a;
  --pill-bg: #2b2f4a;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Sora", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.ad-slot {
  display: none;
}

.ad-slot:not(.hidden) {
  display: block;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.22);
}

.card h2 {
  margin: 0;
  font-size: 1.3rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  flex-grow: 1;
}

.card .views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pill-bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  width: fit-content;
}

.card .play {
  display: inline-block;
  text-align: center;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 14px;
  padding: 12px 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card .play:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.35);
}

.card .play:focus-visible,
.theme-btn:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

.theme-btn {
  background: var(--pill-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
