/* iggi.boo - 90s Pixel Art Ghostly Theme */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #1a0a2e;
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Score Bar */
.score-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: #2e1065;
    border-bottom: 4px solid #6d28d9;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    image-rendering: pixelated;
}

.score-label {
    color: #fbbf24;
    letter-spacing: 2px;
}

.score-value {
    color: #4ade80;
    letter-spacing: 4px;
}

/* Stars */
.star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fbbf24;
    animation: twinkle 2s ease-in-out infinite alternate;
}

.star::before,
.star::after {
    content: '';
    position: absolute;
    background: #fbbf24;
}

.star::before {
    width: 12px;
    height: 4px;
    top: 0;
    left: -4px;
}

.star::after {
    width: 4px;
    height: 12px;
    top: -4px;
    left: 0;
}

.star-1 { top: 10%; left: 15%; animation-delay: 0s; }
.star-2 { top: 25%; right: 20%; animation-delay: 0.5s; }
.star-3 { top: 5%; right: 10%; animation-delay: 1s; }
.star-4 { top: 5%; left: 8%; animation-delay: 0.3s; }
.star-5 { top: 15%; right: 12%; animation-delay: 0.7s; }
.star-6 { top: 50%; left: 5%; animation-delay: 1.2s; }
.star-7 { top: 70%; right: 8%; animation-delay: 0.2s; }
.star-8 { top: 15%; left: 20%; animation-delay: 0.8s; }
.star-9 { top: 10%; right: 15%; animation-delay: 1.5s; }

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* Title Screen */
.title-screen {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 50px;
    background: linear-gradient(180deg, #1a0a2e 0%, #2e1065 100%);
}

/* Pixel Ghost */
.pixel-ghost {
    display: grid;
    grid-template-columns: repeat(8, 24px);
    grid-template-rows: repeat(8, 24px);
    gap: 0;
    margin-bottom: 32px;
    animation: ghostFloat 3s ease-in-out infinite;
    image-rendering: pixelated;
}

.gf {
    display: block;
    width: 24px;
    height: 24px;
}

.gc {
    display: block;
    width: 24px;
    height: 24px;
    background: transparent;
}

@keyframes ghostFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.brand-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 56px;
    color: #4ade80;
    text-shadow: 4px 4px 0 #2e1065, 0 0 20px rgba(74, 222, 128, 0.4);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.boo-shout {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 80px;
    color: #f472b6;
    text-shadow: 4px 4px 0 #2e1065, 0 0 30px rgba(244, 114, 182, 0.5);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.boo-shout.visible {
    opacity: 1;
    transform: scale(1);
}

/* Levels Section */
.levels-section {
    position: relative;
    padding: 80px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    background: #1a0a2e;
}

.level-block {
    max-width: 600px;
    width: 100%;
    padding: 32px;
    background: rgba(46, 16, 101, 0.6);
    border: 4px solid #f472b6;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.level-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.level-block[data-border-color="pink"] {
    border-color: #f472b6;
}

.level-block[data-border-color="cyan"] {
    border-color: #22d3ee;
}

.level-block[data-border-color="yellow"] {
    border-color: #fbbf24;
}

/* Pixelated border effect */
.level-block::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 4px solid rgba(109, 40, 217, 0.3);
    pointer-events: none;
}

.level-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
}

.level-number {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: #fbbf24;
    letter-spacing: 2px;
}

.level-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 32px;
    color: #22d3ee;
}

.level-desc {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #e2e8f0;
    line-height: 1.6;
    margin-bottom: 20px;
}

.level-stars {
    display: flex;
    gap: 12px;
}

.mini-star {
    width: 4px;
    height: 4px;
    background: #fbbf24;
    position: relative;
}

.mini-star::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 4px;
    top: 0;
    left: -4px;
    background: #fbbf24;
}

.mini-star::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 12px;
    top: -4px;
    left: 0;
    background: #fbbf24;
}

/* Sprite Section */
.sprite-section {
    padding: 80px 24px;
    background: linear-gradient(180deg, #1a0a2e 0%, #2e1065 50%, #1a0a2e 100%);
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.sprite-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.sprite-heading {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 40px;
    color: #fbbf24;
    text-shadow: 4px 4px 0 #2e1065;
    margin-bottom: 48px;
    letter-spacing: 2px;
}

.sprite-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
    align-items: flex-end;
}

.sprite-ghost {
    display: grid;
    grid-template-columns: repeat(4, 16px);
    grid-template-rows: repeat(5, 16px);
    gap: 0;
    image-rendering: pixelated;
    transition: transform 0.3s ease;
}

.sprite-ghost:hover {
    transform: scale(1.2) translateY(-8px);
}

.sf {
    display: block;
    width: 16px;
    height: 16px;
}

.sc {
    display: block;
    width: 16px;
    height: 16px;
    background: transparent;
}

.sprite-label {
    display: block;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #e2e8f0;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* Game Over Section */
.game-over-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    background: #1a0a2e;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.game-over-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.game-over-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 64px;
    color: #f472b6;
    text-shadow: 4px 4px 0 #2e1065, 0 0 40px rgba(244, 114, 182, 0.4);
    letter-spacing: 4px;
    margin-bottom: 40px;
    animation: gameOverPulse 2s ease-in-out infinite;
}

@keyframes gameOverPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.hearts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 48px;
}

.heart-icon {
    width: 32px;
    height: 28px;
    position: relative;
}

.heart-icon::before,
.heart-icon::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 24px;
    background: #f472b6;
    border-radius: 16px 16px 0 0;
}

.heart-icon::before {
    left: 0;
    transform: rotate(-45deg);
    transform-origin: bottom left;
}

.heart-icon::after {
    left: 12px;
    transform: rotate(45deg);
    transform-origin: bottom right;
}

.heart-icon.depleted::before,
.heart-icon.depleted::after {
    background: #6d28d9;
    opacity: 0.4;
}

.insert-coin {
    font-family: 'Fira Code', monospace;
    font-size: 20px;
    color: #fbbf24;
    letter-spacing: 4px;
    animation: blink 1s step-end infinite;
    margin-bottom: 60px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.footer-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: #6d28d9;
    letter-spacing: 2px;
    opacity: 0.6;
}

/* Fade-in utility (JS driven) */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 640px) {
    .pixel-ghost {
        grid-template-columns: repeat(8, 16px);
        grid-template-rows: repeat(8, 16px);
    }

    .gf, .gc {
        width: 16px;
        height: 16px;
    }

    .brand-title {
        font-size: 40px;
    }

    .boo-shout {
        font-size: 56px;
    }

    .game-over-text {
        font-size: 40px;
    }

    .sprite-strip {
        gap: 20px;
    }
}
