/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('image/chichi.png') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 250vw;
    height: 250vh;
    background-image: url('image/chichi.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    transform: translate(-50%, -50%);
    animation: spin 2.8s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.game-container {
    padding: 2rem;
    top: 90%;
    left: 10%;
    text-align: center;
}

header {
    margin-bottom: 1rem;
}

h1 {
   color: #6fdceb;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

a {
  all: unset;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.score-item {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: bold;
}

#score {
    display: inline-block;
    transition: transform 0.5s ease;
}

.score-item span:first-child {
    color: #6597e2;
}

/* Music Controls */
.music-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.music-controls .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin: 0;
}

#music-volume {
    width: 100px;
    height: 5px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

#music-volume::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #7e5dda;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.tap-area {
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.tap-square {
    width: 180px;
    height: 180px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.tap-square:hover {
    transform: scale(1.1);
}

.tap-square:active {
    transform: scale(0.9);
}

.game-info {
    margin-top: 2rem;
}

.dropup-container {
    position: fixed;
    bottom: 40px;
/* i found this on https://www.fluid-type-scale.com/ */
--fs-sm: clamp(0.8rem, 41.17vi + -9.49rem, 23.44rem);
--fs-base: clamp(1rem, 55vi + -12.75rem, 31.25rem);
--fs-md: clamp(1.25rem, 73.47vi + -17.12rem, 41.66rem);
--fs-lg: clamp(1.56rem, 98.12vi + -22.97rem, 55.53rem);
--fs-xl: clamp(1.95rem, 131.03vi + -30.8rem, 74.02rem);
--fs-xxl: clamp(2.44rem, 174.96vi + -41.3rem, 98.67rem);
--fs-xxxl: clamp(3.05rem, 233.58vi + -55.34rem, 131.52rem);
}

.dropupbtn {
    width: 500px;
    padding-top: 10px;
    padding-bottom: 10px;
    background-color: #4A443E;
    background-size: cover;
    background-position: center;
    position: relative;
    border: none;
    border-radius: 15px;
    cursor: pointer;
}

.dropupbtn:hover, .dropup:focus {
    position: relative;
    background-color: #504b46;
}

.dropup-content {
    display: none;
    position: absolute;
    background-color: #4A443E;
    bottom: 100%; /* Open upwards */
    min-width: 500px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 15px;
    animation: ease-in-out 0.3s;
}

.dropup-content a {
    color: #f1f1f1;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    display: block;
}

.dropup-content a:hover {
    background-color: #524c46;
    border-radius: 15px;
}

.show {
    display: block;
}

.btn {
    background: linear-gradient(45deg, #8999dd, #69e0e9);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn.hidden {
    display: none;
}

#instructions {
    font-size: 1.2rem;
    color: #6c757d;
}

.score-animation {
    position: absolute;
    font-size: 1.7rem;
    font-weight: bold;
    color: #cfe419;
    pointer-events: none;
    animation: scoreFloat 1.5s ease-out forwards;
}

@keyframes scoreFloat {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

.bounce-animation {
    animation: bounce 0.15s ease-in-out;
}

.game-over {
    background: #f8d7da;
    border-color: #f5c6cb;
}

@media (max-width: 480px) {
    .game-container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .score-board {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .music-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .music-controls .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Footer music info */
.music-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.music-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

#music-name {
    font-weight: bold;
    color: #73c4b6;
}

#credit {
    font-size: 18px;
    font-weight: bold;
    color: #78abee;
    transition: color 0.1s ease, text-decoration 0.2s ease;
}

    #credit:hover {
        color: rgb(0, 247, 255);
        text-decoration: none;
    }

/* back button */
.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

    .back-button:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-2px);
    }

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-option {
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 5px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease;
    background-color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.image-option:hover {
    border-color: #6fdceb;
    box-shadow: 0 4px 12px rgba(111, 220, 235, 0.6);
}

.image-option.selected {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.7);
}

.preview-image {
    width: 100%;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
}
