/* ============================================
   PLAYFUN GAMES — CARTOON Edition v2
   Colorful type · Clean neutral surfaces
   ============================================ */

/* ── Fonts ── */
@font-face { font-family:'Helvetica'; src:url('assets/fonts/Helvetica.ttf') format('truetype'); font-weight:400; font-display:swap; }
@font-face { font-family:'Helvetica'; src:url('assets/fonts/Helvetica-Bold.ttf') format('truetype'); font-weight:700; font-display:swap; }
@font-face { font-family:'Helvetica'; src:url('assets/fonts/Helvetica-Light.ttf') format('truetype'); font-weight:300; font-display:swap; }
@font-face { font-family:'Astalamet'; src:url('assets/fonts/astalamet-pro.otf') format('opentype'); font-weight:400; font-display:swap; }
@font-face { font-family:'Astalamet'; src:url('assets/fonts/astalamet-pro-bold.otf') format('opentype'); font-weight:700; font-display:swap; }
@font-face { font-family:'Astalamet'; src:url('assets/fonts/astalamet-pro-medium.otf') format('opentype'); font-weight:500; font-display:swap; }
@font-face { font-family:'Astalamet'; src:url('assets/fonts/astalamet-pro-light.otf') format('opentype'); font-weight:300; font-display:swap; }
@font-face { font-family:'Realtime'; src:url('assets/fonts/realtimeroundedtest-regular.otf') format('opentype'); font-weight:400; font-display:swap; }
@font-face { font-family:'Realtime'; src:url('assets/fonts/realtimeroundedtest-bold.otf') format('opentype'); font-weight:700; font-display:swap; }
@font-face { font-family:'Realtime'; src:url('assets/fonts/realtimeroundedtest-semibold.otf') format('opentype'); font-weight:600; font-display:swap; }
@font-face { font-family:'Realtime'; src:url('assets/fonts/realtimeroundedtest-light.otf') format('opentype'); font-weight:300; font-display:swap; }

/* ── Light ── */
:root {
  --bg: #FAFAFA;
  --bg-alt: #F3F3F1;
  --text: #151515;
  --text-2: #5A5A58;
  --text-3: #A0A09C;
  --border: rgba(0,0,0,0.07);
  --accent: #151515;
  --accent-soft: rgba(21,21,21,0.05);
  --card: rgba(255,255,255,0.6);
  --shadow: 0 2px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.06);
  --radius: 16px;
  --max-w: 1120px;
  --ease: cubic-bezier(0.4,0,0.2,1);
  --bounce: cubic-bezier(0.34,1.56,0.64,1);

  /* pop colors — text only */
  --pop-pink: #E8457A;
  --pop-blue: #2E96FF;
  --pop-green: #2ECC71;
  --pop-yellow: #F5A623;
  --pop-purple: #8B5CF6;
  --pop-orange: #F47432;
}

/* ── Dark ── */
[data-theme="dark"] {
  --bg: #0F0F0F;
  --bg-alt: #1A1A18;
  --text: #EAEAE8;
  --text-2: #8A8A86;
  --text-3: #4A4A48;
  --border: rgba(255,255,255,0.07);
  --accent: #EAEAE8;
  --accent-soft: rgba(234,234,232,0.06);
  --card: rgba(20,20,18,0.6);
  --shadow: 0 2px 16px rgba(0,0,0,0.20);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.30);

  --pop-pink: #FF6B9D;
  --pop-blue: #5CB8FF;
  --pop-green: #5EE882;
  --pop-yellow: #FFD43B;
  --pop-purple: #A78BFA;
  --pop-orange: #FF9A5C;
}

/* ── Reset ── */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }

body {
  font-family: 'Realtime', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration:none; color:inherit; }
img { display:block; max-width:100%; }
button { font-family:inherit; cursor:pointer; border:none; background:none; }
ul { list-style:none; }

.container { max-width:var(--max-w); margin:0 auto; padding:0 32px; }

/* ════════════════════
   NAVBAR
   ════════════════════ */
.nav {
  position: fixed; inset: 0 0 auto 0;
  z-index: 100; padding: 20px 0;
  transition: background 0.35s, padding 0.35s, backdrop-filter 0.35s, border-color 0.35s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  border-bottom-color: var(--border);
}

.nav .container { display:flex; align-items:center; justify-content:space-between; }

.logo { display:flex; align-items:center; gap:10px; }

.logo-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.35s var(--bounce), background 0.35s;
  flex-shrink: 0;
}

.logo:hover .logo-circle { transform: scale(1.12) rotate(15deg); }

