/* ==========================================================
   Zain El-Abidin's Games Hub — Storybook Arcade Portal
   ========================================================== */

:root {
  --sky-top: #D7EEFF;
  --sky-bottom: #F5FAFF;
  --meadow: #D8F7DE;
  --paper: #FFFFFF;
  --ink: #1B2845;
  --muted: #536482;

  --blue: #2D9CDB;
  --blue-dark: #1672A8;
  --coral: #FF5A5F;
  --coral-dark: #CE353B;
  --gold: #FFB800;
  --gold-dark: #D18A00;
  --green: #2ECC71;
  --green-dark: #1CA254;
  --purple: #7C4DFF;
  --purple-dark: #5828D6;

  --font-ar: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-en: 'Fredoka', sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-ar);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 62%, var(--meadow) 100%);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a {
  text-decoration: none;
  color: inherit;
}

a:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 4px;
}

/* Decorative Sky */
.sky-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  filter: drop-shadow(0 8px 16px rgba(45, 156, 219, 0.1));
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.c1 { width: 160px; height: 50px; top: 28px; right: 7%; }
.c1::before { width: 68px; height: 68px; top: -30px; left: 26px; }
.c1::after { width: 52px; height: 52px; top: -20px; right: 24px; }

.c2 { width: 130px; height: 42px; top: 88px; left: 6%; }
.c2::before { width: 56px; height: 56px; top: -24px; left: 22px; }
.c2::after { width: 42px; height: 42px; top: -15px; right: 20px; }

.hill {
  position: absolute;
  bottom: -100px;
  left: -12%;
  right: -12%;
  height: 190px;
  background: linear-gradient(180deg, #B5F0BE 0%, #8EE39D 100%);
  border-radius: 50% 50% 0 0;
  opacity: 0.7;
}

/* Main Container */
.hub-shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Hero Banner */
.hero-banner {
  background: var(--paper);
  border-radius: 32px;
  padding: 24px 28px;
  border: 3px solid #DFEEFB;
  box-shadow: 0 9px 0 #C8E0F4, 0 20px 38px rgba(27, 40, 69, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-avatar {
  width: 78px;
  height: 78px;
  border-radius: 26px;
  background: linear-gradient(135deg, #FFF0B3 0%, #FFD54F 100%);
  border: 3px solid #F5A623;
  box-shadow: 0 6px 0 #D98A00;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  flex-shrink: 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: #EAF6FF;
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.65rem, 3.8vw, 2.45rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--ink);
}

.hero-title .kid-name {
  color: var(--coral);
}

.hero-sub {
  margin: 6px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
}

.hero-badge-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stars-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #FFF6CC;
  border: 2.5px solid #FFD54F;
  box-shadow: 0 5px 0 #E8B828;
  font-size: 1.15rem;
  font-weight: 900;
  color: #875500;
}

.kg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #EDF4FF;
  border: 2.5px solid #C8DDF8;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--blue-dark);
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--paper);
  border-radius: 30px;
  overflow: hidden;
  border: 3px solid #DFEEFB;
  box-shadow: 0 10px 0 #C8E0F4, 0 22px 42px rgba(27, 40, 69, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 0 #C8E0F4, 0 28px 50px rgba(27, 40, 69, 0.14);
}

.game-card.card-poppy {
  border-color: #D2DCF7;
  box-shadow: 0 10px 0 #B8C8EE, 0 22px 42px rgba(27, 40, 69, 0.13);
}

.card-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #141B34;
  border-bottom: 3px solid #E5F0FA;
}

.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s ease;
}

.game-card:hover .card-preview img {
  transform: scale(1.04);
}

.preview-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.tag-abc {
  background: linear-gradient(135deg, var(--blue), #43B5F4);
}

.tag-poppy {
  background: linear-gradient(135deg, #29B6F6, #FF5252);
  font-family: var(--font-en);
}

.card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--ink);
}

.card-emoji {
  font-size: 1.85rem;
}

.card-desc {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.65;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.f-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: #F1F6FC;
  border: 1.5px solid #DCE8F6;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
}

.play-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 22px;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 900;
  color: #FFFFFF;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.play-cta:active {
  transform: translateY(4px);
}

.cta-abc {
  background: linear-gradient(180deg, #3DA8E8 0%, var(--blue) 100%);
  box-shadow: 0 6px 0 var(--blue-dark);
}
.cta-abc:active { box-shadow: 0 2px 0 var(--blue-dark); }

.cta-poppy {
  background: linear-gradient(180deg, #FF6B6B 0%, var(--coral) 100%);
  box-shadow: 0 6px 0 var(--coral-dark);
}
.cta-poppy:active { box-shadow: 0 2px 0 var(--coral-dark); }

/* Footer */
.hub-footer {
  text-align: center;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--muted);
  padding: 6px 0;
}

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

  .hero-banner {
    padding: 20px 18px;
  }
}

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