* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    /* background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); */
	background: linear-gradient(130deg, #C0C0C0, #B0A0C0, #B8860B, #9B4DFF, #B8860B, #B0A0C0, #C0C0C0);
    background-size: 400% 100%;
    animation: gradientFlow 20s ease infinite;
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
}

.header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.title {
    font-size: 2.5em;
    margin-bottom: 5px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.8;
    margin-bottom: 15px;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.controls button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.controls button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.controls button.active {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
}

/* Spiral container */
.spiral-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    user-select: none;
}

.spiral-container:active {
    cursor: grabbing;
}

.spiral {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
}

.artwork {
    position: absolute;
    width: 250px;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.5s ease, opacity 0.5s ease;
    border: 2px solid transparent;
}

.artwork:hover {
    transform: scale(1.1);
    border-color: #4ecdc4;
    z-index: 10;
    box-shadow: 0 15px 40px rgba(78, 205, 196, 0.4);
}

.artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.artwork:hover img {
    transform: scale(1.05);
}

.artwork.focused {
    border-color: #ff6b6b;
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.4);
}

.artwork.line-center {
    transform: scale(1.1);
    z-index: 100;
    border-color: #4ecdc4;
    box-shadow: 0 15px 40px rgba(78, 205, 196, 0.4);
}

.info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.95);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.info-content h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #4ecdc4;
}

.info-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    opacity: 0.9;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Navigation arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 4em;
    width: 80px;
    height: 80vh;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 500;
    backdrop-filter: blur(5px);
    border-radius: 10px;
}

.nav-arrow.visible {
    opacity: 0.7;
    visibility: visible;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.left-arrow {
    left: 20px;
    border-radius: 10px 0 0 10px;
}

.right-arrow {
    right: 20px;
    border-radius: 0 10px 10px 0;
}

.instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 0.9em;
    opacity: 0.7;
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .title {
        font-size: 2em;
    }
    
    .artwork {
        width: 150px;
        height: 112px;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .nav-arrow {
        width: 50px;
        height: 60vh;
        font-size: 3em;
    }
}




	/* instant title */
.instant-tooltip:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: calc(100% + 5px); 
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000; 
    pointer-events: none;
    opacity: 1;
    transition: none;
    animation: none !important; 
}

/* disable default title */
.instant-tooltip {
    pointer-events: auto !important;
}







/* UFO */

.ufo {
  position: fixed;
  top: 25%;
  left: -300px;
  width: 200px;
  height: auto;
  z-index: 100;
  pointer-events: auto; 
  cursor: pointer; 
  animation: flyAcross 6s linear 1, shadowFade 6s ease-out 1;
  image-rendering: pixelated;
  will-change: transform;
  filter: drop-shadow(0 0 0px rgba(80, 220, 255, 0));
  user-select: none;
}

.ufo:hover {
  filter: drop-shadow(0 0 15px rgba(255,100,100,0.7));
}

.ufo img {
  transform-style: preserve-3d;
  animation: ufoTilt 6s ease-in-out infinite;
}



@keyframes flyAcross {
  0% {
    transform: translateX(-600px);
    opacity: 0;
    animation-timing-function: cubic-bezier(0.1, 1, 0.1, 1); 
  }
  12% {
    transform: translateX(50vw);
    opacity: 1;
  }
  

  12.1% {
    animation-timing-function: cubic-bezier(0.1, 0.6, 0.8, 1.2); 
  }
  40% {
    transform: translateX(52vw);
  }
  
  40.1%, 67% {
    transform: translateX(52vw);
    animation-timing-function: cubic-bezier(0, 0.4, 1, 0.8);
  }
  
  67.1% {
    animation-timing-function: cubic-bezier(0.5, 1.8, 0, 2.8); 
  }
  100% {
    transform: translateX(calc(100vw + 800px));
    opacity: 0;
  }
}

