:root {
    --neon-blue: #00f3ff;
    --neon-pink: #ff00ff;
    --dark-bg: #050507;    /* Darker background */
    --darker-bg: #020203;  /* Even darker background */
    --panel-bg: rgba(0, 0, 0, 0.678);  /* Darker panels */
    --text-primary: #ffffff;
    --text-secondary: #bebebe;
}

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevents scrolling */
    height: 100vh; /* Full viewport height */
    width: 100vw; /* Full viewport width */
}

body {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    position: relative;
    box-sizing: border-box;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 10px var(--neon-blue);
}

.header h1 {
    margin-bottom: 2px;
    font-size: 4em;
    letter-spacing: 2px;
    background: linear-gradient(
        90deg,
        var(--neon-blue) 0%,
        var(--neon-pink) 50%,
        var(--neon-blue) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shine 24s linear infinite;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

@keyframes shine {
    to { background-position: 200% center; }
}

.header p {
    color: var(--text-secondary);
    margin: 5px 0;
    font-size: 1.3em;
}

@media (max-width: 768px) {
    .header p {
        font-size: 0.9em; /* Smaller size for mobile */
    }
}

.game-stats {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.3); /* Darker gray color */
    font-size: 0.8em;
    z-index: 1;
}

#guess-history {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 60px; /* Add space for fixed stats */
    margin-top: 10px;
}


.game-info {
    background: var(--panel-bg);
    padding: 12px 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    font-size: 0.85em;
    color: var(--text-secondary);
    border: 1px solid rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
}

/* Make the game info more compact */
.game-info p {
    margin: 4px 0;
    line-height: 1.2;
}

.insane-levels {
    display: block;
    margin-top: 4px;
    font-size: 1.2em;
    color: #FFAE00;
    text-shadow: 0 0 5px rgba(255, 174, 0, 0.5);
}

/* Make the game info even more compact on mobile */
@media (max-width: 768px) {
    .game-info {
        padding: 10px 12px;
        margin-bottom: 12px;
    }
    
    .game-info p {
        margin: 3px 0;
        line-height: 1.2;
    }
}

#player-container {
    background: 
    repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.3),
        rgba(0, 0, 0, 0.3) 5px,
        rgba(0, 0, 0, 0.4) 5px,
        rgba(0, 0, 0, 0.4) 10px
    ),
    rgba(10, 10, 12, 0.3);
    padding: 20px;
    border-radius: 20px;
    margin: 15px 0 10px 0;
    border: 1px solid rgba(100, 100, 100, 0.4);
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 0, 255, 0.05),
        0 0 30px rgba(96, 240, 209, 0.03); /* Subtle accent glow */
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

