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

:root {
    --primary: #ffd93d;
    --primary-dark: #f5c800;
    --secondary: #6c5ce7;
    --background: #5dbb63;
    --background-light: #5dbb63;
    --text: #1a1a1a;
    --text-muted: #404040;
}

html {
    scroll-behavior: smooth;
}

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

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

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--background);
    overflow: hidden;
}

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

.social-btn {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.2);
    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(--background);
    transform: translateY(-3px);
}

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

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

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

.jj-main {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 217, 61, 0.5));
}

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

#hero h1 {
    font-size: 5rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 40px rgba(255, 217, 61, 0.4);
    margin-bottom: 20px;
}

.tagline {
    font-size: 1.5rem;
    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.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: "Fredoka", sans-serif;
}

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

.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);
}

/* Floating JJs */
.floating-jjs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.float-jj {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0;
    transition: none;
}

/* Bubble container for floating JJs */
.bubble-wrapper {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble-wrapper .float-jj {
    position: relative;
}

/* Bubble effect - circular glow around JJ */
.bubble-wrapper::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 217, 61, 0.15) 0%,
        rgba(255, 217, 61, 0.05) 50%,
        transparent 70%
    );
    border: 2px solid rgba(255, 217, 61, 0.2);
    box-shadow:
        0 0 20px rgba(255, 217, 61, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: scale(0.5);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease;
}

/* Bubble spawn animation - fade in with bubble */
.bubble-wrapper.spawning::before {
    opacity: 1;
    transform: scale(1.3);
}

.bubble-wrapper.spawning .float-jj {
    opacity: 0.6;
    animation: bubbleSpawn 0.8s ease-out forwards;
}

@keyframes bubbleSpawn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

/* Bubble pop animation */
.bubble-wrapper.popping::before {
    animation: bubblePop 0.4s ease-out forwards;
}

.bubble-wrapper.popping .float-jj {
    animation: jjPop 0.4s ease-out forwards;
}

@keyframes bubblePop {
    0% {
        opacity: 1;
        transform: scale(1.3);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.6);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

@keyframes jjPop {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    30% {
        opacity: 0.8;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Lore Section */
#lore {
    min-height: 100vh;
    padding: 60px 0;
    background: var(--background-light);
    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-image {
    max-width: 700px;
    width: 100%;
}

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

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

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

.lore-intro {
    font-size: 1.3rem;
    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);
}

/* PFP Generator Section */
#pfp-generator {
    padding: 100px 0;
    background: var(--background);
    min-height: 600px;
    position: relative;
    overflow: hidden;
}

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

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

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

/* Slot Machine */
.slot-machine {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.slot-frame {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 30px;
    padding: 30px;
    box-shadow:
        0 15px 60px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    border: 6px solid #3a3a3a;
}

.slot-window {
    width: 350px;
    height: 350px;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow:
        inset 0 8px 20px rgba(0, 0, 0, 0.5),
        inset 0 -8px 20px rgba(0, 0, 0, 0.3);
}

.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(0, 0, 0, 0.6), transparent);
}

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

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

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

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

.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 15px 40px rgba(255, 217, 61, 0.4);
}

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

.download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 217, 61, 0.9);
    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;
    text-decoration: none;
}

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

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

.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);
    }
}

/* Gallery Section */
#gallery {
    min-height: 100vh;
    padding: 60px 0;
    background: var(--background);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.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(--background);
    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);
}

/* Footer */
footer {
    padding: 40px 0;
    background: var(--background-light);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .float-jj {
        width: 60px;
        height: 60px;
    }

    #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-main {
        width: 250px;
        height: 250px;
    }

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

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

    .lore-content {
        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 h2 {
        font-size: 2rem;
    }

    .float-jj {
        width: 40px;
        height: 40px;
    }

    /* 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;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    #hero h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .jj-main {
        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;
    }

    .float-jj {
        width: 35px;
        height: 35px;
    }

    /* 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;
    }
}

/* Whack-a-JJ Game Section */
#whack-game {
    min-height: 100vh;
    padding: 60px 0;
    background: var(--background);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

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

.game-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
    font-size: 1.4rem;
    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(15px, 4vw, 40px);
    width: min(90vw, 500px);
    height: min(90vw, 500px);
    max-width: 500px;
    max-height: 500px;
}

.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 {
    display: none;
    background: rgba(0, 0, 0, 0.3);
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid var(--primary);
}

.game-final-score.visible {
    display: block;
    animation: resultPop 0.5s ease-out;
}

.game-final-score h3 {
    font-size: 1.5rem;
    color: var(--text);
    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 {
    display: none;
}

/* 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 {
        /* Larger touch target and visual feedback */
        -webkit-tap-highlight-color: rgba(255, 217, 61, 0.3);
    }
    
    .game-hole:active {
        transform: scale(0.95);
    }
}
