@font-face {
    font-family: "HeyFun";
    src: url("font/HeyFun.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --primary: #14F195;
    --primary-dark: #0cc77a;
    --secondary: #9945FF;
    --sol-green: #14F195;
    --sol-purple: #9945FF;
    --sol-dark: #2d2650;
    --sol-mid: #3b3568;
    --sol-light: #4a4280;
    --background: #13111a;
    --background-light: #1c1830;
    --text: #ffffff;
    --text-muted: #a8a3b8;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "HeyFun", "Fredoka", sans-serif;
    font-weight: bold;
    background: var(--sol-dark);
    color: var(--text);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== IMPRESSION COUNTER ===== */
.impression-counter {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    background: rgba(45, 38, 80, 0.85);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(153, 69, 255, 0.3);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.impression-counter.pfp-visible {
    opacity: 1;
}

.impression-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.impression-number {
    font-size: 1.2rem;
    color: var(--sol-green);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .impression-counter {
        padding: 8px 12px;
        border-radius: 10px;
    }

    .impression-label {
        font-size: 0.6rem;
    }

    .impression-number {
        font-size: 1rem;
    }
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal.from-left {
    transform: translateX(-80px);
}

.scroll-reveal.from-left.revealed {
    transform: translateX(0);
}

.scroll-reveal.from-right {
    transform: translateX(80px);
}

.scroll-reveal.from-right.revealed {
    transform: translateX(0);
}

.scroll-reveal.scale-in {
    transform: scale(0.7);
}

.scroll-reveal.scale-in.revealed {
    transform: scale(1);
}

/* ===== SECTION HILL DIVIDERS ===== */
.hill-divider {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 20;
}

.hill-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

.hill-divider-top {
    position: absolute;
    top: -2px;
    bottom: auto;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 20;
    transform: rotate(180deg);
}

.hill-divider-top svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

/* ===== HERO SECTION ===== */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(180deg, var(--sol-mid) 0%, var(--sol-dark) 100%);
    overflow: hidden;
}

/* Social Links */
.social-links {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.social-links.pfp-visible {
    opacity: 1;
}

.social-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--primary);
    color: var(--sol-dark);
    transform: translateY(-3px);
}

.social-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.anoncoin-icon {
    width: 90%;
    height: 90%;
}

.hero-content {
    text-align: center;
    z-index: 10;
    padding: 20px;
}

.hero-emoji {
    margin-bottom: 30px;
    perspective: 1000px;
}

.jj-coin {
    width: 400px;
    height: 400px;
    margin: 0 auto;
    animation: coinSpin 3s linear infinite;
    filter: drop-shadow(0 0 30px rgba(20, 241, 149, 0.5));
}

.jj-coin img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: opacity 0.3s ease;
}

@keyframes coinSpin {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

#hero h1 {
    font-size: 5rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 40px rgba(20, 241, 149, 0.4), 3px 3px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.tagline {
    font-size: 1.8rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: "HeyFun", "Fredoka", sans-serif;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: var(--sol-dark);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 217, 61, 0.3);
}

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

.btn-secondary:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

/* ===== LORE SECTION ===== */
#lore {
    min-height: 100vh;
    padding: 60px 0;
    background: linear-gradient(180deg, var(--sol-light) 0%, var(--sol-dark) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

#lore h2 {
    font-size: 3rem;
    text-align: center;
    color: var(--primary);
    margin-bottom: 60px;
}

.lore-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Lore bi-directional scroll animation */
.lore-animate {
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.lore-animate.visible {
    opacity: 1;
    transform: scale(1);
}

/* JJ breathe effect - active when section is in view */
.lore-jj-strobe {
    transition: transform 0.3s ease;
}

.lore-animate.visible .lore-jj-strobe {
    animation: jjBreathe 2s ease-in-out infinite;
}

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

/* Lore dragonball JJ */
.lore-dragonball {
    position: fixed;
    width: 240px;
    height: 240px;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.lore-dragonball.visible {
    opacity: 1;
}

.lore-dragonball img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 217, 61, 0.6));
}

@media (max-width: 768px) {
    .lore-dragonball {
        width: 160px;
        height: 160px;
    }
}

