:root {
    --page-bg: #f5efe3;
    --panel-bg: rgba(255, 251, 244, 0.8);
    --panel-border: rgba(55, 42, 31, 0.12);
    --text-main: #201815;
    --text-soft: #5f534a;
    --accent: #e66a2d;
    --accent-strong: #b94413;
    --accent-alt: #0f8a8d;
    --shadow: 0 22px 54px rgba(45, 25, 9, 0.14);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(15, 138, 141, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(230, 106, 45, 0.2), transparent 32%),
        linear-gradient(180deg, #fbf6ea 0%, var(--page-bg) 100%);
}

.page-shell {
    width: min(1500px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 60px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(100%, 520px);
    position: relative;
    padding: 32px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    background: var(--panel-bg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-text {
    margin-bottom: 24px;
    color: var(--text-soft);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form input {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid rgba(32, 24, 21, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    font: inherit;
}

.auth-form input:focus {
    outline: 3px solid rgba(15, 138, 141, 0.18);
    border-color: rgba(15, 138, 141, 0.4);
}

.auth-submit,
.logout-button {
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff9f3;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
    box-shadow: 0 16px 28px rgba(185, 68, 19, 0.22);
}

.auth-submit:hover,
.logout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 34px rgba(185, 68, 19, 0.28);
}

.hero-panel,
.board-section {
    position: relative;
    padding: 28px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    background: var(--panel-bg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-panel {
    overflow: hidden;
}

.hero-topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-bottom: 22px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(15, 138, 141, 0.14);
    color: var(--accent-alt);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logout-button {
    min-height: 42px;
    padding: 0 18px;
    box-shadow: none;
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -80px -100px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230, 106, 45, 0.24), transparent 68%);
}

.hero-copy {
    max-width: 760px;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 14px;
    font-size: clamp(2rem, 4.4vw, 4.2rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(1.5rem, 2.2vw, 2.2rem);
    line-height: 1;
}

.hero-text,
.layout-note,
.field-hint,
.card-reference,
.card-url,
.empty-state p {
    color: var(--text-soft);
}

.hero-text {
    max-width: 70ch;
    margin-bottom: 24px;
    font-size: 1.02rem;
    line-height: 1.6;
}

.link-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    max-width: 900px;
}

.field-label {
    font-weight: 700;
}

.input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.input-row input {
    width: 100%;
    min-height: 60px;
    padding: 0 18px;
    border: 1px solid rgba(32, 24, 21, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-main);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.input-row input:focus {
    outline: 3px solid rgba(15, 138, 141, 0.18);
    border-color: rgba(15, 138, 141, 0.4);
}

.input-row button {
    min-height: 60px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff9f3;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
    box-shadow: 0 16px 28px rgba(185, 68, 19, 0.22);
}

.input-row button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 34px rgba(185, 68, 19, 0.28);
}

.field-hint,
.field-error,
.field-success,
.layout-note,
.card-reference,
.card-url,
.empty-state p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.field-error {
    color: #a32020;
    font-weight: 700;
}

.field-success {
    color: #0f6c52;
    font-weight: 700;
}

.board-section {
    margin-top: 24px;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.layout-note {
    max-width: 360px;
    margin-bottom: 6px;
    text-align: right;
}

.board-rail {
    overflow-x: auto;
    padding-bottom: 8px;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 18px;
    min-width: 1180px;
}

.video-card,
.empty-state {
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(32, 24, 21, 0.08);
    overflow: hidden;
    box-shadow: 0 18px 38px rgba(24, 17, 11, 0.08);
}

.video-card {
    color: inherit;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: rgba(230, 106, 45, 0.3);
    box-shadow: 0 24px 44px rgba(24, 17, 11, 0.12);
}

.thumbnail-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(15, 138, 141, 0.18), rgba(230, 106, 45, 0.16));
}

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

.thumbnail-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: rgba(32, 24, 21, 0.08);
}

.instagram-preview {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 210, 90, 0.88), transparent 26%),
        linear-gradient(135deg, #f9ce34 0%, #ee2a7b 46%, #6228d7 100%);
}

.giphy-preview {
    background:
        radial-gradient(circle at 80% 20%, rgba(0, 255, 153, 0.32), transparent 24%),
        linear-gradient(135deg, #111111 0%, #00ff99 36%, #00ccff 68%, #ff4fd8 100%);
}

.imgur-preview {
    background:
        radial-gradient(circle at 80% 18%, rgba(133, 193, 58, 0.26), transparent 22%),
        linear-gradient(135deg, #1d2732 0%, #2f4357 52%, #85c13a 100%);
}

.thumbnail-fallback {
    position: relative;
    height: 100%;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: 10px;
    color: #fff;
}

.thumbnail-fallback::before {
    content: "";
    position: absolute;
    top: 18px;
    right: 18px;
    width: 72px;
    height: 72px;
    border: 2px solid rgba(255, 255, 255, 0.58);
    border-radius: 24px;
    opacity: 0.75;
}

.thumbnail-fallback::after {
    content: "";
    position: absolute;
    top: 38px;
    right: 38px;
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
}

.thumbnail-fallback strong,
.thumbnail-fallback p,
.fallback-chip {
    position: relative;
    z-index: 1;
}

.fallback-chip {
    align-self: start;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(32, 24, 21, 0.2);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.thumbnail-fallback strong {
    font-size: 1.18rem;
    line-height: 1.2;
}

.thumbnail-fallback p {
    margin-bottom: 0;
    max-width: 28ch;
    color: rgba(255, 249, 243, 0.92);
}

.play-badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(32, 24, 21, 0.8);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.card-body {
    padding: 16px;
}

.card-kicker {
    margin-bottom: 8px;
    color: var(--accent-alt);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.card-body h3 {
    margin-bottom: 8px;
    font-size: 1.15rem;
    line-height: 1.15;
}

.card-reference {
    margin-bottom: 8px;
    font-weight: 700;
}

.card-url {
    margin-bottom: 0;
    word-break: break-word;
}

.empty-state {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 320px;
    padding: 32px;
    text-align: center;
}

.empty-state h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

@media (max-width: 920px) {
    .page-shell {
        width: min(100% - 24px, 1500px);
        padding-top: 20px;
    }

    .hero-panel,
    .board-section {
        padding: 22px;
    }

    .input-row,
    .hero-topbar,
    .section-header {
        grid-template-columns: 1fr;
        display: grid;
    }

    .layout-note {
        max-width: none;
        text-align: left;
        margin-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto;
        transition: none !important;
        animation: none !important;
    }
}
