:root {
  color-scheme: dark;
  --bg: #111316;
  --ink: #f7f4ea;
  --muted: #b8b7ad;
  --panel: rgba(27, 30, 34, 0.82);
  --panel-solid: #1b1e22;
  --line: rgba(255, 255, 255, 0.14);
  --gold: #f4c85f;
  --mint: #73d889;
  --coral: #f46d5f;
  --cyan: #77c8e8;
  --violet: #a998ff;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(135deg, rgba(244, 200, 95, 0.16), transparent 28%),
    linear-gradient(220deg, rgba(119, 200, 232, 0.14), transparent 34%),
    linear-gradient(180deg, #181a1e 0%, #0f1114 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

#ambientCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.34;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(17, 19, 22, 0.78);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--coral));
  color: #171717;
  font-size: 0.82rem;
  box-shadow: 0 8px 24px var(--shadow);
}

.nav-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-actions::-webkit-scrollbar {
  display: none;
}

.icon-button,
.launch-button,
.play-link {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.icon-button {
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.icon-button.active,
.icon-button:hover {
  border-color: rgba(244, 200, 95, 0.6);
  background: rgba(244, 200, 95, 0.14);
  color: var(--ink);
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 52px) 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2.3rem, 8vw, 5.75rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 420px) max-content;
  gap: 12px;
  align-items: center;
}

.search-field {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.search-field span {
  color: var(--cyan);
  text-align: center;
  font-size: 1.4rem;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.launch-button,
.play-link {
  display: inline-grid;
  place-items: center;
  background: var(--gold);
  color: #151515;
  box-shadow: 0 8px 0 rgba(91, 70, 20, 0.72);
}

.launch-button {
  min-width: 142px;
  padding: 0 18px;
}

.featured {
  position: relative;
  min-height: clamp(280px, 48vw, 480px);
  margin-bottom: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15191c;
  box-shadow: 0 22px 60px var(--shadow);
}

#featuredArt {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.featured-copy {
  position: absolute;
  left: clamp(18px, 4vw, 42px);
  bottom: clamp(18px, 4vw, 38px);
  width: min(390px, calc(100% - 36px));
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.72);
}

.featured-copy p:last-child {
  max-width: 32rem;
  margin-bottom: 0;
  color: #f1eee4;
  font-size: 1.05rem;
  line-height: 1.45;
}

.library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-weight: 800;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.game-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.card-art {
  display: block;
  width: 100%;
  aspect-ratio: 12 / 7;
  background: #20252b;
}

.card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.tag {
  margin-bottom: 8px;
  color: var(--mint);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.game-card h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  line-height: 1.1;
}

.description {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.play-link {
  min-height: 42px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

@media (max-width: 700px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-row,
  .card-body {
    grid-template-columns: 1fr;
  }

  .launch-button,
  .play-link {
    width: 100%;
  }
}
