html { scroll-behavior: smooth; }

body {
    background-color: #E8F7FF;
    color: #142357;
    overflow-x: hidden;
    font-family: 'Poppins', sans-serif;
    opacity: 0;
    animation: pageIn .6s ease-out forwards;
}
.font-heading { font-family: 'Titan One', cursive; }

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Animation primitives ---------- */
@keyframes bob {
    0%,100% { transform: translateY(0) rotate(0); }
    50%     { transform: translateY(-10px) rotate(-2deg); }
}
@keyframes bobAlt {
    0%,100% { transform: translateY(0) rotate(0); }
    50%     { transform: translateY(-14px) rotate(3deg); }
}
@keyframes wobble {
    0%,100% { transform: rotate(-1.5deg); }
    50%     { transform: rotate(1.5deg); }
}
@keyframes float {
    0%,100% { transform: translate(0,0) rotate(0); }
    33%     { transform: translate(8px,-12px) rotate(4deg); }
    66%     { transform: translate(-6px,6px) rotate(-3deg); }
}
@keyframes drift {
    from { transform: translateX(-30px); }
    to   { transform: translateX(30px); }
}
@keyframes wave {
    0%,100% { transform: rotate(-8deg); }
    50%     { transform: rotate(12deg); }
}
@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes confettiPop {
    0%   { transform: translate(0,0) scale(0); opacity: 1; }
    20%  { transform: translate(var(--cx,0), var(--cy,-30px)) scale(1); opacity: 1; }
    100% { transform: translate(calc(var(--cx,0) * 2.5), calc(var(--cy,-30px) * 2.5 + 80px)) scale(.4) rotate(360deg); opacity: 0; }
}
@keyframes pulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(20,35,87,.45); }
    100% { box-shadow: 0 0 0 18px rgba(20,35,87,0); }
}

/* Idle bobbing on character images inside feature cards */
.feature-card .character {
    animation: bob 4.2s ease-in-out infinite;
    transition: transform .25s ease;
}
.feature-card:nth-child(even) .character { animation-name: bobAlt; animation-duration: 4.8s; }
.feature-card:hover .character { animation-play-state: paused; transform: translateX(-50%) scale(1.06) rotate(-4deg); }

/* Pill heading gentle wobble */
.pill-heading { animation: wobble 5s ease-in-out infinite; }
.pill-heading.light { animation-duration: 6s; }

/* Welcome card: floats subtly */
.welcome-card { animation: bob 6s ease-in-out infinite; }

/* News + game card hover lift already exists, add 3D readiness */
.news-card, .game-card, .feature-card, .bean-card {
    will-change: transform;
    transform-style: preserve-3d;
}

/* Bean card idle wiggle (subtle, on the wrapper so it doesn't fight the dimmed-image transitions) */
.bean-card .bean-img-wrap { animation: bob 4.5s ease-in-out infinite; }
.bean-card:nth-child(2n) .bean-img-wrap { animation-duration: 5s; animation-delay: -.5s; }
.bean-card:nth-child(3n) .bean-img-wrap { animation-duration: 5.4s; animation-delay: -1.1s; }
.bean-card:nth-child(5n) .bean-img-wrap { animation-name: bobAlt; animation-duration: 6s; animation-delay: -1.7s; }

/* Platform pills float in place */
.platform-pill { animation: bob 5s ease-in-out infinite; }
.platform-pill:nth-child(2) { animation-delay: -1s; animation-duration: 5.6s; }
.platform-pill:nth-child(3) { animation-delay: -2s; animation-duration: 6.2s; }
.platform-pill:nth-child(4) { animation-delay: -3s; animation-duration: 4.8s; }

/* btn-primary: extra squish on click via JS sets .squish */
.btn-primary { position: relative; overflow: visible; }
.btn-primary.squish { animation: pulseRing .55s ease-out; }
.btn-primary:active { transform: translateY(1px) scale(.97); }

/* Header scroll-shrink (JS toggles .scrolled on header) */
header > div { transition: padding .25s ease, box-shadow .25s ease, transform .25s ease; }
header.scrolled > div {
    padding-top: .5rem;
    padding-bottom: .5rem;
    box-shadow: 0 8px 22px rgba(20,35,87,0.18);
    transform: scale(0.97);
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1);
}
.reveal.visible {
    opacity: 1;
    transform: none;
}
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }

/* Floating decorative beans (added by JS) */
.float-bean {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    width: 64px;
    height: auto;
    opacity: .85;
    filter: drop-shadow(0 6px 0 rgba(20,35,87,.12));
    animation: float 9s ease-in-out infinite;
}
.float-bean.size-sm { width: 44px; }
.float-bean.size-lg { width: 86px; }

/* Confetti particle */
.confetti {
    position: fixed;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 100;
    animation: confettiPop .9s cubic-bezier(.25,.7,.4,1) forwards;
}

/* Animated gradient backgrounds (Games / Party heroes) */
.bg-anim-gradient {
    background-size: 200% 200%;
    animation: shimmer 12s ease-in-out infinite;
}

/* 3D tilt set by JS via inline custom prop */
.tiltable {
    transform: perspective(1000px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateZ(0);
    transition: transform .25s ease;
}

/* Marquee strip (used optionally) */
.marquee {
    display: flex;
    gap: 32px;
    animation: drift 6s ease-in-out infinite alternate;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    body { opacity: 1; }
}

.hero-curved-bottom {
    border-bottom-left-radius: 50% 60px;
    border-bottom-right-radius: 50% 60px;
}
@media(min-width: 768px) {
    .hero-curved-bottom {
        border-bottom-left-radius: 50% 100px;
        border-bottom-right-radius: 50% 100px;
    }
}

.btn-primary {
    background-color: #142357;
    color: #ffffff;
    border-radius: 8px;
    padding: 14px 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: transform .2s ease, background-color .2s ease;
    display: inline-block;
    text-transform: uppercase;
    font-size: 16px;
    text-decoration: none;
}
.btn-primary:hover {
    transform: translateY(-2px);
    background-color: #1c2f74;
}

.pill-heading {
    background-color: #142357;
    color: #ffffff;
    border: 3px solid #142357;
    border-radius: 18px;
    padding: 18px 56px;
    display: inline-block;
    box-shadow: 0 6px 0 0 #0c163d;
    font-family: 'Titan One', cursive;
    font-size: 32px;
    letter-spacing: 1px;
    transform: rotate(-1deg);
}
.pill-heading.light {
    background-color: #BFE1F4;
    color: #142357;
    box-shadow: 0 6px 0 0 #142357;
}

.welcome-card {
    background: #ffffff;
    border: 3px solid #142357;
    border-radius: 22px;
    box-shadow: 0 10px 0 0 #142357;
}

.feature-card {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 80px 40px 48px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(20, 35, 87, 0.08);
}
.feature-card .character {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
}

.news-card {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 10px 10px 0;
    box-shadow: 0 8px 24px rgba(20, 35, 87, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform .3s ease;
    text-decoration: none;
    color: inherit;
}
.news-card:hover { transform: translateY(-4px); }
.news-card > img {
    border: 3px solid #BFE1F4;
    border-radius: 12px;
    display: block;
}

.bean-card {
    background: #1c2f74;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    position: relative;
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: 0 8px 22px rgba(20, 35, 87, 0.18);
}
.bean-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(20, 35, 87, 0.3);
}
.bean-card .bean-img-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.bean-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 1;
    transition: transform .35s ease;
}
.bean-card:hover img {
    transform: scale(1.05);
}
.bean-card .bean-info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px 22px 22px;
    background: linear-gradient(180deg, transparent 45%, rgba(20, 35, 87, 0.85) 70%, #142357 100%);
    pointer-events: none;
}
.bean-card .bean-name {
    font-family: 'Titan One', cursive;
    color: #ffffff;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 8px;
    line-height: 1;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.bean-card .bean-desc {
    color: #BFE1F4;
    font-size: 12.5px;
    line-height: 1.5;
    margin: 0;
}

.game-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(20, 35, 87, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform .3s ease;
}
.game-card:hover { transform: translateY(-4px); }
.game-card .key-art {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 3px solid #BFE1F4;
    border-radius: 12px;
    display: block;
}

/* Reusable framed image style — soft light-blue border + rounded */
.framed-img {
    border: 3px solid #BFE1F4;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(20, 35, 87, 0.08);
    display: block;
}

/* ---------- Footer with banner background ---------- */
.site-footer {
    position: relative;
    color: #ffffff;
    background-color: #142357;
    background-image: url('../assets/footer-banner.png');
    background-size: cover;
    background-position: center 25%;
    background-repeat: no-repeat;
    overflow: hidden;
    border-top-left-radius: 50% 60px;
    border-top-right-radius: 50% 60px;
    margin-top: -1px;
}
@media (min-width: 768px) {
    .site-footer {
        border-top-left-radius: 50% 100px;
        border-top-right-radius: 50% 100px;
    }
}
@media (min-width: 1280px) {
    .site-footer {
        border-top-left-radius: 50% 140px;
        border-top-right-radius: 50% 140px;
    }
}
.site-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(20, 35, 87, 0.10) 0%,
        rgba(20, 35, 87, 0.20) 35%,
        rgba(20, 35, 87, 0.78) 65%,
        rgba(20, 35, 87, 0.97) 88%,
        #142357 100%);
    pointer-events: none;
}
.site-footer-inner {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(240px, 28vw, 460px) 1.5rem 2.25rem;
}

