html, body {
    overflow: hidden;
}

.status-wrapper {
    display: flex;
    flex-direction: column;
    width: 95vw;
    height: 95vh;
    height: 95dvh;
    box-sizing: border-box;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    background-color: #f7d9c4;
    border: 1px solid #c4a882;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 0 0 0 28px;
    box-shadow: 4px -2px 10px rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.status-header h2 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: clamp(20px, 2.2vw, 36px);
    color: #4A3728;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    padding: 14px 0;
}

.home-btn {
    font-size: 3rem;
    font-weight: 900;
    color: #4A3728;
    text-decoration: none;
    line-height: 1;
    border: none;
    border-left: 1px solid #c4a882;
    border-radius: 0 8px 0 0;
    padding: 0 3vw;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 300ms;
    background-color: #eac7a8;
}

.home-btn:hover {
    background-color: #e1b791;
}

.status-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 16% 1fr 24%;
    grid-template-rows: minmax(0, 1fr);
    border: 1px solid #c4a882;
    box-shadow: 6px 6px 24px rgba(0,0,0,0.18);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* ---- Board panel ---- */

.board-panel {
    background-color: #f7d9c4;
    border-right: 1px solid #c4a882;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.2rem, 3vw, 2.4rem);
    padding: clamp(1.2rem, 3vw, 2.2rem) clamp(0.6rem, 1.2vw, 1rem) 0;
}

.board-label {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 1.3vw, 20px);
    color: #4A3728;
    text-align: center;
    line-height: 1.4;
}

/* ---- Main panel (announcement + chat) ---- */

.main-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #faedcb;
    overflow: hidden;
}

.announcement-bar {
    flex-shrink: 0;
    padding: clamp(0.8rem, 1.6vw, 1.4rem) clamp(1rem, 2vw, 1.8rem);
    border-bottom: 1px solid #c4a882;
    background-color: rgba(0,0,0,0.03);
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    user-select: none;
}

.announcement-label {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 1.3vw, 18px);
    color: rgba(74, 55, 40, 0.6);
    flex-shrink: 0;
}

.announcement-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.4vw, 20px);
    color: #4A3728;
}

.chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(0.8rem, 1.6vw, 1.4rem);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    scrollbar-width: none;
}

.chat-list::-webkit-scrollbar {
    display: none;
}

.chat-message {
    border: 1px solid rgba(196, 168, 130, 0.5);
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    background-color: rgba(255, 255, 255, 0.4);
}

.chat-message-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.2rem;
}

.chat-message-name {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(13px, 1.1vw, 16px);
    color: #8B6914;
}

.chat-message-time {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: clamp(11px, 0.9vw, 13px);
    color: rgba(74, 55, 40, 0.45);
}

.chat-message-body {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 1.2vw, 18px);
    color: #4A3728;
    line-height: 1.5;
    word-break: break-word;
}

.chat-input-row {
    flex-shrink: 0;
    display: flex;
    border-top: 1px solid #c4a882;
}

.chat-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: clamp(0.8rem, 1.6vw, 1.2rem);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(16px, 1.4vw, 20px);
    color: #4A3728;
}

.chat-input:focus {
    outline: none;
    background-color: rgba(255,255,255,0.35);
}

.send-btn {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: clamp(14px, 1.2vw, 18px);
    color: #4A3728;
    background-color: #faedcb;
    border: none;
    border-left: 1px solid #c4a882;
    padding: 0 clamp(1.2rem, 2.5vw, 2.2rem);
    cursor: pointer;
    transition: background-color 300ms;
}

.send-btn:hover {
    background-color: #E7D7B1;
}

/* ---- Name capture overlay ---- */

.name-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background-color: rgba(74, 55, 40, 0.25);
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.name-box {
    background-color: #faedcb;
    border: 1px solid #c4a882;
    border-radius: 8px;
    box-shadow: 6px 6px 20px rgba(0,0,0,0.25);
    padding: clamp(1.4rem, 3vw, 2.4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    width: min(80%, 360px);
}

.name-prompt {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(16px, 1.6vw, 22px);
    color: #4A3728;
    text-align: center;
}

.name-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c4a882;
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(16px, 1.3vw, 18px);
    color: #4A3728;
    background-color: rgba(255,255,255,0.6);
}

.name-input:focus {
    outline: none;
    background-color: #ffffff;
}

.name-confirm-btn {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: clamp(14px, 1.2vw, 18px);
    color: #4A3728;
    background-color: #f7d9c4;
    border: 1px solid #c4a882;
    border-radius: 4px;
    padding: 0.5rem 1.4rem;
    cursor: pointer;
    transition: background-color 300ms;
}

.name-confirm-btn:hover {
    background-color: #E1C0A5;
}

