:root {
    --bg-color: #1a2d4b;
    --accent-color: #38bdf8;
    --text-active: #fff;
    --text-inactive: rgba(255, 255, 255, 0.4);
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #1a2d4b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-active);
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    background: #1a2d4b;
}

.bg-gradient {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background: 
        radial-gradient(circle at 20% 30%, #3b82f6 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, #0ea5e9 0%, transparent 60%),
        radial-gradient(circle at 50% 80%, #1e40af 0%, transparent 60%),
        radial-gradient(circle at 70% 60%, #06b6d4 0%, transparent 60%);
    filter: blur(80px);
    animation: bg-rotate 20s infinite alternate linear;
}

@keyframes bg-rotate {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(10deg) scale(1.1); }
}

.app-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: var(--safe-area-inset-top);
    padding-bottom: var(--safe-area-inset-bottom);
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    position: relative;
    z-index: 40;
}

.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    overflow: hidden;
}

@media (min-width: 800px) {
    .app-container {
        max-width: 100%;
        flex-direction: row;
        overflow: hidden;
    }

    .sidebar {
        width: 25%;
        height: 100vh;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        flex-direction: column;
        position: relative;
        z-index: 40;
        flex: none;
    }

    .main-content {
        width: 75%;
        height: 100vh;
        position: relative;
        flex: none;
    }

    .app-container.player-mode #playerScreen.screen {
        display: flex !important;
        width: 100%;
        height: 100%;
        padding: 0;
    }

    .app-container.browse-mode .sidebar {
        width: 100%;
        border-right: none;
    }

    .app-container.browse-mode .main-content {
        display: none;
    }

    .app-container.player-mode .sidebar {
        width: 25%;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .app-container.player-mode .main-content {
        display: flex;
        width: 75%;
    }

    .mobile-only {
        display: none !important;
    }
}


.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    z-index: 30;
    position: sticky;
    top: 0;
    min-height: 76px;
}

.header-nav-icons {
    display: none;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

@media (min-width: 800px) {
    .header-nav-icons {
        display: flex;
    }
}

.nav-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s, color 0.3s;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-icon i {
    font-size: 20px;
}

.nav-icon.active {
    opacity: 1;
    color: var(--accent-color);
}

.header-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    opacity: 0.9;
    text-align: center;
    flex: 1;
}

.screen {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 120px;
    scrollbar-width: none;
    height: 100%;
}

.screen::-webkit-scrollbar {
    display: none;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

.list-title {
    font-size: 34px;
    font-weight: 800;
    margin: 20px 0 30px;
    letter-spacing: -1px;
}

.content-section + .content-section {
    margin-top: 28px;
}

.section-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-inactive);
    margin-bottom: 14px;
}

.grid-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 800px) {
    .grid-list {
        grid-template-columns: 1fr;
    }
}

.card-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    user-select: none;
}

.card-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.card-item:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.1);
}

.card-item-featured {
    min-height: 92px;
}

.card-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-color);
}

.card-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-info p {
    font-size: 14px;
    color: var(--text-inactive);
}

#playerScreen {
    padding: 0;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

#playerScreen.active {
    display: flex;
}

.lyrics-container {
    flex: 1;
    overflow-y: scroll;
    padding: 120px 32px 300px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 70%, transparent 85%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 70%, transparent 85%);
}

@media (min-width: 800px) {
    .lyrics-container {
        padding-top: 200px;
        padding-bottom: 350px;
    }
}

.lyrics-container::-webkit-scrollbar {
    display: none;
}

.phrase-item {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 32px;
    color: var(--text-inactive);
    transition: color 0.4s, transform 0.4s, filter 0.4s;
    cursor: pointer;
    transform-origin: left center;
    filter: blur(1px);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    user-select: none;
}

.phrase-item:hover {
    color: rgba(255, 255, 255, 0.6);
    filter: blur(0);
}

@media (min-width: 800px) {
    .phrase-item {
        font-size: 48px;
        margin-bottom: 48px;
        text-align: center;
        transform-origin: center center;
    }
}

.phrase-item.active {
    color: var(--text-active);
    transform: scale(1.05);
    filter: blur(0);
}

.player-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: transparent;
    padding: 20px 24px calc(20px + var(--safe-area-inset-bottom));
    z-index: 30;
}

@media (min-width: 800px) {
    .player-controls {
        position: absolute;
        padding: 40px 100px 60px;
        bottom: 0;
        left: 0;
        width: 100%;
    }

    .progress-section {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
}

.progress-section {
    margin-bottom: 24px;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 8px;
    position: relative;
    cursor: pointer;
}

.progress-bar-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    width: 0%;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-inactive);
}

.main-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.control-btn:hover {
    opacity: 0.8;
}

.control-btn:active {
    transform: scale(0.9);
}

.btn-prev, .btn-next {
    font-size: 24px;
}

.btn-play-pause {
    font-size: 48px;
    width: 64px;
}

.menu-popup {
    position: absolute;
    top: 70px;
    right: 24px;
    background: rgba(25, 25, 25, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 8px;
    min-width: 200px;
    z-index: 100;
    display: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.menu-popup.show {
    display: block;
}

.menu-item {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    color: #fff;
}

.menu-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.menu-item i {
    width: 20px;
    color: var(--accent-color);
}

.hidden {
    display: none !important;
}

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.login-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.login-subtitle {
    font-size: 16px;
    color: var(--text-inactive);
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.login-input:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.15);
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    margin-top: 8px;
}

.login-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

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

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    padding: 20px;
    text-align: center;
    min-height: 100%;
    position: relative;
    width: 100%;
}

.full-screen-intro.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: #1a2d4b;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.intro-orbit {
    position: relative;
    width: min(72vw, 340px);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
}

.intro-dots-track {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: clamp(4px, 1vw, 8px);
}

.intro-dot {
    position: relative;
    width: clamp(42px, 9vw, 58px);
    height: calc(clamp(42px, 9vw, 58px) + var(--stretch, 0px));
    border-radius: 999px;
    pointer-events: none;
    opacity: 0.6;
    transition: height 110ms ease-out, opacity 110ms ease-out, filter 110ms ease-out;
    background: #7ddcff;
    box-shadow:
        0 0 calc(12px + 30px * var(--glow, 0.16)) rgba(125, 220, 255, 0.46);
    filter: brightness(calc(0.9 + var(--glow, 0.16) * 0.26));
}

@media (max-width: 800px) {
    .intro-orbit {
        width: min(84vw, 300px);
        min-height: 120px;
        padding: 16px 20px;
    }

    .intro-dot {
        width: clamp(34px, 11vw, 48px);
    }
}

.notification {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(255, 60, 60, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 60, 60, 0.3);
    color: #fff;
    padding: 16px 32px;
    border-radius: 16px;
    font-weight: 600;
    z-index: 2000;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
}

.notification.show {
    opacity: 1;
    visibility: visible;
}

.transcription-word {
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: help;
    display: inline-block;
}

.tooltip-popup {
    position: fixed;
    background: rgba(60, 85, 130, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 18px;
    padding: 16px 24px;
    z-index: 200;
    box-shadow: 0 15px 45px rgba(0,0,0,0.4);
    color: #fff;
    font-size: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transform: translateY(5px) scale(0.95);
}

.tooltip-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tooltip-transcription {
    font-family: 'Inter', sans-serif;
    color: var(--text-active);
    font-weight: 700;
    letter-spacing: 0.5px;
}