/* Footer X chip */
.footer-x {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-family: 'Titan One', cursive;
    font-size: 14px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.footer-x:hover {
    background: #BFE1F4;
    color: #142357;
    transform: translateY(-2px);
}
.footer-x svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Game Console Frame ---------- */
.console-frame {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(0,0,0,0) 30%),
        linear-gradient(160deg, #1c2f74 0%, #142357 55%, #0c163d 100%);
    border-radius: 32px;
    padding: 22px 28px 28px;
    box-shadow:
        0 28px 60px rgba(20, 35, 87, 0.35),
        inset 0 -8px 0 rgba(0, 0, 0, 0.28),
        inset 0 4px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 0 3px rgba(191, 225, 244, 0.18);
    position: relative;
}
.console-frame::before,
.console-frame::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, #BFE1F4 30%, #142357 75%);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
    transform: translateY(-50%);
}
.console-frame::before { left: -7px; }
.console-frame::after  { right: -7px; }

.console-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px 16px;
    color: #BFE1F4;
    font-family: 'Titan One', cursive;
    letter-spacing: 3px;
    font-size: 13px;
    text-transform: uppercase;
}
.console-led {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #44ff7a;
    box-shadow: 0 0 12px rgba(68, 255, 122, 0.85), inset 0 -2px 0 rgba(0,0,0,0.25);
    animation: ledPulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}
.console-led.led-amber {
    background: #ffcb57;
    box-shadow: 0 0 12px rgba(255, 203, 87, 0.85), inset 0 -2px 0 rgba(0,0,0,0.25);
    animation-delay: -0.8s;
}
.console-brand {
    flex: 1;
    text-align: center;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
@keyframes ledPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

.console-screen {
    background: #000;
    border: 8px solid #0c163d;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    position: relative;
    box-shadow:
        inset 0 0 0 2px #1c2f74,
        inset 0 0 30px rgba(191, 225, 244, 0.12),
        0 6px 0 rgba(0, 0, 0, 0.35);
}

.console-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 28px 16px 6px;
    gap: 24px;
}