.logo-text {
  font-family: 'Helvetica', sans-serif;
  font-weight: 700; font-size: 19px;
  letter-spacing: -0.3px;
  color: var(--text);
  transition: color 0.35s;
}

.logo-text em { font-style: normal; color: var(--pop-pink); }

.nav-right { display:flex; align-items:center; gap:4px; }

.nav-link {
  font-family: 'Realtime'; font-size: 13px; font-weight: 400;
  color: var(--text-2); padding: 8px 16px; border-radius: 99px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--text); background: var(--accent-soft); }
.nav-link.active { color: var(--text); font-weight: 600; }

.nav-btn {
  font-family: 'Realtime'; font-size: 13px; font-weight: 600;
  color: var(--bg); background: var(--text);
  padding: 9px 22px; border-radius: 99px; margin-left: 4px;
  transition: opacity 0.25s, transform 0.25s;
}

.nav-btn:hover { opacity: 0.8; transform: translateY(-1px); }

.theme-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  transition: background 0.25s, transform 0.3s var(--bounce);
  margin-left: 8px; position: relative;
}

.theme-btn:hover { background: var(--accent-soft); transform: rotate(20deg); }

.theme-btn svg {
  width: 16px; height: 16px;
  stroke: var(--text-2); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  position: absolute; transition: opacity 0.3s, transform 0.3s;
}

.theme-btn .moon { opacity:0; transform:rotate(90deg) scale(0.5); }
[data-theme="dark"] .theme-btn .sun { opacity:0; transform:rotate(-90deg) scale(0.5); }
[data-theme="dark"] .theme-btn .moon { opacity:1; transform:rotate(0) scale(1); }

.hamburger { display:none; flex-direction:column; gap:5px; padding:6px; }
.hamburger span { width:20px; height:2.5px; background:var(--text); border-radius:1px; transition:0.25s; }

/* ════════════════════
   HERO
   ════════════════════ */
.hero {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 140px 32px 100px;
  position: relative;
}

.hero-blob { display: none; }

.hero-label {
  font-family: 'Realtime'; font-size: 12px; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 36px;
  animation: popIn 0.6s var(--bounce) both;
  transition: color 0.35s;
}

.hero h1 {
  font-family: 'Astalamet', serif;
  font-weight: 700;
  font-size: clamp(54px, 10vw, 130px);
  line-height: 0.95; letter-spacing: -3px;
  text-transform: lowercase;
  margin-bottom: 28px;
  animation: popIn 0.7s var(--bounce) 0.06s both;
  transition: color 0.35s;
  color: var(--text);
}

.hero h1 .word-blue { color: var(--pop-blue); }
.hero h1 .word-pink { color: var(--pop-pink); }
.hero h1 .dot { color: var(--pop-yellow); }

.hero-sub {
  font-family: 'Realtime'; font-size: clamp(15px,1.8vw,18px); font-weight: 300;
  color: var(--text-2); max-width: 420px; line-height: 1.7;
  margin-bottom: 48px;
  animation: popIn 0.7s var(--bounce) 0.14s both;
  transition: color 0.35s;
}

.hero-cta {
  display: flex; align-items: center; gap: 14px;
  animation: popIn 0.7s var(--bounce) 0.22s both;
}

.btn {
  font-family: 'Realtime'; font-size: 14px; font-weight: 600;
  padding: 14px 34px; border-radius: 99px;
  transition: transform 0.3s var(--bounce), opacity 0.25s, background 0.25s, color 0.25s, border-color 0.25s;
}

.btn:hover { transform: translateY(-2px); }

.btn--fill {
  background: var(--text); color: var(--bg);
}

.btn--fill:hover { opacity: 0.85; }

.btn--ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}

.btn--ghost:hover { border-color: var(--text-2); }

.scroll-hint {
  position: absolute; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: popIn 0.7s var(--bounce) 0.45s both;
}

.scroll-hint span {
  font-family: 'Realtime'; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-3); transition: color 0.35s;
}

.scroll-line {
  width: 1px; height: 40px;
  background: var(--border);
  position: relative; overflow: hidden;
  transition: background 0.35s;
}

.scroll-line::after {
  content: ''; position: absolute; top: -100%;
  width: 100%; height: 50%;
  background: var(--text-3);
  animation: scrollDown 2s var(--ease) infinite;
}

@keyframes scrollDown { 0%{top:-50%} 100%{top:150%} }

/* ════════════════════
   MARQUEE
   ════════════════════ */