.play-button {
    background: rgba(0, 0, 0, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    width: 100%;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* Gradient glow effect that follows mouse */
.play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle 160px at var(--mouse-x) var(--mouse-y),
        rgba(0, 243, 255, 0.4),
        rgba(255, 0, 255, 0.2),
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

/* Bright spot that follows mouse */
.play-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(
        circle 40px at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.4),
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.play-button:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 
        0 0 20px rgba(0, 243, 255, 0.3),
        0 0 40px rgba(255, 0, 255, 0.1);
    background-image: linear-gradient(
        45deg,
        rgba(0, 243, 255, 0.05) 0%,
        rgba(255, 0, 255, 0.05) 25%,
        rgba(0, 243, 255, 0.1) 50%,
        rgba(255, 0, 255, 0.05) 75%,
        rgba(0, 243, 255, 0.05) 100%
    );
    background-size: 400% 400%;
    animation: gradientPulse 4s ease infinite;
}

@keyframes gradientPulse {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

.play-button:hover::before,
.play-button:hover::after {
    opacity: 1;
}

/* Active state */
.play-button:active {
    transform: scale(0.98);
    box-shadow: 
        0 0 10px rgba(0, 243, 255, 0.2),
        0 0 20px rgba(255, 0, 255, 0.1);
}

@keyframes shine {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

.progress-container {
    position: relative;
    margin-bottom: 0px;
    width: 100%;
    z-index: 1;
}

.progress-segments {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.progress-segment {
    height: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background-color 0.3s ease-out;
}

/* Adjust widths based on actual durations */
.progress-segment:nth-child(1) { /* 0-1s */
    flex: 1;
}
.progress-segment:nth-child(2) { /* 1-2s */
    flex: 1;
}
.progress-segment:nth-child(3) { /* 2-4s */
    flex: 2;
}
.progress-segment:nth-child(4) { /* 4-8s */
    flex: 4;
}
.progress-segment:nth-child(5) { /* 8-12s */
    flex: 4;
}
.progress-segment:nth-child(6) { /* 12-16s */
    flex: 4;
}

.progress-segment.played {
    animation: segmentPlayed 0.3s ease-out forwards;
    box-shadow: 0 0 4px rgba(255, 0, 0, 0.5); /* Red glow */
}

.progress-segment.current {
    background-color: rgba(255, 255, 255, 0.1);
    animation: glowPulse 1s ease-in-out infinite;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.6),
                0 0 8px rgba(255, 255, 255, 0.3);
    outline: 2px solid rgba(255, 255, 255, 0.6);
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
                    0 0 5px rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.8),
                    0 0 8px rgba(255, 255, 255, 0.4);
        border-color: rgba(255, 255, 255, 0.8);
    }
    100% {
        box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
                    0 0 5px rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.4);
    }
}

.progress-segment.correct {
    animation: segmentCorrect 0.3s ease-out forwards;
    box-shadow: 0 0 10px #00ff66 !important;
}

@keyframes segmentPlayed {
    0% {
        transform: scale(1);
        background-color: rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        background-color: rgba(255, 0, 0, 0.8);
    }
}

@keyframes segmentCorrect {
    0% {
        transform: scale(1);
        background-color: rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        background-color: #00ff66;
    }
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: visible;
    margin-top: 15px;
    position: relative;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #00ff66;
    box-shadow: 0 0 10px  #00ff66;
    transition: width linear;
    will-change: width;
    transform: translateZ(0);
    position: relative;
    z-index: 2;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent calc(6.25% - 1px),  /* 1s */
        rgba(255, 255, 255, 0.3) calc(6.25% - 1px),
        rgba(255, 255, 255, 0.3) 6.25%,
        transparent 6.25%,
        transparent calc(12.5% - 1px),  /* 2s */
        rgba(255, 255, 255, 0.3) calc(12.5% - 1px),
        rgba(255, 255, 255, 0.3) 12.5%,
        transparent 12.5%,
        transparent calc(25% - 1px),    /* 4s */
        rgba(255, 255, 255, 0.3) calc(25% - 1px),
        rgba(255, 255, 255, 0.3) 25%,
        transparent 25%,
        transparent calc(50% - 1px),    /* 8s */
        rgba(255, 255, 255, 0.3) calc(50% - 1px),
        rgba(255, 255, 255, 0.3) 50%,
        transparent 50%,
        transparent calc(75% - 1px),    /* 12s */
        rgba(255, 255, 255, 0.3) calc(75% - 1px),
        rgba(255, 255, 255, 0.3) 75%,
        transparent 75%,
        transparent calc(100% - 1px),   /* 16s */
        rgba(255, 255, 255, 0.3) calc(100% - 1px),
        rgba(255, 255, 255, 0.3) 100%
    );
    pointer-events: none;
    z-index: 1;
}


