body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 1rem;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url(../images/IMG_1386.jpeg);
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.box {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    background-color: rgba(255, 255, 255, 0.05); 
    color: white;
    backdrop-filter: blur(3px);
    box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    width: 200px;
    transition: background 0.2s ease, color 0.2s ease, width 0.2s ease, border-radius 0.2s ease;
}

.box:active { 
    cursor: grabbing;
}


.controls {
    position: absolute;
    top: 200px;
    left: 50px;
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(3px);
    width: 260px;
    transform-origin: bottom left;
    opacity: 0;
    transform: scale(0.4);
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.2s ease, background 0.2s ease, color 0.2s ease, width 0.2s ease, border-radius 0.2s ease, backdrop-filter 0.2s ease;;
}

.controls.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.controls h2 { 
    margin: 0; font-size: 1.2rem;
    }
    
.controls label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.input-text,
.input-color,
.input-range {
    width: 100%;
    margin-top: 6px;
    border-radius: 6px;
    border: none;
    outline: none;
}

.input-text {
    padding: 6px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.8rem;
    color: inherit;
}

.input-color {
    height: 35px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
    background: transparent;
    border-radius: 6px;
}

.input-range {
  -webkit-appearance: none;
  width: 100%;
  height: 35px;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
  margin: 10px 0;
  margin-top: 6px;
  
}

.input-range::-webkit-slider-runnable-track {
  height: 5px;
  background: #888;
  border-radius: 999px;
}

.input-range::-moz-range-track {
  height: 5px;
  background: #888;
  border-radius: 999px;
}

.input-range::-webkit-slider-thumb {
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border-bottom-right-radius: 50%;
  background: #ffffff;
  border: none;
  box-shadow: none;
  margin-top: calc((5px - 20px) / 2);
}

.input-range::-moz-range-thumb {
  align-items: center;
  width: 200px;
  height: 30px;
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
  background: #ffffff;
  border: none;
}

.input-range::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    #ffffff 0%,
    #ffffff var(--value, 50%),
    #888 var(--value, 50%),
    #888 100%
  );
}

.reset-button {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    color: inherit;
    transition: background 0.2s ease;
}

.reset-button:hover { 
    background: rgba(255,255,255,0.35);
}

.tab-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tab-buttons button {
  flex: 1;
  padding: 6px;
  border: none;
  background: #444;
  color: white;
  cursor: pointer;
  border-radius: 5px;
}

.tab-buttons button.active {
  background: #1e88e5;
}

.tab-content {
  overflow: hidden;
  will-change: opacity, transform;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tab-content label {
  display: block;
  margin-bottom: 8px;
}

.icon-button {
    position: fixed;
    bottom: clamp(20px, 12.5vh + env(safe-area-inset-bottom), 8px);
    left: 5vw;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(3px);
    box-shadow: inset 0 0 2px rgba(255, 255, 255 ,0.3);
    cursor: grab;
    opacity: 1;
    z-index: 9999;
    color: white;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.icon-button svg, 
.icon-button img {
    width: 28px;
    height: 28px;
    pointer-events: none;
}

.icon-button:active { 
    cursor: grabbing;
    transform: scale(0.9);
}

.close-button {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: inherit;
}

@media (min-width: 768px) {
    .box {
        width: 220px;
        padding: 15px 25px;
    }
    .controls {
        top: 220px;
        left: 60px;
        width: 280px;
        padding: 20px;
    }
    .icon-button {
        bottom: clamp(25px, 10vh + env(safe-area-inset-bottom), 100px);
        left: 4vw;
        width: 60px;
        height: 60px;
    }
}

@media (min-width: 1024px) {
    .box {
        width: 250px;
        padding: 20px 30px;
    }
    .controls {
        top: 250px;
        left: 70px;
        width: 300px;
        padding: 25px;
    }
    .icon-button {
        bottom: clamp(30px, 8vh + env(safe-area-inset-bottom), 120px);
        left: 3vw;
        width: 65px;
        height: 65px;
    }
}

@media (min-width: 1440px) {
    .box {
        width: 280px;
        padding: 25px 35px;
    }
    .controls {
        top: 280px;
        left: 80px;
        width: 320px;
        padding: 30px;
    }
    .icon-button {
        bottom: clamp(35px, 6vh + env(safe-area-inset-bottom), 140px);
        left: 2vw;
        width: 70px;
        height: 70px;
    }
}