.marquee-wrap {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0; overflow: hidden;
  transition: border-color 0.35s;
}

.marquee {
  display: flex; gap: 40px;
  animation: marquee 22s linear infinite;
  width: max-content;
}

.marquee span {
  font-family: 'Realtime'; font-size: 13px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  white-space: nowrap;
}

.marquee span:nth-child(8n+1) { color: var(--pop-pink); }
.marquee span:nth-child(8n+2) { color: var(--pop-blue); }
.marquee span:nth-child(8n+3) { color: var(--pop-green); }
.marquee span:nth-child(8n+4) { color: var(--pop-yellow); }
.marquee span:nth-child(8n+5) { color: var(--pop-orange); }
.marquee span:nth-child(8n+6) { color: var(--pop-purple); }
.marquee span:nth-child(8n+7) { color: var(--pop-blue); }
.marquee span:nth-child(8n+8) { color: var(--pop-pink); }

.marquee span::after {
  content: '·';
  margin-left: 40px;
  color: var(--text-3);
}

@keyframes marquee { to { transform: translateX(-50%); } }

/* ════════════════════
   SECTIONS
   ════════════════════ */
.section { padding: 100px 0; }

.section-label {
  font-family: 'Realtime'; font-size: 11px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--pop-blue);
  margin-bottom: 10px; transition: color 0.35s;
}

.section-title {
  font-family: 'Astalamet', serif; font-weight: 400;
  font-size: clamp(30px,5vw,56px);
  text-transform: lowercase; letter-spacing: -1px;
  line-height: 1.1; margin-bottom: 48px;
  transition: color 0.35s;
}

/* ════════════════════
   CATEGORY PILLS
   ════════════════════ */
.cats { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:48px; }

.cat-pill {
  font-family: 'Realtime'; font-size: 13px; font-weight: 400;
  color: var(--text-2); padding: 10px 22px;
  border-radius: 99px; border: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.cat-pill:hover {
  color: var(--text);
  border-color: var(--text-2);
  transform: translateY(-1px);
}

.cat-pill.active {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

.cat-count {
  display: inline-block; margin-left: 7px;
  font-size: 11px; font-weight: 400; opacity: 0.55;
  font-variant-numeric: tabular-nums;
}
.cat-pill.active .cat-count { opacity: 0.75; }

/* ════════════════════
   GAME CARDS
   ════════════════════ */
.games-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.game {
  border-radius: var(--radius); overflow: hidden;
  position: relative; cursor: pointer;
  aspect-ratio: 3 / 4; background: var(--bg-alt);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--bounce), box-shadow 0.35s, border-color 0.35s, background 0.35s;
}

.game:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--text-3);
}

.game img { width:100%; height:100%; object-fit:cover; transition: transform 0.5s var(--ease); }
.game:hover img { transform: scale(1.05); }

.game-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 14px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.80), rgba(0,0,0,0.30) 55%, transparent);
}

/* Name is ALWAYS visible on the card */
.game-name, .game-info h3 {
  font-family:'Realtime'; font-size:14px; font-weight:700; color:#fff;
  margin:0; line-height:1.2; text-shadow:0 1px 4px rgba(0,0,0,0.6);
}
/* Genre only reveals on hover */
.game-genre, .game-info p {
  font-family:'Realtime'; font-size:11px; font-weight:300; color:rgba(255,255,255,0.78);
  letter-spacing:1px; text-transform:uppercase; margin:3px 0 0;
  opacity:0; max-height:0; overflow:hidden; transform:translateY(4px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), max-height 0.28s var(--ease);
}
.game:hover .game-genre, .game:hover .game-info p { opacity:1; max-height:22px; transform:translateY(0); }

.game-badge {
  position: absolute; top: 14px; left: 14px;
  font-family: 'Realtime'; font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 99px;
  color: var(--bg); background: var(--text);
}

/* ════════════════════
   SEARCH + BROWSE BAR
   ════════════════════ */
.browse { display: flex; flex-direction: column; gap: 18px; margin-bottom: 36px; }
.browse .cats { margin-bottom: 0; }
.search-wrap { position: relative; width: 100%; max-width: 380px; }
.search-ico {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-2); pointer-events: none;
}
.game-search {
  width: 100%; font-family: 'Realtime'; font-size: 14px; color: var(--text);
  padding: 13px 18px 13px 44px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-alt);
  outline: none; transition: border-color 0.2s, background 0.2s;
}
.game-search::placeholder { color: var(--text-3); }
.game-search:focus { border-color: var(--text-3); }