@keyframes ufoTilt {
  0% { transform: rotateZ(30deg) rotateY(20deg); }
  12% { transform: rotateZ(30deg) rotateY(20deg); }
  
  30% { transform: rotateZ(5deg) rotateY(5deg); }
  
  30.1%, 40% { transform: rotateZ(5deg) rotateY(5deg); }
  
  40.1% { transform: rotateZ(10deg) rotateY(15deg); }
  60% { transform: rotateZ(25deg) rotateY(30deg); }
  100% { transform: rotateZ(35deg) rotateY(40deg); }
}


@keyframes shadowFade {
  0%, 45% {
    filter: drop-shadow(0 0 0px rgba(80, 220, 255, 0));
  }
  
  50% {
    filter: drop-shadow(0 0 20px rgba(80, 220, 255, 0.9));
  }
  51% {
    filter: drop-shadow(0 0 5px rgba(80, 220, 255, 0.3));
  }
  52% {
    filter: drop-shadow(0 0 20px rgba(80, 220, 255, 0.9));
  }
  53% {
    filter: drop-shadow(0 0 5px rgba(80, 220, 255, 0.3));
  }
  54% {
    filter: drop-shadow(0 0 20px rgba(80, 220, 255, 0.9));
  }
  
  55% {
    filter: drop-shadow(0 0 20px rgba(80, 220, 255, 0.9));
  }
  56% {
    filter: drop-shadow(0 0 5px rgba(80, 220, 255, 0.3));
  }
  57% {
    filter: drop-shadow(0 0 20px rgba(80, 220, 255, 0.9));
  }
  58% {
    filter: drop-shadow(0 0 5px rgba(80, 220, 255, 0.3));
  }
  59% {
    filter: drop-shadow(0 0 20px rgba(80, 220, 255, 0.9));
  }
  
  
  
  

  
  60% {
    filter: drop-shadow(0 0 8px rgba(80, 220, 255, 0.4));
  }
  70% {
    filter: drop-shadow(0 0 3px rgba(80, 220, 255, 0.1));
  }
  65%, 100% {
    filter: drop-shadow(0 0 0px rgba(80, 220, 255, 0));
  }
}




.ufo-trigger {
  position: fixed;
  bottom: 62px;
  right: 135px;
  opacity: 1;
  cursor: pointer;
  transition: opacity 0.3s;
  z-index: 1000;
}

.ufo-trigger:hover {
  opacity: 0.9;
}

.ufo-trigger:active {
  transform: scale(0.9);
}




.ufo-explosion {
  position: fixed;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, 
    rgba(255,200,0,0.8) 0%, 
    rgba(255,100,0,0.6) 30%, 
    rgba(255,0,0,0) 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  transform: scale(0);
  opacity: 0;
  display: none;
}

@keyframes explode {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}



/* Physics mode */
.physics-mode-active .spiral-container {
    display: none;
}

#physicsCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: auto;
}

.controls button.active {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
}

#physicsMode.active {
    background: rgba(255, 107, 107, 0.3);
    border-color: #ff6b6b;
}

/* Window with the full image */
.full-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(20px);
}

.full-image-modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.full-image-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.full-image-content img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.full-image-info {
    padding: 20px;
    color: white;
    max-width: 800px;
}

.full-image-info h3 {
    color: #4ecdc4;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.full-image-info p {
    margin-bottom: 10px;
    opacity: 0.9;
    line-height: 1.5;
}

.close-full-image {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-full-image:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}







/*Secret stuff with the "mining" magic staff for the physics mode */
.secret-area {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 150;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.secret-container {
    position: relative;
    width: 128px;
    height: 128px;
    cursor: pointer;
}

.mining-animation {
    position: relative;
    width: 128px;
    height: 128px;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

#miningGif {
    width: 128px;
    height: 128px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 100, 0, 0.5));
    transition: filter 0.3s ease;
}

.mining-animation:hover #miningGif {
    filter: drop-shadow(0 0 10px rgba(255, 200, 0, 0.8));
}

.spark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, 
        rgba(255, 200, 0, 0) 0%,
        rgba(255, 200, 0, 0) 60%,
        rgba(255, 150, 0, 0.3) 70%,
        rgba(255, 100, 0, 0) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.spark-overlay.active {
    opacity: 1;
    animation: sparkPulse 0.5s ease-out;
}

