:root {
    --bg: #f3ede2;
    --bg-strong: #e8d8be;
    --panel: #fffaf4;
    --text: #1d2939;
    --muted: #667085;
    --line: #e7d9c5;
    --primary: #b93816;
    --primary-dark: #7d2410;
    --secondary: #174c63;
    --success: #0f766e;
    --warning: #b45309;
    --error: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 196, 92, 0.45), transparent 26%),
        linear-gradient(135deg, var(--bg) 0%, var(--bg-strong) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: rgba(255, 250, 244, 0.88);
    border-bottom: 1px solid rgba(125, 36, 16, 0.08);
    backdrop-filter: blur(10px);
}

.top-link,
.inline-link {
    color: var(--secondary);
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff4db;
    color: var(--warning);
    font-size: 0.9rem;
    font-weight: 700;
}

.status-pill.is-online {
    background: #d1fae5;
    color: #065f46;
}

.status-pill.is-offline {
    background: #fee2e2;
    color: #991b1b;
}

.landing-shell,
.gallery-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 40px;
}

.landing-shell {
    min-height: calc(100vh - 76px);
    display: grid;
    place-items: center;
}

.landing-card,
.panel {
    background: rgba(255, 250, 244, 0.92);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(29, 41, 57, 0.12);
}

.landing-card {
    width: min(760px, 100%);
    padding: 40px;
}

.eyebrow {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ffedd5;
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 700;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    margin-top: 18px;
    font-size: clamp(2.6rem, 5vw, 4.4rem);
    line-height: 0.98;
}

.lead,
.panel-text,
.muted,
.video-item span {
    color: var(--muted);
}

.player-note {
    margin-top: 10px;
    max-width: 560px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.lead {
    margin-top: 16px;
    font-size: 1.08rem;
    line-height: 1.75;
}

.feature-list {
    margin: 22px 0 0;
    padding-left: 20px;
    line-height: 1.9;
}

.auth-box {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.switcher,
.auth-form,
.video-form,
.player-actions,
.filter-row,
.brand-row,
.nav-row {
    display: flex;
    gap: 12px;
}

.switcher,
.auth-form,
.video-form {
    flex-direction: column;
}

.form-toggle {
    margin-top: 18px;
    width: fit-content;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.auth-form h2 {
    margin-bottom: 4px;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
}

button,
.filter-btn,
.whats-btn {
    border: 0;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
}

.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, #de5a1f 100%);
}

.secondary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--secondary) 0%, #236b89 100%);
}

.ghost-btn,
.filter-btn {
    color: var(--secondary);
    background: #eef4f6;
}

.filter-btn.is-active {
    color: #fff;
    background: var(--secondary);
}

.whats-btn {
    color: #fff;
    background: #1f9d55;
}

.full {
    width: 100%;
}

.is-hidden {
    display: none;
}

.message-stack {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.message {
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 700;
}

.message-success {
    color: #065f46;
    background: #d1fae5;
}

.message-warning {
    color: #92400e;
    background: #fef3c7;
}

.message-error {
    color: #991b1b;
    background: #fee2e2;
}

.gallery-shell {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 24px;
}

.main-column,
.side-column {
    display: grid;
    gap: 18px;
    align-content: start;
}

.panel {
    padding: 24px;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
}

.video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.video-frame.is-pinned {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: min(360px, calc(100vw - 24px));
    z-index: 20;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.player-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
}

.player-link-box {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.player-link-text {
    overflow-wrap: anywhere;
    font-size: 0.95rem;
}

.playlist-head,
.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.video-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.video-item {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    min-height: 86px;
    height: 86px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    transform-origin: center;
}

.video-item:hover {
    border-color: rgba(23, 76, 99, 0.32);
    box-shadow: 0 10px 22px rgba(29, 41, 57, 0.12);
    animation: card-shake 0.28s linear 1;
}

.video-item.is-current {
    border-color: var(--secondary);
    background: #eef4f6;
}

@keyframes card-shake {
    0% { transform: translateX(0) rotate(0deg); }
    20% { transform: translateX(-1px) rotate(-0.4deg); }
    40% { transform: translateX(1.5px) rotate(0.4deg); }
    60% { transform: translateX(-1px) rotate(-0.3deg); }
    80% { transform: translateX(1px) rotate(0.3deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

.video-item img {
    width: 112px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
}

.video-item-body {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.video-item-title {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.video-item-meta {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.empty-state {
    padding: 24px 4px;
}

@media (max-width: 900px) {
    .gallery-shell {
        grid-template-columns: 1fr;
    }

    .player-meta {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .landing-card,
    .panel {
        padding: 20px;
        border-radius: 20px;
    }

    .topbar {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }

    .video-item {
        grid-template-columns: 96px 1fr;
        min-height: 78px;
        height: 78px;
    }

    .video-item img {
        width: 96px;
        height: 56px;
    }
}