/* Lore fly-in text */
.lore-flyin-text {
    margin-top: 30px;
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.flyin-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(80px) rotate(10deg);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lore-animate.visible .flyin-1 { opacity: 1; transform: translateY(0) rotate(0); transition-delay: 0.3s; }
.lore-animate.visible .flyin-2 { opacity: 1; transform: translateY(0) rotate(0); transition-delay: 0.45s; }
.lore-animate.visible .flyin-3 { opacity: 1; transform: translateY(0) rotate(0); transition-delay: 0.6s; }
.lore-animate.visible .flyin-4 { opacity: 1; transform: translateY(0) rotate(0); transition-delay: 0.75s; }
.lore-animate.visible .flyin-5 { opacity: 1; transform: translateY(0) rotate(0); transition-delay: 0.9s; }
.lore-animate.visible .flyin-6 { opacity: 1; transform: translateY(0) rotate(0); transition-delay: 1.05s; }

@media (max-width: 768px) {
    .lore-flyin-text {
        font-size: 1.6rem;
        gap: 8px;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .lore-flyin-text {
        font-size: 1.3rem;
        gap: 6px;
    }
}

/* Lore bull sliding right */
.lore-bull {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 25%;
    max-width: 175px;
    z-index: 25;
    transform: translateX(-100%);
    transition: transform 3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.lore-bull img {
    width: 100%;
    height: auto;
}

.lore-bull.visible {
    transform: translateX(0);
}

/* Section corner JJs */
.section-funjj {
    position: fixed;
    bottom: 0;
    width: 20%;
    max-width: 150px;
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease, transform 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.section-funjj img {
    width: 100%;
    height: auto;
    display: block;
}

.section-funjj-bl {
    left: 0;
    transform: translateX(-100%);
}

.section-funjj-br {
    right: 0;
    transform: translateX(100%);
}

.section-funjj.visible {
    opacity: 1;
}

.section-funjj-bl.visible {
    transform: translateX(0);
}

.section-funjj-br.visible {
    transform: translateX(0);
}

.lore-image {
    max-width: 700px;
    width: 100%;
}

.lore-image img {
    width: 100%;
}

.lore-text {
    font-size: 1.3rem;
    line-height: 1.8;
}

.lore-text p {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.lore-intro {
    font-size: 1.5rem;
    color: var(--text) !important;
    font-style: italic;
}

.lore-text strong {
    color: var(--primary);
}

.lore-gallery {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.lore-gallery img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.lore-gallery img:hover {
    transform: scale(1.1) rotate(5deg);
}

#lore-2 {
    min-height: 100vh;
    padding: 60px 0;
    background: linear-gradient(180deg, var(--sol-dark) 0%, var(--sol-mid) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: visible;
    position: relative;
}

/* Lore 2 Layout */
.lore-2-layout {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 40px 0;
}

.lore-2-image {
    flex-shrink: 0;
    width: 450px;
    padding-right: 20px;
}

.lore-2-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    filter: drop-shadow(0 0 30px rgba(153, 69, 255, 0.3));
}

.lore-2-text {
    flex: 1;
}

.lore-2-text h2 {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(20, 241, 149, 0.3);
}

.lore-2-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 35px;
}

.lore-stat {
    display: flex;
    flex-direction: column;
    padding: 15px 25px;
    background: rgba(153, 69, 255, 0.15);
    border: 1px solid rgba(153, 69, 255, 0.3);
    border-radius: 12px;
}

.lore-stat-number {
    font-size: 2.5rem;
    color: var(--sol-green);
    line-height: 1;
}

.lore-stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.lore-2-facts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lore-fact {
    font-size: 1.2rem;
    color: var(--text);
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--sol-purple);
    border-radius: 0 8px 8px 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    #lore-2 {
        padding: 20px 0 120px;
    }

    .lore-2-layout {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .lore-2-image {
        width: 200px;
        padding-top: 20px;
    }

    .lore-2-text h2 {
        font-size: 2rem;
    }

    .lore-2-stats {
        justify-content: center;
        gap: 20px;
    }

    .lore-stat-number {
        font-size: 1.8rem;
    }

    .lore-fact {
        font-size: 1rem;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .lore-2-image {
        width: 150px;
    }

    .lore-2-text h2 {
        font-size: 1.6rem;
    }

    .lore-2-stats {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .lore-stat-number {
        font-size: 1.5rem;
    }

    .lore-fact {
        font-size: 0.9rem;
        padding: 10px 14px;
    }
}

/* ===== PFP GENERATOR SECTION ===== */
#pfp-generator {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--sol-dark) 0%, var(--sol-mid) 50%, var(--sol-dark) 100%);
    min-height: 600px;
    position: relative;
    overflow: hidden;
}

/* --- PFP Intro Animation --- */
.pfp-intro-hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.pfp-intro-hidden.pfp-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Spinning JJ Logo */
.pfp-intro-logo {
    position: absolute;
    top: 50%;
    left: -400px;
    width: 300px;
    height: 300px;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
}

.pfp-intro-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pfp-intro-logo.animating {
    opacity: 1;
    animation: logoSpinAcross 2s linear forwards;
}

@keyframes logoSpinAcross {
    0% {
        left: -400px;
        opacity: 0;
        transform: translateY(-50%) rotate(0deg) scale(0.5);
    }
    10% {
        opacity: 1;
        transform: translateY(-50%) rotate(72deg) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) rotate(360deg) scale(1.2);
    }
    90% {
        opacity: 1;
        transform: translateY(-50%) rotate(648deg) scale(1);
    }
    100% {
        left: calc(100% + 400px);
        opacity: 0;
        transform: translateY(-50%) rotate(720deg) scale(0.5);
    }
}

/* Drawing Pencil */
.drawing-pencil {
    position: absolute;
    width: 288px;
    height: 288px;
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    transform: translate(-144px, -72px);
}

.drawing-pencil img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin-left: 28%;
    margin-top: -15%;
    mask-image: linear-gradient(to bottom right, #000 40%, transparent 95%);
    -webkit-mask-image: linear-gradient(to bottom right, #000 40%, transparent 95%);
}

.drawing-pencil.active {
    opacity: 1;
}

/* SVG Frame Drawing - covers the entire slot-frame */
.slot-frame-draw {
    position: absolute;
    top: -3px;
    left: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    z-index: 10;
    pointer-events: none;
    overflow: visible;
}

.draw-border {
    transition: none;
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 1;
    animation: confettiFall var(--fall-duration, 3s) cubic-bezier(0.25, 0, 0.5, 1) forwards;
    animation-delay: var(--delay, 0s);
}

.confetti-piece.square {
    border-radius: 2px;
}

.confetti-piece.circle {
    border-radius: 50%;
}

.confetti-piece.strip {
    width: 4px;
    height: 14px;
    border-radius: 2px;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) rotate(var(--spin, 180deg)) translateX(var(--drift, 30px)) scale(1);
        opacity: 1;
    }
    75% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(var(--spin-end, 720deg)) translateX(var(--drift-end, -20px)) scale(0.3);
        opacity: 0;
    }
}

/* Slot machine starts invisible during intro */
.slot-frame.intro-pending {
    background: transparent;
}

.slot-frame.intro-pending .slot-window {
    opacity: 0;
}

/* After drawing completes, fade in the inside */
.slot-frame.intro-complete {
    background: var(--sol-light);
    transition: background 0.6s ease;
}

.slot-frame.intro-complete .slot-window {
    opacity: 1;
    transition: opacity 0.6s ease 0.2s;
}

.slot-machine .spin-btn {
    transition: opacity 0.5s ease, transform 0.3s ease;
}

.slot-frame.intro-pending ~ .spin-btn {
    opacity: 0;
    pointer-events: none;
}

.slot-frame.intro-complete ~ .spin-btn {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.5s ease 0.4s;
}

#pfp-generator h2 {
    font-size: 3rem;
    text-align: center;
    color: var(--primary);
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.5rem;
    margin-bottom: 60px;
}

