/* --- Navbar login form --- */
.navbar-login-form input[type="text"],
.navbar-login-form input[type="password"] {
    padding: 0.3rem 0.6rem;
    font-size: 0.95rem;
    border: 2px solid #2e1065;
    border-radius: 0;
    box-shadow: 2px 2px 0 #2e1065;
    margin-right: 0.3rem;
    background: #fff;
    color: #1e0a3c;
}

.navbar-login-form input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 2px 2px 0 #7c3aed;
}

.navbar-login-form .pure-button-primary {
    padding: 0.3rem 1rem;
    font-size: 0.95rem;
    border-radius: 0;
    box-shadow: 2px 2px 0 #2e1065;
    background: #7c3aed;
    color: #fff;
    border: 2px solid #2e1065;
    transition: box-shadow 0.1s, transform 0.1s;
}

.navbar-login-form .pure-button-primary:hover {
    background: #5b21b6;
    box-shadow: 1px 1px 0 #2e1065;
    transform: translate(1px, 1px);
}

/* =========================================================
   SyncTV — Custom Stylesheet
   1. Base
   2. Navbar
   3. Forms & Buttons (Pure CSS overrides)
   4. Modals
   5. Home page
   6. Room page
   7. Footer
   8. Error pages
   9. Responsive
   ========================================================= */


/* ── 1. Base ─────────────────────────────────────────────── */

html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #f5f3ff;
    color: #1e0a3c;
}

main {
    flex: 1;
    padding: 0.4rem 0.6rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Room page needs no padding so the layout doesn't overflow the viewport */
main:has(.room-layout) {
    padding: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Hide footer on the room page */
main:has(.room-layout)~.footer {
    display: none;
}


/* ── 2. Navbar ───────────────────────────────────────────── */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #6d28d9;
    color: #fff;
    border-bottom: 2px solid #2e1065;
    box-shadow: 0 4px 0 #2e1065;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.navbar a {
    color: #fff;
}

.navbar-item {
    font-size: 1.25rem;
    text-decoration: none;
}

.navbar-item strong {
    display: inline-block;
    border: 2px solid #000;
    box-shadow: 3px 3px 0 #000;
    padding: 0.1rem 0.5rem;
    background: #fff;
    color: #ff0000;
}

.navbar-username {
    font-weight: 600;
    color: #fff;
    padding: 0.5rem 1rem;
}

.search-section {
    position: relative;
}

.search-box {
    padding: 0.5rem 1rem;
    border: 2px solid #2e1065;
    border-radius: 0;
    font-size: 0.95rem;
    min-width: 250px;
    box-shadow: 4px 4px 0 #2e1065;
}

.search-box:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 4px 4px 0 #7c3aed;
}

.btn-login,
.btn-signup {
    padding: 0.5rem 1.5rem;
    border: 2px solid #2e1065;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 4px 4px 0 #2e1065;
    transition: box-shadow 0.1s, transform 0.1s;
}

.btn-login {
    background: white;
    color: #7c3aed !important;
}

.btn-login:hover {
    background: #ede9fe;
    box-shadow: 2px 2px 0 #2e1065;
    transform: translate(2px, 2px);
}

.btn-login:active {
    box-shadow: none;
    transform: translate(4px, 4px);
}

.btn-signup {
    background: #7c3aed;
    color: white !important;
    border-color: #2e1065;
}

.btn-signup:hover {
    background: #5b21b6;
    box-shadow: 2px 2px 0 #2e1065;
    transform: translate(2px, 2px);
}

.btn-signup:active {
    box-shadow: none;
    transform: translate(4px, 4px);
}

.btn-logout {
    padding: 0.5rem 1.5rem;
    background: #f14668;
    color: white;
    border: 2px solid #000;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 4px 4px 0 #000;
    transition: box-shadow 0.1s, transform 0.1s;
}

.btn-logout:hover {
    background: #ef2e4f;
    box-shadow: 2px 2px 0 #000;
    transform: translate(2px, 2px);
}

.btn-logout:active {
    box-shadow: none;
    transform: translate(4px, 4px);
}


/* ── 3. Forms & Buttons (Pure CSS overrides) ─────────────── */

.pure-button {
    border-radius: 0 !important;
}

.pure-form input[type="text"],
.pure-form input[type="email"],
.pure-form input[type="password"],
.pure-form input[type="search"],
.pure-form input[type="url"],
.pure-form textarea,
.pure-form select {
    border-radius: 0;
    border: 2px solid #2e1065;
    box-shadow: 3px 3px 0 #2e1065;
}

.pure-form input:focus,
.pure-form textarea:focus,
.pure-form select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 3px 3px 0 #7c3aed;
}