@keyframes sparkPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0.3; }
}

.staff-container {
    width: 64px;
    height: 64px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(155, 77, 255, 0.2);
    border: 2px solid rgba(155, 77, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

#staffImage {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(155, 77, 255, 0.7));
}

.staff-container:hover {
    background: rgba(155, 77, 255, 0.3);
    border-color: rgba(255, 215, 0, 0.7);
    transform: translate(-50%, -50%) scale(1.1);
}

.staff-container:hover #staffImage {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9));
}

.secret-info {
    position: absolute;
    bottom: -25px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #FFD700;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.secret-container:hover .secret-info {
    opacity: 1;
}

/* Flash of light */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    display: none; 
}

.flash-overlay.active {
    display: block;
    animation: flashEffect 2s ease-out forwards; 
}

@keyframes flashEffect {
    0% { 
        opacity: 0; 
        display: block;
    }
    10% { 
        opacity: 1; /* fast to white */
    }
    50% { 
        opacity: 1; /* full white */
    }
    80% { 
        opacity: 0.9; /* slowly decreasing */
    }
    95% { 
        opacity: 0.1; /* almost visible now */
    }
    100% { 
        opacity: 0; 
        display: none;
    }
}

/* Magic staff cursor */
body.staff-cursor #physicsCanvas {
    cursor: none !important;
}

.staff-cursor {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    width: 64px;
    height: 64px;
    pointer-events: none;
    z-index: 9999;
    filter: drop-shadow(0 0 8px rgba(155, 77, 255, 0.8));
    transform: translate(-32px, -32px);
    transition: transform 0.1s ease;
}

.custom-cursor img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Indicate that user is holding a ball (magic staff) */
.ball-held-indicator {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255,215,0,1) 0%, rgba(255,100,0,0.7) 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    animation: pulseGlow 1s infinite alternate;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 10px rgba(255,215,0,0.7); }
    to { box-shadow: 0 0 20px rgba(255,100,0,1); }
}



/* change from static picture to GIF smoothly */
.mining-animation img {
    position: absolute;
    top: 0;
    left: 0;
    width: 128px;
    height: 128px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

#miningStatic {
    filter: drop-shadow(0 0 5px rgba(255, 100, 0, 0.5));
}

#miningGif {
    opacity: 0;
}

#miningGif.playing {
    opacity: 1;
    display: block;
}




/* Upload panel */
.upload-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.95);
    padding: 20px;
    border-radius: 15px;
    max-width: 350px;
    width: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.upload-panel.active {
    opacity: 1;
    visibility: visible;
}

.upload-content h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
    text-align: center;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.05);
}

.upload-icon {
    font-size: 40px;
    color: #4ecdc4;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 12px;
    opacity: 0.6;
    margin-top: 5px;
}

.preview-area {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    max-height: 200px;
}

#imagePreview {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: rgba(255, 107, 107, 0.8);
    transform: scale(1.1);
}

.upload-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-fields input,
.upload-fields textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.upload-fields input:focus,
.upload-fields textarea:focus {
    outline: none;
    border-color: #4ecdc4;
    background: rgba(255, 255, 255, 0.15);
}

.upload-fields textarea {
    min-height: 80px;
    resize: vertical;
}

.upload-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.upload-buttons button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

#cancelUpload {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

#cancelUpload:hover {
    background: rgba(255, 107, 107, 0.3);
}

#addArtwork {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

#addArtwork:enabled {
    background: rgba(78, 205, 196, 0.3);
    cursor: pointer;
}

#addArtwork:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#addArtwork:enabled:hover {
    background: rgba(78, 205, 196, 0.4);
}

/* Show upload panel only in spiral mode (not physics or line modes) */
.physics-mode-active .upload-panel,
.line-mode-active .upload-panel {
    display: none !important;
}

/* Add line-mode class to body when in line mode */
.line-mode-active .upload-panel {
    display: none !important;
}