@import url('');

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

html, body {
    width: 100%;
    height: 100%;
    background-color: #ffefde;
}

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

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJhIiB4PSIwIiB5PSIwIj48ZmVUdXJidWxlbmNlIGJhc2VGcmVxdWVuY3k9Ii43NSIgc3RpdGNoVGlsZXM9InN0aXRjaCIgdHlwZT0iZnJhY3RhbE5vaXNlIi8+PGZlQ29sb3JNYXRyaXggdHlwZT0ic2F0dXJhdGUiIHZhbHVlcz0iMCIvPjwvZmlsdGVyPjxwYXRoIGQ9Ik0wIDBoMzAwdjMwMEgweiIgZmlsdGVyPSJ1cmwoI2EpIiBvcGFjaXR5PSIuMDUiLz48L3N2Zz4=');
    pointer-events: none;
    z-index: 1000;
    opacity: 0.5;
    mix-blend-mode: overlay;
}

.hover-images-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    pointer-events: none;
    display: none;
    background-color: rgba(106, 90, 55, 0.8);
}

.hover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;
    opacity: 0.5;
}

#ribbonPaths {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

#ribbonPaths text {
    pointer-events: auto;
    cursor: pointer;
}

.control-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-family: "Barlow Condensed", sans-serif;
    min-width: 300px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .control-panel {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        padding: 15px;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .control-panel {
        top: 5px;
        right: 5px;
        left: 5px;
        padding: 10px;
        max-height: 80vh;
    }
}

.ribbon-selector {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.ribbon-selector select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 16px;
    margin-top: 5px;
}

.ribbon-controls h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.selected-info {
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
}

.size-control {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.text-controls {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.text-control {
    margin-bottom: 12px;
}

.text-control:last-child {
    margin-bottom: 0;
}

.position-controls {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-bottom: 15px;
}

.position-control {
    margin-bottom: 12px;
}

.position-control:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

input[type="color"] {
    width: 100%;
    height: 30px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

select {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: "Barlow Condensed", sans-serif;
}

span {
    display: inline-block;
    min-width: 40px;
    text-align: right;
    color: #63480D;
    font-size: 1.30rem;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    #ribbonPaths {
        transform: scale(0.8);
        transform-origin: center;
    }
    
    #ribbonPaths text {
        font-size: 0.9em;
        cursor: pointer;
        touch-action: manipulation;
    }
    
    .hover-image img {
        object-fit: cover;
        object-position: center;
    }
    
    /* Improve touch targets */
    input[type="range"] {
        height: 44px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
        -webkit-appearance: none;
        appearance: none;
        background: #63480D;
        border-radius: 50%;
        cursor: pointer;
    }
    
    input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
        background: #63480D;
        border-radius: 50%;
        border: none;
        cursor: pointer;
    }
}

@media (max-width: 480px) {
    #ribbonPaths {
        transform: scale(0.6);
        transform-origin: center;
    }
    
    #ribbonPaths text {
        font-size: 0.8em;
    }
    
    span {
        font-size: 1.10rem;
        min-width: 30px;
    }
    
    .ribbon-selector select,
    select {
        font-size: 14px;
        padding: 8px;
    }
    
    label {
        font-size: 12px;
    }
    
    input[type="color"] {
        height: 40px;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    /* Optimize hover effects for touch devices */
    .hover-image {
        will-change: opacity;
    }
    
    /* Reduce motion for users who prefer it */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
        
        #ribbonPaths text {
            animation: none !important;
        }
    }
}