/* ── 4. Modals ───────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(46, 16, 101, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-overlay:target {
    display: flex;
}

.modal-box {
    background: #f5f3ff;
    border: 2px solid #2e1065;
    box-shadow: 8px 8px 0 #2e1065;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
    color: #7c3aed;
}

.modal-close:hover {
    color: #2e1065;
}

.modal-box h2 {
    margin: 0 0 1rem;
    color: #2e1065;
}

.modal-box .pure-form-stacked input {
    width: 100%;
    margin-bottom: 0.75rem;
    border: 2px solid #2e1065;
    box-shadow: 3px 3px 0 #2e1065;
}

.modal-box .pure-button-primary {
    width: 100%;
    margin-top: 0.5rem;
    background: #7c3aed;
    border: 2px solid #2e1065;
    box-shadow: 4px 4px 0 #2e1065;
    border-radius: 0;
    color: #fff;
    transition: box-shadow 0.1s, transform 0.1s;
}

.modal-box .pure-button-primary:hover {
    background: #5b21b6;
    box-shadow: 2px 2px 0 #2e1065;
    transform: translate(2px, 2px);
}

.modal-box .pure-button-primary:active {
    box-shadow: none;
    transform: translate(4px, 4px);
}

.modal-box p {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #1e0a3c;
}

.modal-box p a {
    color: #7c3aed;
    font-weight: 600;
}

.modal-box p a:hover {
    color: #2e1065;
}

.modal-error {
    background: #fee2e2;
    color: #7f1d1d;
    border: 2px solid #b91c1c;
    box-shadow: 4px 4px 0 #7f1d1d;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-weight: 700;
    font-size: 0.95rem;
}

.modal-error::before {
    content: "✕  ";
    font-weight: 900;
}


/* ── 5. Home page ────────────────────────────────────────── */

.landing-container {
    max-width: 480px;
    margin: 3rem auto;
    padding: 2rem;
    background: #f5f3ff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.login-prompt {
    text-align: center;
    padding: 2rem;
    background: #ede9fe;
    border: 2px solid #7c3aed;
    box-shadow: 6px 6px 0 #2e1065;
}

.login-prompt p {
    color: #363636;
    font-size: 1.1rem;
    margin: 0;
}

.signup-section {
    text-align: left;
    padding: 2rem;
    background: #ede9fe;
    border: 2px solid #2e1065;
    box-shadow: 6px 6px 0 #2e1065;
}

.signup-section p {
    color: #1e0a3c;
    font-size: 1rem;
    margin: 0;
}

.signup-heading {
    font-size: 1.4rem;
    font-weight: 900;
    color: #1e0a3c;
    margin: 0 0 0.5rem;
    border-bottom: 2px solid #2e1065;
    padding-bottom: 0.5rem;
}

.signup-section .pure-form-stacked label {
    font-weight: 700;
    color: #1e0a3c;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.signup-section .pure-form-stacked input {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #2e1065;
    border-radius: 0;
    box-shadow: 3px 3px 0 #2e1065;
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
    background: #fff;
    color: #1e0a3c;
    margin-bottom: 0.25rem;
}

.signup-section .pure-form-stacked input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 3px 3px 0 #7c3aed;
}

.signup-submit-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: #7c3aed;
    color: #fff;
    border: 2px solid #2e1065;
    border-radius: 0;
    box-shadow: 4px 4px 0 #2e1065;
    font-weight: 700;
    font-size: 1rem;
    transition: box-shadow 0.1s, transform 0.1s;
}

.signup-submit-btn:hover {
    background: #5b21b6;
    box-shadow: 2px 2px 0 #2e1065;
    transform: translate(2px, 2px);
}

.signup-submit-btn:active {
    box-shadow: none;
    transform: translate(4px, 4px);
}

.create-room-section {
    text-align: center;
    padding: 2rem;
    background: #ede9fe;
    border: 2px solid #2e1065;
    box-shadow: 6px 6px 0 #2e1065;
}

.create-room-section p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e0a3c;
    margin-bottom: 1rem;
}

.create-room-section input[type="text"] {
    padding: 0.5rem 1rem;
    border: 2px solid #2e1065;
    border-radius: 0;
    box-shadow: 3px 3px 0 #2e1065;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.create-room-section input[type="text"]:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 3px 3px 0 #7c3aed;
}

.create-room-btn {
    padding: 0.5rem 1.5rem;
    background: #7c3aed;
    color: white;
    border: 2px solid #2e1065;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 4px 4px 0 #2e1065;
    transition: box-shadow 0.1s, transform 0.1s;
}

.create-room-btn:hover {
    background: #5b21b6;
    box-shadow: 2px 2px 0 #2e1065;
    transform: translate(2px, 2px);
}

.create-room-btn:active {
    box-shadow: none;
    transform: translate(4px, 4px);
}


/* ── 6. Room page ────────────────────────────────────────── */

/* Two-column YouTube-style layout */
.room-layout {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.room-main {
    flex: 1 1 0;
    min-width: 0;
    overflow-y: auto;
}

/* Video player */
.video-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 56vh;
    background: #0f0f0f;
    border-bottom: 2px solid #2e1065;
    overflow: hidden;
    position: relative;
}

.empty-state-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: #0f0f0f;
    z-index: 5;
    pointer-events: none;
}

.empty-state-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.95rem;
    color: #a78bfa;
    font-weight: 600;
    opacity: 0.8;
    text-align: center;
    padding: 0 1.5rem;
}

.unmute-overlay {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(46, 16, 101, 0.9);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #7c3aed;
    box-shadow: 3px 3px 0 #7c3aed;
    z-index: 10;
    transition: background 0.15s;
}

