* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow: hidden;
    background: #0a0a0f;
    color: #ffffff;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    width: 100vw;
    position: fixed;
    margin: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    /* iOS safe area */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg,
            #0a0a0f 0%,
            #1a0b2e 25%,
            #16213e 50%,
            #0f3460 75%,
            #0a0a0f 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

/* Game screen specific: top-aligned with bottom padding */
#game-screen.active {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0 0 60px 0;
}

/* Fullscreen mode for gameplay: hide global navigation and remove padding */
.container.fullscreen-mode {
    padding: 0;
}

.container.fullscreen-mode .global-back-btn,
.container.fullscreen-mode .global-user-info {
    display: none !important;
}

.container.fullscreen-mode #game-screen.active {
    padding: 0;
}



.container.fullscreen-mode .game-ui {
    max-width: 100%;
    /* Allow full width on mobile */
}

/* Glass Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
}

/* Title */
.title {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.title-main {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, #a8b2d1, #c9a0dc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(168, 178, 209, 0.3);
}

.title-sub {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff00ff, #00f5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 6px;
}

.subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
    letter-spacing: 2px;
}

/* Difficulty Selection */
.difficulty-select h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 2px;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.difficulty-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px 40px;
    color: white;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 2px;
}

.difficulty-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.3);
    border-color: #00f5ff;
}

