/* ==========================================================================
   Lili Magic — landing page
   Palette borrowed from the two games: the mermaid's sea blues and pink, and
   Save the Animals' blood red and sunny yellow.
   ========================================================================== */
:root {
  --pink: #ff6fa5;
  --pink-dark: #e85a90;
  --sea: #1c7fbf;
  --sea-deep: #0f4f82;
  --sky: #eafbff;
  --ink: #243b53;
  --blood: #a3202f;
  --blood-deep: #3a0710;
  --sun: #ffc93c;
  --sun-deep: #e0a51c;
  --white: #ffffff;
  --font: "Baloo 2", "Comic Sans MS", "Trebuchet MS", "Segoe UI",
          "Noto Sans", "Noto Sans Hebrew", "Noto Sans Arabic", "Noto Sans Devanagari",
          system-ui, sans-serif;
  --radius: 26px;
  --shadow: 0 18px 44px rgba(15, 79, 130, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #cfeefc 0%, transparent 70%),
    linear-gradient(180deg, var(--sky) 0%, #d7f2fb 45%, #bfe6f7 100%);
  -webkit-font-smoothing: antialiased;
  padding-inline: 16px;
  padding-bottom: 40px;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ---- Language picker (round flag button, top end corner) ------------- */
.lang-wrap {
  position: fixed;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 50;
}
.lang-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid var(--white);
  background: var(--white);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 79, 130, 0.25);
  overflow: hidden;
  transition: transform .15s ease;
}
.lang-btn:hover, .lang-btn:focus-visible { transform: scale(1.08); outline: none; }
.lang-btn:focus-visible { box-shadow: 0 0 0 4px rgba(28, 127, 191, 0.45); }
.lang-btn .lang-flag { width: 100%; height: 100%; object-fit: cover; }

.lang-menu {
  position: absolute;
  top: 60px;
  inset-inline-end: 0;
  min-width: 190px;
  background: var(--white);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 14px 36px rgba(15, 79, 130, 0.28);
  display: grid;
  gap: 2px;
}
.lang-menu[hidden] { display: none; }
.lang-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 1rem; font-weight: 600;
  cursor: pointer;
  text-align: start;
}
.lang-item:hover, .lang-item:focus-visible { background: var(--sky); outline: none; }
.lang-item.is-active { background: #dff3fd; color: var(--sea-deep); }
.lang-item .lang-flag {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  border: 2px solid #eef6fa; flex: 0 0 auto;
}

/* ---- Hero ------------------------------------------------------------- */
.hero {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 0 18px;
  text-align: center;
}
.logo {
  margin: 0 auto 6px;
  width: 130px; height: auto;
  filter: drop-shadow(0 4px 0 rgba(255,255,255,.9));
}
.site-title {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: .5px;
  color: var(--sea-deep);
  text-shadow: 0 3px 0 #fff, 0 8px 22px rgba(28,127,191,.25);
}
.site-title::after {
  content: "";
  display: block;
  width: 110px; height: 8px;
  margin: 12px auto 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--pink), var(--sun));
}
.tagline {
  margin: 14px auto 0;
  max-width: 560px;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  font-weight: 600;
  color: #35557a;
}