/* Add segment markers */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent calc(6.25% - 1px),  /* 1s */
        rgba(255, 255, 255, 0.3) calc(6.25% - 1px),
        rgba(255, 255, 255, 0.3) 6.25%,
        transparent 6.25%,
        transparent calc(12.5% - 1px),  /* 2s */
        rgba(255, 255, 255, 0.3) calc(12.5% - 1px),
        rgba(255, 255, 255, 0.3) 12.5%,
        transparent 12.5%,
        transparent calc(25% - 1px),    /* 4s */
        rgba(255, 255, 255, 0.3) calc(25% - 1px),
        rgba(255, 255, 255, 0.3) 25%,
        transparent 25%,
        transparent calc(50% - 1px),    /* 8s */
        rgba(255, 255, 255, 0.3) calc(50% - 1px),
        rgba(255, 255, 255, 0.3) 50%,
        transparent 50%,
        transparent calc(75% - 1px),    /* 12s */
        rgba(255, 255, 255, 0.3) calc(75% - 1px),
        rgba(255, 255, 255, 0.3) 75%,
        transparent 75%,
        transparent calc(100% - 1px),   /* 16s */
        rgba(255, 255, 255, 0.3) calc(100% - 1px),
        rgba(255, 255, 255, 0.3) 100%
    );
    pointer-events: none;
}

.input-container {
    position: relative;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
    z-index: 1002;
}

.song-reveal {
    display: block;
    margin: 10px 0;
}

#game-controls {
    width: 100%;
    box-sizing: border-box;
}

#guess-input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: 
        rgb(0, 0, 0);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
    z-index: 1002;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 0, 255, 0.05),
        0 0 30px rgba(96, 240, 209, 0.03);
    backdrop-filter: blur(5px);
}

#guess-input:focus {
    outline: none;
    border-color: rgb(255, 255, 255);
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 0, 255, 0.08),
        0 0 30px rgba(96, 240, 209, 0.05);
}

/* Optional: Style the placeholder text */
#guess-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.button-container {
    display: flex;
    gap: 15px;
    width: 100%;
}

.button-container button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.content-wrapper {
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 10px 0 10px; 
    box-sizing: border-box;
    flex: 1;
}

#waveCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 1;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        #000000,
        #030303,
        #050505,
        #030303,
        #000000
    );
}

/* Base styles for both buttons */
#skip-button, #submit-button {
    background: rgba(0, 0, 0, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* Submit button glow effect (green/teal) */
#submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle 160px at var(--mouse-x) var(--mouse-y),
        rgba(0, 255, 136, 0.4),
        rgba(0, 180, 120, 0.2),
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

/* Submit button bright spot */
#submit-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(
        circle 40px at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.4),
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

/* Skip button glow effect (red/orange) */
#skip-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle 160px at var(--mouse-x) var(--mouse-y),
        rgba(255, 80, 80, 0.4),
        rgba(255, 100, 50, 0.2),
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

/* Skip button bright spot */
#skip-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(
        circle 40px at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.4),
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

/* Show effects on hover */
#submit-button:hover::before,
#submit-button:hover::after,
#skip-button:hover::before,
#skip-button:hover::after {
    opacity: 1;
}

/* Submit button hover state */
#submit-button:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: 
        0 0 20px rgba(0, 255, 136, 0.3),
        0 0 40px rgba(0, 180, 120, 0.1);
    background-image: linear-gradient(
        45deg,
        rgba(0, 255, 136, 0.05) 0%,
        rgba(0, 180, 120, 0.05) 25%,
        rgba(0, 255, 136, 0.1) 50%,
        rgba(0, 180, 120, 0.05) 75%,
        rgba(0, 255, 136, 0.05) 100%
    );
    background-size: 400% 400%;
    animation: gradientPulse 4s ease infinite;
}

/* Skip button hover state */
#skip-button:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 80, 80, 0.5);
    box-shadow: 
        0 0 20px rgba(255, 80, 80, 0.3),
        0 0 40px rgba(255, 100, 50, 0.1);
    background-image: linear-gradient(
        45deg,
        rgba(255, 80, 80, 0.05) 0%,
        rgba(255, 100, 50, 0.05) 25%,
        rgba(255, 80, 80, 0.1) 50%,
        rgba(255, 100, 50, 0.05) 75%,
        rgba(255, 80, 80, 0.05) 100%
    );
    background-size: 400% 400%;
    animation: gradientPulse 4s ease infinite;
}

