:root {
    --bg: #0b0f19;
    --panel: #121827;
    --panel-2: #0f1524;
    --line: #1e293b;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #8b5cf6;
    --accent-2: #38bdf8;
    --ok: #10b981;
    --error: #f43f5e;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--accent-2); text-decoration: none; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ------------------------ gate */
.gate {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 24px;
}
.gate-box {
    width: 100%; max-width: 380px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
}
.gate-brand {
    width: 90px; height: 90px; margin: 0 auto 16px;
    display: grid; place-items: center;
}
.gate-brand img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gate-logo-fallback { font-size: 56px; }
.gate-box h1 { margin: 0 0 8px; font-size: 24px; }
.gate-box input {
    width: 100%;
    padding: 12px 14px;
    margin: 14px 0 10px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.gate-box .btn { width: 100%; }
.error-text { color: var(--error); min-height: 22px; margin: 8px 0 0; }

/* ------------------------ app */
.app-header {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(11,15,25,.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 34px; width: auto; object-fit: contain; }
.brand-fallback {
    width: 34px; height: 34px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--accent); color: #fff; font-weight: 700;
}

.app-main { max-width: 1200px; margin: 0 auto; padding: 24px; }

.player-section { margin-bottom: 28px; }
.player-wrap {
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    display: grid; place-items: center;
}
.player-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-wrap .placeholder { color: var(--muted); }

.search-bar {
    display: flex; gap: 10px; margin-bottom: 12px;
}
.search-bar input {
    flex: 1;
    padding: 12px 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: 15px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.result-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .12s ease, border-color .12s ease;
}
.result-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.result-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.result-card .meta { padding: 10px 12px; }
.result-card .title { font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 640px) {
    .app-header { flex-wrap: wrap; }
    .results-grid { grid-template-columns: repeat(2, 1fr); }
}