.unmute-overlay:hover {
    background: rgba(124, 58, 237, 0.95);
}

.unmute-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.unmute-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.unmute-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
}

.unmute-hint {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.75;
    line-height: 1.2;
}

#player-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

/* Force YouTube iframe to fill its generated container */
#player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Room info bar (below video) */
.room-info {
    padding: 14px 20px 12px;
    background: #f5f3ff;
    border-bottom: 2px solid #2e1065;
}

.room-info-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.room-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e0a3c;
    margin: 0;
    line-height: 1.3;
}

.host-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background: #7c3aed;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #2e1065;
    box-shadow: 2px 2px 0 #2e1065;
    vertical-align: middle;
}

.room-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
    color: #5b21b6;
}

.room-meta-dot {
    opacity: 0.5;
}

.share-btn {
    padding: 0.4rem 1rem;
    background: #fff;
    color: #7c3aed;
    border: 2px solid #2e1065;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 3px 3px 0 #2e1065;
    transition: box-shadow 0.1s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}

.share-btn:hover {
    background: #ede9fe;
    box-shadow: 1px 1px 0 #2e1065;
    transform: translate(2px, 2px);
}

.share-btn:active {
    box-shadow: none;
    transform: translate(3px, 3px);
}

/* Video URL submit bar */
.video-url-input {
    position: relative;
    display: flex;
    background: #ede9fe;
    border: 2px solid #2e1065;
    box-shadow: 3px 3px 0 #2e1065;
    margin: 8px 0;
}

.video-url-input input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: none;
    border-right: 2px solid #2e1065;
    border-radius: 0;
    font-size: 0.95rem;
    background: #fff;
}

.video-url-input input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #7c3aed;
}

.video-url-input button {
    padding: 0.4rem 0.8rem;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.1s;
}

.video-url-input button:hover {
    background: #5b21b6;
}

/* Now playing info */
.now-playing-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
}

.now-playing-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.82rem;
    color: #606060;
}

/* Player controls */
.player-controls {
    display: flex;
    gap: 0;
    align-items: center;
    background: #1e0a3c;
    border-bottom: 2px solid #2e1065;
}

.player-ctrl-btn {
    padding: 0.45rem 1.2rem;
    background: #1e0a3c;
    color: #fff;
    border: none;
    border-right: 1px solid #2e1065;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.1s;
}

.player-ctrl-btn:hover {
    background: #7c3aed;
}

.player-ctrl-btn:active {
    background: #5b21b6;
}

#play-pause-btn {
    min-width: 3rem;
    font-size: 1.15rem;
}

.player-time {
    margin-left: auto;
    padding: 0 14px;
    color: #d8b4fe;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Viewer time bar (non-host, mirrors player-controls bar) */
.viewer-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.4rem 14px;
    background: #1e0a3c;
    border-bottom: 2px solid #2e1065;
}

.viewer-bar-label {
    color: #a78bfa;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.viewer-time {
    color: #d8b4fe;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Volume control */
.vol-ctrl {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    flex-shrink: 0;
}

.vol-btn {
    background: none;
    border: none;
    color: #d8b4fe;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.1s;
}

.vol-btn:hover {
    color: #fff;
}

.vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 76px;
    height: 4px;
    background: linear-gradient(to right, #a78bfa 0%, #a78bfa 100%, #4c1d95 100%);
    outline: none;
    cursor: pointer;
    border-radius: 0;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px;
    height: 11px;
    background: #d8b4fe;
    border: 2px solid #2e1065;
    border-radius: 0;
    cursor: pointer;
}

.vol-slider::-moz-range-thumb {
    width: 11px;
    height: 11px;
    background: #d8b4fe;
    border: 2px solid #2e1065;
    border-radius: 0;
    cursor: pointer;
    box-shadow: none;
}

.sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sync-ok {
    background: #34d399;
}

.sync-off {
    background: #f87171;
}

.sync-label {
    color: #d8b4fe;
    white-space: nowrap;
}

.sync-btn {
    padding: 1px 8px;
    background: transparent;
    color: #a78bfa;
    border: 1px solid #7c3aed;
    border-radius: 0;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}

.sync-btn:hover {
    background: #7c3aed;
    color: #fff;
}

/* Approve button (host actions) */
.btn-approve {
    padding: 0.3rem 0.8rem;
    border: 2px solid #2e1065;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 3px 3px 0 #2e1065;
    transition: box-shadow 0.1s, transform 0.1s;
}

.btn-approve:hover {
    box-shadow: 1px 1px 0 #2e1065;
    transform: translate(2px, 2px);
}

.btn-approve:active {
    box-shadow: none;
    transform: translate(3px, 3px);
}

/* Request list items (pending) */
.request-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #d8b4fe;
    background: #fff;
}

.request-thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #2e1065;
}

.request-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.request-label {
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    color: #1e0a3c;
}

.pending-label {
    font-size: 0.75rem;
    color: #5b21b6;
    font-weight: 600;
}

.vote-badge {
    display: inline-block;
    padding: 1px 7px;
    background: #7c3aed;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid #2e1065;
    box-shadow: 2px 2px 0 #2e1065;
    align-self: flex-start;
}