#pfp-app {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== HAND-DRAWN SLOT MACHINE ===== */
/* SVG filter for hand-drawn look */
.slot-machine {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    position: relative;
}

.slot-frame {
    background: var(--sol-light);
    border-radius: 8px;
    padding: 20px;
    position: relative;
    z-index: 2;
    border: 3px solid transparent;
}

.slot-window {
    width: 350px;
    height: 350px;
    background: var(--sol-dark);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(153, 69, 255, 0.3);
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(153, 69, 255, 0.1);
}

.slot-window::before,
.slot-window::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 10;
    pointer-events: none;
}

.slot-window::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(45, 38, 80, 0.8), transparent);
}

.slot-window::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(45, 38, 80, 0.8), transparent);
}

.slot-reel {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.1s linear;
    position: relative;
    z-index: 1;
}

.slot-jj {
    width: 350px;
    height: 350px;
    object-fit: contain;
    flex-shrink: 0;
}

.spin-btn {
    font-size: 1.5rem;
    padding: 18px 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--primary);
    color: var(--sol-dark);
    border: 2px solid rgba(20, 241, 149, 0.5);
    box-shadow: 0 0 20px rgba(20, 241, 149, 0.2);
    border-radius: 50px;
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.spin-btn:not(:disabled):hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 30px rgba(20, 241, 149, 0.4);
}

