/* ─── Queue Panel Overlay ─────────────────────────── */
.queue-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(0, 0, 0, .45);
}

.queue-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-surface);
    box-shadow: -4px 0 16px rgba(0, 0, 0, .4);
    z-index: 1301;
}

.queue-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.queue-panel-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#yt-player {
    width: 100%;
    aspect-ratio: 16 / 9;
}

#yt-player iframe {
    width: 100%;
    height: 100%;
    display: block;
}

/* Hide YouTube cast button to prevent remote playback */
.ytp-chrome-top-buttons .ytp-remote-button,
.ytp-chrome-controls .ytp-remote-button,
button[class*="cast"],
button[aria-label*="Cast"],
button[title*="Cast"],
.ytp-cast-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ─── Now Singing Overlay (host) ─────────────────────────────── */
.nso-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background:
        radial-gradient(ellipse at 50% 43%, rgba(255, 64, 160, .2), transparent 44%),
        radial-gradient(ellipse at 72% 58%, rgba(124, 77, 255, .16), transparent 48%),
        radial-gradient(ellipse at 28% 62%, rgba(0, 207, 255, .1), transparent 46%),
        #0c0a16;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--nso-fade-duration, 1s) ease;
}

.nso-backdrop--visible {
    pointer-events: all;
    opacity: 1;
    transition: opacity 0s;
}

@media (prefers-reduced-motion: reduce) {
    .nso-backdrop,
    .nso-backdrop--visible {
        transition: none;
    }
}

.nso-content {
    width: min(100%, 960px);
    box-sizing: border-box;
    text-align: center;
    color: #fff3fb;
    padding: clamp(1.5rem, 5vw, 3rem);
}

.nso-label {
    display: inline-block;
    padding: .55rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(8px);
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .2em;
    opacity: .9;
}

.nso-singer {
    margin: .55rem 0 .35rem;
    font-family: "Noto Sans JP", sans-serif;
    font-size: clamp(3rem, 11vw, 7rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -.03em;
    overflow-wrap: anywhere;
    text-shadow: 0 0 2px #fff, 0 0 12px currentColor, 0 0 36px currentColor;
}

.nso-song {
    max-width: 620px;
    margin: 0 auto 1.75rem;
    color: rgba(255, 243, 251, .82);
    font-size: clamp(1.05rem, 2.4vw, 1.5rem);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.nso-progress-bar-track {
    height: 4px;
    background: rgba(255, 255, 255, .14);
    border-radius: 2px;
    width: 360px;
    max-width: 80vw;
    margin: 0 auto 1rem;
}

.nso-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff5fb0, #7c4dff 70%, #00cfff);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(255, 95, 176, .7);
    animation: nsoProgressShrink linear forwards;
}

@keyframes nsoProgressShrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

.nso-hint {
    font-size: .85rem;
    opacity: .55;
}

/* ─── Marquee Bar ─────────────────────────────────────────── */
.marquee-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, .78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    overflow: hidden;
    padding-top: calc(clamp(12px, 5vh, 54px) - 20px);
    padding-bottom: .3rem;
    display: flex;
    align-items: stretch;
}

.marquee-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 0;
}

.marquee-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    white-space: nowrap;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-weight: 600;
    flex-shrink: 0;
}

.marquee-label--now {
    background: rgba(29, 158, 117, .22);
    color: #1D9E75;
}

.marquee-label--next {
    background: rgba(127, 119, 221, .2);
    color: #9E99E0;
}

.marquee-label--intermission {
    background: rgba(239, 159, 39, .22);
    color: #EF9F27;
}

.marquee-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.marquee-singer {
    font-size: 1rem;
    color: rgba(255, 255, 255, .75);
    white-space: nowrap;
}

.marquee-sep {
    font-size: 1rem;
    color: rgba(255, 255, 255, .3);
    white-space: nowrap;
}

.marquee-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, .92);
    white-space: nowrap;
}

.marquee-divider {
    font-size: .68rem;
    color: rgba(255, 255, 255, .2);
    padding: 0 1.5rem;
}

