@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  --bg: #f6f1e8;
  --bg-glow: rgba(249, 115, 22, 0.22);
  --surface: #ffffff;
  --surface-2: #f7f0e6;
  --surface-border: rgba(59, 35, 20, 0.12);
  --text: #23180f;
  --text-muted: #6e5a47;
  --accent: #f97316;
  --accent-2: #ef4444;
  --accent-3: #0f766e;
  --ring: rgba(249, 115, 22, 0.35);
  --shadow-soft: 0 14px 30px rgba(37, 24, 12, 0.12);
  --shadow-strong: 0 22px 55px rgba(37, 24, 12, 0.2);
  --radius-lg: 22px;
  --radius-md: 14px;
}

:root[data-theme="ocean"] {
  --bg: #e9f5ff;
  --bg-glow: rgba(56, 189, 248, 0.25);
  --surface: #ffffff;
  --surface-2: #eaf6ff;
  --surface-border: rgba(3, 38, 68, 0.12);
  --text: #0f172a;
  --text-muted: #486581;
  --accent: #0284c7;
  --accent-2: #14b8a6;
  --accent-3: #f97316;
  --ring: rgba(2, 132, 199, 0.3);
  --shadow-soft: 0 16px 32px rgba(2, 41, 70, 0.12);
  --shadow-strong: 0 26px 58px rgba(2, 41, 70, 0.2);
}

:root[data-theme="forest"] {
  --bg: #ecf4ef;
  --bg-glow: rgba(34, 197, 94, 0.2);
  --surface: #ffffff;
  --surface-2: #e6f1e8;
  --surface-border: rgba(17, 56, 35, 0.12);
  --text: #0f1f16;
  --text-muted: #466354;
  --accent: #16a34a;
  --accent-2: #ca8a04;
  --accent-3: #0f766e;
  --ring: rgba(22, 163, 74, 0.35);
  --shadow-soft: 0 14px 30px rgba(10, 38, 22, 0.12);
  --shadow-strong: 0 24px 56px rgba(10, 38, 22, 0.2);
}

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

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif !important;
  color: var(--text) !important;
  background: radial-gradient(1200px 600px at 10% 0%, var(--bg-glow), transparent 55%),
              radial-gradient(1000px 600px at 90% 10%, rgba(236, 72, 153, 0.12), transparent 55%),
              var(--bg) !important;
  line-height: 1.6;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -40% -30% auto -30%;
  height: 60%;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.6), transparent 60%);
  opacity: 0.7;
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3, h4 {
  font-family: "Fraunces", "Times New Roman", serif;
  letter-spacing: 0.5px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.app-shell {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 52px);
}

.landing {
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-page .app-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-hero {
  width: min(560px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(24px, 6vw, 56px);
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hero-title {
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  margin: 0 0 0.75rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  color: var(--accent-3);
  margin-bottom: 1rem;
  font-weight: 600;
}

.hero-card,
.panel {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: clamp(20px, 4vw, 32px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.5rem;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface-border);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px dashed var(--surface-border);
  box-shadow: none;
}

.games-page .page-header {
  text-align: center;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: clamp(16px, 2.5vw, 24px);
}

.game-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), var(--surface));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
}

.game-card p {
  color: var(--text-muted);
  margin: 0;
}

.theme-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  z-index: 50;
}

.theme-switcher select {
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.theme-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .theme-switcher {
    inset: auto 16px 16px auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
