@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ── Theme tokens ───────────────────────────────────────────────────────────
   Edit colors here. Dark mode overrides follow below.
   ────────────────────────────────────────────────────────────────────────── */
:root {
  --color-bg:         #ffffff;
  --color-text:       #111111;
  --color-muted:      #555555;
  --color-surface:    #ffffff;
}

[data-theme="dark"] {
  --color-bg:         #111111;
  --color-text:       #eeeeee;
  --color-muted:      #aaaaaa;
  --color-surface:    #1a1a1a;
}

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

html {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  color: var(--color-text);
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Nav */

nav {
  padding: 1.5rem 0;
  border-bottom: 1px solid currentColor;
}

nav .container {
  display: flex;
  align-items: baseline;
  gap: 2rem;
}

nav .wordmark {
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}

nav a {
  font-size: 0.875rem;
  text-decoration: none;
  color: inherit;
}

nav a:hover {
  text-decoration: underline;
}

/* Nav dropdown */

.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 0.5rem;
  background: var(--color-surface);
  border: 1px solid currentColor;
  min-width: 10rem;
  z-index: 100;
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  text-decoration: underline;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  display: block;
}

/* Main */

main {
  flex: 1;
  padding: 3rem 0;
}

/* Footer */

footer {
  padding: 1.5rem 0;
  border-top: 1px solid currentColor;
  font-size: 0.8125rem;
}

/* Typography */

h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.25rem;
}

/* Game grid on home */

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

.game-card {
  border: 1px solid currentColor;
  padding: 1.25rem;
}

.game-card h2 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.game-card p {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.game-card .badge {
  font-size: 0.75rem;
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* Game icon */

.game-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin-bottom: 1.25rem;
  display: block;
}

/* Page header */

.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid currentColor;
}

.page-header p {
  font-size: 1.0625rem;
}

/* App Store link */

.app-store-link {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid currentColor;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
}

.app-store-link:hover {
  text-decoration: none;
  opacity: 0.7;
}

/* Support & contact */

.support-game {
  border-top: 1px solid currentColor;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.support-game:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* Contact form */

form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
}

input, textarea, select {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid currentColor;
  background-color: var(--color-bg);
  color: var(--color-text);
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 8rem;
}

button[type="submit"] {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border: 1px solid currentColor;
  background-color: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  align-self: flex-start;
}

button[type="submit"]:hover {
  opacity: 0.7;
}

/* Prose (privacy policy etc.) */

.prose h2:first-of-type {
  margin-top: 0;
}

.prose p + ul {
  margin-top: -0.5rem;
}

/* Dark mode toggle */

#theme-toggle {
  font-family: inherit;
  font-size: 0.8125rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
  line-height: 1;
}

#theme-toggle:hover {
  opacity: 0.6;
}

/* Responsive */

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  nav .container {
    gap: 1.25rem;
  }
}