.host-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Playlist panel (right column) */
.playlist-panel {
    width: 320px;
    flex-shrink: 0;
    border-left: 2px solid #2e1065;
    background: #ede9fe;
    height: calc(100vh - 60px);
    overflow-y: auto;
    position: sticky;
    top: 60px;
}

.playlist-heading {
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #1e0a3c;
    border-bottom: 2px solid #2e1065;
    background: #ede9fe;
    margin: 0;
    position: sticky;
    top: 0;
}

.playlist-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #d8b4fe;
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
    box-sizing: border-box;
}

.playlist-item:hover {
    background: #f5f3ff;
}

.playlist-item.is-current {
    background: #ede9fe;
    border-left: 3px solid #7c3aed;
}

/* Inline delete button (host only) */
.pl-delete-btn {
    flex-shrink: 0;
    margin-left: auto;
    padding: 2px 6px;
    background: transparent;
    color: #a78bfa;
    border: 1px solid transparent;
    border-radius: 0;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s, background 0.1s;
    white-space: nowrap;
}

.playlist-item:hover .pl-delete-btn {
    opacity: 1;
}

.pl-delete-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
}

/* Armed (first-click) state */
.pl-delete-btn--armed {
    opacity: 1 !important;
    background: #ef4444;
    color: #fff !important;
    border-color: #991b1b !important;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
}

.drag-handle {
    cursor: grab;
    color: #a78bfa;
    font-size: 0.9rem;
    padding: 0 6px 0 0;
    flex-shrink: 0;
    user-select: none;
    align-self: center;
    line-height: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.playlist-item.dragging {
    opacity: 0.35;
}

.playlist-item.drag-over {
    box-shadow: inset 0 2px 0 #7c3aed;
    background: #ede9fe;
}

.playlist-thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    flex-shrink: 0;
}

.playlist-card {
    flex: 1;
    min-width: 0;
}

.playlist-title {
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    color: #1e0a3c;
}

.playlist-duration {
    font-size: 0.75rem;
    color: #5b21b6;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}



/* ── 7. Footer ───────────────────────────────────────────── */

.footer {
    text-align: center;
    background-color: #ede9fe;
    color: #1e0a3c;
    border-top: 2px solid #2e1065;
    box-shadow: 0 -4px 0 #2e1065;
    padding: 1.5rem 1rem;
}

.footer a {
    color: #7c3aed;
}


/* ── 8. Error pages ──────────────────────────────────────── */

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #f5f3ff;
    text-align: center;
    padding: 2rem;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 900;
    color: #2e1065;
    margin: 0;
    line-height: 1;
    text-shadow: 6px 6px 0 #7c3aed;
}

.error-page p {
    font-size: 1.1rem;
    color: #1e0a3c;
    margin: 0;
}

.error-page .pure-button {
    border: 2px solid #2e1065;
    box-shadow: 4px 4px 0 #2e1065;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: box-shadow 0.1s, transform 0.1s;
}

.error-page .pure-button:hover {
    box-shadow: 2px 2px 0 #2e1065;
    transform: translate(2px, 2px);
}


/* ── 9. Responsive ───────────────────────────────────────── */

@media (max-width: 1280px) {
    .playlist-panel {
        width: 280px;
    }
}

@media (max-width: 1024px) {
    .playlist-panel {
        width: 240px;
    }
}

@media (max-width: 768px) {

    /* Allow body to grow taller than viewport so the page can scroll */
    html,
    body {
        height: auto;
        min-height: 100%;
    }

    .room-layout {
        height: auto;
        overflow: visible;
    }

    .navbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .navbar-right {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .search-box {
        min-width: 200px;
    }

    .room-layout {
        flex-direction: column;
    }

    .room-main {
        width: 100%;
        overflow-y: visible;
    }

    .playlist-panel {
        width: 100%;
        height: auto;
        max-height: none;
        overflow-y: visible;
        position: static;
        border-left: none;
        border-top: 2px solid #2e1065;
    }

    /* Re-enable page scrolling — the stacked layout scrolls as a normal page */
    main {
        padding: 0.4rem;
    }

    /* Override the desktop overflow:hidden with matching specificity */
    main:has(.room-layout) {
        overflow: visible;
    }
}

/* ── Phone: ≤ 599px — fixed bars fit side-by-side ───────── */

@media (max-width: 599px) {
    .participant-bar {
        right: 0;
        width: calc(50vw - 6px);
    }

    .participant-bar-header {
        font-size: 0.75rem;
        padding: 7px 8px;
        gap: 5px;
    }

    .participant-bar .panel-body {
        max-height: 280px;
    }

    .qr-bar {
        left: 0;
        width: calc(50vw - 6px);
    }

    .qr-bar-header {
        font-size: 0.75rem;
        padding: 7px 8px;
        gap: 5px;
    }

    .qr-panel-body {
        max-height: 280px;
    }

    /* QR canvas responsive inside narrow panel */
    #qr-code-container canvas,
    #qr-code-container img {
        max-width: 100%;
        height: auto;
    }
}

/* ── Phone: ≤ 480px — general phone fixes ───────────────── */

