:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #232734;
  --border: #2a2f3d;
  --text: #e6e8ee;
  --text-dim: #9099aa;
  --accent: #6ea8ff;
  --accent-hover: #8cbaff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.site-header {
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.5rem 0 0;
  color: var(--text-dim);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

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

.game-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.game-card:hover,
.game-card:focus-visible {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

.game-card .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.game-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.game-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.4;
}

.card-logo {
  text-align: center;
  margin: 0.25rem 0 0.85rem;
  user-select: none;
}

.card-logo-title {
  font-family: "Bungee Inline", "Bungee", system-ui, sans-serif;
  font-size: 1.85rem;
  letter-spacing: 0.03em;
  line-height: 1;
  display: inline-block;
}

.card-logo-sub {
  margin-top: 0.5rem;
  font-family: "Bungee", system-ui, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.game-card.theme-mars {
  background: radial-gradient(ellipse at top, #11241a 0%, #0d1722 70%);
  border-color: #1f4a2a;
}

.game-card.theme-mars:hover,
.game-card.theme-mars:focus-visible {
  border-color: #6eff7a;
  background: radial-gradient(ellipse at top, #163322 0%, #11202c 70%);
}

.game-card.theme-mars .card-logo-title {
  color: #6eff7a;
  -webkit-text-stroke: 1.5px #08120a;
  text-shadow:
    1px 1px 0 #08120a,
    2px 2px 0 #08120a,
    3px 3px 0 #1a3a1a,
    4px 4px 0 #08120a,
    5px 5px 10px rgba(0, 0, 0, 0.6),
    0 0 14px rgba(110, 255, 122, 0.3);
  transform: skewX(-6deg);
}

.game-card.theme-mars .card-logo-sub {
  color: #ff5e5e;
  text-shadow: 1px 1px 0 #2a0a0a, 0 0 8px rgba(255, 94, 94, 0.35);
}

.empty-state, .error-state {
  text-align: center;
  color: var(--text-dim);
  padding: 3rem 1rem;
}

.error-state { color: #ff8a8a; }

[hidden] { display: none !important; }

.player {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 10;
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.player-bar button {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

.player-bar button:hover { color: var(--accent-hover); border-color: var(--accent); }

#player-title {
  font-weight: 600;
}

#game-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #000;
}
