@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Parisienne&family=Rouge+Script&display=swap');

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

:root {
    /* Quiet Luxury color palette */
    --bg-deep: #0f0f14;
    --bg-surface: #16161d;
    --bg-elevated: #1e1e28;

    /* Soft champagne gold - not bright */
    --accent-primary: #c9b896;
    --accent-secondary: #a69882;

    /* Text colors */
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.3);

    /* Border */
    --border-subtle: rgba(255, 255, 255, 0.06);

    /* Safe area for notch */
    --safe-top: env(safe-area-inset-top, 0);
    --safe-bottom: env(safe-area-inset-bottom, 0);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    margin: 0;
}

/* Background Container */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.background-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('monet-spring.jpg') center/cover no-repeat;
    animation: none;
}

@keyframes gradientShift {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.05);
    }
}



/* Entry Screen */
.entry-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    background: url('monet-spring.jpg') center/cover no-repeat fixed;
}

/* Subtle blur overlay for entry screen */
.entry-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    background: rgba(255, 255, 255, 0.05);
}

/* Entry container - no visible card, just layout */
.entry-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2.5rem;
    gap: 12px;

    /* No visible background - transparent */
    background: transparent;

    animation: cardAppear 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Decorative flowers */
.entry-decoration {
    font-size: 1.8rem;
    color: #8b6914;
    letter-spacing: 0.5em;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 1),
        0 0 40px rgba(255, 255, 255, 0.8),
        0 0 60px rgba(255, 255, 255, 0.5);
    animation: gentleReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.entry-greeting {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3.5rem;
    letter-spacing: 0.15em;
    color: #3d3224;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.9),
        0 0 40px rgba(255, 255, 255, 0.6),
        0 2px 10px rgba(255, 255, 255, 0.5);
    animation: gentleReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
    margin: 0;
}

/* Poetic subtitle */
.entry-subtitle {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.4rem;
    color: #5a4d3e;
    letter-spacing: 0.1em;
    margin: 0;
    animation: gentleReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

/* Music icon */
.entry-music-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
    animation: gentleReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both,
        musicPulse 2s ease-in-out infinite 1s;
}

.entry-music-icon svg {
    width: 32px;
    height: 32px;
}

.entry-hint {
    font-size: 1rem;
    color: #3d3224;
    letter-spacing: 0.08em;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 1),
        0 0 40px rgba(255, 255, 255, 0.8);
    animation: gentleReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both,
        hintPulse 2s ease-in-out infinite 1.2s;
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

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

@keyframes gentleReveal {
    0% {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(12px);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@keyframes musicPulse {

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

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

@keyframes hintPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes entryFadeOut {
    0% {
        opacity: 1;
        pointer-events: auto;
    }

    100% {
        opacity: 0;
        pointer-events: none;
    }
}

/* Player Screen */
.player-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    padding: 4px;
    padding-top: max(4px, var(--safe-top));
    padding-bottom: max(4px, var(--safe-bottom));
    isolation: isolate;
}

.player-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 95%;
    max-width: 320px;
    border-radius: 20px;
    padding: 1rem 1.2rem;
    overflow: hidden;

    /* Glassmorphism overlay */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* Blurred background layer - pseudo-element approach for reliable blur */
.player-wrapper::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    background: url('monet-spring.jpg') center/cover no-repeat fixed;
    filter: blur(25px);
    z-index: -1;
    pointer-events: none;
}

/* Top shine highlight */
.player-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.8),
            transparent);
    pointer-events: none;
    z-index: 1;
}