/* floating bubbles behind the hero — pure decoration */
.bubbles { position: absolute; inset: 0; pointer-events: none; z-index: -1; overflow: visible; }
.bubbles span {
  position: absolute; bottom: -20px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0, rgba(255,255,255,.35) 60%, rgba(28,127,191,.15) 100%);
  border: 1.5px solid rgba(255,255,255,.9);
  animation: rise 9s linear infinite;
  opacity: 0;
}
.bubbles span:nth-child(1) { left: 8%;  animation-delay: 0s;   width: 14px; height: 14px; }
.bubbles span:nth-child(2) { left: 20%; animation-delay: 2s;   width: 24px; height: 24px; }
.bubbles span:nth-child(3) { left: 33%; animation-delay: 4.5s; }
.bubbles span:nth-child(4) { left: 55%; animation-delay: 1s;   width: 12px; height: 12px; }
.bubbles span:nth-child(5) { left: 68%; animation-delay: 6s;   width: 28px; height: 28px; }
.bubbles span:nth-child(6) { left: 82%; animation-delay: 3s; }
.bubbles span:nth-child(7) { left: 92%; animation-delay: 7.5s; width: 16px; height: 16px; }
@keyframes rise {
  0%   { transform: translateY(0) translateX(0);     opacity: 0; }
  10%  { opacity: .9; }
  90%  { opacity: .6; }
  100% { transform: translateY(-260px) translateX(14px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bubbles span { animation: none; opacity: .5; bottom: auto; top: 20%; }
}

/* ---- Game cards ------------------------------------------------------- */
.games { max-width: 1040px; margin: 0 auto; }
.pick {
  text-align: center;
  margin: 18px 0 18px;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  color: var(--sea-deep);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}
.card {
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 26px 56px rgba(15, 79, 130, 0.26); }
.card-link {
  display: flex; flex-direction: column; height: 100%;
  color: inherit; text-decoration: none;
}
.card-link:focus-visible { outline: 4px solid var(--sun); outline-offset: -4px; border-radius: var(--radius); }

.card-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card-art img { transform: scale(1.05); }
.card-art .wave {
  position: absolute; left: 0; right: 0; bottom: -2px; height: 34px;
  background: var(--white);
  clip-path: polygon(0 60%, 6% 40%, 12% 60%, 18% 40%, 24% 60%, 30% 40%, 36% 60%, 42% 40%, 48% 60%, 54% 40%, 60% 60%, 66% 40%, 72% 60%, 78% 40%, 84% 60%, 90% 40%, 96% 60%, 100% 40%, 100% 100%, 0 100%);
}

.card-body { padding: 14px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 1.9rem);
  font-weight: 800; line-height: 1.15;
}
.card--sea   .card-title { color: var(--sea-deep); }
.card--blood .card-title { color: var(--blood); }
.card-text { margin: 0; font-size: 1.05rem; line-height: 1.45; color: #35557a; }

.chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: .85rem; font-weight: 700;
  padding: 5px 11px; border-radius: 999px;
}
.card--sea   .chips li { background: #e3f4fc; color: var(--sea-deep); }
.card--blood .chips li { background: #fdeaea; color: var(--blood); }

.play-btn {
  margin-top: auto;
  align-self: stretch;
  text-align: center;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 1.25rem; font-weight: 800;
  color: var(--white);
  box-shadow: 0 6px 0 var(--btn-shadow), 0 12px 24px rgba(0,0,0,.14);
  transition: transform .1s ease, box-shadow .1s ease;
}
.card--sea   .play-btn { background: linear-gradient(180deg, var(--pink), var(--pink-dark)); --btn-shadow: #c2447a; }
.card--blood .play-btn { background: linear-gradient(180deg, var(--sun), var(--sun-deep)); --btn-shadow: #b8860b; color: var(--blood-deep); }
.card-link:active .play-btn { transform: translateY(4px); box-shadow: 0 2px 0 var(--btn-shadow), 0 6px 14px rgba(0,0,0,.14); }

/* ---- Footer ----------------------------------------------------------- */
.foot {
  max-width: 720px;
  margin: 40px auto 0;
  text-align: center;
  display: grid; gap: 14px; justify-items: center;
}
.foot-note { margin: 0; color: #35557a; font-weight: 600; line-height: 1.5; }
.support-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--white);
  color: var(--pink-dark);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(15, 79, 130, 0.16);
  transition: transform .15s ease;
}
.support-link:hover { transform: scale(1.04); }
.support-link svg { width: 20px; height: 20px; fill: var(--pink); }
.foot-langs { margin: 0; font-size: .9rem; color: #5c7a99; font-weight: 600; }

/* ---- Small phones ----------------------------------------------------- */
@media (max-width: 420px) {
  .hero { padding-top: 70px; }
  .card-body { padding: 10px 18px 20px; }
}