/* Active states */
#submit-button:active {
    transform: scale(0.98);
    box-shadow: 
        0 0 10px rgba(0, 255, 136, 0.2),
        0 0 20px rgba(0, 180, 120, 0.1);
}

#skip-button:active {
    transform: scale(0.98);
    box-shadow: 
        0 0 10px rgba(255, 80, 80, 0.2),
        0 0 20px rgba(255, 100, 50, 0.1);
}

#result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    background: var(--panel-bg);
    text-align: center;
    border: 1px solid rgba(0, 243, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
}

#guess-history {
    width: 100%;
    box-sizing: border-box;
    min-height: calc(6 * (1.1em + 30px + 16px));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.guess-item {
    padding: 8px 12px;
    font-size: 1.1em;
    margin: 4px 0;
    border: 1px solid rgba(100, 100, 100, 0.2); /* More transparent border */
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.9); /* Keep text visible */
    text-align: center;
    background: 
        repeating-linear-gradient(
            45deg,
            rgba(0, 0, 0, 0.1),  /* More transparent base */
            rgba(0, 0, 0, 0.1) 5px,
            rgba(0, 0, 0, 0.2) 5px,  /* Slightly darker for lines */
            rgba(0, 0, 0, 0.2) 10px
        ),
        rgba(10, 10, 12, 0.1);  /* More transparent background */
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 0, 255, 0.02),
        0 0 30px rgba(96, 240, 209, 0.01);
    backdrop-filter: blur(3px); /* Reduced blur */
}

/* When a new guess is added */
.guess-item.new {
    animation: pulseRed 0.5s ease-out forwards;
}

@keyframes pulseRed {
    0% {
        background: 
            repeating-linear-gradient(
                45deg,
                rgba(0, 0, 0, 0.3),
                rgba(0, 0, 0, 0.3) 5px,
                rgba(0, 0, 0, 0.4) 5px,
                rgba(0, 0, 0, 0.4) 10px
            ),
            rgba(60, 10, 10, 0.8);
        transform: scale(1.02);
    }
    100% {
        background: 
            repeating-linear-gradient(
                45deg,
                rgba(0, 0, 0, 0.3),
                rgba(0, 0, 0, 0.3) 5px,
                rgba(0, 0, 0, 0.4) 5px,
                rgba(0, 0, 0, 0.4) 10px
            ),
            rgba(10, 10, 12, 0.3);
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    html, body {
        overflow: auto;
    }
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 2.5em;
    }

    .game-info {
        font-size: 0.8em;
        padding: 15px;
    }

    #player-container {
        padding: 15px;
    }

    .button-container {
        flex-direction: row;
        gap: 10px;
    }

    .input-container {
        width: 100%;
    }

    #guess-input {
        width: 100%;
        font-size: 0.9em;
    }
    
    .container, .content-wrapper {
        max-width: 100%;
        padding: 0 5px; /* Reduce side padding */
    }
}

.w-100 {
    width: 100%;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.guess-item.new {
    animation: pulseRed 0.5s ease-out forwards;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Dark background instead of blur */
    z-index: 9999;
    contain: strict;
    transform: translateZ(0);
}

.modal-content {
    position: fixed; /* Change to fixed */
    top: 40%; /* Center vertically */
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-bg);
    padding: 10px 15px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15); /* Reduced shadow */
    max-width: 600px;
    width: 90%;
    z-index: 10000;
    contain: content;
    will-change: transform;
    max-height: 90vh; /* Prevent overflow on small screens */
    overflow-y: auto;
}

.modal-title {
    color: var(--neon-blue);
    margin-bottom: 2px;
    margin-top: 10px;
    font-size: 1.4em;
}

