/* ===========================
   GLOBAL
   =========================== */

body {
    margin: 0;
    padding: 0;
    background-color: #100C08;
    color: #FFFAFA;
    font-family: 'Rubik', sans-serif;
    transition: background-color 0.6s ease;
}

body.no-fade {
    transition: none !important;
}

/* ===========================
   SONG GRID
   =========================== */

.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* ===========================
   SONG BOX (outer container)
   =========================== */

.song-box {
    padding: 1rem;                 /* uniform padding */
    background: #111;
    color: #eee;
    border: 2px solid #3a6dff;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    contain: layout paint;         /* prevents displacement */
    isolation: isolate;            /* isolates shadows/blur */
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* background blur layer */
.song-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    opacity: 0.18;
    filter: blur(2px);
    transition: opacity 0.3s ease, filter 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.song-box:hover::before {
    opacity: 0.35;
    filter: blur(6px);
}

/* ===========================
   INNER WRAPPER (only this expands)
   =========================== */

.song-box-inner {
    position: relative;
    z-index: 2;
    transition: transform 0.25s ease, padding-bottom 0.25s ease;
    padding-bottom: 0rem;          /* default */
}

/* hover expansion — ONLY inner wrapper grows */
.song-box:hover .song-box-inner {
    transform: scale(1.07);
    padding-bottom: 2.2rem;        /* space for menu */
}

/* ===========================
   HOVER EFFECTS (outer box)
   =========================== */

.song-box:hover {
    border-color: #ff4f4f;
    box-shadow:
         0 0 6px #ff4f4f,
         0 0 14px #77b5fe,
         0 0 26px #3a6dff,
         0 0 42px #1f2aff;
    animation:
        entropyGlow 1.2s ease-out forwards,
        electricFlicker 0.08s infinite alternate,
        entropyFlicker 0.6s infinite alternate;
}

/* ===========================
   SONG LINK + FLOATING EMOJI
   =========================== */

.song-link {
    position: relative;
    display: inline-block;
    padding: 6px 10px;
    color: #F4C430;
    text-shadow:
        0 0 4px rgba(255,255,255,0.4),
        0 0 8px rgba(255,255,255,0.2);
    cursor: default;
}

.song-link .float {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    font-size: 1.25em;
    color: #ffd27f;
}

.song-link:hover .float {
    opacity: 1;
    animation: floatNoteGlow 1.1s ease-out forwards;
}

/* ===========================
   DROPDOWN MENUS
   =========================== */

.menu-zone {
    position: relative;
    width: 100%;
    text-align: center;
}

.menu-level-1 {
    display: none;
}

/* correct hover selector */
.song-box:hover .song-box-inner .menu-level-1 {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.song-box.menu-open .menu-level-1 {
    display: flex;
}

.menu-level-1 a {
    display: inline-flex;
    padding: 6px 10px;
    background: #111;
    border: 1px solid #3a6dff;
    border-radius: 6px;
    color: #f0e6d2;
    cursor: pointer;
}

.menu-level-1 a:hover {
    background: #222;
    color: #ffd27f;
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes floatNoteGlow {
    0% { opacity: 0; transform: translate(-50%, 0) scale(1); }
    20% { opacity: 1; }
    70% { opacity: 1; transform: translate(-50%, -22px) scale(1.25); }
    100% { opacity: 0; transform: translate(-50%, -32px) scale(0.8); }
}

@keyframes entropyGlow {
    0% { box-shadow: 0 0 2px #ff4f4f, 0 0 4px #77b5fe, 0 0 6px #3a6dff; }
    40% { box-shadow: 0 0 10px #fff, 0 0 15px #9ac9ff, 0 0 20px #fff; }
    100% { box-shadow: 0 0 16px #ff9c9c, 0 0 40px #b5d9ff; }
}

@keyframes entropyFlicker {
    from { box-shadow: 0 0 6px #3a6dff; }
    to   { box-shadow: 0 0 16px #1f2aff; }
}

@keyframes electricFlicker {
    from { box-shadow: 0 0 6px #ff4f4f; }
    to   { box-shadow: 0 0 14px #ffffff; }
}
