/* Basic page styling */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    scroll-behavior: smooth;
}

:root {
    --purple: #6f42c1;
    --purple-light: #f3e8ff;
    --text: #2b0b3a;
}

body {
    color: var(--text);
}

/* Header / Navigation */
header {
    background: var(--purple);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

nav a {
    color: white;
    text-decoration: none;
}

/* Hero section */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--purple-light);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: contrast(1.1) brightness(0.95);
}

#hero > img,
#hero > h1,
#hero > p {
    position: relative;
    z-index: 2;
}

#hero h1 {
    color: var(--purple-light);
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 8px 8px 16px rgba(0, 0, 0, 0.7), 4px 4px 8px rgba(0, 0, 0, 0.6);
    font-family: 'Creepster', cursive;
    font-size: 5rem;
    font-weight: 400;
    letter-spacing: 2px;
}

#hero p {
    color: var(--purple-light);
    text-shadow: 0 0 25px rgba(0, 0, 0, 0.8), 6px 6px 12px rgba(0, 0, 0, 0.7), 2px 2px 6px rgba(0, 0, 0, 0.6);
    font-family: 'Fredoka One', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.hero-logo {
    max-width: 450px;
    width: 90%;
    height: auto;
    margin-bottom: 2rem;
}

/* Other sections */
section {
    padding: 4rem 2rem;
    text-align: center;
}

/* Bones counter styling */
#bones-counter {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    background: rgba(47, 17, 69, 0.95);
    color: #f8eaff;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 9999;
    pointer-events: none; /* doesn't block clicks */
}

#bones-counter {
    display: inline-flex;
    align-items: center;
}

.bone-icon {
    width: 28px;
    height: 28px;
    display: block;
    margin-right: 0.5rem;
    image-rendering: pixelated; /* keeps pixel-art sharp */
}

/* Pop animation on click */
.bone-icon {
    transition: transform 160ms ease;
}

.bone-icon.pop {
    transform: scale(1.35) translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    .bone-icon {
        transition: none;
    }
    .bone-icon.pop {
        transform: none;
    }
}

/* Flying bone particle styles */
.bone-particle {
    position: fixed;
    width: 28px;
    height: 28px;
    pointer-events: none;
    z-index: 9990; /* put particles behind the counter (9999) */
    image-rendering: pixelated;
    transform-origin: center center;
    animation-name: bone-fly;
    animation-duration: var(--dur, 1000ms);
    animation-timing-function: cubic-bezier(0.22, 0.9, 0.32, 1);
    animation-fill-mode: forwards;
}

@keyframes bone-fly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx, 0px), var(--dy, -160px)) scale(0.5) rotate(var(--rot, 0deg));
    }
}

@media (prefers-reduced-motion: reduce) {
    .bone-particle { animation: none; display: none; }
}

.bones-text {
    line-height: 1;
}

/* Game container styling */
#work .game-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
}

#work h3 {
    color: var(--purple);
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

#work > .game-container > p {
    color: var(--text);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

#work iframe {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.2);
    display: block;
    border: 1px solid rgba(111, 66, 193, 0.15);
}

#work .project-video {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.2);
    display: block;
    border: 1px solid rgba(111, 66, 193, 0.15);
    background: #000;
}

#work .storyboard-placeholder {
    width: 100%;
    min-height: 260px;
    border-radius: 8px;
    border: 1px solid rgba(111, 66, 193, 0.2);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.15);
    background: linear-gradient(135deg, #f6eeff 0%, #ead9ff 100%);
    color: var(--purple);
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

#work {
    background: var(--purple-light);
}

#game {
    background:
        radial-gradient(circle at top, rgba(111, 66, 193, 0.14), transparent 45%),
        linear-gradient(180deg, #fff9ff 0%, #f6eeff 100%);
}

.mole-game {
    max-width: 960px;
    margin: 2rem auto 0;
    padding: 2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(111, 66, 193, 0.14);
    box-shadow: 0 18px 48px rgba(111, 66, 193, 0.12);
    backdrop-filter: blur(10px);
}

