body {
    background: #18003d;
    margin: 0;
    font-family: 'Quicksand', 'Segoe UI', Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
}

.screen {
    display: none;
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1;
    transition: opacity 0.4s;
    overflow: hidden;
}

.screen.active {
    display: flex;
    opacity: 1;
}

#logo {
    font-family: 'Pacifico', cursive;
    font-size: 4rem;
    color: #e94fff;
    text-shadow: 0 0 40px #e94fff, 0 0 80px #6ffcff;
    letter-spacing: 0.14em;
    margin: 0 0 1.5rem 0;
    animation: neon-glow 1.8s infinite alternate;
    text-align: center;
}
@keyframes neon-glow {
    from { text-shadow: 0 0 20px #e94fff, 0 0 40px #6ffcff; }
    to { text-shadow: 0 0 70px #e94fff, 0 0 120px #6ffcff; }
}

.subtitle {
    color: #6ffcff;
    font-family: 'Quicksand', 'Segoe UI', Arial, sans-serif;
    font-size: 1.15rem;
    text-shadow: 0 0 10px #6ffcff;
    margin-bottom: 2.2rem;
    text-align: center;
    opacity: 0.92;
}
.credits {
    margin-top: 3rem;
    font-size: 0.98rem;
    opacity: 0.7;
}

.home-btns {
    margin-bottom: 1.8rem;
    display: flex;
    gap: 2vw;
    flex-wrap: wrap;
    justify-content: center;
}

.neon-btn {
    background: linear-gradient(90deg, #41c9ff 0%, #a066ff 100%);
    border: none;
    border-radius: 1.8rem;
    color: #fff;
    font-family: 'Orbitron', Arial, sans-serif;
    font-size: 2.2rem;
    padding: 1.1rem 2.5rem;
    margin: 0.5rem 0.3rem;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.16s;
    box-shadow: 0 0 0px #41c9ff;
    outline: none;
    position: relative;
    text-shadow: 0 0 10px #41c9ff88;
}
.neon-btn:active {
    transform: scale(0.96);
    background: linear-gradient(90deg, #a066ff 0%, #41c9ff 100%);
}
.neon-btn.big { font-size: 2.2rem; padding: 1.2rem 3.2rem; }
.neon-btn.settings {
    font-size: 1.3rem;
    padding: 0.7rem 1.3rem;
    background: linear-gradient(90deg, #a066ff 0%, #41c9ff 100%);
}
.neon-btn.small {
    font-size: 1.09rem;
    padding: 0.55rem 1.3rem;
    border-radius: 1.1rem;
}

/* ----------------- SONG SELECT SCREEN ----------------- */
#song-select {
    background: transparent;
    z-index: 10;
    align-items: flex-start;
    padding-top: 5vh;
}
.songselect-header {
    color: #e94fff;
    font-family: 'Orbitron', Arial, sans-serif;
    font-size: 2.1rem;
    text-shadow: 0 0 24px #e94fff, 0 0 40px #a066ff;
    margin-bottom: 0.5rem;
    text-align: center;
    width: 100vw;
}

#song-list {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
    width: 92vw;
    max-width: 500px;
}

.song-entry {
    background: rgba(20,10,48,0.86);
    border: 2px solid #41c9ff;
    border-radius: 1.2rem;
    padding: 1.2rem 1.6rem;
    color: #fff;
    box-shadow: 0 0 9px #41c9ff33;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    overflow: visible;
    transition: box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.song-entry:hover, .song-entry:focus {
    background: #2b1656;
    box-shadow: 0 0 24px #41c9ff, 0 0 10px #a066ff;
    border-color: #e94fff;
}
.song-title {
    font-size: 1.19rem;
    color: #6ffcff;
    font-weight: bold;
    letter-spacing: 0.01em;
    font-family: 'Orbitron', Arial, sans-serif;
}
.song-meta {
    font-size: 0.97rem;
    color: #a066ff;
    margin-top: 0.3rem;
    font-family: 'Quicksand', Arial, sans-serif;
}
.song-score {
    font-size: 1.01rem;
    margin-top: 0.5rem;
    color: #fff;
}
.mastery-medal {
    margin-left: 0.7rem;
    font-size: 1.25rem;
    vertical-align: middle;
    filter: drop-shadow(0 0 3px #ffd700);
}
.song-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #41c9ff44 0%, #a066ff33 100%);
    border-radius: 2px;
    margin: 0.7rem 0 0.3rem 0;
    opacity: 0.6;
}

/* Countdown */
#countdown {
    background: rgba(0, 0, 0, 0.93);
    justify-content: center;
    align-items: center;
    z-index: 10;
}
#countdown-number {
    font-size: 5.2rem;
    color: #41c9ff;
    text-shadow: 0 0 30px #41c9ff, 0 0 70px #a066ff;
    animation: countdown-pop 0.8s;
}
@keyframes countdown-pop {
    from { transform: scale(0.3); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    to { transform: scale(1); opacity: 1; }
}

/* ----------------- GAMEPLAY ----------------- */
#gameplay {
    background: #0c0026;
    justify-content: flex-end;
    align-items: center;
    flex-direction: column;
    z-index: 2;
    position: relative;
    overflow: hidden;
    padding: 0;
}
#game-ui {
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    pointer-events: none;
    padding-top: 1.2rem;
}
#song-title {
    font-family: 'Orbitron', 'Quicksand', Arial, sans-serif;
    color: #a066ff;
    font-size: 2.1rem;
    letter-spacing: 0.04em;
    font-weight: 700;
    text-shadow: 0 0 16px #a066ff99, 0 4px 18px #000;
    margin-bottom: 0.3rem;
    pointer-events: none;
}
#score {
    font-family: 'Orbitron', 'Quicksand', Arial, sans-serif;
    font-size: 3.1rem;
    color: #41c9ff;
    font-weight: 700;
    text-shadow: 0 0 30px #41c9ff, 0 2px 18px #000;
    background: none;
    padding: 0;
    margin: 0 0 0.4rem 0;
    border-radius: 0;
    min-width: 0;
    text-align: center;
    pointer-events: none;
}
#game-canvas {
    display: block;
    position: absolute;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    z-index: 1;
}

