/**
 * Background Music & Welcome Modal Styles — Janoo Special Edition 👑
 */

/* ===================================================
   1. Initial Music Selection Modal
   =================================================== */
.janoo-music-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(20, 10, 35, 0.96) 0%, rgba(8, 4, 18, 0.98) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s ease;
}

.janoo-music-modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.janoo-music-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6),
                0 0 40px rgba(255, 77, 148, 0.25),
                inset 0 0 30px rgba(255, 255, 255, 0.03);
    border-radius: 28px;
    padding: 36px 30px;
    max-width: 540px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: modalPopIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.janoo-music-modal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 20%, rgba(255, 77, 148, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.janoo-music-modal__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255, 77, 148, 0.25), rgba(168, 85, 247, 0.25));
    border: 1px solid rgba(255, 77, 148, 0.4);
    color: #ff94c2;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 18px;
    box-shadow: 0 4px 15px rgba(255, 77, 148, 0.2);
    letter-spacing: 0.5px;
}

.janoo-music-modal__title {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.5;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.janoo-music-modal__title span {
    background: linear-gradient(135deg, #ff4d94, #ff80bf, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.janoo-music-modal__subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 28px;
    line-height: 1.4;
}

.janoo-music-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 500px) {
    .janoo-music-cards-grid {
        grid-template-columns: 1fr;
    }
}

.janoo-mood-card {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 22px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.janoo-mood-card:hover, .janoo-mood-card:active {
    transform: translateY(-6px) scale(1.02);
    border-color: #ff4d94;
    background: rgba(255, 77, 148, 0.08);
    box-shadow: 0 12px 30px rgba(255, 77, 148, 0.3),
                0 0 20px rgba(168, 85, 247, 0.2);
}

.janoo-mood-card--chill:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.3);
}

.janoo-mood-card--very-chill:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.3);
}

.janoo-mood-card__icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: floatIcon 3s ease-in-out infinite alternate;
}

@keyframes floatIcon {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

.janoo-mood-card__name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.janoo-mood-card__desc {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.35;
    margin-bottom: 14px;
    flex-grow: 1;
}

.janoo-mood-card__btn {
    background: linear-gradient(135deg, #ff4d94, #a855f7);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(255, 77, 148, 0.3);
}

.janoo-mood-card--chill .janoo-mood-card__btn {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.janoo-mood-card--very-chill .janoo-mood-card__btn {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.janoo-mood-card:hover .janoo-mood-card__btn {
    transform: scale(1.04);
}

/* ===================================================
   2. Floating Music Player Widget
   =================================================== */
.janoo-music-player {
    position: fixed;
    bottom: 18px;
    left: 20px;
    z-index: 9999;
    background: rgba(18, 12, 32, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 7px 14px 7px 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6),
                0 0 20px rgba(255, 77, 148, 0.25);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: calc(100vw - 40px);
}

/* Clear bottom stats bar in game page */
.game-page ~ .janoo-music-player,
body:has(.game-stats-bar) .janoo-music-player,
.game-stats-bar ~ .janoo-music-player {
    bottom: 56px;
}

@media (max-width: 600px) {
    .janoo-music-player {
        bottom: 14px;
        left: 10px;
        right: 10px;
        max-width: none;
        padding: 6px 10px 6px 8px;
    }

    body:has(.game-stats-bar) .janoo-music-player,
    .game-stats-bar ~ .janoo-music-player {
        bottom: 52px;
    }
}

.janoo-music-player__inner {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.janoo-music-player__disc-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    cursor: pointer;
}

.janoo-music-player__disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4d94, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    box-shadow: 0 0 12px rgba(255, 77, 148, 0.5);
    transition: transform 0.3s ease;
}

.janoo-music-player__disc.spinning {
    animation: spinDisc 4s linear infinite;
}

@keyframes spinDisc {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.janoo-music-player__eq {
    position: absolute;
    bottom: -2px;
    right: -2px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 3px;
    border-radius: 4px;
}

.janoo-music-player__eq span {
    width: 2px;
    height: 2px;
    background: #ff4d94;
    border-radius: 1px;
    transition: height 0.2s ease;
}

.janoo-music-player__eq.active span:nth-child(1) { animation: eqBounce 0.8s ease-in-out infinite 0.1s; }
.janoo-music-player__eq.active span:nth-child(2) { animation: eqBounce 0.8s ease-in-out infinite 0.3s; }
.janoo-music-player__eq.active span:nth-child(3) { animation: eqBounce 0.8s ease-in-out infinite 0.2s; }
.janoo-music-player__eq.active span:nth-child(4) { animation: eqBounce 0.8s ease-in-out infinite 0.4s; }

@keyframes eqBounce {
    0%, 100% { height: 2px; }
    50% { height: 10px; }
}

.janoo-music-player__info {
    display: flex;
    flex-direction: column;
    min-width: 100px;
    max-width: 200px;
    overflow: hidden;
    flex-grow: 1;
}

@media (max-width: 480px) {
    .janoo-music-player__info {
        max-width: 130px;
    }
}

.janoo-music-player__mode-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #ff94c2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.janoo-music-player__title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.janoo-music-player__controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: auto;
}

.janoo-music-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.janoo-music-btn:hover {
    background: rgba(255, 77, 148, 0.25);
    border-color: #ff4d94;
    transform: scale(1.08);
}

.janoo-music-btn--mode {
    border-radius: 999px;
    width: auto;
    padding: 0 8px;
    font-size: 0.7rem;
    font-weight: 700;
    height: 26px;
    background: rgba(255, 77, 148, 0.15);
    border-color: rgba(255, 77, 148, 0.3);
    color: #ff94c2;
}

@media (max-width: 480px) {
    .janoo-music-btn--mode {
        display: none;
    }
}

.janoo-music-vol-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 600px) {
    .janoo-music-vol-slider {
        display: none;
    }
}

.janoo-music-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 50px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

.janoo-music-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ff4d94;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(255, 77, 148, 0.8);
}