.mole-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mole-stat {
    padding: 1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f0ff 100%);
    border: 1px solid rgba(111, 66, 193, 0.12);
}

.mole-stat-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(43, 11, 58, 0.7);
    margin-bottom: 0.35rem;
}

.mole-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--purple);
    line-height: 1;
}

.mole-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.mole-button {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 0.9rem 1.4rem;
    background: linear-gradient(135deg, var(--purple) 0%, #8f5dff 100%);
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(111, 66, 193, 0.25);
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.mole-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(111, 66, 193, 0.3);
}

.mole-button:active {
    transform: translateY(0);
}

.mole-button-secondary {
    background: linear-gradient(135deg, #fff 0%, #f4eaff 100%);
    color: var(--purple);
    border: 1px solid rgba(111, 66, 193, 0.18);
    box-shadow: none;
}

.mole-board {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: 620px;
    margin: 0 auto;
    padding: 1.5rem;
    border-radius: 28px;
    background:
        radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.12), transparent 28%),
        radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.08), transparent 24%),
        linear-gradient(180deg, #31462a 0%, #20311d 14%, #271b18 14%, #2f201c 100%);
    border: 1px solid rgba(188, 204, 170, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -18px 24px rgba(0, 0, 0, 0.28),
        0 20px 36px rgba(43, 11, 58, 0.16);
    overflow: hidden;
}

.mole-board::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 0%, rgba(210, 230, 190, 0.18), transparent 18%),
        radial-gradient(circle at 40% 6%, rgba(210, 230, 190, 0.12), transparent 18%),
        radial-gradient(circle at 72% 8%, rgba(210, 230, 190, 0.14), transparent 18%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 30px);
    pointer-events: none;
    opacity: 0.9;
}



.mole-hole {
    position: relative;
    aspect-ratio: 1;
    border: none;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 40%, #2b1c18 0 26%, #1a1110 27% 48%, #0f0909 49% 100%);
    box-shadow:
        inset 0 4px 10px rgba(255, 255, 255, 0.05),
        inset 0 -10px 18px rgba(0, 0, 0, 0.34),
        0 8px 14px rgba(0, 0, 0, 0.16);
    overflow: hidden;
    cursor: pointer;
}

.mole-hole::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 78%;
    height: 78%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(110, 78, 52, 0.28);
    box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.02);
}

.mole-hole::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 12%;
    width: 62%;
    height: 12%;
    transform: translateX(-50%);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
    opacity: 0.35;
}

.mole-sprite {
    position: absolute;
    inset: 12%;
    width: 76%;
    height: 76%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.22));
    opacity: 0;
    transform: translateY(30%) scale(0.55);
    transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.mole-hole.active .mole-sprite {
    opacity: 1;
    transform: translateY(-10%) scale(1.04);
}

.mole-hole.hit .mole-sprite {
    opacity: 1;
    transform: translateY(2%) scale(0.92) rotate(-6deg);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.2)) saturate(0.95) brightness(1.02);
}

.mole-hole:focus-visible,
.mole-button:focus-visible {
    outline: 3px solid #2b0b3a;
    outline-offset: 3px;
}

.mole-message {
    min-height: 1.5em;
    margin: 1.2rem 0 0;
    font-weight: 600;
    color: rgba(43, 11, 58, 0.88);
}

@media (max-width: 768px) {
    #work .game-container {
        padding: 1.5rem 1rem;
    }
    
    #work iframe {
        height: 550px !important;
    }
    
    #work h3 {
        font-size: 1.5rem;
    }

    .mole-game {
        padding: 1.25rem;
        border-radius: 20px;
    }

    .mole-stats {
        grid-template-columns: 1fr;
    }

    .mole-board {
        gap: 0.75rem;
        padding: 1rem;
    }

    .mole-stat-value {
        font-size: 1.7rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    #bones-counter {
        transition: transform 160ms ease, opacity 160ms ease;
    }
}