/* ============================================================
 *  GOOD BOOK FUN — HOME PAGE STYLES
 * ============================================================
 *  Colors, fonts and logo come from theme.css (shared with the
 *  games so the whole site feels like one brand).
 * ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  background-image:
    radial-gradient(60vmax 60vmax at 12% -10%, var(--glow-1), transparent 60%),
    radial-gradient(55vmax 55vmax at 115% 5%, var(--glow-2), transparent 55%);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

.page {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1.1rem
           max(1.4rem, env(safe-area-inset-bottom)) 1.1rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- language toggle ---------- */
.lang-row { display: flex; gap: 0.5rem; justify-content: flex-end; }
.lang-chip {
  font-family: inherit; font-weight: 700; font-size: 0.82rem;
  padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer;
  background: var(--color-surface-2); color: var(--color-text-dim);
  border: 2px solid transparent; transition: all .18s;
}
.lang-chip.active { background: var(--color-primary); color: var(--color-primary-ink); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 1.4rem 0 2rem; }
.hero-logo {
  width: clamp(88px, 24vw, 128px); height: auto; display: block; margin: 0 auto 0.7rem;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.45));
  animation: floaty 4s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-title {
  font-size: clamp(2.3rem, 10vw, 3.4rem); font-weight: 700; line-height: 1; letter-spacing: -0.02em;
}
.hero-title span { color: var(--color-primary); }
.hero-tagline { font-size: clamp(1.05rem, 4.5vw, 1.3rem); font-weight: 600; margin-top: 0.7rem; }
.hero-intro { color: var(--color-text-dim); margin-top: 0.4rem; font-size: 0.98rem; }

/* ---------- game cards ---------- */
.games { display: flex; flex-direction: column; gap: 0.85rem; flex: 1; }

.game-card {
  --accent: var(--color-primary);
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none; color: inherit;
  background: var(--color-surface);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  transition: transform .14s ease, border-color .2s, background .2s;
  animation: cardIn .5s ease both;
  position: relative; overflow: hidden;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* accent glow strip on the left */
.game-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--accent);
}

a.game-card:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--color-surface-2); }
a.game-card:active { transform: scale(0.99); }

.card-icon {
  flex: none; width: 3.4rem; height: 3.4rem; border-radius: var(--radius-md);
  display: grid; place-items: center; font-size: 1.8rem;
  background: color-mix(in srgb, var(--accent) 18%, var(--color-surface-2));
}
.card-body { flex: 1; min-width: 0; }
.card-title { font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.card-desc { color: var(--color-text-dim); font-size: 0.9rem; margin-top: 0.25rem; line-height: 1.35; }

.card-cta { flex: none; }
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap;
  font-weight: 700; font-size: 0.85rem; padding: 0.5rem 0.9rem; border-radius: 999px;
}
.badge.play { background: var(--accent); color: #1a1205; }
.badge.soon { background: var(--color-surface-2); color: var(--color-text-dim); }

/* locked (coming soon) cards */
.game-card.locked { cursor: default; opacity: 0.72; }
.game-card.locked .card-icon { filter: grayscale(0.4); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 2rem; padding-top: 1.2rem; text-align: center;
  color: var(--color-text-dim); font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.footer-mark { width: 1.4rem; height: 1.4rem; opacity: 0.7; }

/* ---------- larger screens ---------- */
@media (min-width: 620px) {
  .games { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .game-card { flex-direction: column; text-align: center; align-items: center; padding: 1.6rem 1.2rem; }
  .game-card::before { width: 100%; height: 5px; bottom: auto; }
  .card-cta { margin-top: 0.3rem; }
}

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