/* Box Seats web client. Dark by design -- this is a video app and the grid sits next to a player. */
:root {
    --bg: #0b0d10;
    --surface: #14181d;
    --surface-2: #1c2229;
    --line: #262d36;
    --text: #eef2f6;
    --muted: #93a1b0;
    --accent: #e8b64c;
    --accent-ink: #16191d;
    --danger: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#root { height: 100%; }

.boot, .login-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The wordmark is an image with a text fallback (see Brand.kt), so each of these carries both:
   the img rule sizes the mark, the font rules style the text if the image never loads. */
.wordmark {
    margin: 0 0 4px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-align: center;
}

.wordmark img {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.wordmark-small {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.16em;
    white-space: nowrap;
}

.wordmark-small img {
    display: block;
    height: 18px;
    width: auto;
}

.boot img {
    width: 220px;
    max-width: 60%;
    height: auto;
}

/* ---------------------------------------------------------------- login */

.login-form {
    width: min(360px, calc(100vw - 48px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.login-sub { margin: 0 0 6px; color: var(--muted); }

.field {
    padding: 11px 13px;
    font-size: 15px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.field:focus, .search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn-primary {
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-ink);
    background: var(--accent);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
}

.login-error { margin: 2px 0 0; color: var(--danger); }

/* --------------------------------------------------------------- browse */

.browse { height: 100%; display: flex; flex-direction: column; }

.app-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.tabs { display: flex; gap: 6px; }

.tab {
    padding: 7px 14px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
}

.tab-active { color: var(--accent-ink); background: var(--accent); font-weight: 700; }

.search {
    margin-left: auto;
    min-width: 0;
    width: min(280px, 40vw);
    padding: 8px 12px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.btn-plain {
    padding: 8px 12px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.browse-body { flex: 1; display: flex; min-height: 0; }

.categories {
    width: 230px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 10px;
    background: var(--surface);
    border-right: 1px solid var(--line);
}

.category {
    display: block;
    width: 100%;
    padding: 9px 11px;
    margin-bottom: 3px;
    text-align: left;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.category:hover { background: var(--surface-2); color: var(--text); }
.category-active { background: var(--surface-2); color: var(--accent); font-weight: 600; }

.catalogue { flex: 1; overflow-y: auto; padding: 18px; }

.status { margin: 6px 2px; color: var(--muted); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 0;
    text-align: left;
    color: var(--text);
    background: transparent;
    border: 0;
    cursor: pointer;
}

.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }

.art {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
}

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

.art-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 34px;
    font-weight: 800;
    color: var(--line);
}

.card-title {
    font-size: 13px;
    line-height: 1.3;
    /* Titles run long and a card that grows to fit one breaks the grid rhythm. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-sub { font-size: 12px; color: var(--muted); }

.btn-more {
    display: block;
    margin: 22px auto 8px;
    padding: 11px 22px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

/* --------------------------------------------------------------- player */

.player-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #000;
}

.player-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.player-title { font-weight: 600; }

.video { flex: 1; width: 100%; min-height: 0; background: #000; }

.player-message {
    margin: 0;
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

/* Live channel logos are wide, not poster-shaped, and letterboxing them looks better than
   cropping a station ident. The rail also collapses on a phone, where 230px is most of the width. */
@media (max-width: 720px) {
    .wordmark-small img { height: 14px; }
    .categories { width: 148px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
    .search { width: 130px; }
}

/* --------------------------------------------------------------- series */

.series-title {
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episodes { display: flex; flex-direction: column; gap: 6px; }

.episode {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 13px;
    text-align: left;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
}

.episode:hover { background: var(--surface-2); }
.episode:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.episode-num {
    flex: 0 0 44px;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.episode-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Two episodes in three are a container the browser cannot open; the badge says so before the
   click rather than after it. */
.episode-badge {
    flex: 0 0 auto;
    padding: 3px 9px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 11px;
}

/* ------------------------------------------------------------ seek strip */
/* Shown only for remuxed titles. The stream is generated as it is read, so the browser's own
   scrubber has nothing to scrub: this strip drives seeking by restarting the stream at an offset. */

.seek-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.seek-track {
    flex: 1;
    height: 6px;
    min-width: 60px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    overflow: hidden;
}

.seek-fill { height: 100%; width: 0; background: var(--accent); }

.seek-position {
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