/* D-pad */
.console-dpad {
    position: relative;
    width: 110px;
    height: 110px;
    justify-self: start;
}
.console-dpad .dpad-bar {
    position: absolute;
    background: linear-gradient(180deg, #2a3a85, #0c163d);
    border-radius: 10px;
    box-shadow:
        inset 0 -3px 0 rgba(0, 0, 0, 0.45),
        inset 0 2px 0 rgba(255, 255, 255, 0.08),
        0 3px 0 rgba(0, 0, 0, 0.4);
}
.console-dpad .dpad-v { width: 36px; height: 110px; left: 37px; top: 0; }
.console-dpad .dpad-h { width: 110px; height: 36px; top: 37px; left: 0; }
.console-dpad .dpad-center {
    position: absolute;
    width: 16px; height: 16px;
    background: #142357;
    border-radius: 50%;
    top: 47px; left: 47px;
    box-shadow: inset 0 2px 0 rgba(0,0,0,0.4);
}

/* Center pills (select/start) */
.console-center {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.console-pill {
    background: #0c163d;
    color: #BFE1F4;
    font-family: 'Titan One', cursive;
    font-size: 11px;
    letter-spacing: 2px;
    padding: 6px 16px;
    border-radius: 999px;
    box-shadow:
        inset 0 -2px 0 rgba(0, 0, 0, 0.5),
        0 3px 0 rgba(0, 0, 0, 0.35);
}

/* A/B/X/Y buttons */
.console-buttons {
    display: grid;
    grid-template-columns: repeat(2, 48px);
    grid-template-rows: repeat(2, 48px);
    gap: 12px;
    justify-self: end;
    transform: rotate(45deg);
}
.cbtn {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Titan One', cursive;
    font-size: 18px;
    color: #142357;
    transform: rotate(-45deg);
    box-shadow:
        inset 0 -4px 0 rgba(0, 0, 0, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        0 4px 0 rgba(0, 0, 0, 0.4);
    user-select: none;
}
.cbtn-a { background: #FF6B6B; color: #ffffff; }
.cbtn-b { background: #FFCB57; }
.cbtn-x { background: #7FCBE6; }
.cbtn-y { background: #A4D67C; }

@media (max-width: 720px) {
    .console-frame { padding: 16px 16px 18px; border-radius: 24px; }
    .console-topbar { font-size: 11px; letter-spacing: 2px; }
    .console-controls { grid-template-columns: 1fr 1fr; gap: 18px; padding: 20px 6px 4px; }
    .console-center { grid-column: 1 / -1; flex-direction: row; order: 3; }
    .console-dpad { width: 86px; height: 86px; }
    .console-dpad .dpad-v { width: 28px; height: 86px; left: 29px; }
    .console-dpad .dpad-h { width: 86px; height: 28px; top: 29px; }
    .console-dpad .dpad-center { width: 12px; height: 12px; top: 37px; left: 37px; }
    .console-buttons { grid-template-columns: repeat(2, 40px); grid-template-rows: repeat(2, 40px); gap: 8px; }
    .cbtn { width: 40px; height: 40px; font-size: 15px; }
}

.platform-pill {
    border-radius: 999px;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: 'Titan One', cursive;
    font-size: 22px;
    letter-spacing: 1px;
    box-shadow: 0 6px 0 rgba(0,0,0,0.18);
}

::-webkit-scrollbar { width: 12px; background: #E8F7FF; }
::-webkit-scrollbar-thumb { background: #142357; border-radius: 8px; border: 2px solid #E8F7FF; }

/* ---------- Nav pill links ---------- */
nav .nav-link {
    border-radius: 999px;
    padding: 10px 22px;
    transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
    line-height: 1;
    position: relative;
}
nav .nav-link:hover:not(.active) {
    background-color: #BFE1F4;
    color: #142357;
    transform: translateY(-2px);
    box-shadow: 0 4px 0 0 rgba(20, 35, 87, 0.18);
}
nav .nav-link.active {
    background-color: #142357;
    color: #ffffff;
}
nav .nav-link.active:hover {
    background-color: #1c2f74;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 0 0 rgba(12, 22, 61, 0.4);
}

/* ---------- Navbar Play Now button ---------- */
.nav-play-btn {
    background-color: #142357;
    color: #ffffff;
    border-radius: 999px;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Titan One', cursive;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
    box-shadow: 0 4px 0 0 #0c163d;
    text-decoration: none;
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.nav-play-btn:hover {
    transform: translateY(-2px);
    background-color: #1c2f74;
    box-shadow: 0 6px 0 0 #0c163d;
}
.nav-play-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 0 #0c163d;
}
.nav-play-btn svg {
    width: 14px;
    height: 14px;
}

/* ---------- Navbar $DWTD token button (matches Play Now) ---------- */
.nav-token-btn {
    background-color: #142357;
    color: #ffffff;
    border-radius: 999px;
    padding: 4px 16px 4px 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Titan One', cursive;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
    box-shadow: 0 4px 0 0 #0c163d;
    text-decoration: none;
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.nav-token-btn:hover {
    transform: translateY(-2px);
    background-color: #1c2f74;
    box-shadow: 0 6px 0 0 #0c163d;
}
.nav-token-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 0 #0c163d;
}
.nav-token-btn img {
    height: 28px;
    width: auto;
}