.modal-text {
    margin-bottom: 25px;
    margin-top: 2px;
    font-size: 0.8em; 
    color: var(--text-secondary);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.modal-button {
    flex: 1;
    max-width: 160px;
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.modal-button.dimmed {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none !important; /* Prevent glow effect */
}

/* Modify existing modal-button hover to only work when not dimmed */
.modal-button:not(.dimmed):hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
    background: #f0f0f0;
}

.share-button.dimmed {
    background: #333333 !important; /* Darker background when dimmed */
}


.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
    background: #f0f0f0;
}

.share-button {
    background: #000000 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3) !important;
}

.share-button:hover {
    background: #1a1a1a !important;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5) !important;
}

.song-list-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #f0f0f0;
    color:#f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 0;
}

.song-list-icon:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 10px var(--neon-blue),
                inset 0 0 5px rgba(0, 243, 255, 0.3);
}

.song-list-modal {
    max-width: 600px !important;
    max-height: 85vh;
    margin-top: 80px; /* Add this line to move it down */
}

.song-list-modal .modal-title {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.song-list-container {
    max-height: 63vh;
    overflow-y: auto;
    padding: 3px;
    margin: 8px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

/* Scrollbar styles for Webkit browsers */
.song-list-container::-webkit-scrollbar {
    width: 10px;
}

.song-list-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.song-list-container::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 5px;
    box-shadow: 0 0 5px var(--neon-blue);
}

.song-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink);
}

/* Firefox scrollbar */
.song-list-container {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) rgba(0, 0, 0, 0.2);
}

.song-list-item {
    padding: 6px;
    margin: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.song-list-item:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.song-list-item:active {
    transform: translateX(5px) scale(0.98);
}

.song-list-title {
    color: var(--text-primary);
    font-size: 1em;
}

.song-list-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.song-list-levels {
    color: #FFAE00;
    text-shadow: 0 0 5px rgba(255, 174, 0, 0.5);
    font-size: 0.9em;
    margin-left: 10px;
}

.song-list-item:last-child {
    border-bottom: none;
}

.modal-button:hover ~ .difficulty-guess-container .difficulty-btn:not(.correct):not(.incorrect) {
    border-color: #FFAE00;
    box-shadow: 0 0 5px rgba(255, 174, 0, 0.3);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .song-list-icon {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }

    .song-list-modal {
        max-height: 85vh; /* Increased for more space */
        margin: 10px;
        margin-top: 40px; /* Smaller margin for mobile */
    }

    .modal-content {
        top: 50%;
        width: 85%;
        margin: 0 auto;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 8px 12px;
        box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
    }

    .song-list-container {
        max-height: 60vh; /* Increased for taller list */
        padding: 3px;
        margin: 8px 0;
    }

    .song-list-item {
        padding: 6px;
        margin: 2px 0;
    }

    .song-list-title {
        font-size: 0.9em;
    }

    .song-list-levels {
        font-size: 0.8em;
    }

    .modal-title {
        margin-top: 5px;
        margin-bottom: 5px;
    }

    .modal-text {
        margin-top: 0;
        margin-bottom: 10px;
    }
}


#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}


.attempts-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 8px;
    min-height: 18px; /* Keep consistent height even when empty */
}

.suggestion-box {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background: #0a0a0f;
    border-radius: 10px;
    max-height: 374px; /* Desktop height */
    overflow-y: auto;
    display: none;
    z-index: 1001;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    padding: 4px;
}

.suggestion-box::-webkit-scrollbar {
    width: 10px;
}

.suggestion-box::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.suggestion-box::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 5px;
    box-shadow: 0 0 5px var(--neon-blue);
}

.suggestion-box::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink);
}