/* ── favourite heart on each card ── */
.fav-btn {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  font-size: 16px; line-height: 1; color: #fff;
  background: rgba(0,0,0,0.42); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.2s, transform 0.15s, background 0.2s;
}
.game:hover .fav-btn { opacity: 1; }
.fav-btn:hover { transform: scale(1.14); }
.fav-btn.on { opacity: 1; color: #FF5DAA; background: rgba(0,0,0,0.55); }

/* ── continue / favourites strips ── */
.strip { margin-bottom: 30px; }
.strip-title {
  font-family: 'Realtime'; font-size: 14px; font-weight: 700;
  color: var(--text-2); margin-bottom: 14px; letter-spacing: 0.5px;
}
.strip-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.strip-row .game { flex: 0 0 148px; }

.no-results { text-align: center; color: var(--text-2); font-family: 'Realtime'; padding: 36px 0; }
.game.is-hidden { display: none !important; }

/* ════════════════════
   STATS
   ════════════════════ */
.stats {
  display: grid; grid-template-columns: repeat(3,1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.35s;
}

.stat {
  text-align: center; padding: 52px 20px;
  border-right: 1px solid var(--border);
  transition: border-color 0.35s;
}

.stat:last-child { border-right: none; }

.stat-num {
  font-family: 'Astalamet', serif; font-weight: 700;
  font-size: clamp(38px,5.5vw,60px);
  text-transform: lowercase; letter-spacing: -1px;
}

.stat:nth-child(1) .stat-num { color: var(--pop-pink); }
.stat:nth-child(2) .stat-num { color: var(--pop-blue); }
.stat:nth-child(3) .stat-num { color: var(--pop-green); }

.stat-lbl {
  font-family: 'Realtime'; font-size: 12px; font-weight: 300;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-3); margin-top: 6px;
  transition: color 0.35s;
}

/* ════════════════════
   CTA
   ════════════════════ */
.cta { padding: 120px 32px; text-align: center; }

.cta-blob { display: none; }

.cta-title {
  font-family: 'Astalamet', serif; font-weight: 700;
  font-size: clamp(34px,7vw,80px);
  text-transform: lowercase; letter-spacing: -2px; line-height: 1.0;
  margin-bottom: 20px; transition: color 0.35s;
}

.cta-title .q { color: var(--pop-yellow); }

.cta-sub {
  font-family: 'Realtime'; font-size: 16px; font-weight: 300;
  color: var(--text-2); max-width: 380px;
  margin: 0 auto 40px; line-height: 1.7;
  transition: color 0.35s;
}

/* ════════════════════
   FOOTER
   ════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 44px 0; transition: border-color 0.35s;
}

.footer .container {
  display: flex; align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}

.footer-copy { font-family:'Realtime'; font-size:12px; color:var(--text-3); font-weight:300; transition:color 0.35s; }

.footer-links { display:flex; gap:24px; }
.footer-links a { font-family:'Realtime'; font-size:12px; color:var(--text-3); font-weight:400; transition:color 0.25s; }
.footer-links a:hover { color: var(--text); }

/* ════════════════════
   ANIMATIONS
   ════════════════════ */
@keyframes popIn {
  from { opacity:0; transform:translateY(28px) scale(0.97); }
  to { opacity:1; transform:translateY(0) scale(1); }
}

.reveal {
  opacity:0; transform:translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.visible { opacity:1; transform:translateY(0); }

/* ════════════════════
   RESPONSIVE
   ════════════════════ */
@media (max-width:900px) {
  .games-row { grid-template-columns: repeat(2,1fr); }
  .stats { grid-template-columns:1fr; }
  .stat { border-right:none; border-bottom:1px solid var(--border); padding:36px 20px; }
  .stat:last-child { border-bottom:none; }
}

@media (max-width:680px) {
  .nav-right .nav-link, .nav-right .nav-btn { display:none; }
  .hamburger { display:flex; }

  .nav-right.open {
    position:absolute; top:calc(100% + 8px); right:32px;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter:blur(24px);
    border:1px solid var(--border); border-radius:var(--radius);
    padding:16px; flex-direction:column; gap:4px;
    box-shadow:var(--shadow-lg); animation: popIn 0.2s var(--bounce);
  }
  .nav-right.open .nav-link, .nav-right.open .nav-btn { display:flex; }

  .games-row { grid-template-columns:1fr 1fr; gap:12px; }
  .hero { padding:120px 24px 80px; }
  .hero-cta { flex-direction:column; width:100%; }
  .hero-cta .btn { width:100%; text-align:center; }
}

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