:root {
    --videos-card: rgba(3, 16, 25, 0.82);
    --videos-line: rgba(139, 225, 248, 0.2);
    --videos-gold: #e8bd68;
}

body.videos-page {
    min-height: 100vh;
    background: #020a10;
    overflow-x: hidden;
}

.videos-page::before {
    background:
        radial-gradient(circle at 49% 8%, rgba(99, 222, 255, 0.16), transparent 33%),
        linear-gradient(180deg, rgba(1, 8, 14, 0.08), rgba(1, 7, 12, 0.36) 55%, rgba(1, 5, 9, 0.74));
}

.videos-page::after {
    background:
        linear-gradient(90deg, rgba(1, 6, 10, 0.42), rgba(1, 7, 12, 0.05) 30%, rgba(1, 7, 12, 0.08) 68%, rgba(1, 6, 10, 0.5)),
        radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.12) 62%, rgba(0, 0, 0, 0.52) 100%);
}

.videos-page .site-wallpaper {
    background-image: url("/assets/kraken-unbound-mermaid-wreck-wallpaper.png");
    background-position: center center;
    filter: saturate(1.02) contrast(1.06) brightness(0.78);
}

.videos-page .aurelia-background {
    opacity: 0.62;
    filter: brightness(1.1) contrast(1.08) saturate(1.04) drop-shadow(0 0 28px rgba(99, 222, 255, 0.28));
}

.videos-page .depth-scene {
    z-index: 1;
}

.videos-topbar,
.videos-shell,
.videos-footer {
    position: relative;
    z-index: 5;
}

.videos-topbar {
    width: min(1320px, calc(100% - 36px));
    margin: 0 auto;
    padding: 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.back-link,
.manage-toggle,
.panel-close {
    border: 1px solid var(--videos-line);
    background: rgba(3, 15, 24, 0.64);
    color: #c9edf7;
    border-radius: 999px;
    backdrop-filter: blur(14px);
}

.back-link {
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 700;
}

.manage-toggle {
    padding: 10px 17px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.back-link:hover,
.manage-toggle:hover,
.manage-toggle[aria-expanded="true"] {
    color: #fff;
    border-color: rgba(111, 226, 255, 0.72);
    box-shadow: 0 0 24px rgba(84, 214, 246, 0.2);
}

.videos-shell {
    width: min(1320px, calc(100% - 36px));
    margin: 0 auto;
    padding: clamp(10px, 2vw, 24px) 0 52px;
}

.videos-hero {
    width: min(760px, 100%);
    margin: 0 auto clamp(24px, 3vw, 38px);
    text-align: center;
    text-shadow: 0 4px 26px rgba(0, 0, 0, 0.9);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--videos-gold);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.videos-hero h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.4rem, 8vw, 6.6rem);
    font-weight: 500;
    line-height: 0.9;
    letter-spacing: -0.055em;
    color: #f2fbff;
    text-shadow: 0 6px 38px rgba(0, 0, 0, 0.92), 0 0 42px rgba(84, 214, 246, 0.3);
}

.videos-hero > p:last-child {
    max-width: 600px;
    margin: 14px auto 0;
    color: #b9dbe5;
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.5;
}

.manage-panel {
    margin: 0 0 32px;
    padding: clamp(20px, 2.5vw, 28px);
    border: 1px solid rgba(116, 220, 248, 0.26);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(7, 31, 43, 0.92), rgba(2, 13, 21, 0.9));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46), inset 0 1px rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(22px);
}

.manage-panel[hidden],
.manage-form[hidden] {
    display: none;
}

.manage-heading,
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.manage-heading h2,
.section-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 500;
}

.panel-close {
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    font-size: 1.6rem;
}

.manage-form {
    margin-top: 16px;
}

.manage-form label,
.manage-form label span {
    display: block;
    color: #cce9f1;
    font-size: 0.9rem;
    font-weight: 700;
}

.manage-form input {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    padding: 0 15px;
    border: 1px solid rgba(137, 222, 245, 0.25);
    border-radius: 10px;
    background: rgba(1, 10, 16, 0.72);
    color: #f2fbff;
    font: inherit;
    outline: none;
}