/* Firefox scrollbar */
.suggestion-box {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    body {
        padding-bottom: 0;
        position: relative;
        width: 100%;
        min-height: 100%;
        overflow-y: auto;
    }

    .content-wrapper {
        height: auto;
        min-height: 100%;
        overflow-y: visible;
        padding-bottom: 20px;
        position: relative;
    }

    /* Add this to handle viewport height changes */
    .keyboard-open .content-wrapper {
        height: auto;
        min-height: auto;
    }

    #game-controls {
        position: static; /* Change from relative to static */
        padding: 15px 0;
        background: transparent;
        box-shadow: none;
        z-index: 1;
        transform: none !important; /* Prevent any transformations */
    }

    .suggestion-box {
        position: absolute;
        bottom: calc(100% + 5px); /* Position above input with 5px gap */
        top: auto; /* Remove top positioning */
        max-height: 27vh; /* Reduced from 40vh to prevent overflow */
        width: 98%;
        left: 0;
        right: 0;
        background: #0a0a0f; /* Ensure background is solid */
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }

    .input-container {
        position: relative; /* Reinforce relative positioning */
    }

    #guess-input {
        position: relative;
        z-index: 1002;
    }

    #guess-history {
        min-height: calc(6 * (0.9em + 20px + 10px)); /* Smaller reserved space for mobile */
    }
    
    .guess-item {
        padding: 10px;
        font-size: 0.9em;
        margin: 5px 0;
    }

    .button-container {
        gap: 10px;
        position: relative; /* Ensure this stays in normal flow */
    }

    .button-container button {
        padding: 15px;
    }

    #guess-history {
        margin-bottom: 20px;
    }

    .game-stats {
        position: relative;
        bottom: auto;
        margin-top: 20px;
    }

    /* Remove any keyboard-specific positioning adjustments */
    .keyboard-open #game-controls {
        position: static;
        bottom: auto;
        transform: none !important;
    }
}

.suggestion-item {
    padding: 4px 8px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.suggestion-item .song-title {
    color: var(--text-primary);
    font-size: 1em;
}

.suggestion-item .song-artist {
    color: #888;
    font-size: 0.8em;
    margin-top: 2px;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: #00363477;
}

.song-reveal .song-title {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 1.7em;
    color: #fff;
    font-weight: 500; /* Zen Maru Gothic might look smoother at 500 */
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.9),
                 0 0 10px rgba(255, 255, 255, 0.8),
                 0 0 15px rgba(255, 255, 255, 0.7);
    display: block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: 0.03em; /* Slightly increased for Zen Maru Gothic */
    transform: translateZ(0); /* Force GPU acceleration */
    backface-visibility: hidden; /* Can help with text rendering */
    margin-bottom: 0px;
    margin-top: 50px;
}

