:root {
    --ft-bg: #0f1419;
    --ft-surface: #1a2230;
    --ft-surface-2: #232c3d;
    --ft-border: #2e3a52;
    --ft-text: #e6e8eb;
    --ft-text-muted: #94a3b8;
    --ft-accent: #ff5722;
    --ft-accent-hover: #ff7043;
    --ft-accent-soft: rgba(255, 87, 34, 0.15);
    --ft-success: #22c55e;
    --ft-danger: #ef4444;
    --ft-radius: 8px;
    --ft-radius-lg: 12px;
    --ft-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --ft-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--ft-bg);
    color: var(--ft-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
}

a {
    color: var(--ft-accent);
    text-decoration: none;
}

a:hover {
    color: var(--ft-accent-hover);
    text-decoration: underline;
}

h1, h2, h3 {
    margin: 0 0 0.5em;
    line-height: 1.25;
    font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* Header */
.ft-header {
    background: var(--ft-surface);
    border-bottom: 1px solid var(--ft-border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
}

.ft-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.ft-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--ft-text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.ft-brand:hover {
    text-decoration: none;
    color: var(--ft-text);
}

.ft-brand__icon {
    font-size: 1.5rem;
}

.ft-brand__name--accent {
    color: var(--ft-accent);
}

.ft-nav {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.ft-nav__link {
    color: var(--ft-text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: var(--ft-radius);
    font-weight: 500;
}

.ft-nav__link:hover {
    color: var(--ft-text);
    background: var(--ft-surface-2);
    text-decoration: none;
}

.ft-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ft-user__name {
    color: var(--ft-text-muted);
    font-size: 0.9rem;
}

.ft-user__logout {
    margin: 0;
}

/* Buttons */
.ft-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--ft-radius);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.ft-btn:hover { text-decoration: none; }
.ft-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ft-btn--primary {
    background: var(--ft-accent);
    color: #fff;
}
.ft-btn--primary:hover {
    background: var(--ft-accent-hover);
    color: #fff;
}

.ft-btn--ghost {
    background: transparent;
    color: var(--ft-text);
    border-color: var(--ft-border);
}
.ft-btn--ghost:hover {
    background: var(--ft-surface-2);
    color: var(--ft-text);
}

.ft-btn--danger {
    background: transparent;
    color: var(--ft-danger);
    border-color: var(--ft-danger);
}
.ft-btn--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ft-danger);
}

.ft-btn--lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.ft-btn--sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Main */
.ft-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

/* Footer */
.ft-footer {
    border-top: 1px solid var(--ft-border);
    padding: 1.5rem 1.25rem;
    color: var(--ft-text-muted);
    font-size: 0.875rem;
}
.ft-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ft-footer a { color: var(--ft-text-muted); }
.ft-footer a:hover { color: var(--ft-text); }

/* Hero */
.ft-hero {
    text-align: center;
    padding: 2rem 0 3rem;
}
.ft-hero__title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--ft-text) 30%, var(--ft-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ft-hero__subtitle {
    color: var(--ft-text-muted);
    max-width: 540px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* Video grid */
.ft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ft-card {
    background: var(--ft-surface);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-lg);
    overflow: hidden;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}

.ft-card:hover {
    transform: translateY(-2px);
    border-color: var(--ft-accent);
    box-shadow: var(--ft-shadow-lg);
}

.ft-card__link {
    display: block;
    color: var(--ft-text);
    text-decoration: none;
}
.ft-card__link:hover { text-decoration: none; color: var(--ft-text); }

.ft-card__thumb {
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    position: relative;
}

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

.ft-card__thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.15s;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.ft-card:hover .ft-card__thumb-overlay {
    opacity: 1;
}

.ft-card__body {
    padding: 0.75rem 1rem 1rem;
}

.ft-card__title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ft-text);
}

.ft-card__meta {
    color: var(--ft-text-muted);
    font-size: 0.85rem;
}

/* Forms */
.ft-form {
    max-width: 420px;
    margin: 0 auto;
    background: var(--ft-surface);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-lg);
    padding: 1.5rem;
}
.ft-form__field {
    margin-bottom: 1rem;
}
.ft-form__label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--ft-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}
.ft-form__input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--ft-bg);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    color: var(--ft-text);
    font-family: inherit;
    font-size: 1rem;
}
.ft-form__input:focus {
    outline: none;
    border-color: var(--ft-accent);
    box-shadow: 0 0 0 2px var(--ft-accent-soft);
}
.ft-form__error {
    color: var(--ft-danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Utility */
.ft-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ft-text-muted);
}

.ft-stack > * + * {
    margin-top: 1rem;
}

/* ---------- Feed page (home) ---------- */
.ft-feed-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ft-search {
    display: flex;
    flex: 1;
    min-width: 240px;
    gap: 0.5rem;
}

.ft-search__input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    background: var(--ft-surface);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    color: var(--ft-text);
    font-family: inherit;
    font-size: 1rem;
}

.ft-search__input:focus {
    outline: none;
    border-color: var(--ft-accent);
    box-shadow: 0 0 0 2px var(--ft-accent-soft);
}

.ft-feed-header__cta {
    flex-shrink: 0;
}

.ft-card__caption-preview {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    max-width: 92%;
    padding: 0.25rem 0.55rem;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.25;
    text-align: center;
    border-radius: 4px;
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ft-card__stats {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
    color: var(--ft-text-muted);
    font-size: 0.85rem;
}

.ft-card--lib {
    position: relative;
}

.ft-card__footer {
    padding: 0 1rem 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.ft-editor-warning {
    flex: 1;
    color: var(--ft-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* ---------- View page ---------- */
.ft-view {
    max-width: 900px;
    margin: 0 auto;
}
.ft-view__header { margin-bottom: 1rem; }
.ft-view__title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
}
.ft-view__byline {
    color: var(--ft-text-muted);
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.ft-view__byline strong { color: var(--ft-text); font-weight: 600; }
.ft-view__sep { opacity: 0.5; }

.ft-view__player {
    position: relative;
    background: #000;
    border-radius: var(--ft-radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 16 / 9;
    width: 100%;
}

.ft-unmute {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.15s, transform 0.15s;
    z-index: 5;
}

.ft-unmute:hover {
    background: var(--ft-accent);
    border-color: var(--ft-accent);
    transform: scale(1.03);
}

.ft-unmute[hidden] {
    display: none;
}
.ft-view__video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}
.ft-view__video::cue {
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-weight: 600;
    line-height: 1.3;
    padding: 0.2rem 0.4rem;
}
.ft-view__actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.ft-view__hint {
    color: var(--ft-text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}