.spin-btn:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(20, 241, 149, 0.2);
}

.result-info {
    text-align: center;
    font-size: 1.4rem;
    color: var(--text);
    min-height: 30px;
}

.download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(20, 241, 149, 0.9);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 20;
    color: #1a1a1a;
    padding: 0;
}

.download-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.download-btn.visible {
    opacity: 1;
    visibility: visible;
}

/* Background Picker */
.slot-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    border-radius: 6px;
    pointer-events: none;
}

.bg-picker-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    background: rgba(20, 241, 149, 0.9);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 20;
    color: #1a1a1a;
}

.bg-picker-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.bg-picker-btn.visible {
    opacity: 1;
    visibility: visible;
}

.bg-picker-popup {
    position: absolute;
    top: 52px;
    left: 10px;
    background: rgba(45, 38, 80, 0.95);
    border-radius: 12px;
    padding: 10px;
    z-index: 30;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(153, 69, 255, 0.3);
    display: none;
    backdrop-filter: blur(10px);
}

.bg-picker-popup.open {
    display: block;
    animation: pickerFadeIn 0.15s ease-out;
}

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

.bg-picker-row {
    display: flex;
    gap: 6px;
}

.bg-picker-row + .bg-picker-row,
.bg-custom-dialog + .bg-picker-row {
    margin-top: 6px;
}

.bg-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bg-swatch:hover:not(:disabled) {
    border-color: var(--primary-dark);
    transform: scale(1.15);
}

.bg-swatch.active {
    border-color: #2a2a2a;
    box-shadow: 0 0 8px rgba(255, 217, 61, 0.5);
}

.bg-swatch-none {
    background: rgba(200, 200, 200, 0.5);
    color: rgba(42, 42, 42, 0.5);
}

.bg-swatch-img {
    background-size: cover;
    background-position: center;
}

.bg-swatch-custom {
    background: conic-gradient(
        #ff0000,
        #ffff00,
        #00ff00,
        #00ffff,
        #0000ff,
        #ff00ff,
        #ff0000
    );
    position: relative;
}

.bg-swatch-custom svg {
    position: relative;
    z-index: 1;
}

.bg-custom-dialog {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 0 2px;
}

.bg-custom-dialog.open {
    display: flex;
}

.bg-custom-wheel {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.bg-custom-wheel::-webkit-color-swatch-wrapper {
    padding: 0;
}

.bg-custom-wheel::-webkit-color-swatch {
    border: 2px solid rgba(42, 42, 42, 0.3);
    border-radius: 6px;
}

.bg-custom-inputs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bg-custom-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bg-custom-field label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    width: 26px;
    text-align: right;
    flex-shrink: 0;
}

.bg-custom-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    font-family: "HeyFun", "Fredoka", sans-serif;
    font-size: 15px;
    padding: 3px 5px;
    outline: none;
}

.bg-custom-input:focus {
    border-color: var(--primary-dark);
}

#bg-custom-hex {
    width: 68px;
}

.bg-custom-rgb {
    display: flex;
    gap: 3px;
}

.bg-custom-rgb-input {
    width: 38px;
    text-align: center;
    -moz-appearance: textfield;
}

.bg-custom-rgb-input::-webkit-inner-spin-button,
.bg-custom-rgb-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bg-swatch.placeholder {
    background: rgba(200, 200, 200, 0.4);
    color: rgba(42, 42, 42, 0.3);
    cursor: not-allowed;
    opacity: 0.5;
}

.result-info.revealed {
    animation: resultPop 0.5s ease-out;
}

@keyframes resultPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slot Machine Waiting Animation */
.slot-waiting {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    z-index: 15;
    display: none;
}

.slot-waiting.active {
    display: block;
}

.slot-waiting img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation:
        waitSpin 1s linear infinite,
        waitGlow 1.5s ease-in-out infinite;
}

