/* Daily Casual Games — cool teal/cyan/indigo on deep navy. */
:root {
  color-scheme: dark;

  --bg-0: #0a1220;
  --bg-1: #0e1b2c;
  --bg-2: #070d18;

  --surface: rgba(224, 242, 255, 0.05);
  --surface-2: rgba(224, 242, 255, 0.015);
  --border: rgba(45, 212, 191, 0.16);
  --border-strong: rgba(56, 189, 248, 0.5);

  --text: #eaf3f8;
  --muted: #a6bccb;
  --faint: #6f8698;

  /* accent stops (also mirrored into SVG gradients in index.html) */
  --a1: #34e0d0;
  --a2: #38bdf8;
  --a2b: #6366f1;

  --ink: #06232e;          /* dark text sitting on an accent fill */
  --chalk: #eaf3f8;        /* light text on the board */
  --chalk-faint: rgba(234, 243, 248, 0.5);

  --pill-ink: #04202a;
  --glow: rgba(56, 189, 248, 0.4);
  --glow-a: rgba(56, 189, 248, 0.2);
  --glow-b: rgba(52, 224, 208, 0.16);
  --glow-c: rgba(99, 102, 241, 0.16);
  --ring: #38e0d0;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg-0);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layered background glows — fixed and behind everything, never overlaps content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(58% 52% at 12% 6%, var(--glow-a), transparent 60%),
    radial-gradient(52% 48% at 90% 2%, var(--glow-b), transparent 58%),
    radial-gradient(75% 62% at 52% 116%, var(--glow-c), transparent 60%),
    linear-gradient(162deg, var(--bg-1), var(--bg-0) 52%, var(--bg-2));
}

/* Subtle dot-grid texture — fixed, behind content. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1.5px);
  background-size: 24px 24px;
}

.page {
  position: relative;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(30px, 6vw, 76px) clamp(18px, 4vw, 40px) 40px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto clamp(30px, 5vw, 54px);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 7px 15px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--a1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.title {
  margin: 0;
  font-size: clamp(2.3rem, 8vw, 4.7rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, var(--a1), var(--a2) 55%, var(--a2b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: clamp(14px, 2.5vw, 20px) auto 0;
  max-width: 540px;
  font-size: clamp(1.02rem, 2.4vw, 1.28rem);
  color: var(--muted);
}

.trust {
  margin: 18px auto 0;
  font-size: 0.85rem;
  color: var(--faint);
  letter-spacing: 0.01em;
}

/* ---------- Game grid (3 + 2 on desktop, 2 on tablet, 1 on mobile) ---------- */
.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid > .card:nth-child(5) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 11px);
  }
}

@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(6, 1fr); }
  .grid > .card { grid-column: span 2; }
  .grid > .card:nth-child(4) { grid-column: 2 / span 2; }
  .grid > .card:nth-child(5) { grid-column: 4 / span 2; width: auto; justify-self: stretch; }
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(165deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px 14px 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 40px -20px rgba(0, 0, 0, 0.8),
    0 6px 16px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  will-change: transform;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 28px 60px -24px rgba(0, 0, 0, 0.85),
    0 0 0 1px var(--border-strong),
    0 22px 50px -28px var(--glow);
}

.card:active { transform: translateY(-1px) scale(0.99); }

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

.art {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 68%),
    linear-gradient(165deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.12));
}

.thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 8px 2px;
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card-desc {
  margin: 7px 0 14px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted);
}

.pill {
  align-self: flex-start;
  margin-top: auto;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--pill-ink);
  background: linear-gradient(100deg, var(--a1), var(--a2));
  border-radius: 999px;
  box-shadow: 0 8px 18px -8px var(--glow);
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.card:hover .pill {
  filter: brightness(1.08);
  box-shadow: 0 12px 26px -8px var(--glow);
}

/* ---------- SVG art helpers ---------- */
.thumb text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wend-halo { opacity: 0.5; }
.wh-trace { stroke-dashoffset: 0; }
.star { transform-box: fill-box; transform-origin: 50% 50%; }

.card:hover .wend-halo { animation: glowPulse 1.6s ease-in-out infinite; }
.card:hover .wh-trace { stroke-dasharray: 9 9; animation: dashFlow 0.9s linear infinite; }
.card:hover .ss-stars > g:nth-child(1) .star { animation: twinkle 1.7s ease-in-out infinite; }
.card:hover .ss-stars > g:nth-child(2) .star { animation: twinkle 1.7s ease-in-out 0.18s infinite; }
.card:hover .ss-stars > g:nth-child(3) .star { animation: twinkle 1.7s ease-in-out 0.36s infinite; }
.card:hover .ss-stars > g:nth-child(4) .star { animation: twinkle 1.7s ease-in-out 0.54s infinite; }
.card:hover .ss-stars > g:nth-child(5) .star { animation: twinkle 1.7s ease-in-out 0.72s infinite; }
.card:hover .cc-up { animation: ccUp 1.1s ease-in-out infinite; }
.card:hover .cc-down { animation: ccDown 1.1s ease-in-out infinite; }
.card:hover .eg-tray-tiles > g:nth-child(1) .eg-tile { animation: egBob 1.4s ease-in-out infinite; }
.card:hover .eg-tray-tiles > g:nth-child(2) .eg-tile { animation: egBob 1.4s ease-in-out 0.1s infinite; }
.card:hover .eg-tray-tiles > g:nth-child(3) .eg-tile { animation: egBob 1.4s ease-in-out 0.2s infinite; }
.card:hover .eg-tray-tiles > g:nth-child(4) .eg-tile { animation: egBob 1.4s ease-in-out 0.3s infinite; }
.card:hover .eg-tray-tiles > g:nth-child(5) .eg-tile { animation: egBob 1.4s ease-in-out 0.4s infinite; }

@keyframes glowPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.9; } }
@keyframes dashFlow { to { stroke-dashoffset: -36; } }
@keyframes twinkle { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.18); } }
@keyframes ccUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes ccDown { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2.5px); } }
@keyframes egBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* ---------- Footer ---------- */
.footer {
  margin-top: clamp(38px, 6vw, 64px);
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--faint);
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer a:hover {
  color: var(--a1);
  border-color: var(--border-strong);
}

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