/* ─── Singer Room — Your Turn Backdrop ──────────────────────── */
.your-turn-card {
    border: 2px solid;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, .5);
    max-width: 360px;
    width: 90%;
    animation: cardGlow 1.5s ease-in-out infinite;
}

@keyframes cardGlow {
    0%, 100% {
        box-shadow: 0 0 24px var(--singer-color, #fff);
    }

    50% {
        box-shadow: 0 0 64px var(--singer-color, #fff);
    }
}

/* ─── YouTubeQueue — Mobile Layout ──────────────────────────── */
.yt-mobile-layout {
    display: none;
    flex-direction: column;
    width: 100%;
    position: relative;
    z-index: 100;
}

.yt-mobile-queue {
    width: 100%;
    overflow-y: auto;
}

.yt-mobile-qr {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

@media (max-width: 767px) {
    .yt-hide-mobile {
        display: none !important;
    }

    .yt-player-container {
        height: auto !important;
    }

    .yt-mobile-layout {
        display: flex !important;
    }
}

.lobby-room-code {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: .15em;
}

.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    text-align: center;
}

/* ─── Home hero ─────────────────────────────────── */
.home-hero {
    position: relative;
    overflow: hidden;
    min-height: 70vh;
    padding-bottom: 32px;
    display: flex;
    align-items: center;
    text-align: center;
}

.home-hero-photo {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
}

.home-hero-photo-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(10, 6, 20, .35) 0%, rgba(10, 6, 20, .55) 55%, var(--mud-palette-background, #0c0a16) 100%),
        linear-gradient(to right, rgba(10, 6, 20, .2) 0%, transparent 25%, transparent 75%, rgba(10, 6, 20, .2) 100%);
}

.home-hero-glow {
    position: absolute;
    inset: -20%;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 64, 160, .28), transparent 45%),
        radial-gradient(circle at 70% 40%, rgba(124, 77, 255, .28), transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(0, 207, 255, .18), transparent 50%);
    filter: blur(60px);
    animation: home-glow-drift 18s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}

.home-hero-content {
    position: relative;
    z-index: 1;
}

@media (max-width: 899px) {
    .home-hero-photo {
        bottom: auto;
        aspect-ratio: 1;
    }
}

@media (min-width: 900px) {
    .home-hero {
        min-height: calc(100vh - 72px);
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        padding-bottom: 48px;
    }

    .home-hero-photo {
        background-position: center calc(48% - 6vw);
    }

    .home-hero-content {
        transform: translateY(-28px);
        padding-bottom: 24px !important;
    }

    .home-hero-mascot {
        display: none;
    }

    .home-hero-eyebrow {
        padding: 0;
        border: 0;
        background: none;
        text-transform: none;
        font-size: clamp(2.2rem, 4vw, 4rem);
        letter-spacing: .12em;
        line-height: 1;
        opacity: 1;
        text-shadow: 0 0 8px rgba(255, 255, 255, .9), 0 0 24px rgba(255, 76, 166, .9), 0 0 48px rgba(255, 76, 166, .5);
    }

    .home-hero-title.home-neon-title {
        background: none;
        -webkit-background-clip: initial;
        background-clip: initial;
        color: #fff3fb;
        animation: none;
    }
}

/* ─── Closing section: donate + footer with photo bleeding behind both (desktop) ── */
.home-closing {
    position: relative;
    overflow: hidden;
}

.home-closing-photo {
    position: absolute;
    display: none;
    inset: 0;
    background-size: cover;
    background-position: center 78%;
    background-repeat: no-repeat;
    opacity: .8;
}