@keyframes waitSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes waitGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(255, 217, 61, 0.6))
            drop-shadow(0 0 20px rgba(255, 217, 61, 0.4))
            drop-shadow(0 0 30px rgba(255, 217, 61, 0.2));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 217, 61, 0.9))
            drop-shadow(0 0 40px rgba(255, 217, 61, 0.6))
            drop-shadow(0 0 60px rgba(255, 217, 61, 0.4));
    }
}

/* ===== GALLERY SECTION ===== */
#gallery {
    min-height: 100vh;
    padding: 60px 0;
    background: linear-gradient(180deg, var(--sol-mid) 0%, var(--sol-dark) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: visible;
}

#gallery h2 {
    font-size: 3rem;
    text-align: center;
    color: var(--primary);
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding: 0 20px;
}

.gallery-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.gallery-side {
    width: 150px;
    height: 150px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.gallery-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery-main {
    width: 350px;
    height: 350px;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.gallery-arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-arrow:hover {
    background: var(--primary);
    color: var(--sol-dark);
    transform: scale(1.1);
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

/* ===== NAV LINKS ===== */
.nav-links {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 16px;
    z-index: 100;
}

.nav-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    font-size: calc(48px * 0.6);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--primary);
    color: var(--sol-dark);
    transform: translateY(-2px);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--sol-mid);
    border-radius: 20px;
    padding: 40px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 217, 61, 0.2);
}

.modal-content h2 {
    font-size: 2.5rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 10px;
}

.modal-content .section-subtitle {
    margin-bottom: 30px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    color: var(--primary);
    transform: scale(1.2);
}

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

@media (max-width: 768px) {
    .modal-content {
        padding: 25px 15px;
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 15px;
    }

    .modal-content h2 {
        font-size: 1.8rem;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-link {
        width: 48px;
        height: 48px;
        font-size: calc(48px * 0.6);
    }
}

/* ===== MARQUEE BANNERS ===== */
.marquee-section {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    padding: 10px 0;
    z-index: 30;
}

#pfp-generator .marquee-section {
    opacity: 0;
    transition: opacity 0.6s ease;
}

#pfp-generator .marquee-section.pfp-visible {
    opacity: 1;
}

