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

body {
    font-family: 'Comic Sans MS', 'Trebuchet MS', sans-serif;
    min-height: 100vh;
    overflow: hidden;
    color: #2d3561;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 50%, #fab1a0 100%);
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

#setupScreen {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 50%, #fab1a0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    opacity: 0.15;
    animation: blobMove 20s ease-in-out infinite;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #ff7675;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #74b9ff;
    bottom: -150px;
    right: -150px;
    animation-delay: -7s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: #a29bfe;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes blobMove {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
        transform: translate(30px, -50px) rotate(120deg);
    }
    66% {
        border-radius: 50% 60% 30% 60% / 60% 30% 70% 40%;
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.setup-container {
    max-width: 620px;
    width: 100%;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 35px;
}

header h1 {
    font-size: 3.8rem;
    margin-bottom: 8px;
    font-weight: 900;
    line-height: 1;
    color: #2d3561;
    text-shadow: 
        3px 3px 0 #ff7675,
        6px 6px 0 #74b9ff;
    transform: rotate(-2deg);
}

.subtitle {
    font-size: 1.3rem;
    color: #2d3561;
    font-weight: 600;
    transform: rotate(1deg);
    display: inline-block;
}

.stats-display {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.7);
    border: 3px solid #2d3561;
    border-radius: 50px;
    font-size: 0.9rem;
    color: #2d3561;
    display: inline-block;
    font-weight: 700;
    transform: rotate(-1deg);
    box-shadow: 4px 4px 0 rgba(45, 53, 97, 0.2);
}

.setup-panel {
    background: white;
    padding: 35px;
    border: 4px solid #2d3561;
    border-radius: 30px;
    box-shadow: 
        8px 8px 0 #ff7675,
        12px 12px 0 rgba(45, 53, 97, 0.2);
    transform: rotate(1deg);
}

.setup-section {
    margin-bottom: 30px;
}

.setup-section label {
    display: block;
    font-weight: 800;
    margin-bottom: 12px;
    color: #2d3561;
    font-size: 1.2rem;
    transform: rotate(-1deg);
    display: inline-block;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.color-btn {
    aspect-ratio: 1;
    border: 4px solid #2d3561;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 20px;
    box-shadow: 3px 3px 0 rgba(45, 53, 97, 0.3);
    position: relative;
}

.color-btn::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.color-btn:hover {
    transform: rotate(-5deg) scale(1.1);
    box-shadow: 5px 5px 0 rgba(45, 53, 97, 0.4);
}

.color-btn.active {
    transform: rotate(-3deg) scale(1.15);
    box-shadow: 6px 6px 0 rgba(45, 53, 97, 0.5);
}

.color-btn.active::after {
    transform: translate(-50%, -50%) scale(1);
}

.texture-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.texture-btn {
    padding: 16px;
    background: #ffeaa7;
    border: 4px solid #2d3561;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 800;
    font-size: 1rem;
    color: #2d3561;
    box-shadow: 3px 3px 0 rgba(45, 53, 97, 0.3);
    position: relative;
}

.texture-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 4px dashed transparent;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.texture-btn:hover {
    transform: rotate(-2deg) translateY(-3px);
    box-shadow: 5px 5px 0 rgba(45, 53, 97, 0.4);
}

.texture-btn.active {
    background: #74b9ff;
    color: white;
    transform: rotate(2deg) scale(1.05);
    box-shadow: 5px 5px 0 rgba(45, 53, 97, 0.5);
}

.texture-btn.active::before {
    border-color: #2d3561;
}

.texture-name {
    font-family: 'Comic Sans MS', 'Trebuchet MS', sans-serif;
}

.setup-section select {
    width: 100%;
    padding: 14px 18px;
    border: 4px solid #2d3561;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    background: #ffeaa7;
    font-family: 'Comic Sans MS', 'Trebuchet MS', sans-serif;
    font-weight: 700;
    color: #2d3561;
    box-shadow: 3px 3px 0 rgba(45, 53, 97, 0.3);
    transition: all 0.2s ease;
}

.setup-section select:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(45, 53, 97, 0.4);
}

.setup-section select:focus {
    outline: none;
    transform: rotate(-1deg);
}

.start-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #ff7675 0%, #fd79a8 100%);
    color: white;
    border: 4px solid #2d3561;
    border-radius: 50px;
    font-size: 1.4rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-family: 'Comic Sans MS', 'Trebuchet MS', sans-serif;
    box-shadow: 
        5px 5px 0 #2d3561,
        8px 8px 0 rgba(45, 53, 97, 0.3);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.start-btn:hover {
    transform: rotate(-2deg) scale(1.02) translateY(-3px);
    box-shadow: 
        7px 7px 0 #2d3561,
        10px 10px 0 rgba(45, 53, 97, 0.3);
}

.start-btn:active {
    transform: rotate(-1deg) scale(0.98) translateY(2px);
    box-shadow: 
        3px 3px 0 #2d3561,
        5px 5px 0 rgba(45, 53, 97, 0.3);
}

#paintScreen {
    background: #000;
}

.paint-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    --paint-color: #F7DC6F;
}

.paint-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--paint-color);
    opacity: 0;
    transition: opacity 0.8s ease, filter 2s ease;
}

.imperfections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
    z-index: 2;
}