/* --- Raised Hit Bar --- */
#gameplay .hitbar, .hitbar {
    /* bar is 60px high, raised 48px from bottom */
    position: absolute;
    left: 0;
    width: 100vw;
    height: 60px;
    bottom: 48px;
    z-index: 10;
    pointer-events: none;
    /* extra style for visual clarity */
    background: rgba(105,220,255,0.18);
    border-top: 4px solid #a066ff99;
    border-bottom: 4px solid #a066ff99;
    box-shadow: 0 0 16px #41c9ffbb, 0 2px 24px #6ffcff44;
}

/* Endscreen Modal */
#endscreen {
    background: rgba(12,0,38,0.98);
    z-index: 20;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#endscreen-title {
    font-family: 'Orbitron', 'Quicksand', Arial, sans-serif;
    font-size: 2.6rem;
    color: #e94fff;
    text-shadow: 0 0 30px #a066ff;
    margin-bottom: 2rem;
}
#endscreen-score {
    font-family: 'Orbitron', 'Quicksand', Arial, sans-serif;
    font-size: 2rem;
    color: #41c9ff;
    margin-bottom: 1.2rem;
}
#endscreen-progress {
    width: 300px;
    margin: 0 auto 2.4rem auto;
    /* Flexible with inline bar */
}
#endscreen-btn {
    margin-top: 1.4rem;
    font-size: 1.4rem;
    padding: 0.7rem 2.2rem;
}

/* --- Progress Bar for Endscreen --- */
#endscreen-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.progress-bar-track {
    width: 220px;
    height: 16px;
    background: #23234b;
    border-radius: 30px;
    box-shadow: 0 0 8px #8884;
    position: relative;
    margin: 0.9em 0 0.5em 0;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 30px;
    background: linear-gradient(90deg,#41c9ff,#e94fff);
    transition: width 0.8s;
}
.progress-bar-stars {
    position: absolute;
    left: 0; top: -24px;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    pointer-events: none;
}
.progress-bar-star {
    font-size: 2rem;
    opacity: 0.2;
    transition: opacity 0.5s;
}
.progress-bar-star.active {
    opacity: 1;
}

@media (max-width: 700px) {
    #logo { font-size: 2rem; }
    .neon-btn { font-size: 1.1rem; padding: 0.7rem 1.3rem; }
    .neon-btn.big { font-size: 1.24rem; padding: 0.85rem 2.0rem; }
    #song-title { font-size: 1.1rem; }
    #score { font-size: 1.35rem; }
    .song-entry { padding: 0.7rem 1rem; }
    #endscreen-title { font-size: 1.3rem; }
    #endscreen-score { font-size: 1.1rem; }
    #endscreen-btn { font-size: 0.9rem; }
    #endscreen-progress { width: 98vw; }
}

::-webkit-scrollbar { width: 0; height: 0; }
