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

body {
    background: linear-gradient(45deg, #1a1a1a, #2d2d2d, #1a1a1a);
    background-size: 400% 400%;
    animation: backgroundShift 8s ease-in-out infinite;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    height: 100vh;
}

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

#collage-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

.strip {
    flex: 1;
    height: 100vh;
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.02) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 100%);
}

.strip:first-child {
    border-left: none;
}

.collage-object {
    position: absolute;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    cursor: grab;
    transition: transform 0.3s ease;
    z-index: 1;
}

.collage-object img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    filter: contrast(1.2) saturate(1.3);
}

.collage-object:hover {
    transform: scale(1.1) rotate(5deg) !important;
    z-index: 100;
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
}

.collage-object.dragging {
    cursor: grabbing !important;
    filter: contrast(1.5) saturate(1.5) brightness(1.2);
    box-shadow: 0 8px 40px rgba(255, 255, 255, 0.4);
}

.collage-object.crushing {
    animation: crushPulse 0.3s ease-in-out infinite;
}

@keyframes crushPulse {
    0%, 100% { filter: brightness(0.5) contrast(2); }
    50% { filter: brightness(0.3) contrast(3); }
}

.fragment {
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.mode-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #00ff88;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 18px;
    z-index: 10000;
    border: 2px solid #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    animation: modePopIn 0.3s ease-out;
}

@keyframes modePopIn {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.5); 
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
}

/* Frenzied animation classes */
.ritual-spin {
    animation: ritualSpin 3s linear infinite;
}

.ritual-float {
    animation: ritualFloat 4s ease-in-out infinite;
}

.ritual-pulse {
    animation: ritualPulse 2s ease-in-out infinite;
}

.ritual-shake {
    animation: ritualShake 0.5s ease-in-out infinite;
}

.ritual-drift {
    animation: ritualDrift 6s ease-in-out infinite;
}

@keyframes ritualSpin {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(0.8); }
    50% { transform: rotate(180deg) scale(1.2); }
    75% { transform: rotate(270deg) scale(0.9); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes ritualFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(5deg); }
    66% { transform: translateY(15px) rotate(-3deg); }
}

@keyframes ritualPulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.3) rotate(10deg); opacity: 0.7; }
}

@keyframes ritualShake {
    0%, 100% { transform: translateX(0px); }
    25% { transform: translateX(-3px) rotate(-1deg); }
    75% { transform: translateX(3px) rotate(1deg); }
}

@keyframes ritualDrift {
    0%, 100% { transform: translateX(0px) translateY(0px) rotate(0deg); }
    20% { transform: translateX(10px) translateY(-15px) rotate(2deg); }
    40% { transform: translateX(-5px) translateY(20px) rotate(-1deg); }
    60% { transform: translateX(15px) translateY(5px) rotate(3deg); }
    80% { transform: translateX(-10px) translateY(-10px) rotate(-2deg); }
}

#ritual-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    color: #ff4444;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.pulse {
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.7);
}

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

#generation-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: #00ff88;
    font-weight: bold;
    z-index: 1000;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

#credit-line {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: #cccccc;
    font-size: 11px;
    z-index: 1000;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

#credit-line a {
    color: #00ff88;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

#credit-line a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

#hints-dropdown {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

#hints-toggle {
    background: rgba(0, 0, 0, 0.8);
    color: #00ff88;
    border: 2px solid #00ff88;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    transition: all 0.3s ease;
}

#hints-toggle:hover {
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.5);
    transform: scale(1.05);
}

.hints-content {
    position: absolute;
    top: 45px;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff88;
    border-radius: 10px;
    min-width: 320px;
    max-width: 400px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
    display: none;
    animation: hintsSlideIn 0.3s ease-out;
}

.hints-content.show {
    display: block;
}

@keyframes hintsSlideIn {
    0% { 
        opacity: 0; 
        transform: translateY(-10px) scale(0.95); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.hints-section {
    margin-bottom: 20px;
}

.hints-section:last-child {
    margin-bottom: 0;
}

.hints-section h3 {
    color: #ff4444;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 68, 68, 0.3);
    padding-bottom: 4px;
}

.hints-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hints-section li {
    color: #cccccc;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 6px;
    padding-left: 15px;
    position: relative;
}

.hints-section li:before {
    content: "→";
    color: #00ff88;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.hints-section li.current-mode {
    color: #00ff88;
    font-weight: bold;
}

.hints-section li.current-mode:before {
    content: "★";
}

.key-combo {
    background: rgba(0, 255, 136, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    color: #00ff88;
    font-weight: bold;
}

#ritual-input-container {
    position: fixed;
    top: 70px;
    left: 20px;
    z-index: 1000;
    font-family: 'Courier New', monospace;
}

#ritual-input-container label {
    display: block;
    color: #00ff88;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.input-group {
    display: flex;
    gap: 5px;
}

#ritual-input {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff88;
    border-radius: 15px;
    padding: 8px 12px;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    width: 200px;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    transition: all 0.3s ease;
}

#ritual-input:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.5);
    background: rgba(0, 0, 0, 0.9);
}

#ritual-input::placeholder {
    color: #666666;
    font-style: italic;
}

#ritual-submit {
    background: rgba(0, 255, 136, 0.2);
    border: 2px solid #00ff88;
    border-radius: 15px;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ritual-submit:hover {
    background: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    transform: scale(1.1);
}

#ritual-submit:active {
    transform: scale(0.95);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #hints-dropdown {
        top: 60px;
        right: 10px;
    }
    
    .hints-content {
        min-width: 280px;
        max-width: calc(100vw - 20px);
        right: -10px;
    }
    
    #hints-toggle {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .strip {
        min-width: 80px;
    }
    
    .collage-object {
        min-width: 40px !important;
        min-height: 40px !important;
    }
    
    #ritual-input-container {
        top: 65px;
        left: 10px;
    }
    
    #ritual-input {
        width: 150px;
        font-size: 10px;
        padding: 6px 10px;
    }
    
    #ritual-submit {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}