.paint-fullscreen.painting .imperfections-layer,
.paint-fullscreen.wet .imperfections-layer,
.paint-fullscreen.drying .imperfections-layer,
.paint-fullscreen.dry .imperfections-layer {
    opacity: 1;
}

.bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.paint-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, 
        rgba(255, 255, 255, 0.4), 
        rgba(255, 255, 255, 0.1) 40%,
        rgba(0, 0, 0, 0.05) 100%);
    box-shadow: 
        inset -2px -2px 4px rgba(0, 0, 0, 0.1),
        inset 2px 2px 4px rgba(255, 255, 255, 0.3);
    animation: bubbleFloat 3s ease-in-out infinite;
}

.paint-bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    filter: blur(2px);
}

.paint-bubble::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 20%;
    width: 20%;
    height: 20%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    filter: blur(1px);
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.02);
    }
}

.paint-bubble.popping {
    animation: bubblePop 0.4s ease-out forwards;
}

@keyframes bubblePop {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.paint-fullscreen.painting .paint-layer,
.paint-fullscreen.wet .paint-layer,
.paint-fullscreen.drying .paint-layer,
.paint-fullscreen.dry .paint-layer {
    opacity: 1;
}

.paint-fullscreen.wet .paint-layer {
    filter: brightness(1.1) saturate(1.2);
}

.paint-fullscreen.drying .paint-layer {
    filter: brightness(1.05) saturate(1.1);
}

.paint-fullscreen.dry .paint-layer {
    filter: brightness(0.9) saturate(0.9);
}

.paint-fullscreen.texture-matte.dry .paint-layer {
    filter: brightness(0.85) saturate(0.85);
}

.paint-fullscreen.texture-glossy .paint-layer {
    box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.1);
}

.paint-fullscreen.texture-glossy.wet .paint-layer {
    filter: brightness(1.15) saturate(1.3) contrast(1.1);
}

.paint-fullscreen.texture-glossy.dry .paint-layer {
    filter: brightness(1.0) saturate(1.0) contrast(1.05);
}

.paint-fullscreen.texture-satin .paint-layer {
    box-shadow: inset 0 0 200px rgba(255, 255, 255, 0.05);
}

.paint-fullscreen.texture-satin.wet .paint-layer {
    filter: brightness(1.12) saturate(1.15);
}

.paint-fullscreen.texture-satin.dry .paint-layer {
    filter: brightness(0.95) saturate(0.95);
}

.paint-fullscreen.texture-metallic .paint-layer {
    background: linear-gradient(
        135deg,
        var(--paint-color) 0%,
        color-mix(in srgb, var(--paint-color) 70%, white) 25%,
        var(--paint-color) 50%,
        color-mix(in srgb, var(--paint-color) 80%, black) 75%,
        var(--paint-color) 100%
    );
    background-size: 200% 200%;
}

.paint-fullscreen.texture-metallic.wet .paint-layer {
    filter: brightness(1.2) saturate(1.1) contrast(1.15);
    animation: metallic-shimmer 3s ease-in-out infinite;
}

.paint-fullscreen.texture-metallic.drying .paint-layer {
    filter: brightness(1.1) saturate(1.05) contrast(1.1);
}

.paint-fullscreen.texture-metallic.dry .paint-layer {
    filter: brightness(1.0) saturate(0.95) contrast(1.08);
}

@keyframes metallic-shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.shine-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    opacity: 0;
    pointer-events: none;
}

.paint-fullscreen.wet .shine-effect {
    opacity: 1;
    animation: shine 4s ease-in-out infinite;
}

.paint-fullscreen.texture-matte .shine-effect {
    display: none;
}

.paint-fullscreen.texture-glossy.wet .shine-effect {
    opacity: 1;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shine 3s ease-in-out infinite;
}

.paint-fullscreen.texture-metallic.wet .shine-effect {
    opacity: 1;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 30%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.4) 70%,
        transparent 100%
    );
    animation: shine 2.5s ease-in-out infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(to top, rgba(45, 53, 97, 0.9) 0%, transparent 100%);
    color: white;
    z-index: 10;
}

.status-display {
    text-align: center;
    margin-bottom: 15px;
}

.status-display span {
    font-size: 1.8rem;
    font-weight: 800;
    text-shadow: 3px 3px 0 rgba(255, 118, 117, 0.7);
}

.quote-display {
    text-align: center;
    margin-bottom: 25px;
    min-height: 60px;
}

.quote-display p {
    font-size: 1.2rem;
    font-style: normal;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
    animation: fadeInQuote 0.5s ease-in;
}

@keyframes fadeInQuote {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-display {
    max-width: 800px;
    margin: 0 auto 30px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid white;
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff7675 0%, #fd79a8 50%, #74b9ff 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.restart-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 30px;
    background: white;
    color: #2d3561;
    border: 3px solid #2d3561;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-family: 'Comic Sans MS', 'Trebuchet MS', sans-serif;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.restart-btn:hover {
    transform: rotate(-2deg) scale(1.05);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .setup-panel {
        padding: 30px 20px;
    }

    .color-options {
        grid-template-columns: repeat(4, 1fr);
    }

    .texture-options {
        grid-template-columns: 1fr;
    }

    .overlay-info {
        padding: 30px 20px;
    }

    .status-display span {
        font-size: 1.4rem;
    }

    .quote-display p {
        font-size: 1rem;
    }

    .quote-display {
        min-height: 80px;
    }

    .progress-text {
        font-size: 1.1rem;
    }
}