.manage-form input:focus {
    border-color: #71dcf7;
    box-shadow: 0 0 0 3px rgba(84, 214, 246, 0.13);
}

.field-grid,
.url-row {
    display: grid;
    gap: 14px;
    align-items: end;
}

.login-fields {
    grid-template-columns: 1fr 1fr auto;
}

.url-row {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 8px;
}

.url-row input {
    margin: 0;
}

.primary-button {
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid rgba(116, 225, 252, 0.58);
    border-radius: 10px;
    background: linear-gradient(135deg, #1b819c, #0d5169);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.primary-button:hover {
    background: linear-gradient(135deg, #239bb9, #12647f);
    box-shadow: 0 0 26px rgba(84, 214, 246, 0.24);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.form-note,
.form-status {
    margin: 10px 0 0;
    color: #91bac7;
    font-size: 0.88rem;
}

.form-status.is-error {
    color: #ffaca4;
}

.gallery-section {
    min-height: 260px;
}

.section-heading {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--videos-line);
}

.video-count {
    margin: 0 0 5px;
    color: #9bc9d6;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(18px, 2vw, 28px);
}

.video-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--videos-line);
    border-radius: 14px;
    background: var(--videos-card);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4), inset 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.video-card:hover {
    transform: translateY(-5px);
    border-color: rgba(127, 228, 255, 0.46);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.52), 0 0 30px rgba(84, 214, 246, 0.1);
}

.video-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--videos-line);
    background: radial-gradient(circle at 38% 28%, #16495c, #03121d 70%);
    color: #fff;
    cursor: pointer;
}

.video-media img,
.video-media iframe,
.embed-frame {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    object-fit: cover;
}

.video-media img {
    transition: transform 300ms ease, filter 300ms ease;
}

.video-card:hover .video-media img {
    transform: scale(1.035);
    filter: brightness(0.82);
}

.play-disc {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background: rgba(2, 13, 20, 0.72);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 26px rgba(84, 214, 246, 0.24);
    backdrop-filter: blur(10px);
}

.play-disc::before {
    content: "";
    margin-left: 4px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 13px solid white;
}

.x-preview-mark {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: clamp(4rem, 9vw, 7rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 0 32px rgba(84, 214, 246, 0.35);
}

.x-embed-host {
    width: 100%;
    min-height: 360px;
    display: grid;
    place-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.78);
}

.video-copy {
    padding: 18px 18px 20px;
}

.platform-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
    color: #79d9ef;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.video-copy h3 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.35;
    color: #f1fbff;
}

.video-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 10px 0 15px;
    color: #9fc4ce;
    font-size: 0.9rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.video-link {
    color: var(--videos-gold);
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

.video-link:hover {
    color: #ffe0a0;
}

.delete-video {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid rgba(255, 145, 134, 0.55);
    border-radius: 999px;
    background: rgba(38, 5, 7, 0.82);
    color: #ffd0ca;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.empty-state,
.gallery-status {
    text-align: center;
    color: #9fc5d0;
}

.empty-state {
    padding: 38px 20px;
    border: 1px dashed rgba(126, 218, 242, 0.28);
    border-radius: 16px;
    background: rgba(3, 15, 23, 0.58);
    backdrop-filter: blur(16px);
}

.empty-state[hidden],
.gallery-status[hidden] {
    display: none;
}

.empty-icon {
    display: block;
    margin-bottom: 14px;
    color: rgba(116, 220, 248, 0.55);
    font-size: 2.5rem;
}

.empty-state h3 {
    margin: 0 0 8px;
    color: #e7f8fc;
}

.empty-state p {
    margin: 0;
}

.gallery-status {
    padding: 60px 20px;
}

.videos-footer {
    padding: 24px 18px 34px;
    text-align: center;
    color: rgba(191, 222, 230, 0.62);
    font-size: 0.85rem;
}

@media (max-width: 1020px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .videos-topbar,
    .videos-shell {
        width: min(100% - 24px, 560px);
    }

    .videos-shell {
        padding-top: 18px;
    }

    .videos-hero {
        margin-bottom: 32px;
    }

    .video-grid,
    .login-fields,
    .url-row {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .primary-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-card,
    .video-media img {
        transition: none;
    }
}
