:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface-hover: #22223a;
  --border: #2e2e42;
  --text: #e2e2f0;
  --text-muted: #8888aa;
  --accent: #7c6af7;
  --accent-hover: #9d8fff;
  --card-thumb-bg: #12121c;
  --grid-dot: #2a2a3e;
  --header-bg: rgba(15, 15, 19, 0.9);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --tag-bg: #2a2a3e;
  --tag-text: #a0a0c8;
}

[data-theme="light"] {
  --bg: #f4f4f8;
  --surface: #ffffff;
  --surface-hover: #f0f0fa;
  --border: #d8d8e8;
  --text: #1a1a2e;
  --text-muted: #5a5a7a;
  --accent: #6355e8;
  --accent-hover: #4e41d6;
  --card-thumb-bg: #eaeaf8;
  --grid-dot: #c8c8e0;
  --header-bg: rgba(244, 244, 248, 0.92);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --tag-bg: #e8e8f4;
  --tag-text: #5050a0;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.25s, color 0.25s;
}

/* HEADER */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* THEME BUTTON */
.theme-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.theme-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

[data-theme="dark"] .theme-icon::before { content: "☀️"; }
[data-theme="light"] .theme-icon::before { content: "🌙"; }

/* MAIN */
main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* HERO */
.hero {
  padding: 56px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, #b06ef5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* GAMES SECTION */
.games-section h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

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

/* GAME CARD */
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  box-shadow: var(--shadow);
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 36px rgba(0,0,0,0.35);
  border-color: var(--accent);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 3/2;
  background: var(--card-thumb-bg);
  overflow: hidden;
}

.card-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

.card-tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 4px;
  margin-top: 4px;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 20px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .hero {
    padding: 36px 0 28px;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }
}