@media (max-width: 480px) {

    /* Navbar login form stacks vertically */
    .navbar-login-form {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 0.4rem !important;
    }

    .navbar-login-form input[type="text"],
    .navbar-login-form input[type="password"] {
        max-width: none;
        width: 100%;
        margin-right: 0;
    }

    .navbar-login-form .pure-button-primary {
        width: 100%;
    }

    /* Landing page — reduce top spacing */
    .landing-container {
        margin: 1.5rem auto;
        padding: 1.2rem;
    }

    /* Modals — full width on phones */
    .modal-box {
        max-width: none;
        width: calc(100% - 2rem);
        margin: 1rem;
        padding: 1.4rem;
        box-shadow: 4px 4px 0 #2e1065;
    }

    /* Room sections — tighter padding */
    .room-info {
        padding: 10px 12px;
    }

    .video-url-input {
        padding: 10px 12px;
    }

    .request-section {
        padding: 10px 12px;
    }


    /* Player controls — allow wrapping on very small screens */
    .player-controls {
        flex-wrap: wrap;
    }

    .player-ctrl-btn {
        min-width: 2.4rem;
        padding: 0.45rem 0.8rem;
    }

    /* Volume slider — shrink slightly */
    .vol-slider {
        width: 56px;
    }

    /* Search box full width */
    .search-box {
        min-width: 0;
        flex: 1;
    }
}

.autoplay-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5b21b6;
    cursor: pointer;
}

.playlist-heading-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.yt-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: #1e0a3c;
    border: 2px solid #2e1065;
    box-shadow: 2px 2px 0 #2e1065;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, box-shadow 0.1s, transform 0.1s;
}

.yt-open-btn:hover {
    background: #7c3aed;
    box-shadow: 1px 1px 0 #2e1065;
    transform: translate(1px, 1px);
}

.playlist-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 2px solid #2e1065;
    background: #ede9fe;
    position: sticky;
    top: 0;
}

.playlist-heading-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist-total-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #5b21b6;
    background: #fff;
    padding: 2px 8px;
    border: 1px solid #2e1065;
    box-shadow: 1px 1px 0 #2e1065;
    font-variant-numeric: tabular-nums;
}

/* Non-host: pointer for clickable playlist items */
body:not(.is-host) .playlist-item {
    cursor: pointer;
}

/* ── Toast notifications ────────────────────────────────── */

#toast-container {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 18px;
    border: 2px solid #2e1065;
    box-shadow: 3px 3px 0 #2e1065;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e0a3c;
    pointer-events: auto;
    animation: toast-in 0.25s ease-out, toast-out 0.3s 2.7s ease-in forwards;
    max-width: 340px;
}

.toast.success {
    background: #d1fae5;
    border-color: #065f46;
    box-shadow: 3px 3px 0 #065f46;
    color: #065f46;
}

.toast.error {
    background: #fee2e2;
    border-color: #991b1b;
    box-shadow: 3px 3px 0 #991b1b;
    color: #991b1b;
}

.toast.info {
    background: #ede9fe;
    border-color: #5b21b6;
    box-shadow: 3px 3px 0 #5b21b6;
    color: #5b21b6;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ── HTMX request indicator ─────────────────────────────── */

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request button[type="submit"] {
    opacity: 0.6;
    pointer-events: none;
}

.submit-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Participant bar (Facebook chat style) ──────────────── */

.participant-bar {
    position: fixed;
    bottom: 0;
    right: 24px;
    width: 260px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.participant-bar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #7c3aed;
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
    border: 2px solid #2e1065;
    box-shadow: -3px -3px 0 #2e1065;
}

.participant-bar-header:hover {
    background: #6d28d9;
}

.participant-bar-toggle {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.participant-bar.open .participant-bar-toggle {
    transform: rotate(180deg);
}

/* Panel body — hidden by default, revealed when open */
.participant-bar .panel-body {
    display: none;
    flex-direction: column;
    max-height: 380px;
    background: #fff;
    border: 2px solid #2e1065;
    border-bottom: none;
    box-shadow: -3px 0 0 #2e1065;
    overflow: hidden;
}

.participant-bar.open .panel-body {
    display: flex;
}

/* Tab strip */
.panel-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 2px solid #2e1065;
}

.panel-tab {
    flex: 1;
    padding: 7px 10px;
    background: #1e0a3c;
    color: #a78bfa;
    border: none;
    border-right: 1px solid #2e1065;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.panel-tab:last-child {
    border-right: none;
}

.panel-tab.active,
.panel-tab:hover {
    background: #7c3aed;
    color: #fff;
}

/* Tab content areas */
.tab-content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#tab-chat {
    flex-direction: column;
}

/* Chat messages */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 80px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 0.82rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-sender {
    font-size: 0.75rem;
    font-weight: 700;
    color: #7c3aed;
}

.chat-message--host .chat-sender {
    color: #f59e0b;
}

.chat-message--self .chat-sender {
    color: #2e1065;
}

.chat-text {
    color: #1e0a3c;
}

/* Chat input bar */
.chat-input-bar {
    display: flex;
    flex-shrink: 0;
    border-top: 2px solid #2e1065;
    background: #ede9fe;
}