@keyframes playerFadeIn {
    0% {
        opacity: 0;
        pointer-events: none;
    }

    100% {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Vinyl Container */
.vinyl-container {
    display: flex;
    justify-content: center;
    width: 100%;
    position: relative;
}

.vinyl-record {
    position: relative;
    width: 210px;
    height: 210px;
    border-radius: 50%;

    /* Base vinyl color with subtle blue-ish tint like real vinyl */
    background:
        /* Light reflection sweep - creates realistic shine */
        conic-gradient(from 0deg at 50% 50%,
            transparent 0deg,
            rgba(255, 255, 255, 0.03) 15deg,
            rgba(255, 255, 255, 0.08) 30deg,
            transparent 60deg,
            transparent 180deg,
            rgba(255, 255, 255, 0.02) 200deg,
            rgba(255, 255, 255, 0.05) 220deg,
            transparent 250deg,
            transparent 360deg),
        /* Fine grooves - many subtle lines */
        repeating-radial-gradient(circle at center,
            transparent 0px,
            transparent 1px,
            rgba(40, 40, 45, 1) 1.5px,
            rgba(20, 20, 25, 1) 2px,
            rgba(30, 30, 35, 1) 2.5px,
            transparent 3px),
        /* Medium groove bands */
        repeating-radial-gradient(circle at center,
            rgba(25, 25, 30, 0.8) 0px,
            rgba(35, 35, 40, 0.6) 4px,
            rgba(20, 20, 25, 0.8) 8px),
        /* Base gradient - center hole to edge */
        radial-gradient(circle at center,
            #2a2a2f 0%,
            #1a1a1f 35%,
            #0d0d12 36%,
            #1a1a1f 37%,
            #151518 100%);

    box-shadow:
        /* Outer rim highlight */
        0 0 0 1px rgba(60, 60, 70, 0.5),
        /* Depth shadow */
        0 8px 24px rgba(0, 0, 0, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.4),
        /* Inner shadow for depth */
        inset 0 0 20px rgba(0, 0, 0, 0.3);

    animation: vinylAppear 0.6s ease-out 0.5s both;
}

/* Vinyl glossy highlight overlay */
.vinyl-record::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background:
        /* Rainbow iridescence like real vinyl */
        conic-gradient(from 120deg at 30% 30%,
            transparent 0deg,
            rgba(100, 140, 200, 0.04) 20deg,
            rgba(140, 100, 180, 0.03) 40deg,
            rgba(180, 140, 100, 0.02) 60deg,
            transparent 90deg,
            transparent 360deg),
        /* Top-left light reflection */
        radial-gradient(ellipse 60% 40% at 25% 25%,
            rgba(255, 255, 255, 0.08) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 2;
}

/* Center label area with metallic spindle */
.vinyl-record::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
            #888 0%,
            #444 40%,
            #222 100%);
    box-shadow:
        0 0 0 2px #333,
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    z-index: 3;
}

.vinyl-record.playing {
    animation: albumSpin 20s linear infinite;
}

.vinyl-record.paused {
    animation: albumSpin 20s linear infinite;
    animation-play-state: paused;
}

.album-cover {
    position: absolute;
    width: 65%;
    height: 65%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    object-fit: cover;
    z-index: 1;
    box-shadow:
        0 0 0 3px rgba(30, 30, 35, 0.9),
        inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.album-cover.playing {
    animation: none;
    transform: translate(-50%, -50%);
}

.album-cover.paused {
    animation: none;
    transform: translate(-50%, -50%);
}

.vinyl-label {
    display: none;
}

@keyframes vinylAppear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes vinylSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes albumSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Lyrics Container */
.lyrics-container {
    width: 100%;
    height: 180px;
    animation: lyricsAppear 0.6s ease-out 0.6s both;
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.lyrics-container::before,
.lyrics-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 10;
}

.lyrics-container::before {
    top: 0;
    background: none;
}

.lyrics-container::after {
    bottom: 0;
    background: none;
}

.lyrics-panel {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 16px;
    height: 100%;
    overflow-y: auto;
    box-shadow: none;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.lyrics-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    text-align: center;
}

.lyric-line {
    font-family: 'Rouge Script', cursive;
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.55);
    text-align: center;
    transition: all 0.4s ease;
    line-height: 1.5;
    width: 100%;
    display: block;
}

/* English lyrics - slightly larger */
.lyric-line.lyric-english {
    font-size: 1.15rem;
}

/* Chinese lyrics - slightly smaller */
.lyric-line.lyric-chinese {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 0.8rem;
}

.lyric-line.current {
    font-size: 1.3rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.lyric-line.current.lyric-english {
    font-size: 1.5rem;
}

.lyric-line.current.lyric-chinese {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 0.95rem;
}

.lyric-line.next {
    opacity: 0.8;
}

/* Lyric line layout for play button */
.lyric-line {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.lyric-text {
    flex: 0 1 auto;
    /* Don't stretch */
}

/* Small play button on lyric lines */
.lyric-play-btn {
    position: absolute;
    right: 10px;
    /* Position absolutely on the right */
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.lyric-play-btn svg {
    width: 10px;
    height: 10px;
}

@media (hover: hover) {
    .lyric-line:hover .lyric-play-btn {
        opacity: 1;
    }
}

.lyrics-panel.scrolling .lyric-play-btn {
    opacity: 1;
}

.lyric-play-btn:hover {
    background: var(--accent-primary);
    color: #fff;
}

/* Space after each Chinese translation line (paired lyrics only, not outro) */
.lyric-line:nth-child(2n+9):not(.lyric-outro) {
    margin-bottom: 12px;
}

/* Outro lyrics - force consistent spacing with high specificity */
.lyric-line.lyric-outro.lyric-chinese,
.lyric-line.lyric-outro.lyric-english,
.lyric-line.lyric-outro {
    margin-bottom: 6px !important;
    margin-top: 0 !important;
}

@keyframes lyricsAppear {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Controls Container */
.controls-container {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 8px 12px;
    width: 100%;
    box-shadow: none;
    animation: controlsAppear 0.6s ease-out 0.7s both;
}

.song-info {
    text-align: center;
    margin-bottom: 8px;
}

.song-title {
    font-family: 'Rouge Script', cursive;
    /* font-family: 'Parisienne', cursive; */
    font-size: 2.6rem;
    font-weight: 400;
    color: #3d3224;
    margin-bottom: 2px;
    letter-spacing: 0.02em;
}

@keyframes controlsAppear {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.controls {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Vinyl Play Overlay */
.vinyl-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    background: transparent;
    transition: opacity 0.3s ease;
}

.vinyl-play-overlay svg {
    width: 36px;
    height: 36px;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.vinyl-play-overlay:hover svg {
    opacity: 0.85;
}

/* Show pause icon when playing (will fade out after 2s) */
.vinyl-container.playing .vinyl-play-overlay {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.5s ease;
}

/* Hide pause icon after 2 seconds */
.vinyl-container.playing.hide-overlay .vinyl-play-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Show pause icon on hover while playing */
.vinyl-container.playing .vinyl-play-overlay:hover {
    opacity: 1;
    pointer-events: auto;
}

.vinyl-container.playing .vinyl-play-overlay:hover .pause-icon {
    opacity: 0.7;
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.time {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.7);
    font-variant-numeric: tabular-nums;
    min-width: 35px;
}

.current-time {
    text-align: right;
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

#progressSlider {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 24px;
    transform: translateY(-50%);
    opacity: 0;
    cursor: pointer;
}



/* Shared Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Responsive Design - Mobile First (iPhone SE: 375×667) */
@media (min-width: 768px) {
    .player-wrapper {
        max-width: 500px;
        gap: 32px;
    }

    .vinyl-record {
        width: 240px;
        height: 240px;
        border-radius: 50%;
    }

    .lyrics-container {
        height: 300px;
    }
}

@media (min-width: 1024px) {
    .player-wrapper {
        max-width: 900px;
        display: grid;
        grid-template-columns: 400px 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 20px 40px;
        align-items: start;
    }

    .vinyl-container {
        grid-row: 1 / 3;
        grid-column: 1;
        align-self: center;
        justify-self: center;
    }

    .vinyl-record {
        width: 280px;
        height: 280px;
        flex-shrink: 0;
        border-radius: 50%;
    }

    .song-info {
        grid-row: 1;
        grid-column: 2;
        text-align: center;
        margin-bottom: 0;
    }

    .lyrics-container {
        grid-row: 2;
        grid-column: 2;
        height: 280px;
    }

    .controls-container {
        grid-row: 3;
        grid-column: 1 / 3;
        width: 100%;
    }
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {

    .entry-greeting,
    .entry-hint {
        animation: none;
        opacity: 1;
    }

    .vinyl-record.playing {
        animation: none;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}