.marquee-banner {
    white-space: nowrap;
    overflow: hidden;
    padding: 12px 0;
    background: var(--sol-purple);
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.marquee-banner:first-child {
    transform: rotate(-2deg) scale(1.05);
    margin-bottom: -8px;
}

.marquee-banner:last-child {
    transform: rotate(2deg) scale(1.05);
    background: var(--sol-green);
    color: var(--sol-dark);
}

/* Single marquee at top of sections */
.marquee-top {
    top: 0;
    bottom: auto;
}

.marquee-single .marquee-banner {
    transform: rotate(-1deg) scale(1.05);
}

.marquee-single .marquee-banner.marquee-purple {
    background: var(--sol-purple);
    color: #fff;
}

.marquee-single .marquee-banner.marquee-green {
    background: var(--sol-green);
    color: var(--sol-dark);
}

.marquee-track {
    display: inline-flex;
    animation: marqueeScroll 20s linear infinite;
}

.marquee-right .marquee-track {
    animation: marqueeScrollReverse 20s linear infinite;
}

.marquee-track span {
    display: inline-block;
    padding-right: 0;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes marqueeScrollReverse {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .marquee-banner {
        font-size: 1rem;
        padding: 10px 0;
    }
}

/* ===== FOOTER ===== */
footer {
    padding: 40px 0;
    background: var(--sol-dark);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 1024px) {
    #lore {
        padding: 50px 0;
    }

    #lore h2 {
        font-size: 2.5rem;
        margin-bottom: 30px;
    }

    .lore-content {
        grid-template-columns: 200px 1fr;
        gap: 30px;
        margin-bottom: 40px;
    }

    .lore-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .lore-text p {
        margin-bottom: 15px;
    }

    .lore-intro {
        font-size: 1.1rem;
    }

    .lore-gallery img {
        width: 90px;
        height: 90px;
    }

    /* Gallery Tablet */
    #gallery h2 {
        font-size: 2.5rem;
    }

    .gallery-main {
        width: 280px;
        height: 280px;
    }

    .gallery-side {
        width: 120px;
        height: 120px;
    }

    .gallery-arrow {
        width: 45px;
        height: 45px;
    }

}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
    #hero h1 {
        font-size: 3rem;
    }

    .tagline {
        font-size: 1.2rem;
    }

    .jj-coin {
        width: 250px;
        height: 250px;
    }

    /* Lore Section Mobile */
    #lore {
        padding: 40px 0;
    }

    #lore h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .lore-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .lore-image {
        max-width: 500px;
        margin: 0 auto;
    }

    .lore-text p {
        margin-bottom: 12px;
    }

    .lore-intro {
        font-size: 1rem;
    }

    .lore-gallery {
        gap: 15px;
    }

    .lore-gallery img {
        width: 60px;
        height: 60px;
    }

    /* PFP Generator Mobile */
    #pfp-generator {
        padding: 20px 0 15px;
        min-height: auto;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    #pfp-generator h2 {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }

    #pfp-generator .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .pfp-intro-logo {
        width: 300px;
        height: 300px;
    }

    .drawing-pencil {
        width: 216px;
        height: 216px;
        transform: translate(-108px, -54px);
    }

    #pfp-app {
        min-height: auto;
        padding-top: 25px;
    }

    .slot-machine {
        gap: 12px;
    }

    .slot-frame {
        padding: 12px;
        border-radius: 6px;
    }

    .slot-window {
        width: min(75vw, 60dvh);
        height: min(75vw, 60dvh);
        border-radius: 4px;
    }

    .slot-jj {
        width: min(75vw, 60dvh);
        height: min(75vw, 60dvh);
    }

    .spin-btn {
        font-size: 1.1rem;
        padding: 12px 35px;
        margin-top: 5px;
    }

    /* Gallery Mobile */
    #gallery {
        padding: 40px 0;
    }

    #gallery h2 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .gallery-container {
        gap: 10px;
        margin-top: 25px;
    }

    .gallery-display {
        gap: 10px;
    }

    .gallery-main {
        width: 200px;
        height: 200px;
    }

    .gallery-side {
        width: 80px;
        height: 80px;
    }

    .gallery-arrow {
        width: 40px;
        height: 40px;
    }

    .gallery-arrow svg {
        width: 24px;
        height: 24px;
    }

    .gallery-dots {
        margin-top: 20px;
        gap: 8px;
    }

    .gallery-dot {
        width: 8px;
        height: 8px;
    }

    .hill-divider svg,
    .hill-divider-top svg {
        height: 40px;
    }
}

/* ===== RESPONSIVE - SMALL MOBILE ===== */
@media (max-width: 480px) {
    #hero h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .jj-coin {
        width: 180px;
        height: 180px;
    }

    /* Lore Section Small Mobile */
    #lore {
        padding: 30px 0;
    }

    #lore h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .lore-image {
        max-width: 350px;
    }

    .lore-intro {
        font-size: 0.95rem;
    }

    .lore-gallery {
        gap: 10px;
    }

    .lore-gallery img {
        width: 50px;
        height: 50px;
    }

    /* PFP Generator Small Mobile */
    #pfp-generator {
        padding: 15px 0 10px;
    }

    #pfp-generator h2 {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }

    #pfp-generator .section-subtitle {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .slot-machine {
        gap: 10px;
    }

    .slot-frame {
        padding: 8px;
    }

    .spin-btn {
        font-size: 1rem;
        padding: 10px 30px;
    }

    /* Gallery Small Mobile */
    #gallery {
        padding: 30px 0;
    }

    #gallery h2 {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }

    #gallery .section-subtitle {
        font-size: 0.9rem;
    }

    .gallery-container {
        gap: 8px;
        margin-top: 20px;
        padding: 0 10px;
    }

    .gallery-display {
        gap: 8px;
    }

    .gallery-main {
        width: 160px;
        height: 160px;
    }

    .gallery-main img {
        border-radius: 10px;
    }

    .gallery-side {
        width: 60px;
        height: 60px;
    }

    .gallery-side img {
        border-radius: 6px;
    }

    .gallery-arrow {
        width: 35px;
        height: 35px;
    }

    .gallery-arrow svg {
        width: 20px;
        height: 20px;
    }

    .gallery-dots {
        margin-top: 15px;
        gap: 6px;
    }

    .gallery-dot {
        width: 6px;
        height: 6px;
    }

    .hill-divider svg,
    .hill-divider-top svg {
        height: 30px;
    }
}

