:root {
    --accent: #e86c24;
    --accent-hover: #d55b13;
    --bg-main: #14110f;
    --bg-card: #26201c;
    --bg-input: #1a1614;
    --danger: #b91c1c;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

body {
    background-color: var(--bg-main);
    color: white;
}

html[data-jam-preview="1"] #warningModal {
    display: none !important;
}

.btn-hover {
    transition: all 0.2s ease;
}

.btn-hover:active {
    transform: scale(0.95);
}

.queue-container,
.user-list-container {
    transition: max-height 0.5s ease-in-out;
    scroll-behavior: smooth;
}

.vote-anim {
    animation: pulseHeart 0.4s ease-in-out;
    color: var(--accent);
}

#starRatingRow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

#starRatingRow .rating-label {
    flex: 1 0 100%;
}

.star-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Floating Feedback Button */
.feedback-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 40;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

@media (min-width: 1024px) {
    .feedback-btn {
        bottom: 28px;
        top: auto;
        right: 32px;
    }
}


/* Guest portal uses the top Now Playing card only. */
#miniPlayerBar {
    display: none !important;
}
/* ====================================================
   JAM PORTAL GUEST MOBILE SHELL - single source of truth
   No viewport-width typography. Desktop begins at 1024px.
   ==================================================== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    --m-pad: 16px;
    --m-gap: 14px;
    --m-nav-h: 72px;
    --m-radius: 18px;
    --fs-xs: 12px;
    --fs-sm: 14px;
    --fs-base: 16px;
    --fs-md: 17px;
    --fs-lg: 20px;
    --fs-xl: 23px;
    --tap: 52px;
    --jp-bg: #080706;
    --jp-text: #fff7f1;
    --jp-muted: rgba(255, 247, 241, 0.62);
    --jp-surface: rgba(38, 29, 24, 0.94);
    --jp-surface-2: rgba(48, 35, 29, 0.96);
    --jp-border: rgba(255, 255, 255, 0.12);
    --guest-banner-height: 34px;
    --guest-header-height: 54px;
}

@media (max-width: 374px) {
    :root {
        --m-pad: 14px;
        --m-nav-h: 68px;
        --fs-base: 15px;
        --fs-md: 16px;
        --fs-lg: 19px;
        --fs-xl: 22px;
        --tap: 50px;
    }
}

@media (min-width: 400px) and (max-width: 1023px) {
    :root {
        --m-pad: 18px;
        --fs-base: 17px;
        --fs-md: 18px;
        --fs-lg: 21px;
        --fs-xl: 24px;
        --tap: 54px;
    }
}

@media (max-width: 1023px) {
    html {
        height: 100%;
        font-size: 16px;
    }

    body {
        min-height: 100dvh !important;
        height: 100dvh !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
        background: var(--jp-bg) !important;
        color: var(--jp-text) !important;
        font-size: var(--fs-base) !important;
        line-height: 1.45 !important;
        touch-action: manipulation;
    }

    *, *::before, *::after {
        box-sizing: border-box;
    }

    body > .w-full.bg-accent\/10,
    body > div.w-full.bg-accent\/10 {
        height: var(--guest-banner-height) !important;
        min-height: var(--guest-banner-height) !important;
        flex: 0 0 var(--guest-banner-height) !important;
    }

    .whitespace-nowrap.animate-scroll {
        height: var(--guest-banner-height) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: var(--fs-sm) !important;
        line-height: 1 !important;
        font-weight: 800 !important;
    }

    .guest-shell {
        width: 100% !important;
        max-width: none !important;
        height: calc(100dvh - var(--guest-banner-height)) !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 12px var(--m-pad) calc(var(--m-nav-h) + 18px + env(safe-area-inset-bottom)) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .guest-shell > .w-full.text-center {
        display: none !important;
    }

    header {
        flex: 0 0 var(--guest-header-height) !important;
        min-height: var(--guest-header-height) !important;
        display: flex !important;
        align-items: center !important;
    }

    .portal-logo-placeholder {
        width: 38px !important;
        height: 38px !important;
        flex: 0 0 38px !important;
        border-radius: 999px !important;
        overflow: hidden !important;
    }

    .portal-logo-placeholder img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    #guest-portal-name {
        max-width: 52vw !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--jp-text) !important;
        font-size: var(--fs-xl) !important;
        line-height: 1.05 !important;
        font-weight: 900 !important;
    }

    #guestAvatar,
    #guestDisplayName,
    header .hidden.sm\:flex {
        display: none !important;
    }

    header button[data-jam-action="leave-portal"] {
        min-height: 44px !important;
        min-width: 52px !important;
        padding: 0 14px !important;
        border-radius: 999px !important;
        font-size: var(--fs-sm) !important;
        font-weight: 800 !important;
        background: var(--jp-surface) !important;
        color: var(--jp-text) !important;
        border: 1px solid var(--jp-border) !important;
    }

    .guest-main {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden !important;
    }

    .guest-main > div {
        display: contents !important;
    }

    .mobile-panel {
        display: none !important;
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }

    .mobile-panel.is-active {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }

    #searchSection.is-active {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px !important;
    }

    #queueSection.is-active,
    #chatSection.is-active {
        overflow: hidden !important;
    }

    #pendingSection {
        display: none !important;
    }

    #nowPlayingCard:not(.hidden) {
        display: block !important;
        flex: 0 0 auto !important;
        margin-bottom: 14px !important;
        overflow: hidden !important;
        border-radius: 20px !important;
        background: var(--jp-surface) !important;
        border: 1px solid var(--jp-border) !important;
        box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42) !important;
    }

    #nowPlayingCard > .relative {
        aspect-ratio: 16 / 7.4 !important;
        min-height: 154px !important;
    }

    #npArtGuest {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        opacity: 0.86 !important;
    }

    #nowPlayingCard span {
        font-size: var(--fs-xs) !important;
        line-height: 1 !important;
        padding: 5px 10px !important;
    }

    #npTitleGuest {
        font-size: var(--fs-xl) !important;
        line-height: 1.12 !important;
        font-weight: 900 !important;
        white-space: normal !important;
    }

    #npArtistGuest {
        font-size: var(--fs-base) !important;
        line-height: 1.3 !important;
        color: rgba(255, 255, 255, 0.78) !important;
    }

    #npDedicationGuest {
        font-size: var(--fs-xs) !important;
    }

    #searchSection h3,
    #queueSection h3,
    #chatSection h3 {
        color: var(--jp-text) !important;
        font-size: var(--fs-lg) !important;
        line-height: 1.15 !important;
        font-weight: 900 !important;
        margin-bottom: 12px !important;
    }

    #searchSection h3 svg,
    #queueSection h3 svg,
    #chatSection h3 svg {
        width: 22px !important;
        height: 22px !important;
    }

    #searchSection .flex.flex-col.gap-3 {
        gap: 12px !important;
    }

    #searchSection .bg-input,
    #dedicationInputWrapper,
    #chatInputContainer .bg-input {
        min-height: var(--tap) !important;
        padding: 0 14px !important;
        border-radius: 16px !important;
        background: var(--jp-surface-2) !important;
        border: 1px solid rgba(180, 150, 136, 0.45) !important;
    }

    #searchInput,
    #dedicationInput,
    #chatInput {
        font-size: var(--fs-base) !important;
        line-height: 1.3 !important;
        font-weight: 500 !important;
        color: var(--jp-text) !important;
    }

    #searchInput::placeholder,
    #dedicationInput::placeholder,
    #chatInput::placeholder {
        color: rgba(255, 247, 241, 0.45) !important;
    }

    #addToQueueBtn {
        min-height: 56px !important;
        border-radius: 16px !important;
        font-size: var(--fs-md) !important;
        font-weight: 900 !important;
        color: #190800 !important;
        background: var(--accent) !important;
    }

    #dedicationInputWrapper.cta-soft-glow,
    #addToQueueBtn.cta-soft-glow {
        box-shadow: 0 0 0 1px rgba(255, 122, 0, 0.34), 0 0 22px rgba(255, 122, 0, 0.22) !important;
        border-color: rgba(255, 122, 0, 0.55) !important;
    }

    #dedicationInputWrapper:focus-within,
    #addToQueueBtn:focus-visible {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92), 0 0 0 5px rgba(255, 122, 0, 0.28), 0 0 24px rgba(255, 122, 0, 0.24) !important;
        outline: none !important;
    }

    #addToQueueBtn:active {
        transform: none !important;
    }

    @media (prefers-reduced-motion: reduce) {
        #dedicationInputWrapper,
        #addToQueueBtn {
            transition: none !important;
        }
    }

    #addToQueueBtn svg {
        width: 20px !important;
        height: 20px !important;
    }

    #searchResults {
        max-height: min(48dvh, 390px) !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
        border-radius: 18px !important;
        background: rgba(14, 10, 8, 0.98) !important;
        border: 1px solid var(--jp-border) !important;
        padding: 8px !important;
    }

    #searchResults > div,
    .queue-item {
        min-height: 76px !important;
        padding: 10px !important;
        border-radius: 16px !important;
        background: rgba(0, 0, 0, 0.22) !important;
        font-size: var(--fs-base) !important;
    }

    #searchResults img,
    .queue-item img {
        width: 54px !important;
        height: 54px !important;
        flex: 0 0 54px !important;
        border-radius: 13px !important;
    }

    #searchResults h4,
    .queue-item h4 {
        font-size: var(--fs-base) !important;
        line-height: 1.2 !important;
        font-weight: 800 !important;
    }

    #searchResults p,
    .queue-item p {
        font-size: var(--fs-sm) !important;
        line-height: 1.25 !important;
    }

    .queue-item button,
    .vote-btn {
        min-width: 54px !important;
        min-height: 54px !important;
    }

    .queue-item button svg,
    .vote-btn svg {
        width: 22px !important;
        height: 22px !important;
    }

    #queueSection > div:first-child {
        flex: 0 0 auto !important;
        padding-bottom: 12px !important;
        margin-bottom: 12px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    #queueCountBadge,
    #queueToggleBtn,
    #onlineCount {
        font-size: var(--fs-sm) !important;
    }

    #queueListContainer {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #queueList {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        padding-right: 0 !important;
    }

    #queueList .text-center {
        padding: 24px 12px !important;
        font-size: var(--fs-sm) !important;
    }

    #chatSection > div:first-child {
        flex: 0 0 auto !important;
        padding: 0 0 12px !important;
        border: 0 !important;
        background: transparent !important;
        position: static !important;
    }

    #usersListContainer {
        flex: 0 0 auto !important;
        max-height: 96px !important;
        overflow-y: auto !important;
    }

    #chatLog {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0 0 12px !important;
    }

    .chat-message {
        margin-bottom: 12px !important;
    }

    .chat-bubble {
        max-width: 88% !important;
        padding: 12px 14px !important;
        border-radius: 18px !important;
    }

    .chat-bubble p,
    #chatLog p {
        font-size: var(--fs-base) !important;
        line-height: 1.35 !important;
    }

    #chatInputContainer {
        flex: 0 0 auto !important;
        padding: 8px !important;
        border-radius: 20px !important;
        background: var(--jp-surface-2) !important;
        border: 1px solid rgba(180, 150, 136, 0.45) !important;
    }

    #chatInputContainer .bg-input {
        background: transparent !important;
        border: 0 !important;
        padding: 0 10px !important;
    }

    #chatSendBtn {
        min-width: 52px !important;
        min-height: 52px !important;
        border-radius: 15px !important;
    }

    #chatSendBtn svg {
        width: 22px !important;
        height: 22px !important;
    }

    #mobileTabNav {
        position: fixed !important;
        left: var(--m-pad) !important;
        right: var(--m-pad) !important;
        bottom: calc(10px + env(safe-area-inset-bottom)) !important;
        height: var(--m-nav-h) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 6px !important;
        gap: 4px !important;
        border-radius: 999px !important;
        background: rgba(28, 20, 16, 0.94) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65) !important;
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
        z-index: 50 !important;
    }

    #mobileTabNav button {
        min-height: 54px !important;
        border-radius: 999px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
    }

    #mobileTabNav button.is-active {
        background: #ffb693 !important;
        color: #2a0c00 !important;
    }

    #mobileTabNav svg {
        width: 22px !important;
        height: 22px !important;
    }

    #mobileTabNav span {
        font-size: 12px !important;
        line-height: 1 !important;
        font-weight: 800 !important;
    }

    .feedback-btn {
        display: none !important;
    }

    #feedbackModal {
        align-items: flex-end !important;
        padding: var(--m-pad) !important;
        padding-bottom: calc(var(--m-nav-h) + 20px + env(safe-area-inset-bottom)) !important;
    }

    #feedbackModal > div {
        width: 100% !important;
        max-width: none !important;
        border-radius: 24px !important;
        padding: 22px !important;
    }

    #feedbackModal h3 {
        font-size: var(--fs-xl) !important;
    }

    #feedbackDescription,
    #feedbackError {
        font-size: var(--fs-sm) !important;
    }

    #starRatingRow {
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    #starRatingRow button {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 46px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #starRatingRow .rating-label {
        grid-column: 1 / -1 !important;
        font-size: var(--fs-sm) !important;
        margin: 0 0 2px !important;
    }

    #starRatingRow svg {
        width: 28px !important;
        height: 28px !important;
    }

    #feedbackTextarea {
        min-height: 130px !important;
        font-size: var(--fs-base) !important;
        line-height: 1.4 !important;
    }

    #feedbackModal button {
        min-height: 52px !important;
        font-size: var(--fs-base) !important;
    }

    #toast-container {
        top: calc(var(--guest-banner-height) + 12px + env(safe-area-inset-top)) !important;
        left: var(--m-pad) !important;
        right: var(--m-pad) !important;
        width: auto !important;
        gap: 10px !important;
    }

    #toast-container > div {
        min-width: 0 !important;
        width: 100% !important;
        max-width: none !important;
        padding: 14px 16px !important;
        border-radius: 16px !important;
        font-size: var(--fs-base) !important;
        line-height: 1.35 !important;
    }

    #toast-container span {
        font-size: var(--fs-base) !important;
    }
}

@media (min-width: 1024px) {
    html,
    body {
        min-height: 100%;
        overflow-y: auto;
    }

    body {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
    }

    #mobileTabNav {
        display: none !important;
    }

    #guestShell {
        min-height: calc(100dvh - var(--guest-banner-height)) !important;
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    #guestMain {
        gap: 22px;
    }

    #guestMain > div:first-child {
        gap: 18px;
    }

    header {
        flex: 0 0 auto;
    }

    main {
        min-height: 0;
        flex: 1 1 auto;
        overflow: visible;
    }

    main > div,
    #chatSection,
    #queueSection {
        min-height: 0;
    }

    #nowPlayingCard > .relative {
        aspect-ratio: 16 / 4.1 !important;
        max-height: 150px;
    }

    #searchSection {
        flex: 0 1 auto;
        padding: 20px;
        min-height: 0;
        max-height: 42vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #searchSection > div {
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    #searchResults {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
        overflow-y: auto !important;
    }

    #dedicationInputWrapper,
    #addToQueueBtn {
        flex: 0 0 auto;
    }

    #queueSection {
        flex: 1 1 auto;
        min-height: 260px;
        overflow: visible;
    }

    #queueListContainer {
        flex: 1 1 auto;
        min-height: 220px;
        max-height: min(58vh, 680px) !important;
        overflow-y: auto !important;
    }

    #guestMain {
        max-width: 1440px;
        width: 100%;
        margin-inline: auto;
    }

    #searchResults > div,
    .queue-item {
        min-height: 82px !important;
        padding: 14px !important;
        border-radius: 16px !important;
        gap: 14px !important;
    }

    #searchResults img,
    .queue-item img {
        width: 58px !important;
        height: 58px !important;
        flex: 0 0 58px !important;
        border-radius: 14px !important;
    }

    #searchResults h4,
    .queue-item h4 {
        font-size: 1rem !important;
        line-height: 1.25 !important;
    }

    #searchResults p,
    .queue-item p {
        font-size: 0.875rem !important;
        line-height: 1.3 !important;
    }

    #pendingSection {
        display: none !important;
    }

    #queueToggleBtn,
    #pendingToggleBtn {
        display: none !important;
    }

    #chatSection {
        height: 100%;
        overflow: hidden;
    }

    #chatLog {
        min-height: 0;
        overflow-y: auto;
    }

    #chatInputContainer {
        flex: 0 0 auto;
    }

    #guestShell > div.w-full.text-center {
        display: block;
        flex: 0 0 auto;
        margin-top: 6px;
        margin-bottom: 0;
    }
}

/* Song Transition Class */
.song-transition {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.song-changing {
    opacity: 0;
    transform: scale(0.95);
}

.guest-now-playing-artwork {
  aspect-ratio: 16/7;
  background: rgba(0,0,0,0.4);
}

.guest-now-playing-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 60%);
}

.guest-now-playing-badge {
  background: rgba(0,0,0,0.55);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(232,108,36,0.4);
}

.guest-now-playing-title {
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.portal-list-scroll-large {
  max-height: 400px;
  overflow-y: auto;
}

.portal-list-scroll-compact {
  max-height: 260px;
  overflow-y: auto;
}

.warning-modal-initially-hidden {
  display:none;
}

.progress-bar-initial {
  width:0%;
}
