* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0d1130;
    --panel: #161c46;
    --border: #2a3169;
    --accent: #a3c14b;
    --accent-bright: #c6dd6e;
    --live: #f7373a;
    --text: #f2f3f7;
    --muted: #9aa3c7;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
}

header.app {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--panel);
    border-bottom: 2px solid var(--accent);
}

header.app h1 {
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

header.app h1 span {
    color: var(--accent-bright);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logout {
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.logout:hover {
    color: var(--text);
}

video {
    display: block;
    width: 100%;
    background: #000;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--accent);
    color: #0d1130;
}

.btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.btn.danger {
    background: var(--live);
    color: #fff;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.live {
    background: var(--live);
    color: #fff;
}

.badge.idle {
    background: var(--border);
    color: var(--muted);
}

.login-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-card img {
    width: 220px;
    align-self: center;
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.login-card h1 {
    text-align: center;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-bright);
    margin-bottom: 10px;
}

.login-card label {
    font-size: 0.85rem;
    color: var(--muted);
}

.login-card input {
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.login-card .btn {
    margin-top: 12px;
}

.login-error {
    background: rgba(247, 55, 58, 0.15);
    border: 1px solid var(--live);
    color: #ffb4b5;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.cam-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cam-wrap label {
    font-size: 0.9rem;
    color: var(--muted);
}

.cam-wrap input {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    margin-top: 6px;
}

.cam-wrap .btn {
    width: 100%;
    padding: 16px;
    font-size: 1.15rem;
}

.welcome-line {
    font-size: 1.1rem;
}

.welcome-line a {
    color: var(--muted);
    font-size: 0.85rem;
    margin-left: 8px;
}

.welcome-course {
    margin-top: 6px;
    color: var(--accent-bright);
    font-size: 0.95rem;
    font-weight: 600;
}

#status {
    text-align: center;
    font-size: 0.95rem;
    color: var(--muted);
    min-height: 1.4em;
}

#status.on {
    color: var(--accent-bright);
    font-weight: 700;
}

#status.err {
    color: var(--live);
    font-weight: 700;
}

.gps-line {
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    min-height: 1.2em;
}

.gps-line.ok {
    color: var(--accent-bright);
}

.consignes {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.rotate-warn {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(13, 17, 48, 0.94);
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

@media (orientation: portrait) {
    body.streaming .rotate-warn {
        display: flex;
    }
}

.regie {
    padding: 16px;
    display: grid;
    gap: 16px;
}

.program-box {
    max-width: 560px;
    border: 2px solid var(--live);
    border-radius: 10px;
    overflow: hidden;
}

.program-box .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: var(--panel);
    font-size: 0.9rem;
}

.prog-course {
    color: var(--accent-bright);
    font-size: 0.85rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

#grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.card {
    background: var(--panel);
    border: 2px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.card.onair {
    border-color: var(--live);
}

.card .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
}

.card .bar .name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.card .btn {
    padding: 8px 14px;
    font-size: 0.9rem;
}

.gps-ind {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.gps-ind.on {
    color: var(--accent-bright);
}

.course-bar {
    padding: 0 12px 12px;
}

.course-bar select {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.filler-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.fullscreen {
    position: fixed;
    inset: 0;
    background: #000;
}

.fullscreen video {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}
