:root {
  --bg: #f3f0e8;
  --bg-panel: rgba(255, 255, 255, 0.72);
  --bg-panel-strong: rgba(255, 255, 255, 0.9);
  --text: #182126;
  --muted: #5f6c74;
  --line: rgba(24, 33, 38, 0.12);
  --accent: #1d6b57;
  --accent-soft: #d7ece5;
  --shadow: 0 24px 60px rgba(42, 52, 57, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(237, 207, 159, 0.45), transparent 30%),
    radial-gradient(circle at bottom right, rgba(124, 175, 160, 0.28), transparent 28%),
    linear-gradient(180deg, #f6f3ec 0%, #ebe6dc 100%);
}

.launcher {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 56px;
}

.hero,
.library {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero {
  padding: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.intro {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.library {
  margin-top: 22px;
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.section-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: end;
}

.count {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

.game-grid[data-layout="tiles"] {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.game-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-panel-strong);
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.game-grid[data-layout="list"] .game-card {
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
}

.game-grid[data-layout="tiles"] .game-card {
  grid-template-rows: auto 1fr;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(29, 107, 87, 0.32);
  box-shadow: 0 18px 36px rgba(29, 107, 87, 0.12);
  outline: none;
}

.game-thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.34), transparent 32%),
    linear-gradient(135deg, #bfd8d0, #dbe8df);
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(24, 33, 38, 0.08);
}

.game-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-thumbnail-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-content {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 6px 6px 6px 2px;
}

.game-tag {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-card strong {
  font-size: 1.35rem;
}

.game-description {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.view-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.view-button {
  border: 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.view-button.is-active {
  background: var(--accent);
  color: #f7faf8;
}

.empty-state {
  margin: 20px 0 4px;
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .launcher {
    width: min(100% - 18px, 980px);
    padding: 18px 0 28px;
  }

  .hero,
  .library {
    border-radius: 22px;
  }

  .hero {
    padding: 24px;
  }

  .library {
    padding: 18px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .section-tools {
    justify-content: start;
  }

  .game-grid[data-layout="list"] .game-card {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
