/* ===== WUBBLE.FUN - CSS ===== */
/* Aesthetic: Playful maximalism — bold colors, bouncy animations, bubbly shapes */

:root {
  --yellow: #FFD93D;
  --orange: #FF6B35;
  --pink: #FF4E9C;
  --teal: #00C9A7;
  --blue: #4E9CFF;
  --purple: #A855F7;
  --dark: #0F0E1A;
  --dark2: #1A1830;
  --dark3: #252340;
  --card-bg: #1E1C35;
  --text: #F0EEFF;
  --text-muted: #8B87B0;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}


  10% { opacity: 0.06; }
  90% { opacity: 0.06; }
  100% { transform: translateY(-20vh) scale(1.1); opacity: 0; }
}


/* ===== CANVAS BACKGROUND ===== */
#wubble-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 14, 26, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0 24px;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* LOGO */
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon { font-size: 28px; animation: wobble 3s ease-in-out infinite; }
.logo-text {
  font-family: 'Lilita One', cursive;
  font-size: 26px;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.logo-dot {
  font-family: 'Lilita One', cursive;
  font-size: 16px;
  color: var(--teal);
  margin-top: 8px;
}

@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-10deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(6deg); }
}

/* NAV */
.nav {
  display: flex;
  gap: 4px;
  margin-left: 16px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: var(--yellow);
}

/* SEARCH */
.search-wrap {
  margin-left: auto;
  flex-shrink: 0;
}

.search-input {
  background: var(--dark3);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  width: 260px;
  outline: none;
  transition: all 0.3s;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255,217,61,0.15);
  width: 300px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 24px 60px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(255,107,53,0.15) 0%, rgba(255,78,156,0.1) 40%, transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; }

.hero-title {
  font-family: 'Lilita One', cursive;
  font-size: clamp(42px, 8vw, 80px);
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
  animation: slideDown 0.7s ease both;
}

.hero-accent {
  background: linear-gradient(135deg, var(--yellow) 0%, var(--orange) 50%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(16px, 2.5vw, 22px);
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 32px;
  animation: slideDown 0.7s 0.15s ease both;
}

.hero-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: #1A0A00;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 18px;
  padding: 16px 40px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 8px 30px rgba(255,107,53,0.4);
  animation: slideDown 0.7s 0.3s ease both;
}

.hero-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 40px rgba(255,107,53,0.55);
}

.hero-emojis {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
  font-size: 36px;
  flex-wrap: wrap;
}

.hero-emojis span {
  display: inline-block;
  animation: floatBob 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.hero-emojis span:nth-child(1) { animation-delay: 0s; }
.hero-emojis span:nth-child(2) { animation-delay: 0.3s; }
.hero-emojis span:nth-child(3) { animation-delay: 0.6s; }
.hero-emojis span:nth-child(4) { animation-delay: 0.9s; }
.hero-emojis span:nth-child(5) { animation-delay: 1.2s; }
.hero-emojis span:nth-child(6) { animation-delay: 1.5s; }

@keyframes floatBob {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== SECTIONS ===== */
.section {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-title {
  font-family: 'Lilita One', cursive;
  font-size: clamp(24px, 4vw, 36px);
  margin-bottom: 28px;
  color: var(--text);
}

/* ===== CATEGORY BUTTONS ===== */
.categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cat-btn {
  background: var(--dark3);
  border: 2px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
}

.cat-btn:hover {
  border-color: var(--yellow);
  color: var(--yellow);
  transform: translateY(-2px);
}

.cat-btn.active {
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  border-color: transparent;
  color: #1A0A00;
  box-shadow: 0 4px 20px rgba(255,107,53,0.4);
}

/* ===== GAMES GRID ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

/* Loading */
.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px;
  color: var(--text-muted);
  font-weight: 700;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,217,61,0.2);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* No results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
}

/* GAME CARD */
.game-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid transparent;
  position: relative;
  animation: cardIn 0.4s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.game-card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: var(--yellow);
  box-shadow: 0 16px 40px rgba(255,217,61,0.2);
}

.game-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--dark3);
}

.game-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, var(--dark3), var(--dark2));
}

.game-info {
  padding: 12px 14px;
}

.game-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.play-badge {
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: #1A0A00;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 50px;
}

.game-card:hover .play-badge {
  animation: pulse 0.4s ease;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ===== LOAD MORE ===== */
.load-more-wrap {
  text-align: center;
  margin-top: 36px;
}

.load-more-btn {
  background: transparent;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 16px;
  padding: 14px 40px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
}

.load-more-btn:hover {
  background: var(--yellow);
  color: #1A0A00;
  transform: scale(1.04);
}

/* ===== GAME MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.open { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: var(--dark2);
  border-radius: 24px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(255,217,61,0.3);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes modalIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.modal-title {
  font-family: 'Lilita One', cursive;
  font-size: 20px;
  color: var(--yellow);
}

.modal-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text);
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--pink);
  transform: scale(1.1);
}

.modal-body {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.game-frame {
  width: 100%;
  height: 500px;
  border: none;
  display: block;
  background: #000;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.fullscreen-btn {
  background: var(--dark3);
  border: 2px solid rgba(255,255,255,0.1);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.fullscreen-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.modal-gamename {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ===== FOOTER ===== */
.footer {
  position: relative;
  z-index: 1;
  background: var(--dark2);
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  padding: 40px 24px;
  margin-top: 48px;
}

.footer-logo {
  font-family: 'Lilita One', cursive;
  font-size: 22px;
  color: var(--yellow);
  margin-bottom: 10px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-copy {
  color: rgba(255,255,255,0.2);
  font-size: 12px;
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav { display: none; }
  .search-input { width: 180px; }
  .search-input:focus { width: 200px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .game-frame { height: 340px; }
  .hero { padding: 50px 16px 40px; }
  .hero-emojis { font-size: 28px; gap: 12px; }
}

@media (max-width: 480px) {
  .header-inner { gap: 12px; }
  .search-input { width: 140px; font-size: 13px; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .game-frame { height: 260px; }
}