/* ---- Side panel (counter + spotify) ---- */

.side-panel {
    display: flex;
    flex-direction: column;
    background-color: #c6def1;
    border-left: 1px solid #c4a882;
}

.side-label {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: clamp(13px, 1.1vw, 17px);
    color: rgba(74, 55, 40, 0.65);
    letter-spacing: 0.02em;
}

.person-counter {
    flex-shrink: 0;
    border-bottom: 1px solid #c4a882;
    padding: clamp(1rem, 1.8vw, 1.6rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.person-count {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: clamp(28px, 3vw, 44px);
    color: #4A3728;
    line-height: 1;
}

.person-count-phrase {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: clamp(14px, 1.3vw, 19px);
    color: rgba(74, 55, 40, 0.45);
    text-align: center;
    line-height: 1.2;
}

.now-playing-panel {
    flex: 1;
    padding: clamp(1rem, 1.8vw, 1.6rem);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow: hidden;
}

.now-playing {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-align: center;
    /* Lift the whole block above dead-center (it otherwise centers in the
       area below the "listening to" label, which reads as too low). */
    padding-bottom: clamp(3.5rem, 12vh, 7rem);
}

.now-playing-art {
    width: min(70%, 160px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #c4a882;
    box-shadow: 4px 4px 14px rgba(0,0,0,0.15);
}

.now-playing-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.now-playing-track {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 1.3vw, 18px);
    color: #4A3728;
}

.now-playing-artist {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(13px, 1.1vw, 16px);
    color: rgba(74, 55, 40, 0.7);
}

.now-playing-empty {
    font-family: 'DM Mono', monospace;
    font-size: clamp(13px, 1.1vw, 16px);
    color: rgba(74, 55, 40, 0.4);
    letter-spacing: 0.04em;
}

.now-playing-progress {
    width: min(80%, 200px);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.np-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(74, 55, 40, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.np-bar-fill {
    height: 100%;
    width: 0%;
    background-color: #4A3728;
    border-radius: 3px;
    transition: width 500ms linear;
}

.np-times {
    display: flex;
    justify-content: space-between;
    font-family: 'DM Mono', monospace;
    font-size: clamp(10px, 0.9vw, 13px);
    color: rgba(74, 55, 40, 0.55);
}

/* ---- Private message board button ---- */

.private-board {
    position: relative;
    width: 100%;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 1.3vw, 20px);
    color: #4A3728;
    line-height: 1.4;
    text-align: center;
    background-color: #faedcb;
    border: 1px solid #c4a882;
    border-radius: 8px;
    padding: clamp(0.9rem, 1.8vw, 1.5rem) clamp(0.6rem, 1.4vw, 1.2rem);
    cursor: pointer;
    box-shadow: 3px 3px 12px rgba(0,0,0,0.12);
    transition: background-color 300ms, transform 200ms;
}

.private-board:hover {
    background-color: #E7D7B1;
    transform: translateY(-2px);
}

.private-board-dot {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: #c0392b;
    box-shadow: 0 0 0 2px #faedcb;
}

.private-board-dot.show {
    display: block;
}

/* ---- Private message overlays (visitor DM + admin inbox) ---- */

.dm-overlay,
.inbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(74, 55, 40, 0.35);
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.dm-modal,
.inbox-modal {
    display: flex;
    flex-direction: column;
    background-color: #faedcb;
    border: 1px solid #c4a882;
    border-radius: 10px;
    box-shadow: 8px 8px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

.dm-modal {
    width: min(90vw, 440px);
    height: min(80vh, 560px);
}

.inbox-modal {
    width: min(92vw, 780px);
    height: min(82vh, 600px);
}

.dm-header,
.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding: clamp(0.8rem, 1.6vw, 1.2rem) clamp(1rem, 2vw, 1.4rem);
    background-color: #c6def1;
    border-bottom: 1px solid #c4a882;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(15px, 1.5vw, 20px);
    color: #4A3728;
}

.dm-close,
.inbox-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #4A3728;
    cursor: pointer;
    padding: 0 0.3rem;
}

.dm-close:hover,
.inbox-close:hover {
    color: #000;
}

.dm-thread {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(0.8rem, 1.6vw, 1.2rem);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: none;
}

.dm-thread::-webkit-scrollbar {
    display: none;
}

.dm-empty,
.inbox-empty {
    margin: auto;
    font-family: 'DM Mono', monospace;
    font-size: clamp(13px, 1.1vw, 15px);
    color: rgba(74, 55, 40, 0.4);
    text-align: center;
    padding: 1rem;
}

.dm-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.dm-message.from-me {
    align-self: flex-end;
    align-items: flex-end;
}

.dm-message.from-admin {
    align-self: flex-start;
    align-items: flex-start;
}

.dm-bubble {
    padding: 0.5rem 0.8rem;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 1.2vw, 17px);
    color: #4A3728;
    line-height: 1.45;
    word-break: break-word;
}

.dm-message.from-me .dm-bubble {
    background-color: #c9e4de;
    border: 1px solid #a9ccc4;
    border-bottom-right-radius: 3px;
}

.dm-message.from-admin .dm-bubble {
    background-color: #ffffff;
    border: 1px solid rgba(196, 168, 130, 0.6);
    border-bottom-left-radius: 3px;
}

.dm-time {
    font-family: 'DM Mono', monospace;
    font-size: clamp(9px, 0.8vw, 11px);
    color: rgba(74, 55, 40, 0.4);
    margin-top: 0.15rem;
    padding: 0 0.3rem;
}

.dm-input-row,
.inbox-reply-row {
    display: flex;
    flex-shrink: 0;
    border-top: 1px solid #c4a882;
}

.dm-input,
.inbox-reply-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: clamp(0.7rem, 1.4vw, 1rem);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(16px, 1.3vw, 18px);
    color: #4A3728;
}