.chat-input-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 10px;
    font-size: 0.85rem;
    color: #1e0a3c;
    outline: none;
    min-width: 0;
}

.chat-input-bar input::placeholder {
    color: #a78bfa;
}

.chat-input-bar button {
    padding: 8px 14px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-left: 2px solid #2e1065;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.1s;
}

.chat-input-bar button:hover {
    background: #6d28d9;
}

/* Unread badge on Chat tab */
.chat-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
}

.chat-new-dot {
    color: #ef4444;
    font-size: 0.7rem;
    animation: chat-pulse 1.5s infinite;
}

@keyframes chat-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Participant list (inside tab-content, no longer needs to hide itself) */
.participant-list {
    display: block;
    background: #fff;
}

/* Moderation buttons */
.participant-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.kick-btn,
.block-btn {
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.1s;
}

.kick-btn {
    background: transparent;
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.kick-btn:hover {
    background: #f59e0b;
    color: #fff;
}

.block-btn {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.block-btn:hover {
    background: #ef4444;
    color: #fff;
}

.participant-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid #ede9fe;
    font-size: 0.85rem;
}

.participant-entry:last-child {
    border-bottom: none;
}

.participant-left {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.participant-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    border: 1px solid #166534;
    margin-top: 5px;
}

.participant-info {
    flex: 1;
    min-width: 0;
}

.participant-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.participant-name {
    color: #1e0a3c;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-watching {
    font-size: 0.72rem;
    color: #7c3aed;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.participant-host-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: #7c3aed;
    color: #fff;
    padding: 1px 6px;
    border: 1px solid #2e1065;
    box-shadow: 1px 1px 0 #2e1065;
    flex-shrink: 0;
}

.welcome-landing {
    text-align: center;
    margin-bottom: 2.5rem;
}

.welcome-landing h1 {
    font-size: 2.4rem;
    font-weight: 900;
    color: #1e0a3c;
    margin-bottom: 0.75rem;
}

.welcome-landing .lead {
    font-size: 1.1rem;
    color: #5b21b6;
    font-weight: 500;
    margin-bottom: 0;
}

.card {
    max-width: 420px;
    margin: 0 auto 2rem auto;
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    background: #ede9fe;
    border: 2px solid #2e1065;
    box-shadow: 8px 8px 0 #2e1065;
    border-radius: 0;
}

.lead {
    font-size: 1.2rem;
    color: #444;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.subtext {
    font-size: 1rem;
    color: #5b21b6;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 500;
}

.login-link {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #d8b4fe;
    font-size: 0.95rem;
    color: #1e0a3c;
}

.tos-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 1rem 0 0.5rem;
    font-size: 0.88rem;
    color: #1e0a3c;
    line-height: 1.4;
}

.tos-check input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #7c3aed;
    border: 2px solid #2e1065;
    box-shadow: none;
}

.tos-check a {
    color: #7c3aed;
    font-weight: 600;
    text-decoration: underline;
}

.login-link a {
    color: #7c3aed;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}

.login-link a:hover {
    color: #2e1065;
    text-decoration: underline;
}


/* ── 10. Profile page ────────────────────────────────────── */

.navbar-profile-link {
    font-weight: 700;
    color: #fff;
    padding: 0.3rem 0.8rem;
    border: 2px solid #fff;
    box-shadow: 2px 2px 0 #2e1065;
    text-decoration: none;
    font-size: 0.9rem;
    transition: box-shadow 0.1s, transform 0.1s, background 0.1s;
}

.navbar-profile-link:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 1px 1px 0 #2e1065;
    transform: translate(1px, 1px);
}

.profile-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 0 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-card {
    background: #ede9fe;
    border: 2px solid #2e1065;
    box-shadow: 6px 6px 0 #2e1065;
    padding: 1.75rem 2rem;
}

.profile-card-heading {
    font-size: 1.15rem;
    font-weight: 900;
    color: #1e0a3c;
    margin: 0 0 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #2e1065;
}

/* Avatar */
.avatar-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.avatar-wrapper {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border: 3px solid #2e1065;
    box-shadow: 4px 4px 0 #2e1065;
    overflow: hidden;
    background: #7c3aed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-initials {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    line-height: 1;
}

.avatar-upload {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.avatar-upload-label {
    font-weight: 700;
    color: #1e0a3c;
    font-size: 0.9rem;
    cursor: pointer;
}

.avatar-upload input[type="file"] {
    font-size: 0.85rem;
    color: #1e0a3c;
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

.avatar-hint {
    font-size: 0.78rem;
    color: #5b21b6;
}

/* Form inside profile card */
.profile-card .pure-form-stacked label {
    font-weight: 700;
    color: #1e0a3c;
    font-size: 0.88rem;
    margin-top: 0.75rem;
    display: block;
}

.profile-card .pure-form-stacked input[type="text"],
.profile-card .pure-form-stacked input[type="email"],
.profile-card .pure-form-stacked input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #2e1065;
    border-radius: 0;
    box-shadow: 3px 3px 0 #2e1065;
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
    background: #fff;
    color: #1e0a3c;
    margin-bottom: 0.1rem;
}

.profile-card .pure-form-stacked input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 3px 3px 0 #7c3aed;
}

