/* ================================================
   iWebGames — style.css
   Global styles, animations, and component classes
   ================================================ */
/* ═══════════════════════════════════════════
   LOCAL FONTS — Fredoka One & Nunito
   ═══════════════════════════════════════════ */

/* ── Fredoka One (Display) ── */
@font-face {
    font-family: 'Fredoka';
    src: url('../fonts/fredoka/Fredoka-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ── Nunito (Body) ── */
@font-face {
    font-family: 'Nunito';
    src: url('../fonts/nunito/Nunito-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito';
    src: url('../fonts/nunito/Nunito-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito';
    src: url('../fonts/nunito/Nunito-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito';
    src: url('../fonts/nunito/Nunito-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito';
    src: url('../fonts/nunito/Nunito-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

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

/* ── Base ── */
body {
    font-family: 'Nunito', sans-serif;
    background: #0a0a1a;
    color: #e2e8f0;
    overflow-x: hidden;
}

.font-display {
    font-family: 'Fredoka', cursive;
    font-weight: 700;
}

/* ── Scrollbar ── */
.scroll-hidden::-webkit-scrollbar { display: none; }
.scroll-hidden { -ms-overflow-style: none; scrollbar-width: none; }

/* ────────────────────────────────────────────────
   ANIMATIONS
   ──────────────────────────────────────────────── */

/* Floating shapes */
@keyframes f1 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-18px) rotate(8deg); }
}
@keyframes f2 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-14px) rotate(-10deg); }
}
@keyframes f3 {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-22px) rotate(12deg); }
}
@keyframes f4 {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    50%       { transform: translate(8px, -16px) rotate(-15deg); }
}
@keyframes f5 {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-10px) scale(1.1); }
}

.fl1 { animation: f1 4s ease-in-out infinite; }
.fl2 { animation: f2 5s ease-in-out infinite 0.4s; }
.fl3 { animation: f3 3.5s ease-in-out infinite 0.8s; }
.fl4 { animation: f4 6s ease-in-out infinite 0.2s; }
.fl5 { animation: f5 3s ease-in-out infinite 0.6s; }

/* Pulse glow */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(79, 172, 254, 0.3); }
    50%       { box-shadow: 0 0 40px rgba(79, 172, 254, 0.5); }
}
.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* Shimmer text */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.shimmer {
    background: linear-gradient(90deg, #4facfe, #c084fc, #fbbf24, #4ade80, #4facfe);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 5s linear infinite;
}

/* SVG draw-on line */
@keyframes draw-line {
    0%   { stroke-dashoffset: 200; }
    100% { stroke-dashoffset: 0; }
}
.draw-a {
    stroke-dasharray: 200;
    animation: draw-line 3s ease-in-out infinite;
}

/* Bounce scroll indicator */
@keyframes bounce-s {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}
.bounce-s { animation: bounce-s 2s ease-in-out infinite; }

/* Fade up on scroll */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.anim-fu { opacity: 0; }
.anim-fu.visible { animation: fade-up 0.6s ease-out forwards; }

/* Tile pop */
@keyframes tile-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.tile-pop { animation: tile-pop 0.4s ease-out forwards; opacity: 0; }

/* Wiggle on hover */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25%       { transform: rotate(-3deg); }
    75%       { transform: rotate(3deg); }
}
.wiggle-hover:hover { animation: wiggle 0.4s ease-in-out; }

/* Pop in */
@keyframes pop-in {
    0%   { transform: scale(0) rotate(-10deg); opacity: 0; }
    70%  { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.pop-in { animation: pop-in 0.5s ease-out forwards; opacity: 0; }

/* Slow spin */
@keyframes spin-slow {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}
.spin-slow { animation: spin-slow 12s linear infinite; }

/* Sparkle */
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0); }
    50%       { opacity: 1; transform: scale(1) rotate(180deg); }
}
.sparkle { animation: sparkle 2s ease-in-out infinite; }

/* Confetti fall */
@keyframes confetti-fall {
    0%   { transform: translateY(-10px) rotate(0); opacity: 1; }
    100% { transform: translateY(20px) rotate(360deg); opacity: 0; }
}
.confetti { animation: confetti-fall 3s ease-in infinite; }

/* Wave divider */
@keyframes wave {
    0%   { d: path('M0,20 Q80,0 160,20 T320,20 T480,20 T640,20 T800,20 T960,20 V40 H0 Z'); }
    50%  { d: path('M0,20 Q80,40 160,20 T320,20 T480,20 T640,20 T800,20 T960,20 V40 H0 Z'); }
    100% { d: path('M0,20 Q80,0 160,20 T320,20 T480,20 T640,20 T800,20 T960,20 V40 H0 Z'); }
}
.wave-anim { animation: wave 4s ease-in-out infinite; }

/* Jello */
@keyframes jello {
    0%, 100% { transform: scale3d(1, 1, 1); }
    30%       { transform: scale3d(1.15, .85, 1); }
    40%       { transform: scale3d(.85, 1.15, 1); }
    50%       { transform: scale3d(1.1, .9, 1); }
    65%       { transform: scale3d(.95, 1.05, 1); }
    75%       { transform: scale3d(1.05, .95, 1); }
}
.jello-hover:hover { animation: jello 0.7s ease; }

/* Floating background emojis */
@keyframes float-emoji {
    0%   { transform: translateY(100vh) rotate(0); opacity: 0; }
    10%  { opacity: 0.7; }
    90%  { opacity: 0.7; }
    100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}
.floating-emoji {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    font-size: 24px;
    animation: float-emoji linear infinite;
}

/* ────────────────────────────────────────────────
   COMPONENTS
   ──────────────────────────────────────────────── */

/* Game cards */
.game-card { transition: all 0.4s ease; }
.game-card:hover { transform: translateY(-10px) rotate(0.5deg); }

/* Navbar links */
.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4facfe, #c084fc);
    transition: width 0.3s;
}
.nav-link:hover::after { width: 100%; }

/* Spotlight section top border */
.spotlight-section { position: relative; overflow: hidden; }
.spotlight-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

/* Hero game tabs */
.game-tab { transition: all 0.3s ease; cursor: pointer; }
.game-tab.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
.game-tab:hover { background: rgba(255, 255, 255, 0.05); }

/* Mockup window */
.mockup-window {
    background: #1a1a3e;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}
.mockup-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #111128;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mockup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Benefit cards */
.benefit-icon { transition: transform 0.3s; }
.benefit-card:hover .benefit-icon { transform: scale(1.2) rotate(10deg); }
.benefit-card { transition: all 0.3s; }
.benefit-card:hover { transform: translateY(-4px) rotate(-0.5deg); }

/* Fun badge */
.fun-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transform: rotate(-2deg);
}

/* Doodle dashed border */
.doodle-border {
    border: 2px dashed rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}
