:root {
    color-scheme: dark;

    --bg: #0f0f0f;
    --surface: #181818;
    --surface-2: #242424;
    --text: #f5f5f5;
    --muted: #aaaaaa;
    --accent: #ff0033;
    --border: #303030;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family:
        Tahoma,
        Arial,
        sans-serif;
}

body {
    min-height: 100vh;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;

    height: 64px;

    display: flex;
    align-items: center;

    border-bottom: 1px solid var(--border);

    background:
        rgba(15, 15, 15, 0.94);

    backdrop-filter: blur(12px);
}

.brand {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 16px;

    display: flex;
    gap: 10px;
    align-items: center;

    cursor: pointer;
}

.brand-mark {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: var(--accent);
    color: white;

    font-size: 22px;
    font-weight: 800;
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
}

.brand-subtitle {
    margin-top: 1px;

    color: var(--muted);

    font-size: 11px;
}

.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 20px 14px 60px;
}

.hero {
    padding: 35px 5px 22px;
    text-align: center;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 7vw, 46px);
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.search-box {
    width: min(720px, 100%);
    margin: 0 auto 28px;

    display: flex;
    gap: 8px;
}

.search-box input {
    flex: 1;
    min-width: 0;

    height: 50px;
    padding: 0 17px;

    border: 1px solid var(--border);
    border-radius: 16px;

    outline: none;

    background: var(--surface);
    color: var(--text);
}

.search-box input:focus {
    border-color: #666;
}

.search-box button {
    min-width: 90px;

    border: 0;
    border-radius: 16px;

    padding: 0 18px;

    background: var(--accent);
    color: white;

    font-weight: 700;
}

.status {
    min-height: 28px;

    color: var(--muted);

    text-align: center;
    font-size: 14px;
}

.results {
    margin-top: 12px;

    display: grid;
    grid-template-columns:
        repeat(
            auto-fill,
            minmax(220px, 1fr)
        );

    gap: 20px 14px;
}

.video-card {
    overflow: hidden;

    border-radius: 14px;

    background: transparent;

    cursor: pointer;
}

.thumbnail-wrap {
    position: relative;

    overflow: hidden;

    aspect-ratio: 16 / 9;

    border-radius: 13px;

    background: var(--surface-2);
}

.thumbnail-wrap img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.duration {
    position: absolute;
    left: 7px;
    bottom: 7px;

    padding: 3px 6px;

    border-radius: 5px;

    background: rgba(0, 0, 0, 0.82);

    color: white;

    font-size: 12px;
}

.card-title {
    margin: 10px 2px 5px;

    line-height: 1.55;

    font-size: 15px;
    font-weight: 700;
}

.card-channel {
    margin: 0 2px;

    color: var(--muted);

    font-size: 13px;
}

.watch-view {
    width: min(1000px, 100%);
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

.back-button {
    margin-bottom: 14px;
    padding: 9px 14px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
    color: var(--text);
}

.player-shell {
    width: 100%;

    overflow: hidden;

    border-radius: 15px;

    background: black;

    aspect-ratio: 16 / 9;
}

.player-shell video {
    width: 100%;
    height: 100%;

    display: block;

    background: black;
}

.video-info {
    padding: 17px 4px;
}

.video-info h1 {
    margin: 0 0 10px;

    line-height: 1.55;

    font-size: clamp(19px, 4vw, 26px);
}

.channel {
    color: #ddd;
    font-size: 14px;
}

.meta {
    margin-top: 7px;

    color: var(--muted);

    font-size: 13px;
}

@media (max-width: 600px) {

    .container {
        padding:
            14px 10px
            40px;
    }

    .topbar {
        height: 58px;
    }

    .hero {
        padding-top: 22px;
    }

    .search-box {
        gap: 6px;
    }

    .search-box input {
        height: 48px;
    }

    .search-box button {
        min-width: 78px;
        padding: 0 12px;
    }

    .results {
        grid-template-columns: 1fr 1fr;
        gap: 18px 9px;
    }

    .card-title {
        font-size: 13px;
    }

    .card-channel {
        font-size: 12px;
    }

    .player-shell {
        border-radius: 10px;
    }
}

@media (max-width: 390px) {

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