.optional-hint {
    font-size: 0.78rem;
    font-weight: 400;
    color: #5b21b6;
}

.profile-save-btn {
    margin-top: 1.25rem;
    width: 100%;
    padding: 0.5rem 1.5rem;
    background: #7c3aed;
    color: #fff;
    border: 2px solid #2e1065;
    border-radius: 0;
    box-shadow: 4px 4px 0 #2e1065;
    font-weight: 700;
    font-size: 1rem;
    transition: box-shadow 0.1s, transform 0.1s, opacity 0.15s;
}

.profile-save-btn:disabled {
    background: #c4b5fd;
    border-color: #a78bfa;
    box-shadow: none;
    color: #ede9fe;
    cursor: not-allowed;
    opacity: 0.6;
}

.profile-save-btn:not(:disabled):hover {
    background: #5b21b6;
    box-shadow: 2px 2px 0 #2e1065;
    transform: translate(2px, 2px);
}

.profile-save-btn:not(:disabled):active {
    box-shadow: none;
    transform: translate(4px, 4px);
}

/* Alerts */
.profile-alert {
    padding: 0.75rem 1rem;
    border: 2px solid;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 3px 3px 0;
}

.profile-alert-success {
    background: #d1fae5;
    border-color: #065f46;
    box-shadow-color: #065f46;
    box-shadow: 3px 3px 0 #065f46;
    color: #065f46;
}

.profile-alert-error {
    background: #fee2e2;
    border-color: #991b1b;
    box-shadow: 3px 3px 0 #991b1b;
    color: #991b1b;
}

/* Room grid */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.room-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border: 2px solid #2e1065;
    box-shadow: 4px 4px 0 #2e1065;
    padding: 1rem;
    transition: box-shadow 0.1s, transform 0.1s;
}

.room-card:hover {
    box-shadow: 2px 2px 0 #2e1065;
    transform: translate(2px, 2px);
}

.room-card:active {
    box-shadow: none;
    transform: translate(4px, 4px);
}

.room-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1e0a3c;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-card-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.live-badge {
    display: inline-block;
    padding: 1px 8px;
    background: #7c3aed;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border: 2px solid #2e1065;
    box-shadow: 2px 2px 0 #2e1065;
}

.now-playing-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #065f46;
    padding: 1px 6px;
}

.now-playing-tag.empty {
    color: #5b21b6;
    background: #ede9fe;
    border-color: #7c3aed;
}

.room-card-id {
    font-size: 0.72rem;
    color: #5b21b6;
    font-variant-numeric: tabular-nums;
}

.room-card-playlist {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #5b21b6;
    margin-top: 0.25rem;
}

.playlist-sep {
    opacity: 0.5;
}

.playlist-duration {
    font-variant-numeric: tabular-nums;
}

.profile-empty {
    color: #5b21b6;
    font-size: 0.95rem;
}

.profile-empty a {
    color: #7c3aed;
    font-weight: 600;
}

/* Danger zone — compact, collapsed by default */
.danger-zone {
    background: #fff;
    border-color: #991b1b;
    box-shadow: 4px 4px 0 #991b1b;
    padding: 0;
}

.danger-collapse {
    width: 100%;
}

.danger-burger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #991b1b;
}

.danger-burger::-webkit-details-marker {
    display: none;
}

.burger-icon {
    font-size: 1rem;
    line-height: 1;
}

.danger-content {
    padding: 0 1rem 0.9rem 1rem;
    border-top: 1px solid #fca5a5;
}

.danger-desc {
    font-size: 0.85rem;
    color: #7f1d1d;
    margin: 0.6rem 0;
}

.danger-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #7f1d1d;
    margin-bottom: 0.35rem;
}

.danger-email-input {
    width: 100%;
    padding: 0.35rem 0.6rem;
    border: 2px solid #991b1b;
    border-radius: 0;
    font-size: 0.88rem;
    margin-bottom: 0.6rem;
    box-sizing: border-box;
}

.danger-delete-btn {
    padding: 0.35rem 1rem;
    background: #dc2626;
    color: #fff;
    border: 2px solid #7f1d1d;
    border-radius: 0;
    box-shadow: 3px 3px 0 #7f1d1d;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: box-shadow 0.1s, transform 0.1s;
}

.danger-delete-btn:hover {
    background: #b91c1c;
    box-shadow: 1px 1px 0 #7f1d1d;
    transform: translate(2px, 2px);
}

/* Room card wrap — link + inline delete toggle */
.room-card-wrap {
    display: flex;
    flex-direction: column;
    border: 2px solid #2e1065;
    box-shadow: 6px 6px 0 #2e1065;
}

.room-card-wrap .room-card {
    border: none;
    box-shadow: none;
    border-bottom: 1px solid #ede9fe;
}

.room-del-toggle {
    display: block;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    color: #991b1b;
    cursor: pointer;
    user-select: none;
    list-style: none;
    background: #fff5f5;
}

.room-del-toggle::-webkit-details-marker {
    display: none;
}