.dm-input:focus,
.inbox-reply-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.4);
}

.dm-send,
.inbox-send {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: clamp(13px, 1.1vw, 16px);
    color: #4A3728;
    background-color: #faedcb;
    border: none;
    border-left: 1px solid #c4a882;
    padding: 0 clamp(1rem, 2vw, 1.6rem);
    cursor: pointer;
    transition: background-color 300ms;
}

.dm-send:hover,
.inbox-send:hover {
    background-color: #E7D7B1;
}

/* ---- Admin inbox two-column body ---- */

.inbox-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 34% 1fr;
}

.inbox-threads {
    border-right: 1px solid #c4a882;
    overflow-y: auto;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
}

.inbox-threads::-webkit-scrollbar {
    display: none;
}

.inbox-thread {
    padding: clamp(0.7rem, 1.4vw, 1rem);
    border-bottom: 1px solid rgba(196, 168, 130, 0.4);
    cursor: pointer;
    transition: background-color 200ms;
}

.inbox-thread:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.inbox-thread.active {
    background-color: rgba(255, 255, 255, 0.65);
}

.inbox-thread-name {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(13px, 1.2vw, 16px);
    color: #8B6914;
}

.inbox-thread-preview {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(12px, 1vw, 14px);
    color: rgba(74, 55, 40, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.15rem;
}

.inbox-conversation {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.inbox-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(0.8rem, 1.6vw, 1.2rem);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: none;
}

.inbox-messages::-webkit-scrollbar {
    display: none;
}

/* ---- Mobile ---- */

@media (max-width: 768px) {
    .status-wrapper {
        width: 100%;
        height: 100dvh;
    }

    .home-btn {
        font-size: 2rem;
        padding: 0 5vw;
    }

    /* Three columns -> vertical stack: now-playing/counter strip on top,
       private board button, then the chat filling the rest. */
    .status-body {
        display: flex;
        flex-direction: column;
    }

    /* Side panel (counter + spotify) becomes a compact horizontal strip. */
    .side-panel {
        order: 1;
        flex-direction: row;
        border-left: none;
        border-bottom: 1px solid #c4a882;
        flex-shrink: 0;
    }

    .person-counter {
        border-bottom: none;
        border-right: 1px solid #c4a882;
        padding: 0.7rem 1rem;
        justify-content: center;
        gap: 0.1rem;
    }

    .person-count {
        font-size: clamp(24px, 7vw, 32px);
    }

    .person-count-phrase {
        font-size: clamp(12px, 3.2vw, 15px);
    }

    .now-playing-panel {
        flex-direction: row;
        align-items: center;
        gap: 0.7rem;
        padding: 0.7rem 1rem;
    }

    .side-label {
        display: none;
    }

    .now-playing {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0.7rem;
        padding-bottom: 0;
        text-align: left;
    }

    .now-playing-art {
        width: 48px;
        min-width: 48px;
    }

    /* The smoothly-animating progress bar takes too much room in a strip. */
    .now-playing-progress {
        display: none;
    }

    /* Board panel: drop the decorative label, keep just the private button. */
    .board-panel {
        order: 2;
        border-right: none;
        border-bottom: 1px solid #c4a882;
        padding: 0.7rem 1rem;
        flex-shrink: 0;
    }

    .board-label {
        display: none;
    }

    .main-panel {
        order: 3;
        flex: 1;
        min-height: 0;
    }

    /* Admin inbox: stack the threads list above the conversation. */
    .inbox-body {
        grid-template-columns: 1fr;
        grid-template-rows: 40% 1fr;
    }

    .inbox-threads {
        border-right: none;
        border-bottom: 1px solid #c4a882;
    }
}
