/* play.hivup.pro: a bright, playful game launcher for children (and their grown-ups). */
@font-face {
  font-family: 'Baloo 2';
  src: url('fonts/Baloo2-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Baloo Chettan 2';
  src: url('fonts/BalooChettan2-Variable.ttf') format('truetype');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #1d2a4d;
  --ink-2: #44507a;
  --card: #ffffff;
  --sun: #ffc233;
  --play: #ff7a1a;
  --display: 'Baloo 2', 'Baloo Chettan 2', system-ui, sans-serif;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, 'Nirmala UI', 'Noto Sans Devanagari', 'Noto Sans Malayalam', sans-serif;
}
:lang(ml) {
  --display: 'Baloo Chettan 2', 'Baloo 2', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: var(--text);
  color: var(--ink);
  background: linear-gradient(180deg, #5bb8ff 0%, #9fdcff 38%, #fff3d6 100%);
  overflow-x: hidden;
}

/* ---------- Sky: drifting clouds and floating friends ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cloud {
  position: absolute; width: 180px; height: 60px; border-radius: 60px; background: #fff; opacity: 0.85;
  animation: drift 46s linear infinite;
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; top: -40px; left: 28px; }
.cloud::after { width: 104px; height: 104px; top: -54px; left: 70px; }
.c1 { top: 12%; left: -220px; }
.c2 { top: 34%; left: -220px; transform: scale(0.7); animation-duration: 62s; animation-delay: -20s; }
.c3 { top: 62%; left: -220px; transform: scale(1.15); animation-duration: 80s; animation-delay: -45s; }
@keyframes drift { to { left: 110%; } }
.floaty { position: absolute; font-size: 34px; animation: bob 5s ease-in-out infinite; filter: drop-shadow(0 6px 8px rgba(0,0,0,.12)); }
.f1 { top: 16%; left: 6%; }
.f2 { top: 9%; right: 10%; animation-delay: -1s; }
.f3 { bottom: 18%; left: 4%; animation-delay: -2s; }
.f4 { top: 46%; right: 4%; animation-delay: -3s; }
.f5 { bottom: 8%; right: 14%; animation-delay: -1.5s; }
.f6 { top: 72%; left: 46%; animation-delay: -2.5s; font-size: 26px; }
@keyframes bob { 50% { transform: translateY(-18px) rotate(8deg); } }

/* ---------- Header ---------- */
.top {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 18px 20px 0;
}
.brand img { display: block; height: 34px; width: auto; }
.langs { display: flex; gap: 6px; background: rgba(255,255,255,.75); padding: 5px; border-radius: 999px; box-shadow: 0 6px 18px rgba(29,42,77,.12); }
.langs button {
  font: 700 15px/1 var(--text); color: var(--ink-2); background: transparent; border: 0; border-radius: 999px;
  padding: 9px 14px; cursor: pointer; min-height: 40px;
}
.langs button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.langs button:focus-visible, a:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }

/* ---------- Title ---------- */
main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 18px 20px 24px; text-align: center; }
.hello {
  margin: 18px 0 0; font: 800 clamp(2.6rem, 7vw, 4.6rem)/1.05 var(--display); color: #fff;
  text-shadow: 0 4px 0 #2f7fc4, 0 10px 22px rgba(29,42,77,.25);
  animation: pop .8s cubic-bezier(.2, 1.6, .4, 1) both;
}
.choose { margin: 10px 0 26px; font: 700 clamp(1.1rem, 2.4vw, 1.45rem)/1.3 var(--text); color: var(--ink); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- Game cards ---------- */
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; text-align: left; }
.game {
  background: var(--card); border-radius: 32px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 6px 0 rgba(29,42,77,.08), 0 24px 50px rgba(29,42,77,.18);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: rise .7s ease both;
}
.game.hs { animation-delay: .12s; }
.game:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 6px 0 rgba(29,42,77,.08), 0 32px 60px rgba(29,42,77,.24); }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.art { display: block; aspect-ratio: 1024 / 500; overflow: hidden; background: #dff1ff; }
.art img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.game:hover .art img { transform: scale(1.05); }
.body { padding: 0 26px 24px; display: flex; flex-direction: column; flex: 1; }
.name { display: flex; align-items: center; gap: 14px; margin-top: -30px; }
.name img { width: 72px; height: 72px; border-radius: 20px; border: 4px solid #fff; box-shadow: 0 8px 18px rgba(29,42,77,.2); background: #fff; }
.name h2 { margin: 28px 0 0; font: 800 1.9rem/1.1 var(--display); }
.lv .name h2 { color: #1e88e5; }
.hs .name h2 { color: #0e7fa8; }
.tag { margin: 12px 0 14px; font-size: 1.08rem; line-height: 1.45; color: var(--ink-2); }
.chips { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: #f1f5ff; color: var(--ink-2); font-weight: 700; font-size: .9rem; padding: 6px 12px; border-radius: 999px; }
.play {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff;
  font: 800 1.6rem/1 var(--display); padding: 16px 34px 13px; border-radius: 999px;
  background: linear-gradient(135deg, #ffb020, var(--play)); box-shadow: 0 6px 0 #d75a00, 0 16px 26px rgba(255,122,26,.35);
  animation: wiggle 2.6s ease-in-out infinite;
}
.hs .play { background: linear-gradient(135deg, #2ec5e8, #0e7fa8); box-shadow: 0 6px 0 #0a5f7e, 0 16px 26px rgba(14,127,168,.35); }
.play:hover { filter: brightness(1.05); }
.play:active { transform: translateY(4px); box-shadow: 0 2px 0 #d75a00; }
@keyframes wiggle { 0%, 82%, 100% { transform: none; } 86% { transform: rotate(-4deg) scale(1.06); } 90% { transform: rotate(4deg) scale(1.06); } 94% { transform: rotate(-2deg); } }
.lang-note { margin: 12px 0 0; font-size: .95rem; font-weight: 700; color: #a24a00; background: #fff4e0; padding: 8px 12px; border-radius: 14px; }
.hs .lang-note { color: #0a5f7e; background: #e6f6fb; }
.grown { margin-top: auto; padding-top: 18px; border-top: 2px dashed #e5eaf5; font-size: .98rem; color: var(--ink-2); }
.grown-label { font-weight: 800; color: var(--ink); margin-right: 6px; }
.grown a { color: #1e63c7; font-weight: 800; }
.grown p { margin: 6px 0 0; }
.tip { margin: 26px 0 0; font-weight: 700; color: var(--ink-2); }

/* ---------- Footer ---------- */
.foot { position: relative; z-index: 1; text-align: center; padding: 10px 20px 30px; color: var(--ink-2); font-size: .95rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.foot a { color: var(--ink-2); }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .games { grid-template-columns: 1fr; gap: 22px; }
  .top { padding: 12px 14px 0; }
  .langs button { padding: 8px 10px; font-size: 14px; }
  .brand img { height: 28px; }
  .body { padding: 0 18px 20px; }
  .name img { width: 62px; height: 62px; }
  .name h2 { font-size: 1.6rem; }
  .play { align-self: stretch; justify-content: center; }
}

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