.song-reveal .song-artist {
    font-family: sans-serif;
    font-size: 1em;
    color: #ddd;
    font-style: normal;
    display: block;
    margin-top: 0px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.share-success {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    color: #000000;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9em;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes winAnimation {
    0% { 
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes loseAnimation {
    0% { 
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
    }
    25% { 
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 1;
    }
    75% { 
        transform: translate(-50%, -50%) scale(1.02);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes particle {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(
            ${Math.random() * 200 - 100}px,
            ${Math.random() * 200 - 100}px
        ) scale(1);
        opacity: 0;
    }
}

.modal-content.win {
    animation: winAnimation 0.5s ease;
    border-color: #ffffff;
    box-shadow: 0 0 30px rgba(0, 255, 191, 0.3);
}

.modal-content.win .modal-title {
    color: #00ffb3 !important;
}

.modal-content.win .modal-button {
    box-shadow: 0 0 20px rgba(0, 255, 191, 0.4);
}

.modal-content.win .modal-button:hover {
    box-shadow: 0 0 30px rgba(0, 255, 191, 0.6);
}

.modal-content.win .song-title,
.modal-content.win .song-artist { /* Changed to song-artist */
    text-shadow: 0 0 20px rgba(0, 255, 191, 0.8);
}

.modal-content.lose {
    animation: loseAnimation 0.5s ease;
    border-color: #ffffff;
    box-shadow: 0 0 30px rgba(255, 0, 106, 0.3);
}

.modal-content.lose .modal-title {
    color: #ff0055 !important;
}

.modal-content.lose .modal-button {
    box-shadow: 0 0 20px rgba(255, 0, 106, 0.6);
}

.modal-content.lose .modal-button:hover {
    box-shadow: 0 0 30px rgba(255, 0, 106, 0.6);
}

.modal-content.lose .song-title,
.modal-content.lose .song-artist { /* Changed to song-artist */
    text-shadow: 0 0 20px rgba(255, 0, 106, 0.6);
}

@keyframes segmentWin {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes segmentLose {
    0% { transform: scale(1); }
    25% { transform: scale(0.8); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.progress-segment.correct.animate {
    animation: segmentWin 0.5s ease;
}

.progress-segment.played.animate {
    animation: segmentLose 0.5s ease;
}

.difficulty-guess-container {
    margin: 15px auto;
    padding: 15px;
    background: #1a1a1a00;
    border-radius: 10px;
    contain: content;
    max-width: 400px;
    margin-bottom: 0px;
    width: 90%; /* Add this to ensure proper scaling on mobile */
}

.difficulty-prompt {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.9em;
    text-align: center;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    contain: layout style;
    margin: 0 auto; /* Center the grid */
    width: 100%; /* Ensure full width within container */
}

.difficulty-btn {
    background: transparent;
    border: 2px solid #8a8a8a;
    color: #8a8a8a;
    padding: 2px 2px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.5s ease;
    font-size: 1em;
    text-align: center;
    min-width: 20px;
}

.difficulty-btn:hover {
    border: 2px solid #00f7ff;
    color: #00f7ff;
}

/* Correct state */
.difficulty-btn.correct {
    border-color: #00ff66;
    color: #00ff66;
    background: rgba(0, 255, 102, 0.1);
    box-shadow: 0 0 10px #00ff66;
    opacity: 1;
    transition: all 1s ease; /* Match the transition timing */
}

/* Incorrect state */
.difficulty-btn.incorrect {
    border-color: #ff0066;
    color: #ff0066;
    background: rgba(255, 0, 102, 0.1);
    box-shadow: 0 0 10px #ff0066;
    opacity: 1;
    transition: all 1s ease; /* Match the transition timing */
}

/* Disabled/unused state */
.difficulty-btn:disabled:not(.correct):not(.incorrect) {
    border-color: #4a4a5a;
    color: #4a4a5a;
    background: transparent;
    cursor: not-allowed;
    opacity: 0.3;
    box-shadow: none;
    transition: all 1s ease; /* Match the transition timing */
}

.difficulty-result {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
    text-align: center;
}

.search-filters {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    padding: 0 5px;
    align-items: center;
}

#songSearchInput, #difficultyFilter {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

#songSearchInput {
    flex: 1;
}

#songSearchInput::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#difficultyFilter {
    width: 80px;
    flex: none;
    text-align: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) #000000;
}

#difficultyFilter option {
    background-color: #000000;
    color: #fff;
    padding: 8px;
    text-align: center;
}

/* Shared focus styles */
#songSearchInput:focus, #difficultyFilter:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

/* Webkit scrollbar styles */
#difficultyFilter::-webkit-scrollbar {
    width: 8px;
}

#difficultyFilter::-webkit-scrollbar-track {
    background: #000000;
}

#difficultyFilter::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 4px;
}

.song-list-item.playing {
    background: rgba(0, 255, 102, 0.1);
    border-color: rgba(0, 255, 102, 0.3);
}

.song-list-item.playing .song-list-title {
    color: #00ff66;
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.3);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .search-filters {
        margin: 10px 0;
    }
    
    #songSearchInput, #difficultyFilter {
        padding: 6px 10px;
        font-size: 0.9em;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .difficulty-buttons {
        gap: 4px;
        max-width: 300px;
    }

    .difficulty-btn {
        padding: 4px 6px;
        font-size: 0.8em;
        min-width: 30px;
    }
}

.hidden {
    display: none;
}