.room-del-form {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.4rem 0.75rem 0.5rem;
    background: #fff5f5;
    flex-wrap: wrap;
    border-top: 1px solid #fca5a5;
}

.room-del-input {
    flex: 1;
    min-width: 0;
    padding: 0.28rem 0.5rem;
    border: 2px solid #991b1b;
    border-radius: 0;
    font-size: 0.82rem;
}

.room-del-btn {
    padding: 0.28rem 0.75rem;
    background: #dc2626;
    color: #fff;
    border: 2px solid #7f1d1d;
    border-radius: 0;
    box-shadow: 2px 2px 0 #7f1d1d;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: box-shadow 0.1s, transform 0.1s;
}

.room-del-btn:hover {
    background: #b91c1c;
    box-shadow: none;
    transform: translate(2px, 2px);
}

/* ── YouTube search spinner ──────────────────────────────── */
.search-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #a78bfa;
    border-top-color: #7c3aed;
    border-radius: 50%;
    flex-shrink: 0;
    animation: search-spin 0.65s linear infinite;
}

@keyframes search-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── YouTube search dropdown ─────────────────────────────── */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #1e0a3c;
    border: 2px solid #7c3aed;
    box-shadow: 4px 4px 0 #4c1d95;
    max-height: 320px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-bottom: 1px solid #2e1065;
    transition: background 0.1s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #2e1065;
}

.search-result-thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #4c1d95;
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.search-result-title {
    font-size: 0.82rem;
    color: #e9d5ff;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-channel {
    font-size: 0.72rem;
    color: #a78bfa;
}

/* ── About page ──────────────────────────────────────────── */
.about-page {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.about-hero {
    margin-bottom: 2.5rem;
}

.about-hero h1 {
    font-size: 2rem;
    font-weight: 900;
    color: #1e0a3c;
    margin-bottom: 0.5rem;
}

.about-lead {
    font-size: 1.05rem;
    color: #5b21b6;
    font-weight: 500;
    line-height: 1.6;
}

.about-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #ede9fe;
}

.about-section:last-child {
    border-bottom: none;
}

.about-section h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e0a3c;
    margin-bottom: 0.75rem;
}

.about-section p,
.about-section li {
    font-size: 0.95rem;
    color: #3b0764;
    line-height: 1.7;
}

.about-list {
    padding-left: 1.4rem;
    margin: 0;
}

.about-list li {
    margin-bottom: 0.4rem;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    border: 2px solid #2e1065;
    background: #faf5ff;
}

.faq-item summary {
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e0a3c;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: '▶';
    font-size: 0.6rem;
    color: #7c3aed;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.faq-item[open] summary::before {
    transform: rotate(90deg);
}

.faq-item[open] summary {
    border-bottom: 1px solid #ede9fe;
}

.faq-item p {
    margin: 0;
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    color: #3b0764;
    line-height: 1.6;
}

.about-section a {
    color: #7c3aed;
    font-weight: 600;
    text-decoration: underline;
}

/* ── Legal pages (ToS / Privacy) ─────────────────────────── */
.legal-page {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.legal-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid #2e1065;
}

.legal-header h1 {
    font-size: 2rem;
    font-weight: 900;
    color: #1e0a3c;
    margin-bottom: 0.4rem;
}

.legal-meta {
    font-size: 0.82rem;
    color: #7c3aed;
    font-weight: 600;
}

.legal-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid #ede9fe;
}

.legal-section:last-of-type {
    border-bottom: none;
}

.legal-section h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e0a3c;
    margin-bottom: 0.6rem;
}

.legal-section h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #5b21b6;
    margin: 1rem 0 0.4rem;
}

.legal-section p,
.legal-section li,
.legal-section address {
    font-size: 0.9rem;
    color: #3b0764;
    line-height: 1.7;
}

.legal-list {
    padding-left: 1.4rem;
    margin: 0.4rem 0;
}

.legal-list li {
    margin-bottom: 0.35rem;
}

.legal-address {
    font-style: normal;
    background: #faf5ff;
    border-left: 3px solid #7c3aed;
    padding: 0.6rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.88rem;
    line-height: 1.8;
}

.legal-section a {
    color: #7c3aed;
    font-weight: 600;
    text-decoration: underline;
}

.legal-footer-note {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #5b21b6;
}

/* ── QR Code bar (bottom-left, mirrors participant-bar) ─── */

.qr-bar {
    position: fixed;
    bottom: 0;
    left: 24px;
    width: 220px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.qr-bar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #7c3aed;
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
    border: 2px solid #2e1065;
    box-shadow: 3px -3px 0 #2e1065;
}

.qr-bar-header:hover {
    background: #6d28d9;
}

.qr-bar-header .qr-bar-toggle {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.qr-bar.open .qr-bar-toggle {
    transform: rotate(180deg);
}

.qr-panel-body {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px 12px;
    background: #fff;
    border: 2px solid #2e1065;
    border-bottom: none;
    box-shadow: 3px 0 0 #2e1065;
}

.qr-bar.open .qr-panel-body {
    display: flex;
}

.qr-room-url {
    font-size: 0.7rem;
    color: #5b21b6;
    word-break: break-all;
    text-align: center;
    margin: 0;
    line-height: 1.4;
}