/* ===== WHACK-A-JJ GAME ===== */
#whack-game {
    min-height: 100vh;
    padding: 60px 0;
    background: linear-gradient(180deg, var(--sol-dark) 0%, var(--sol-mid) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: visible;
}

#whack-game h2 {
    font-size: 3rem;
    text-align: center;
    color: var(--primary);
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    position: relative;
}

.game-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 30px;
    border-radius: 15px;
}

.game-score span,
.game-timer span {
    color: var(--primary);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: clamp(10px, 3vw, 25px);
    width: min(70vw, 350px);
    height: min(70vw, 350px);
    max-width: 350px;
    max-height: 350px;
}

.game-hole {
    background-color: rgb(165, 85, 11);
    border-radius: 50%;
    box-shadow:
        inset 0 10px 0 7px rgb(53, 21, 6),
        inset 0 20px 20px 15px rgba(0, 0, 0, 0.3),
        0 0 5px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}

.game-hole .game-jj {
    width: 70%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    animation: jjRaise 0.3s ease-out;
    pointer-events: none;
}

@keyframes jjRaise {
    0% {
        transform: translateX(-50%) translateY(100%);
    }
    100% {
        transform: translateX(-50%) translateY(0);
    }
}

.game-hole .game-jj.whacked {
    animation: jjWhacked 0.3s ease-out forwards;
}

@keyframes jjWhacked {
    0% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) translateY(-20%) scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: translateX(-50%) translateY(100%) scale(0.5);
        opacity: 0;
    }
}

.game-cursor {
    width: 80px;
    height: 80px;
    position: fixed;
    top: 100px;
    left: 100px;
    background-image: url("./img/game/hammer.png");
    background-size: 100% 100%;
    transform: translate(-20%, -20%);
    transition: transform 0.1s;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.game-cursor.active {
    transform: translate(-20%, -20%) rotate(-45deg);
}

.game-cursor.visible {
    display: block;
}

.game-final-score {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.85);
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid var(--primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.3s ease;
    z-index: 10;
}

.game-final-score.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.game-final-score h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.game-final-score h1 {
    font-size: 4rem;
    color: var(--primary);
}

.game-start-btn {
    font-size: 1.3rem;
    padding: 18px 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-start-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 217, 61, 0.4);
}

.game-start-btn.hidden {
    visibility: hidden;
}

/* Game Responsive - Tablet */
@media (max-width: 1024px) {
    #whack-game h2 {
        font-size: 2.5rem;
    }

    .game-stats {
        font-size: 1.2rem;
        gap: 30px;
        padding: 12px 25px;
    }

    .game-cursor {
        width: 60px;
        height: 60px;
    }
}

/* Game Responsive - Mobile */
@media (max-width: 768px) {
    #whack-game {
        padding: 40px 0;
    }

    #whack-game h2 {
        font-size: 2rem;
    }

    .game-stats {
        font-size: 1rem;
        gap: 20px;
        padding: 10px 20px;
    }

    .game-cursor {
        width: 50px;
        height: 50px;
    }

    .game-final-score {
        padding: 20px 30px;
    }

    .game-final-score h3 {
        font-size: 1.2rem;
    }

    .game-final-score h1 {
        font-size: 3rem;
    }

    .game-start-btn {
        font-size: 1.1rem;
        padding: 15px 40px;
    }
}

/* Game Responsive - Small Mobile */
@media (max-width: 480px) {
    #whack-game {
        padding: 30px 0;
    }

    #whack-game h2 {
        font-size: 1.6rem;
        margin-bottom: 15px;
    }

    #whack-game .section-subtitle {
        font-size: 0.9rem;
    }

    .game-stats {
        font-size: 0.9rem;
        gap: 15px;
        padding: 8px 15px;
    }

    .game-cursor {
        width: 40px;
        height: 40px;
    }

    .game-final-score {
        padding: 15px 25px;
    }

    .game-final-score h3 {
        font-size: 1rem;
    }

    .game-final-score h1 {
        font-size: 2.5rem;
    }

    .game-start-btn {
        font-size: 1rem;
        padding: 12px 30px;
    }
}

/* Hide game cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    .game-cursor {
        display: none !important;
    }

    #whack-game {
        cursor: default !important;
    }

    .game-hole {
        -webkit-tap-highlight-color: rgba(255, 217, 61, 0.3);
    }

    .game-hole:active {
        transform: scale(0.95);
    }
}