.difficulty-btn.easy:hover {
    border-color: #00ff88;
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.difficulty-btn.medium:hover {
    border-color: #ffaa00;
    box-shadow: 0 10px 30px rgba(255, 170, 0, 0.3);
}

.difficulty-btn.hard:hover {
    border-color: #ff0055;
    box-shadow: 0 10px 30px rgba(255, 0, 85, 0.3);
}

.diff-info {
    font-size: 16px;
    opacity: 0.7;
    font-weight: 400;
}

/* Key Guide */
.key-guide {
    margin-top: 30px;
    margin-bottom: 20px;
}

.key-guide p {
    font-size: 12px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.keys {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.key {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Game Screen */
#game-screen {
    flex-direction: column;
    padding: 0;
}

.game-ui {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    margin-bottom: 5px;
    gap: 15px;
    z-index: 10;
    /* Ensure UI appears above PixiJS background */
}

.score-display,
.combo-display,
.accuracy-display {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
}

.value {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #00f5ff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Canvas */
#game-canvas {
    flex: 1;
    background: transparent;
    /* Transparent to show PixiJS background for all modes */
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Judgment Display */
.judgment-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 0 10px currentColor;
    animation: judgmentPop 0.5s ease;
    z-index: 100;
    /* Ensure it appears above PixiJS background (z-index: 1) and canvas (z-index: 2) */
}

@keyframes judgmentPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

.judgment-display.perfect {
    color: #00ffff;
}

.judgment-display.good {
    color: #ffaa00;
}

.judgment-display.miss {
    color: #ff0055;
}

/* Key Indicators */
.key-indicators {
    display: none;
    /* Hidden for cleaner gameplay experience */
}

/* Result Screen */
.result-panel {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.result-title {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #a8b2d1, #c9a0dc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: 3px;
}

.result-stats {
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #00f5ff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.judgment-stats {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.judgment-stat {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.judgment-stat.perfect {
    border-color: rgba(0, 255, 255, 0.5);
}

.judgment-stat.good {
    border-color: rgba(255, 170, 0, 0.5);
}

.judgment-stat.miss {
    border-color: rgba(255, 0, 85, 0.5);
}

.j-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
}

.j-value {
    font-size: 24px;
    font-weight: 700;
}

.judgment-stat.perfect .j-value {
    color: #00ffff;
}

.judgment-stat.good .j-value {
    color: #ffaa00;
}

.judgment-stat.miss .j-value {
    color: #ff0055;
}

.rank-display {
    font-size: 80px;
    font-weight: 900;
    margin: 15px 0;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* NEW RECORD Badge */
.new-record-badge {
    background: linear-gradient(135deg, #ffd700, #ff8800);
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    animation: badgePulse 2s ease infinite;
    letter-spacing: 2px;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    }
}

/* Menu Buttons */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin: 2rem auto 0 auto;
    width: 100%;
    max-width: 300px;
}

.menu-btn {
    width: 100%;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    backdrop-filter: blur(5px);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.menu-btn.secondary {
    font-size: 1rem;
    padding: 0.8rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Play Button */
.play-btn {
    background: linear-gradient(135deg, #00f5ff, #ff00ff);
    border: none;
    border-radius: 20px;
    padding: 30px 80px;
    color: white;
    font-size: 36px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 4px;
    margin: 30px 0;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px rgba(0, 245, 255, 0.4);
}

.play-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 50px rgba(0, 245, 255, 0.6);
}

/* Settings Button */
.settings-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0px;
    letter-spacing: 1px;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Song Selection Screen */
.song-select-panel {
    max-width: 1000px;
    width: 90%;
    padding: 40px;
    max-height: 90vh;
    overflow-y: auto;
}

.screen-title {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #00f5ff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    letter-spacing: 4px;
}

.selected-song-title {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.song-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 20px;
}

.song-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.song-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #00f5ff;
    box-shadow: 0 15px 40px rgba(0, 245, 255, 0.4);
}

.song-card-bg {
    width: 100%;
    height: 150px;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.song-card:hover .song-card-bg {
    opacity: 0.8;
}

.song-card-content {
    padding: 20px;
}

.song-card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #ffffff;
    letter-spacing: 1px;
}

.song-card-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.song-card-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.song-card-bpm,
.song-card-duration {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Back Button */
.back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px 40px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    letter-spacing: 2px;
}

.back-btn:hover {
    transform: translateY(-2px);
    border-color: #00f5ff;
    box-shadow: 0 8px 20px rgba(0, 245, 255, 0.3);
}

/* Result Screen Updates */
.result-song-title {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

/* Settings Screen */
.settings-panel {
    max-width: 600px;
    width: 90%;
}

.setting-section {
    margin: 30px 0;
}

.setting-label {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    text-align: left;
    letter-spacing: 1px;
}

/* Theme Buttons */
.theme-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.theme-btn.active {
    background: rgba(0, 245, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.theme-name {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

.theme-preview {
    display: flex;
    gap: 8px;
    align-items: center;
}

.preview-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Favorite Button */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    transform: scale(1.15);
    background: rgba(0, 0, 0, 0.8);
    border-color: #ffd700;
}

.favorite-btn.active {
    background: rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
    animation: starPulse 1s ease infinite;
}

@keyframes starPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Auth Screen */
.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #a5f3fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-view.active {
    display: block;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.text-btn {
    background: none;
    border: none;
    color: #a5f3fc;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: underline;
    padding: 0;
}

.text-btn:hover {
    color: #fff;
}

.full-width {
    width: 100%;
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* Online Score Status */
.online-status {
    margin-top: 1rem;
    text-align: center;
    min-height: 1.5em;
    font-size: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.online-status .loading {
    color: #a5f3fc;
    animation: pulse 1.5s infinite;
}

.online-status .success {
    color: #51cf66;
    font-weight: bold;
}

.online-status .error {
    color: #ff6b6b;
}

.online-status .info a {
    color: #a5f3fc;
    text-decoration: underline;
    cursor: pointer;
}

.online-status .highlight {
    color: #ffd700;
    font-weight: bold;
    margin-left: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Ranking Screen */
.ranking-panel {
    max-width: 800px;
    width: 95%;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.ranking-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.ranking-song-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(165, 243, 252, 0.5);
}

.ranking-difficulty-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.ranking-list-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ranking-list-header {
    display: grid;
    grid-template-columns: 60px 1fr 120px 80px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    font-weight: bold;
    color: #a5f3fc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.ranking-item {
    display: grid;
    grid-template-columns: 60px 1fr 120px 80px;
    padding: 0.8rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    transition: background 0.2s;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ranking-item.top-1 {
    color: #ffd700;
    font-weight: bold;
}

.ranking-item.top-2 {
    color: #c0c0c0;
    font-weight: bold;
}

.ranking-item.top-3 {
    color: #cd7f32;
    font-weight: bold;
}

.ranking-item.self {
    background: rgba(165, 243, 252, 0.15);
    border: 1px solid rgba(165, 243, 252, 0.3);
    border-radius: 5px;
}

.ranking-loading {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.ranking-empty {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Mobile adjustments for ranking */
@media (max-width: 600px) {

    .ranking-list-header,
    .ranking-item {
        grid-template-columns: 40px 1fr 80px;
        font-size: 0.9rem;
    }

    .combo-col,
    .ranking-item .combo-val {
        display: none;
    }
}

/* User Info in Menu */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-top: 1rem;
}

.user-info.hidden {
    display: none;
}

#user-display-name {
    font-weight: bold;
    color: #fff;
}

#logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem;
    transition: transform 0.2s ease;
}

#logout-btn:hover {
    transform: scale(1.1);
}

/* Statistics Display */
.stats-display {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item-label {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
}

.stat-item-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.stat-item-value.perfect {
    color: #00ffff;
}

.stat-item-value.good {
    color: #ffaa00;
}

.stat-item-value.miss {
    color: #ff0055;
}


/* Buttons */
.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.share-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.share-icon {
    font-size: 14px;
}

.retry-btn,
.select-song-btn,
.menu-btn,
.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px 35px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.retry-btn:hover,
.select-song-btn:hover,
.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.3);
    border-color: #00f5ff;
}

/* Responsive */
@media (max-width: 768px) {
    .glass-panel {
        padding: 30px;
    }

    .title-main {
        font-size: 42px;
        letter-spacing: 2px;
    }

    .title-sub {
        font-size: 32px;
    }

    .result-title {
        font-size: 36px;
        letter-spacing: 2px;
    }

    .play-btn {
        font-size: 28px;
        padding: 25px 60px;
    }

    .song-select-panel {
        padding: 25px;
    }

    .screen-title {
        font-size: 36px;
    }

    .song-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .song-card-title {
        font-size: 20px;
    }

    .difficulty-btn {
        padding: 20px 30px;
        font-size: 20px;
    }

    .keys {
        flex-wrap: wrap;
    }

    .key-indicators {
        gap: 10px;
    }

    .key-indicator {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .glass-panel {
        padding: 30px 20px;
        max-height: 85vh;
    }

    .result-panel {
        padding: 30px 20px;
        max-height: 85vh;
    }

    .retry-btn,
    .select-song-btn,
    .menu-btn {
        padding: 15px 30px;
        font-size: 16px;
        margin: 5px;
    }

    /* Mobile game screen optimizations */
    #game-screen {
        padding: 0;
        height: 100vh;
        height: 100dvh;
        /* Use dynamic viewport height for mobile browsers */
    }

    .game-ui {
        max-height: 100vh;
        max-height: 100dvh;
        padding: 0;
    }

    .top-bar {
        padding: 3px 8px;
        margin-bottom: 3px;
        border-radius: 8px;
    }

    .label {
        font-size: 9px;
    }

    .value {
        font-size: 16px;
    }

    /* Mobile: ensure game screen is top-aligned with bottom padding */
    #game-screen.active {
        align-items: stretch !important;
        justify-content: flex-start !important;
        padding: 0 0 80px 0 !important;
    }

    /* Mobile landscape: extra padding for horizontal play */
    @media (orientation: landscape) {
        #game-screen.active {
            padding: 0 20px 60px 20px !important;
        }
    }
}

/* ==========================================
   Authentication Modal
   ========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    max-width: 420px;
    width: 100%;
    padding: 2.5rem;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #00ffff, #ff0088);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Auth Tabs */
.auth-tab {
    display: none;
}

.auth-tab.active {
    display: block;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #00ffff;
    background: rgba(255, 255, 255, 0.08);
}

.primary-btn {
    width: 100%;
    padding: 0.9rem;
    margin-top: 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #00ffff, #ff0088);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 255, 255, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.auth-message {
    min-height: 1.5rem;
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.auth-message.error {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.auth-message.success {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.auth-switch a {
    color: #00ffff;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* User Info Display */
.user-info {
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 12px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.user-greeting {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

#user-display-name {
    font-weight: 700;
    color: #00ffff;
}

.logout-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid rgba(255, 136, 0, 0.5);
    border-radius: 6px;
    background: rgba(255, 136, 0, 0.1);
    color: #ff8800;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 136, 0, 0.2);
    border-color: #ff8800;
}

/* ==========================================
   Online Score Status & Ranking
   ========================================== */

.online-score-status {
    text-align: center;
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: 8px;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.online-score-status .loading {
    color: #00ffff;
}

.online-score-status .success {
    color: #00ff88;
}

.online-score-status .error {
    color: #ff4444;
}

.online-score-status .info {
    color: rgba(255, 255, 255, 0.7);
}

.online-score-status .highlight {
    color: #ffaa00;
    font-weight: 700;
}

/* Ranking Screen */
.ranking-panel {
    max-width: 800px;
    width: 100%;
}

.ranking-song-title {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.ranking-difficulty-badge {
    text-align: center;
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 auto 1.5rem auto;
    display: block;
    width: fit-content;
}

.ranking-difficulty-badge.easy {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}

.ranking-difficulty-badge.medium {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border: 1px solid #ffaa00;
}

.ranking-difficulty-badge.hard {
    background: rgba(255, 0, 136, 0.2);
    color: #ff0088;
    border: 1px solid #ff0088;
}

.ranking-list {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.ranking-item {
    display: grid;
    grid-template-columns: 60px 1fr 100px 80px;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Top 3 special styling */
.ranking-item.top-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
}

.ranking-item.top-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1));
    border-color: #c0c0c0;
}

.ranking-item.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1));
    border-color: #cd7f32;
}

/* Self highlight */
.ranking-item.self {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 255, 255, 0.1));
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.rank-val {
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
}

.rank-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    width: fit-content;
}

.rank-badge.rank-SS {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
}

.rank-badge.rank-S {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: #fff;
}

.rank-badge.rank-A {
    background: linear-gradient(135deg, #4ecdc4, #44a19f);
    color: #fff;
}

.rank-badge.rank-B {
    background: linear-gradient(135deg, #95e1d3, #63cbb4);
    color: #000;
}

.rank-badge.rank-C {
    background: linear-gradient(135deg, #a8e6cf, #77c4a5);
    color: #000;
}

.rank-badge.rank-D {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.rank-badge.rank-F {
    background: rgba(128, 128, 128, 0.3);
    color: #999;
}

.score-val {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: right;
}

.stats-val {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
    font-size: 0.9rem;
}

.combo-val {
    color: rgba(255, 255, 255, 0.7);
}

.total-players {
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.ranking-item.top-1 .rank-val {
    color: #ffd700;
}

.ranking-item.top-2 .rank-val {
    color: #c0c0c0;
}

.ranking-item.top-3 .rank-val {
    color: #cd7f32;
}

.ranking-item.top-3 .form-actions button {
    margin-top: 0;
}

/* Share Modal Specifics */
.share-modal-content {
    max-width: 600px;
}

.share-image-container {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    background: #000;
}

.share-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.share-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.share-twitter-btn {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.share-twitter-btn:hover {
    background: #333;
    color: #fff;
}

.player-val {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-val {
    text-align: right;
    font-weight: 700;
    color: #00ffff;
}

.combo-val {
    text-align: right;
    color: #ffaa00;
}

.ranking-loading {
    text-align: center;
    padding: 2rem;
    color: #00ffff;
}

.ranking-empty {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.ranking-error {
    text-align: center;
    padding: 2rem;
    color: #ff4444;
}

/* Result Screen Ranking Section */
.result-ranking-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-ranking-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #00ffff;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.ranking-list.compact {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.ranking-list.compact .ranking-item {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.3rem;
}

.secondary-btn {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
}

/* Song Card Statistics */
.song-card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.3rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.stat-icon {
    font-size: 12px;
}

.stat-value {
    color: rgba(255, 255, 255, 0.5);
}

/* Like Button in Result Screen */
.result-like-section {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.like-btn {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    background: rgba(255, 20, 147, 0.2);
    border: 2px solid rgba(255, 20, 147, 0.5);
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.like-btn.liked {
    background: rgba(255, 20, 147, 0.4);
    border-color: #ff1493;
}

.like-btn:hover {
    background: rgba(255, 20, 147, 0.3);
    transform: scale(1.05);
}

.like-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.like-count-display {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.like-count-display span {
    font-weight: 700;
    color: #ff1493;
}

/* Global Navigation Elements (Outside Glass Panels) */
.global-back-btn {
    position: fixed;
    top: 10px;
    left: 15px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    z-index: 100;
}

.global-back-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: #00ffff;
    transform: translateX(-3px);
}

.global-user-info {
    position: fixed;
    top: 10px;
    right: 15px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
}

.global-user-info:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: #00ffff;
}

.user-icon {
    font-size: 14px;
}

/* Upload Screen Styles */
.upload-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: -10px;
    margin-bottom: 30px;
}

.upload-form {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: #fff;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.required {
    color: #ff1493;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    border-color: #00ffff;
    background: rgba(255, 255, 255, 0.15);
}

.form-textarea {
    resize: vertical;
    font-family: inherit;
}

/* Fetch button styling */
.fetch-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fetch-btn:hover {
    background: linear-gradient(135deg, #00ffff, #00aaff);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.fetch-btn:active {
    transform: translateY(0);
}

.fetch-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-hint {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 5px;
}

.upload-terms {
    margin: 25px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
}

.upload-submit-btn {
    width: 100%;
    margin-top: 10px;
}

.upload-progress {
    text-align: center;
    padding: 40px;
}

.progress-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

.upload-result {
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.upload-result.success {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid rgba(0, 255, 0, 0.3);
    color: #00ff00;
}

.upload-result.error {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid rgba(255, 0, 0, 0.3);
    color: #ff6b6b;
}

/* Background Selection Options */
.gradient-options,
.preset-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.gradient-option,
.preset-option {
    cursor: pointer;
    position: relative;
}

.gradient-option input[type="radio"],
.preset-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.gradient-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.gradient-option input[type="radio"]:checked+.gradient-preview {
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.preset-option img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.preset-option input[type="radio"]:checked+img {
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.gradient-option:hover .gradient-preview,
.preset-option:hover img {
    transform: scale(1.05);
}

/* BPM Selection */
.bpm-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.bpm-option {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: bold;
}

.bpm-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.bpm-option.selected {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Form hint text */
.form-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 5px 0 10px 0;
}

/* Song Tabs */
.song-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: -40px -40px 15px -40px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px 30px 0 0;
    padding: 0 10px;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.5);
    padding: 12px 15px;
    border-radius: 0;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: transparent;
    border-color: #00ffff;
    color: #fff;
    box-shadow: none;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.tab-b#difficulty-screen .tab.active {
    background: transparent;
    border-bottom: 3px solid #00ffff;
    color: #fff;
    box-shadow: none;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #00ffff;
    text-decoration: underline;
}

/* Update Screen Title size */
.screen-title {
    font-size: 24px;
    /* Reduced from 48px */
    margin-bottom: 15px;
    letter-spacing: 4px;
}

/* Search UI */
.song-select-panel {
    position: relative;
    /* Ensure absolute positioning works */
}

.song-search-container {
    position: absolute;
    top: 50px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.song-search-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.song-search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.song-search-input {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.song-search-input.active {
    width: 200px;
    opacity: 1;
    pointer-events: auto;
}

.song-search-input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Music Screen */
.music-panel {
    max-width: 800px;
    width: 95%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Upload Form */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-notice {
    background: rgba(255, 200, 0, 0.1);
    border: 1px solid rgba(255, 200, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.upload-notice h4 {
    color: #ffcc00;
    margin-bottom: 10px;
    font-size: 16px;
}

.upload-notice ul {
    list-style-type: disc;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.6;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group .form-input {
    flex: 1;
}

.action-btn {
    background: rgba(0, 245, 255, 0.2);
    border: 1px solid rgba(0, 245, 255, 0.5);
    color: #00ffff;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-btn:hover {
    background: rgba(0, 245, 255, 0.4);
    transform: translateY(-2px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.required {
    color: #ff4444;
    margin-left: 4px;
}

.form-input,
.form-textarea,
.form-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-size: 16px;
    width: 100%;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: #00ffff;
    outline: none;
}

.form-input[readonly] {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    border-color: transparent;
}

.form-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.bg-select-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.preset-grid,
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.preset-option,
.gradient-option {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.preset-option img,
.gradient-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.2s;
}

.preset-option input,
.gradient-option input {
    position: absolute;
    opacity: 0;
}

.preset-option input:checked+img,
.gradient-option input:checked+.gradient-preview {
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.bpm-display-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bpm-input {
    width: 100px !important;
    text-align: center;
    font-size: 20px !important;
    font-weight: bold;
}

.bpm-unit {
    font-size: 16px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
}

.bpm-candidates {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.bpm-option {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.bpm-option:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bpm-option.selected {
    background: #00ffff;
    color: #000;
    border-color: #00ffff;
    font-weight: bold;
}

.bpm-manual-option {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.terms-label {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.terms-list {
    margin-top: 5px;
    padding-left: 20px;
    list-style-type: disc;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.5;
}

.terms-list strong {
    color: #ffcc00;
}

.submit-btn {
    background: linear-gradient(135deg, #00f5ff, #ff00ff);
    border: none;
    border-radius: 10px;
    padding: 15px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 245, 255, 0.4);
}

.music-player-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.current-track-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.track-art-large {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.track-art-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-details {
    text-align: left;
    flex: 1;
}

.track-details h2 {
    font-size: 24px;
    margin-bottom: 5px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.track-details p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.player-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

#seek-bar {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
}

#seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.control-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.control-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.control-btn.play {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn.play:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.play-game-btn {
    background: linear-gradient(135deg, #00f5ff, #ff00ff);
    border: none;
    border-radius: 10px;
    padding: 12px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    letter-spacing: 1px;
}

.play-game-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.play-game-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 245, 255, 0.4);
}

.music-list-container {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.music-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .current-track-info {
        flex-direction: column;
        text-align: center;
    }

    .track-details {
        text-align: center;
    }

    .track-art-large {
        width: 150px;
        height: 150px;
    }
}

/* Music Screen Redesign */
.music-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.music-controls-top {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.song-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    flex: 0 1 300px;
    min-width: 200px;
}



.filter-box {
    display: flex;
    gap: 10px;
}

#sort-select,
#genre-filter {
    padding: 0 15px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    cursor: pointer;
}

.song-search-input {
    background: rgba(0, 0, 0, 0.8);
    border: 0 solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    width: 0;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    position: absolute;
    right: 45px;
    /* Position to the left of the button */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.song-search-input.active {
    width: 280px;
    /* Reverted width to overlap title appropriately */
    padding: 8px 15px;
    border-width: 1px;
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.song-search-input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.filter-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #ffd700;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Compact Song List */
.song-list.compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.song-list.compact .song-card {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 15px;
}

.song-list.compact .song-card-bg {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    position: static;
    opacity: 1;
}

.song-list.compact .song-card-content {
    position: static;
    background: none;
    padding: 0;
    text-align: left;
    flex: 1;
}

.song-list.compact .song-card-title {
    font-size: 12px;
    margin-bottom: 4px;
    font-weight: normal;
}

.song-list.compact .song-card-subtitle {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Song Edit Screen ===== */
.edit-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-badge {
    font-size: 12px;
    padding: 2px 8px;
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.section-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Edit button on profile songs */
.profile-song-item {
    position: relative;
}

.profile-song-edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    font-size: 12px;
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.profile-song-edit-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

/* ===== Lyrics Editor Styles ===== */
.lyrics-player-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    margin: 15px 0;
}

.player-controls-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.icon-btn-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-btn-small:hover:not(:disabled) {
    transform: scale(1.1);
}

.icon-btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.seek-btn {
    padding: 6px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.seek-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.seek-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.time-display-compact {
    font-size: 14px;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.9);
    margin-left: auto;
}

.record-btn-compact {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.record-btn-compact:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.record-btn-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.blank-btn-compact {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.blank-btn-compact:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.blank-btn-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.time-display {
    font-size: 18px;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.9);
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.current-lyric-display {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
}

#current-lyric-text {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lyric-counter {
    font-size: 14px;
    opacity: 0.7;
}

.record-btn {
    width: 100%;
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    margin: 15px 0;
}

.record-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.record-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lyrics-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 165px;
    /* Reduced to 2/3 of 250px */
    overflow-y: auto;
    font-size: 14px;
}

.lyrics-timeline li {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lyrics-timeline li.recorded {
    background: rgba(102, 126, 234, 0.2);
}

.lyrics-timeline li.current {
    background: rgba(102, 126, 234, 0.4);
    border: 2px solid var(--primary-color);
}

.lyric-time {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    min-width: 60px;
    color: var(--primary-color);
}

.lyric-text {
    flex: 1;
}

.lyric-actions {
    display: flex;
    gap: 5px;
}

.lyric-actions button {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.lyric-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.song-bpm-tag {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: normal;
}



/* Mini Player */
.mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 15px;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.mini-player.hidden {
    transform: translateY(100%);
}

/* Hide mini-player in game mode */
body.game-mode .mini-player {
    display: none !important;
}

/* Close Button (Left) */
.mini-btn.close-left {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s;
    line-height: 1;
}

.mini-btn.close-left:hover {
    color: #ff4444;
    transform: scale(1.1);
}

/* Track Info (Art + Text) */
.mini-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    margin-right: 10px;
}

#mini-art {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.mini-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 2px;
}

.mini-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.mini-artist {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Controls (Simple CSS Icons) */
.mini-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.mini-control-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-control-btn:hover {
    transform: scale(1.1);
}

/* Previous Icon */
.mini-control-btn.prev {
    width: 16px;
    height: 16px;
}

.mini-control-btn.prev::before,
.mini-control-btn.prev::after {
    content: '';
    display: block;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}

.mini-control-btn.prev::before {
    border-width: 6px 8px 6px 0;
    margin-right: -2px;
}

.mini-control-btn.prev::after {
    border-width: 6px 8px 6px 0;
}

/* Next Icon */
.mini-control-btn.next {
    width: 16px;
    height: 16px;
}

.mini-control-btn.next::before,
.mini-control-btn.next::after {
    content: '';
    display: block;
    border-style: solid;
    border-color: transparent transparent transparent #fff;
}

.mini-control-btn.next::before {
    border-width: 6px 0 6px 8px;
    margin-right: -2px;
}

.mini-control-btn.next::after {
    border-width: 6px 0 6px 8px;
}

/* Play/Pause Icon */
.mini-control-btn.play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mini-control-btn.play:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ffff;
}

/* Play State (Triangle) */
.mini-control-btn.play:not(.playing)::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 0 7px 12px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
    /* Optical centering */
}

/* Pause State (Double Bars) */
.mini-control-btn.play.playing::after {
    content: '';
    display: block;
    width: 10px;
    height: 12px;
    border-left: 3px solid #fff;
    border-right: 3px solid #fff;
}

/* Play Game Button (Right) */
.mini-actions {
    display: flex;
    align-items: center;
    margin-left: 10px;
    flex-shrink: 0;
}

.mini-action-btn {
    background: linear-gradient(135deg, #00f5ff, #ff00ff);
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 245, 255, 0.2);
}

.mini-action-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    box-shadow: none;
}

.mini-action-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 245, 255, 0.4);
}

.mini-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.mini-progress-fill {
    height: 100%;
    background: #00ffff;
    width: 0%;
    transition: width 0.1s linear;
}

/* Add padding when mini-player is active (but not in game mode) */
body.mini-player-active:not(.game-mode) .screen.active {
    padding-bottom: 100px;
}

/* Mobile adjustments for mini-player */
@media (max-width: 600px) {
    .mini-player {
        height: 70px;
        padding: 0 10px;
        gap: 10px;
    }

    #mini-art {
        width: 40px;
        height: 40px;
    }

    .mini-title {
        font-size: 13px;
        max-width: 120px;
        /* Ensure text truncates properly on small screens */
    }

    .mini-artist {
        font-size: 11px;
        max-width: 120px;
    }

    .mini-controls {
        gap: 12px;
    }

    .mini-control-btn.play {
        width: 32px;
        height: 32px;
    }

    .mini-action-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* Music Screen Favorites Button */
.music-fav-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 10px;
    z-index: 2;
    /* Ensure it's above the card click area if needed */
}

.music-fav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.music-fav-btn.active {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.3);
}

/* Profile Screen */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

#profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 32px;
    margin: 0 0 10px 0;
    background: linear-gradient(to right, #fff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-bio {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.stat-value.breakdown {
    font-size: 14px;
    font-weight: normal;
    text-align: left;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

.breakdown-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}


.stat-value.small {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.profile-section-title {
    font-size: 20px;
    padding-left: 10px;
    border-left: 4px solid #00ffff;
    margin-bottom: 0;
    /* Reset margin as it's handled by header */
}

.small-btn {
    padding: 5px 15px;
    font-size: 14px;
    min-width: auto;
}

.profile-image-edit-container {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
}

.profile-preview-large {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.profile-preview-large.clickable {
    cursor: pointer;
}

.profile-preview-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: white;
}

.profile-preview-large:hover .profile-image-overlay {
    opacity: 1;
}

.profile-image-overlay i {
    font-size: 24px;
    margin-bottom: 5px;
}

.profile-image-overlay span {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
}

.profile-image-controls {
    flex: 1;
}

.preset-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.preset-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.preset-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.preset-thumb:hover {
    transform: scale(1.1);
}

.preset-thumb.selected {
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.custom-url-group {
    margin-top: 10px;
}

.custom-url-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.7);
}

.small-input {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 13px;
}

@media (max-width: 600px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-image-edit-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .preset-thumbs {
        justify-content: center;
    }

    .preset-thumbs {
        justify-content: center;
    }
}

/* Mobile Optimizations for Music Library */
@media (max-width: 600px) {

    /* Controls - Single Row */
    .music-controls-top {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 5px;
        align-items: center;
        margin-bottom: 2px;
        /* Reduced margin */
    }

    /* Title Size */
    .music-header .screen-title {
        font-size: 20px;
        /* Reduced to 20px */
        margin-bottom: 2px;
        line-height: 1.2;
    }

    /* Panel Padding */
    .music-panel {
        padding: 10px !important;
        /* Reduced padding */
        width: 98% !important;
        gap: 5px;
    }

    /* Header Spacing */
    .music-header {
        gap: 5px;
        margin-bottom: 5px;
    }

    .search-box {
        flex: 1;
        /* Take remaining space */
        min-width: 0;
        /* Allow shrinking */
        max-width: 65%;
        /* Limit width */
    }

    .search-box input {
        padding: 8px 15px;
        font-size: 14px;
        width: 100%;
    }

    /* 1-column grid */
    .song-list.compact {
        display: grid;
        grid-template-columns: 1fr;
        /* Single column */
        gap: 5px;
        /* Reduced gap */
        padding-bottom: 60px;
    }

    .song-list.compact .song-card {
        flex-direction: row;
        /* Horizontal layout */
        height: auto;
        padding: 5px;
        gap: 10px;
        /* Increased gap */
        text-align: left;
        align-items: center;
        position: relative;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
    }

    .song-list.compact .song-card-bg {
        width: 50px;
        /* Slightly larger */
        height: 50px;
        aspect-ratio: 1/1;
        margin-bottom: 0;
        border-radius: 4px;
        flex-shrink: 0;
    }

    .song-list.compact .song-card-content {
        text-align: left;
        flex: 1;
        min-width: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Song Card Text Size */
    .song-list.compact .song-card-title {
        font-size: 14px;
        font-weight: bold;
        /* Bold title */
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .song-list.compact .song-card-subtitle {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        opacity: 0.8;
        width: 100%;
    }

    .song-bpm-tag {
        font-size: 10px;
        padding: 1px 4px;
        margin-left: 5px;
    }

    .song-genre-tag {
        font-size: 9px;
        padding: 1px 4px;
        margin-left: 3px;
    }

    /* Badge style favorite button - Bottom Right of Image */
    .song-list.compact .music-fav-btn {
        position: absolute !important;
        top: 30px !important;
        /* Moved further down */
        left: 30px !important;
        /* Moved further right */
        right: auto !important;
        width: 30px;
        height: 30px;
        font-size: 14px;
        background: rgba(0, 0, 0, 0.6);
        margin: 0;
        border: 1px solid rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(2px);
        z-index: 5;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    /* Back Button Spacing */
    .back-btn {
        margin-top: 5px;
        /* Reduced */
    }
}

/* Combo Cut-in Video Overlay - Background Layer */
.combo-video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Same layer as PixiJS background, will be positioned above via DOM order */
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    background: transparent;
    /* No overlay background - game UI remains visible */
    opacity: 0;
    pointer-events: none;
    /* Always disabled - allows gameplay interaction */
    transition: opacity 2s ease;
    /* Very slow fade for clear visibility */
}

.combo-video-overlay.show {
    display: flex;
    opacity: 1 !important;
    /* FORCE OPACITY */
}

.combo-video-overlay.hidden {
    display: none !important;
    /* Force hide */
}

.combo-video-overlay video {
    max-width: 90%;
    /* Fullscreen for impact */
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    opacity: 0.7;
    /* More transparent for background effect */
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
    /* Soft glow around edges */
    animation: videoFadeIn 2s ease-out forwards;
    /* Slow fade-in for visibility */
    pointer-events: none;
    /* Ensure video itself doesn't block clicks */
}

/* Keyframe animation for video fade-in */
@keyframes videoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 0.7;
        /* Match final opacity */
        transform: scale(1);
    }
}

/* Share Modal */
#share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.share-modal-content {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 90%;
    width: 600px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.share-image-container {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.share-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.share-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.share-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.share-twitter-btn {
    background: #000;
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #333;
    transition: all 0.2s;
}

.share-twitter-btn:hover {
    background: #111;
    transform: translateY(-2px);
    border-color: #555;
}

#share-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

#share-modal-close:hover {
    color: white;
}

/* Song Detail Page */
.song-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.song-detail-header .song-title {
    margin: 0;
    font-size: 24px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: rgba(255, 255, 255, 0.9);
}

.tab.active {
    color: white;
    border-bottom-color: #667eea;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Song Info */
.song-info {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.song-info .song-jacket {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.song-metadata {
    flex: 1;
}

.song-artist {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
}

.song-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 20px;
}

.song-stats {
    display: flex;
    gap: 30px;
    font-size: 16px;
    font-weight: 600;
}

.song-stats .stat-item {
    color: rgba(255, 255, 255, 0.9);
}

/* Play Style Selector */
.play-style-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.style-btn {
    padding: 10px 24px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.style-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.style-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* === Difficulty Screen Tab Styles === */

#difficulty-screen .tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

#difficulty-screen .tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: -60px -60px 30px -60px;
    background: rgba(0, 0, 0, 0.6);
    /* Darker background to prevent see-through */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px 30px 0 0;
    padding: 0 10px;
    overflow-x: auto;
    position: sticky;
    top: -60px;
    /* Adjust top to account for negative margin */
    z-index: 100;
    /* Higher z-index */
    backdrop-filter: blur(20px);
    padding-top: 20px;
    /* Add padding to top */
}

#difficulty-screen .tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.5);
    padding: 12px 25px;
    border-radius: 0;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    white-space: nowrap;
}

#difficulty-screen .tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}


/* === Top Page Redesign === */
.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 40px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease-out;
}

.main-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5), 0 0 40px rgba(0, 255, 255, 0.3);
    margin-bottom: 10px;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

.beta-tag {
    font-size: 1rem;
    background: linear-gradient(45deg, #ff0055, #ff5500);
    padding: 2px 8px;
    border-radius: 4px;
    vertical-align: top;
    margin-left: 10px;
    position: absolute;
    top: 0;
    right: -50px;
    box-shadow: 0 2px 10px rgba(255, 0, 85, 0.4);
    transform: rotate(10deg);
}

.catchphrase {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.catch-main {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.catch-sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

/* Primary Actions (Cards) */
.primary-actions {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 900px;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.menu-card {
    flex: 1;
    height: 220px;
    border: none;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    text-align: center;
    backdrop-filter: blur(10px);
}

.game-card {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(0, 150, 255, 0.2));
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.1);
}

.music-card {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.1), rgba(150, 0, 255, 0.2));
    border: 1px solid rgba(255, 0, 255, 0.3);
    box-shadow: 0 10px 30px rgba(255, 0, 255, 0.1);
}

.menu-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.game-card:hover {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 150, 255, 0.3));
    box-shadow: 0 20px 50px rgba(0, 255, 255, 0.3), 0 0 20px rgba(0, 255, 255, 0.2) inset;
    border-color: rgba(0, 255, 255, 0.8);
}

.music-card:hover {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.2), rgba(150, 0, 255, 0.3));
    box-shadow: 0 20px 50px rgba(255, 0, 255, 0.3), 0 0 20px rgba(255, 0, 255, 0.2) inset;
    border-color: rgba(255, 0, 255, 0.8);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    transition: transform 0.4s ease;
}

.menu-card:hover .card-icon {
    transform: scale(1.2) rotate(5deg);
}

.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.card-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Secondary Actions */
.secondary-actions {
    display: flex;
    gap: 20px;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.secondary-menu-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.secondary-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.secondary-menu-btn .icon {
    font-size: 1.1rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .main-logo {
        font-size: 2.5rem;
    }

    .beta-tag {
        right: -40px;
        font-size: 0.8rem;
    }

    .catch-main {
        font-size: 1.2rem;
    }

    .primary-actions {
        flex-direction: column;
        gap: 15px;
    }

    .menu-card {
        height: 140px;
        flex-direction: row;
        padding: 20px;
        text-align: left;
        gap: 20px;
    }

    .card-icon {
        font-size: 2.5rem;
        margin-bottom: 0;
    }

    .card-content {
        flex: 1;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .secondary-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .secondary-menu-btn {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
}



#difficulty-screen .tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

#difficulty-screen .tab-content.active {
    display: block;
}

/* Ranking tab specific styles */
#difficulty-screen .play-style-selector,
#difficulty-screen .difficulty-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

#difficulty-screen .style-btn,
#difficulty-screen .diff-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 600;
}

#difficulty-screen .style-btn:hover,
#difficulty-screen .diff-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

#difficulty-screen .style-btn.active,
#difficulty-screen .diff-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.auth-tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.auth-tab-btn.active {
    color: #fff;
    border-bottom-color: #00f5ff;
}

.auth-tab-btn:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.auth-tab {
    display: none;
}

.auth-tab.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Footer */
.main-footer {
    padding: 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

/* Info Modal Content */
.info-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    padding: 1rem;
}

.info-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
}

.info-content p {
    margin-bottom: 1rem;
}

.info-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.info-content li {
    margin-bottom: 0.5rem;
}

/* Language Switching */
body.lang-en .lang-ja {
    display: none !important;
}

body.lang-ja .lang-en {
    display: none !important;
}

/* Language Selector */
.lang-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 10px;
    backdrop-filter: blur(5px);
}

.lang-select:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Menu Footer Links */
.menu-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    margin: 0 5px;
    transition: color 0.3s;
}

.menu-link:hover {
    color: white;
    text-decoration: underline;
}

.separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
}

/* Fix for Upload Screen Input Group */
.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group .form-input {
    flex: 1;
    margin-bottom: 0 !important;
}

.input-group .secondary-btn {
    width: auto !important;
    margin-bottom: 0 !important;
    white-space: nowrap;
    padding: 0 20px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Info Modal Content Styles */
.legal-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.legal-text h4 {
    color: #00ffff;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 5px;
}

.legal-text ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}

.legal-text li {
    margin-bottom: 5px;
}

.last-updated {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
    margin-bottom: 20px;
}

/* Tutorial Styles */
.tutorial-section h3 {
    color: #00ffff;
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-align: center;
}

.control-layout-guide {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.key-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.key-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 5px 10px;
    margin: 2px;
    font-family: monospace;
    font-weight: bold;
    color: #fff;
    min-width: 30px;
    text-align: center;
}

.key-badge.wide {
    width: 100px;
}

.key-group .desc {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

.feature-list,
.step-list {
    margin-left: 20px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.step-list li {
    margin-bottom: 10px;
}

.note {
    background: rgba(255, 170, 0, 0.1);
    border-left: 3px solid #ffaa00;
    padding: 10px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
}

/* ===================================
   BUG REPORT STYLES
   =================================== */

/* Bug Report Button - Prominent orange/red color for beta */
.bug-report-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%) !important;
    border: 2px solid rgba(255, 107, 53, 0.5) !important;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    animation: pulse-bug 2s ease-in-out infinite;
}

.bug-report-btn:hover {
    background: linear-gradient(135deg, #ff8c42 0%, #ffa366 100%) !important;
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
    transform: translateY(-2px);
}

@keyframes pulse-bug {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
    }
}

/* Bug Report Modal */
#bug-report-modal .modal-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

#bug-report-modal textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}

#bug-report-modal textarea:focus {
    outline: none;
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.2);
}

#bug-report-modal label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.9rem;
}

.bug-report-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.bug-report-actions button {
    flex: 1;
}