.home-closing-fade {
    position: absolute;
    display: none;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to bottom, var(--mud-palette-background, #0c0a16) 0%, rgba(10, 6, 20, .72) 45%, rgba(10, 6, 20, .55) 100%),
        linear-gradient(to right, rgba(10, 6, 20, .35) 0%, transparent 25%, transparent 75%, rgba(10, 6, 20, .35) 100%);
}

@media (min-width: 900px) {
    .home-closing-photo,
    .home-closing-fade {
        display: block;
    }

    .home-closing-photo {
        top: auto;
        height: max(100%, calc(100vh - 72px));
        background-position: center calc(78% - 3vw);
    }

    .home-closing > .mud-container {
        position: relative;
        z-index: 1;
    }

    .home-closing .home-footer {
        margin-top: 0;
        padding-top: 8px !important;
        padding-bottom: clamp(48px, 10vw, 96px) !important;
        border-top: none;
    }
}

/* Start 3 seconds after loading ends; the last 5 seconds of each 30-second cycle stay dark. */
@keyframes neon-start {
    0%, 83.333333%, 100% {
        color: #633449;
        filter: url(#home-neon-outline);
    }

    1.5% {
        color: #fff3fb;
        filter: url(#home-neon-outline) var(--home-neon-glow);
    }
}

@keyframes neon-start-delayed {
    0%, 83.333333%, 100% {
        color: #633449;
        filter: url(#home-neon-outline);
    }

    2.5% {
        color: #fff3fb;
        filter: url(#home-neon-outline) var(--home-neon-glow);
    }
}

@keyframes neon-start-late {
    0%, 83.333333%, 100% {
        color: #633449;
        filter: url(#home-neon-outline);
    }

    4% {
        color: #fff3fb;
        filter: url(#home-neon-outline) var(--home-neon-glow);
    }
}

@keyframes neon-start-flicker {
    0%, 2.5%, 4.5%, 83.333333%, 100% {
        color: #633449;
        filter: url(#home-neon-outline);
    }

    2%, 4%, 7% {
        color: #fff3fb;
        filter: url(#home-neon-outline) var(--home-neon-glow);
    }
}

.home-hero-glow {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 82%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 82%);
}

.home-hero::after {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}

.home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 160px 160px;
    opacity: .07;
    mix-blend-mode: soft-light;
}

.home-hero-mascot {
    filter: drop-shadow(0 18px 30px rgba(124, 77, 255, .45));
    animation: home-float 5s ease-in-out infinite;
}

.home-hero-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    padding: 8px 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(8px);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .28em;
    opacity: .85;
}

.home-hero-title {
    margin: 0;
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 900;
    font-size: clamp(2.75rem, 9vw, 5.5rem);
    line-height: 1.05;
    letter-spacing: -.02em;
}

.home-hero-title.home-neon-title {
    --home-neon-glow: drop-shadow(0 0 2px #fff) drop-shadow(0 0 3px #ff5fb0) drop-shadow(0 0 6px #ff5fb0) drop-shadow(0 0 16px #ff2e91) drop-shadow(0 0 28px rgba(255, 46, 145, .9));
    color: #fff3fb;
    -webkit-text-fill-color: currentColor;
    text-shadow: none;
}

.home-neon-letter {
    display: inline-block;
    filter: url(#home-neon-outline) var(--home-neon-glow);
    /* Apply the unlit first frame during the initial delay, too. */
    animation: neon-start 30s steps(1, end) 3s infinite backwards;
}

.app-loading .home-neon-letter {
    animation-play-state: paused;
}

.home-neon-letter:nth-child(2),
.home-neon-letter:nth-child(5) {
    animation-name: neon-start-delayed;
}

.home-neon-letter:nth-child(4) {
    animation-name: neon-start-late;
}

.home-neon-letter.home-neon-flicker {
    animation-name: neon-start-flicker;
}

@media (max-width: 899.98px) {
    .home-hero-title.home-neon-title {
        --home-neon-glow: drop-shadow(0 0 1px #fff) drop-shadow(0 0 4px #ff5fb0) drop-shadow(0 0 9px #ff2e91) drop-shadow(0 0 16px rgba(255, 46, 145, .85));
    }
}

.home-hero-tagline {
    font-weight: 600 !important;
}

.home-neon-tagline {
    color: #9cecff;
    text-shadow: 0 0 3px #fff, 0 0 8px #48dfff, 0 0 18px #00aaff, 0 0 32px rgba(0, 130, 255, .9);
}

.home-hero-lead {
    max-width: 560px;
    opacity: .85;
}

.home-hero-cta {
    margin-top: 8px;
}

.home-btn-primary,
.home-btn-join {
    border-radius: 999px !important;
}

.home-btn-primary {
    padding: 12px 32px !important;
}

.home-return-room {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    padding: 6px 6px 6px 20px;
    border: 1px solid rgba(104, 223, 245, .45);
    border-radius: 999px;
    background: rgba(15, 37, 52, .72);
    backdrop-filter: blur(12px);
    text-align: left;
}

.home-return-room-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.home-return-room-label {
    color: rgba(255, 255, 255, .7);
    font-size: .8rem;
}

.home-return-room-code {
    color: #9cecff;
    font-size: 1.1rem;
    letter-spacing: .08em;
}

.home-return-room-action,
.home-btn-join {
    box-sizing: border-box;
    flex: 0 0 136px;
    width: 136px !important;
    min-width: 136px !important;
    height: 40px !important;
}

.home-return-room-action {
    flex-shrink: 0;
    padding: 8px 20px !important;
    border-radius: 999px !important;
    background: rgba(0, 180, 216, .2) !important;
    color: #9cecff !important;
}

.home-return-room-action:hover {
    background: rgba(0, 180, 216, .32) !important;
}

.home-btn-join:disabled {
    background: rgba(255, 255, 255, .12) !important;
    color: rgba(255, 255, 255, .4) !important;
    box-shadow: none !important;
}

.home-join-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 420px;
    font-size: .85rem;
    opacity: .6;
}

.home-join-divider::before,
.home-join-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
}

.home-join-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    padding: 6px 6px 6px 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(12px);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.home-join-bar:focus-within {
    border-color: rgba(124, 77, 255, .8);
    box-shadow: 0 0 0 4px rgba(124, 77, 255, .2);
}

.home-join-input {
    flex: 1;
    margin: 0 !important;
}

.home-join-input input {
    text-transform: uppercase;
    letter-spacing: .25em;
    font-weight: 700;
}

.home-join-input input::placeholder {
    letter-spacing: .2em;
}

.home-btn-join {
    padding: 8px 20px !important;
    flex-shrink: 0;
}

/* ─── Home feature cards ─────────────────────────── */
.home-feature-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0 8px 16px;
    border-left: 2px solid rgba(255, 64, 160, .55);
}

.home-feature-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 1.75rem;
    line-height: 1;
}

/* ─── Home how-it-works steps ────────────────────── */
.home-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-steps::before {
    content: "";
    position: absolute;
    top: 28px;
    left: calc(100% / 6);
    right: calc(100% / 6);
    height: 1px;
    background: rgba(255, 255, 255, .2);
}

.home-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.home-step-number {
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ff40a0;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff79ba;
    background: var(--mud-palette-background);
}

@media (max-width: 599.98px) {
    .home-steps {
        grid-template-columns: 1fr;
    }

    .home-steps::before {
        display: none;
    }
}

/* ─── Home about section ─────────────────────────── */
.home-about {
    padding: 0;
}

.home-about-quote {
    margin: 24px auto 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.home-about-quote-jp {
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 900;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.1;
    color: #fff3fb;
}

.home-about-quote-en {
    font-style: italic;
    opacity: .7;
}

.home-about-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    text-align: left;
}

.home-about-columns .mud-typography {
    line-height: 1.7;
    opacity: .9;
}

.home-about-link {
    margin-top: 32px;
    text-align: center;
}

.home-about-link a.mud-link {
    color: #9cecff !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.home-about-link a.mud-link:focus-visible {
    outline: 2px solid #9cecff;
    outline-offset: 4px;
}

@media (max-width: 599.98px) {
    .home-about {
        padding: 24px;
    }

    .home-about-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ─── Home donate section ────────────────────────── */
.home-donate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
    text-align: center;
}

.home-donate-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.home-donate-lead {
    max-width: 600px;
    line-height: 1.7;
    opacity: .9;
}

.home-donate-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-top: 8px;
}

.home-donate-form {
    margin: 0;
}

.home-donate-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.home-donate-qr img {
    width: 160px;
    height: 160px;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
}

.home-donate-thanks {
    opacity: .8;
}

@media (max-width: 599.98px) {
    .home-donate {
        padding: 24px;
    }
}

/* ─── Donation complete page ─────────────────────── */
.donation-hero {
    min-height: auto;
    padding-bottom: 48px;
}

.donation-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 640px;
    padding: 32px;
    border-radius: 24px;
    background: #211a2d;
    border: 1px solid rgba(255, 255, 255, .1);
}

.donation-card .mud-typography {
    line-height: 1.7;
    opacity: .9;
}

.donation-encore {
    font-weight: 600 !important;
}

@media (max-width: 599.98px) {
    .donation-card {
        padding: 24px;
    }
}

/* ─── Home section spacing, reveal & footer ──────── */
.home-section {
    padding-top: clamp(16px, 3vw, 32px) !important;
    padding-bottom: clamp(16px, 3vw, 32px) !important;
}

.home-hero + .home-section {
    padding-top: 16px !important;
}

@supports (animation-timeline: view()) {
    .home-reveal {
        animation: home-reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 40%;
    }
}

@keyframes home-reveal {
    from {
        opacity: 0;
        transform: translateY(32px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.home-footer {
    margin-top: 32px;
    padding-top: 24px !important;
    padding-bottom: 32px !important;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.home-footer-pill {
    width: fit-content;
    margin-inline: auto;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(9, 7, 18, .86);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    backdrop-filter: blur(12px);
}

.home-footer-pill a,
.home-footer-pill .mud-typography {
    color: rgba(255, 255, 255, .9) !important;
}

/* ─── Informational page headers ─────────────────── */
.info-hero {
    min-height: 0;
    padding: 32px 0 clamp(80px, 8vw, 128px);
    justify-content: center;
}

.info-hero .home-hero-photo {
    bottom: 0;
    aspect-ratio: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 100%);
}

.info-hero .home-hero-content {
    transform: none;
    padding-top: 32px !important;
    padding-bottom: 16px !important;
}

.info-hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: #fff3fb;
    text-shadow: 0 0 8px rgba(255, 95, 176, .8), 0 0 24px rgba(255, 46, 145, .55);
}

/* ─── Karaoke-dō page ────────────────────────────── */
.kdo-card {
    border-left: 2px solid rgba(255, 64, 160, .55);
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.kdo-level-badge {
    margin-bottom: 0;
}

.kdo-card .mud-alert {
    border-radius: 12px;
}

.kdo-card .mud-chip {
    border-radius: 999px;
    margin: 0;
}

.kdo-card .mud-card-actions {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 20px 20px;
}

.kdo-diagram svg {
    display: block;
    width: 100%;
    max-width: 940px;
    height: auto;
    margin: 0 auto;
}

/* ─── FAQ page ───────────────────────────────────── */
.faq-hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

.faq-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-section-title::before {
    content: "";
    width: 2px;
    height: 1.2em;
    background: rgba(255, 64, 160, .55);
}

.faq-panels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 2px 2px 8px;
    overflow: visible !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.faq-panels .mud-expand-panel,
.faq-panels .mud-expand-panel.mud-panel-expanded,
.faq-panels .mud-expand-panel.mud-panel-next-expanded,
.faq-panels .mud-expand-panel.mud-expand-panel-border {
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, .15) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden;
}

.faq-panels .mud-expand-panel::before {
    display: none;
}

.faq-panels .mud-expand-panel-header {
    font-weight: 600;
}

.faq-panels .mud-expand-panel-header:hover,
.faq-panels .mud-panel-expanded .mud-expand-panel-header {
    background: rgba(255, 255, 255, .05);
}

.faq-panels .mud-link {
    color: #9cecff !important;
}

/* ─── Legal documents ────────────────────────────── */
.legal-document {
    max-width: 76ch;
    margin: 0 auto;
    padding: 8px 0 8px 16px;
    border-left: 2px solid rgba(255, 64, 160, .55);
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.legal-document .mud-typography-body1 {
    line-height: 1.6;
}

.legal-document .mud-link {
    color: #9cecff !important;
}

.legal-document .mud-typography-h5 {
    font-size: 1.3rem;
    font-weight: 700;
}

.legal-document .mud-typography-h6 {
    font-size: 1.1rem;
    font-weight: 600;
}

.legal-date {
    color: #9cecff;
}

.glass-bottom-menu.mud-appbar {
    background-color: rgba(15, 13, 30, .72) !important;
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    border-top: 1px solid rgba(255, 255, 255, .14);
}

/* ─── Favorites page ─────────────────────────────── */
/* Reserve the navigation bar's actual height, not an estimated viewport offset. */
.mud-layout:has(.fav-library) {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}

.mud-layout:has(.fav-library) > .mud-appbar {
    position: static !important;
}

.mud-main-content:has(.fav-library) {
    min-height: 0;
    overflow: hidden;
}

.mud-container:has(> .fav-library) {
    height: 100%;
    margin-bottom: 0 !important;
}

.fav-library {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 16px 0 0;
}

.fav-library > .fav-header-title,
.fav-tabs .mud-tabs-tabbar,
.fav-column > :not(.fav-list),
.fav-tab-content > :not(.fav-list) {
    flex: 0 0 auto;
}

.fav-library .fav-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    width: 100% !important;
    margin: 0 !important;
}

.fav-columns > .fav-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    overflow: hidden;
    padding-top: 0 !important;
}

.fav-tabs,
.fav-tabs .mud-tabs-panels {
    flex: 1;
    min-height: 0;
}

.fav-tab-content {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.fav-header-title {
    text-align: center;
    text-shadow: none;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    padding: 8px 0 16px;
}

.fav-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 16px;
    border-left: 2px solid rgba(255, 64, 160, .55);
}

.fav-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-gutter: stable;
    overscroll-behavior-y: contain;
}

.fav-library :focus-visible {
    outline: 2px solid #9cecff;
    outline-offset: -2px;
}

.fav-action {
    align-self: flex-start;
}

.fav-library .home-btn-primary:disabled {
    opacity: .5;
}

.fav-empty {
    max-width: 65ch;
    padding: 24px 16px;
    border-left: 2px solid rgba(255, 64, 160, .55);
    color: #b0bec5;
}

.fav-empty .mud-button-root {
    align-self: flex-start;
}

/* ItemSize includes the fixed card height plus its 4px bottom margin. */
.fav-library .fav-card {
    height: 120px;
    max-height: 120px;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: inset 0 -1px rgba(255, 255, 255, .15) !important;
}

.fav-library .fav-card-editable {
    height: 148px;
    max-height: 148px;
}

@media (min-width: 960px) {
    .fav-library .fav-card-editable {
        height: 128px;
        max-height: 128px;
    }

    .fav-library .fav-card .song-rating-editor {
        height: 32px;
    }
}

.fav-library .fav-card:hover,
.fav-library .fav-card:focus-within {
    background: rgba(255, 255, 255, .03) !important;
}

.fav-library .fav-card .fav-song-title {
    width: 100%;
    line-height: 24px;
    font-weight: 700;
    color: #fff3fb;
}

.fav-library .fav-card .fav-song-artist {
    line-height: 20px;
    color: #eeeeee;
}

.fav-library .fav-card .mud-typography-caption {
    line-height: 16px;
    color: #b0bec5 !important;
}

.fav-tabs .mud-tabs-tabbar {
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: inset 0 -1px rgba(255, 255, 255, .15);
}

.fav-tabs .mud-tab {
    text-transform: none;
    font-weight: 600;
    color: #b0bec5;
}

.fav-tabs .mud-tab:hover {
    background: rgba(255, 255, 255, .05);
}

.fav-tabs .mud-tab.mud-tab-active {
    color: #fff3fb !important;
    background: transparent;
}

.fav-tabs .mud-tab-slider {
    height: 3px !important;
    background: #ff40a0 !important;
}

/* ─── Shared glass card ──────────────────────────── */
.glass-card {
    border-radius: 16px !important;
    background: rgba(255, 255, 255, .05) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1) !important;
}

.glass-card--danger {
    background: rgba(226, 75, 74, .06) !important;
    box-shadow: inset 0 0 0 1px rgba(226, 75, 74, .35) !important;
}

.mud-button-root.mud-button-filled.mud-button-filled-primary:not(:disabled) {
    color: #fff;
    background-color: #b51f69;
    --mud-ripple-color: #fff;
}

.mud-button-root.mud-button-filled.mud-button-filled-primary:not(:disabled):hover,
.mud-button-root.mud-button-filled.mud-button-filled-primary:not(:disabled):focus-visible,
.mud-button-root.mud-button-filled.mud-button-filled-primary:not(:disabled):active {
    background-color: #c12873;
}

.pill-btn {
    border-radius: 999px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}

/* ─── Logout page ────────────────────────────────── */
.logout-card {
    border-radius: 24px !important;
    text-align: center;
}

.logout-icon {
    margin-bottom: 0;
}

.logout-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.login-divider {
    max-width: none;
}

.logout-card .mud-input-outlined-border {
    border-radius: 12px;
}

.logout-card .home-btn-primary {
    padding: 10px 24px !important;
}

@keyframes home-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

@keyframes home-glow-drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(4%, -3%) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-glow,
    .home-hero-mascot,
    .home-neon-title .home-neon-letter {
        animation: none;
    }

    .home-feature-card,
    .home-feature-card:hover {
        transition: none;
        transform: none;
    }

    .home-reveal {
        animation: none !important;
    }
}

/* ===== Admin pages ===== */
.admin-title { margin-bottom: 16px; text-align: left; }
.admin-section-title { letter-spacing: .02em; }
.admin-toolbar { row-gap: 12px; }
.admin-search { flex: 1 1 18rem; min-width: min(100%, 18rem); }
.admin-settings-guidance { max-width: 72ch; }
.admin-table { max-width: 100%; }
.admin-table .mud-table-container { max-width: 100%; overflow-x: auto; }
.admin-table .mud-table-root { background: transparent !important; }
.admin-table .mud-table-head .mud-table-cell { background: rgba(255,255,255,.04) !important; font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; opacity: .85; }
.admin-table .mud-table-cell { border-bottom-color: rgba(255,255,255,.06) !important; }
.admin-table .mud-table-pagination { background: transparent !important; border-top: 1px solid rgba(255,255,255,.06); }
.admin-settings-table .setting-value-cell { min-width: 0; }
.admin-settings-table .setting-value { display: block; min-width: 0; max-width: 65%; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.channel-id { overflow-wrap: anywhere; }

@media (max-width: 600px) {
    .admin-title { font-size: 1.65rem; }
    .admin-toolbar { align-items: stretch !important; }
    .admin-search { flex-basis: 100%; }
    .admin-settings-guidance { line-height: 1.5; }
}

/* Fixed song card height includes the rating row (120px + 4px margin). */
.fav-card { height: 120px; max-height: 120px; overflow: hidden; box-sizing: border-box; }
.fav-card .mud-typography { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fav-card .mud-stack { min-width: 0; overflow: hidden; }
.fav-card-editable { height: 160px; max-height: 160px; }

.songs-grid .mud-table-head .mud-table-cell { background: var(--mud-palette-surface) !important; opacity: 1; }

/* Fixed row height so virtualization (ItemSize) stays accurate */
.songs-grid .mud-table-body .mud-table-row { height: 60px; }
.songs-grid .mud-table-body .mud-table-cell { height: 60px; max-height: 60px; padding-top: 4px !important; padding-bottom: 4px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; box-sizing: border-box; }
.songs-grid .mud-table-body .mud-table-cell .mud-typography { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.songs-grid .mud-table-body .mud-table-cell img { height: 45px; width: 80px; display: block; }

