/* Live Webcams — dark "TV" theme. */
:root {
    --wc-bg: #07090d;
    --wc-panel: #10141c;
    --wc-panel-2: #171c27;
    --wc-line: #252c3a;
    --wc-text: #e7eaf1;
    --wc-dim: #8b93a7;
    --wc-accent: #4fc3f7;
    --wc-live: #ff3b4e;
    --wc-star: #ffcc4d;
    --wc-nav: 0px; /* no site nav bar on the public copy */
}

html, body.wc-body { background: var(--wc-bg); color: var(--wc-text); }
body.wc-body { padding-top: var(--wc-nav); min-height: 100vh; overflow-x: hidden; }

.wc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 14px;
    padding: 14px;
    height: calc(100vh - var(--wc-nav));
    height: calc(100dvh - var(--wc-nav));
}

/* ---- Stage ---------------------------------------------------------------------------------------- */
.wc-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 10px; }
.wc-screen {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--wc-line), 0 20px 60px rgba(0, 0, 0, .6);
}
.wc-screen iframe, .wc-screen #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.wc-static {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background:
        repeating-radial-gradient(circle at 17% 32%, rgba(255,255,255,.09) 0 1px, transparent 1px 3px),
        repeating-radial-gradient(circle at 73% 61%, rgba(255,255,255,.07) 0 1px, transparent 1px 4px),
        #0b0d12;
    background-size: 7px 7px, 11px 11px, auto;
    animation: wc-noise .25s steps(4) infinite;
    transition: opacity .35s ease;
    pointer-events: none;
}
.wc-static.off { opacity: 0; }
.wc-static span {
    font: 600 clamp(14px, 2vw, 20px)/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .2em; text-transform: uppercase;
    padding: 10px 16px; border-radius: 8px;
    background: rgba(0, 0, 0, .55); color: #cfd6e6;
}
@keyframes wc-noise {
    0% { background-position: 0 0, 0 0, 0 0; }
    25% { background-position: 3px 2px, -4px 1px, 0 0; }
    50% { background-position: -2px 4px, 2px -3px, 0 0; }
    75% { background-position: 4px -1px, -1px 4px, 0 0; }
}
@media (prefers-reduced-motion: reduce) { .wc-static { animation: none; } }

.wc-channel, .wc-live {
    position: absolute; top: 12px;
    font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    padding: 6px 9px; border-radius: 6px;
    background: rgba(0, 0, 0, .6); color: #b8ffcf;
    pointer-events: none; letter-spacing: .08em;
}
.wc-channel { left: 12px; text-shadow: 0 0 6px rgba(120, 255, 170, .6); }
.wc-live { right: 12px; color: #fff; background: rgba(255, 59, 78, .85); display: flex; align-items: center; gap: 6px; }
.wc-live .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: wc-pulse 1.4s ease-in-out infinite; }
@keyframes wc-pulse { 50% { opacity: .25; } }
.wc-channel, .wc-live { transition: opacity .2s; }
.wc-screen:hover .wc-channel, .wc-screen:hover .wc-live { opacity: 0; }

/* ---- Channel bar ---------------------------------------------------------------------------------- */
.wc-bar {
    flex: 0 0 auto;
    background: var(--wc-panel);
    border: 1px solid var(--wc-line);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
}
.wc-info { flex: 1 1 280px; min-width: 0; }
.wc-title {
    font-size: 1.05rem; font-weight: 650; margin: 0 0 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-meta { color: var(--wc-dim); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.wc-time::before { content: "\1F552\00A0"; }
.wc-viewers:empty, .wc-time:empty { display: none; }
.wc-yt { color: var(--wc-dim); }
.wc-yt:hover { color: #ff4e45; }

.wc-controls, .wc-owner { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wc-owner { flex-basis: 100%; padding-top: 8px; border-top: 1px dashed var(--wc-line); }
.wc-btn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 12px;
    border: 1px solid var(--wc-line); border-radius: 9px;
    background: var(--wc-panel-2); color: var(--wc-text);
    font-size: .88rem; font-weight: 550; cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
}
.wc-btn:hover { background: #202736; border-color: #33405a; }
.wc-btn:active { transform: translateY(1px); }
.wc-btn:focus-visible, .wc-tab:focus-visible, .wc-chip:focus-visible { outline: 2px solid var(--wc-accent); outline-offset: 2px; }
.wc-btn-main { background: #12384d; border-color: #1f5b7a; }
.wc-btn-main:hover { background: #174761; }
.wc-icon { width: 36px; padding: 0; justify-content: center; }
.wc-sm { height: 30px; padding: 0 10px; font-size: .8rem; }
.wc-danger:hover { background: #4a1820; border-color: #7a2733; }
.wc-btn.on { border-color: var(--wc-star); color: var(--wc-star); }
.wc-btn.armed { border-color: var(--wc-accent); color: var(--wc-accent); }

.wc-surf {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 4px 0 10px;
    border: 1px solid var(--wc-line); border-radius: 9px; background: var(--wc-panel-2);
    color: var(--wc-dim);
}
.wc-surf select, .wc-sm-select {
    background: transparent; color: var(--wc-text); border: 0; font-size: .85rem; height: 100%; cursor: pointer;
}
.wc-surf select option, .wc-sm-select option { background: var(--wc-panel); }
.wc-sm-select { height: 30px; border: 1px solid var(--wc-line); border-radius: 9px; padding: 0 8px; background: var(--wc-panel-2); }
.wc-surf.active { border-color: var(--wc-accent); color: var(--wc-accent); }

/* ---- Side panel ----------------------------------------------------------------------------------- */
.wc-side {
    display: flex; flex-direction: column; min-height: 0; min-width: 0;
    background: var(--wc-panel); border: 1px solid var(--wc-line); border-radius: 14px; overflow: hidden;
}
.wc-tabs { display: flex; border-bottom: 1px solid var(--wc-line); }
.wc-tab {
    flex: 1; padding: 10px; background: none; border: 0; color: var(--wc-dim); font-weight: 600; font-size: .9rem;
    border-bottom: 2px solid transparent; cursor: pointer;
}
.wc-tab.active { color: var(--wc-text); border-bottom-color: var(--wc-accent); }
.wc-count { font-size: .75rem; color: var(--wc-dim); font-weight: 500; }

.wc-filters { padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--wc-line); }
.wc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.wc-chip {
    border: 1px solid var(--wc-line); background: var(--wc-panel-2); color: var(--wc-dim);
    border-radius: 999px; padding: 3px 10px; font-size: .78rem; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.wc-chip .sw { width: 8px; height: 8px; border-radius: 50%; }
.wc-chip.active { color: var(--wc-text); border-color: #3d4b66; background: #222a3a; }
.wc-chip .n { opacity: .6; }
.wc-search {
    width: 100%; height: 34px; padding: 0 10px; border-radius: 9px;
    border: 1px solid var(--wc-line); background: var(--wc-bg); color: var(--wc-text); font-size: .88rem;
}

.wc-views { position: relative; flex: 1 1 auto; min-height: 0; }
.wc-map { position: absolute; inset: 0; background: #0d1118; }
.wc-map.placing { cursor: crosshair; }
.wc-place-hint {
    position: absolute; left: 10px; right: 10px; top: 10px; z-index: 1000;
    background: rgba(18, 56, 77, .95); border: 1px solid #1f5b7a; border-radius: 9px; padding: 8px 10px; font-size: .85rem;
}
.wc-list { position: absolute; inset: 0; overflow-y: auto; margin: 0; padding: 6px; list-style: none; }
.wc-list .grp { color: var(--wc-dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: 10px 6px 4px; }
.wc-list .wc-row {
    display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 9px; cursor: pointer;
    border: 1px solid transparent;
}
.wc-list .wc-row:hover { background: var(--wc-panel-2); }
.wc-list .wc-row.current { border-color: #1f5b7a; background: #12263a; }
.wc-list .wc-row.seen .t { color: var(--wc-dim); }
.wc-list img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; background: #000; }
.wc-list .txt { min-width: 0; }
.wc-list .t { font-size: .84rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wc-list .p { font-size: .76rem; color: var(--wc-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-list .star { color: var(--wc-star); }
.wc-empty { color: var(--wc-dim); padding: 20px; text-align: center; font-size: .9rem; }

.wc-admin { border-top: 1px solid var(--wc-line); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.wc-add { display: flex; gap: 6px; }
.wc-add input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--wc-line); background: var(--wc-bg); color: var(--wc-text); font-size: .82rem; }
.wc-admin-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.wc-admin-status { font-size: .75rem; color: var(--wc-dim); }
.wc-link { background: none; border: 0; padding: 0; color: var(--wc-accent); font-size: .8rem; cursor: pointer; text-decoration: underline; }

.wc-keys { margin: 0; padding: 6px 10px 8px; font-size: .72rem; color: var(--wc-dim); border-top: 1px solid var(--wc-line); }
.wc-keys kbd { background: var(--wc-panel-2); border: 1px solid var(--wc-line); color: var(--wc-text); padding: 0 4px; margin: 0 1px; font-size: .7rem; }

/* ---- Map markers ---------------------------------------------------------------------------------- */
.wc-pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .6); box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.wc-pin.seen { opacity: .55; }
.wc-pin.fav { box-shadow: 0 0 0 2px var(--wc-star); }
.wc-now {
    width: 26px; height: 26px; border-radius: 50%;
    border: 3px solid #fff; background: var(--wc-live);
    box-shadow: 0 0 0 0 rgba(255, 59, 78, .7); animation: wc-ring 1.8s ease-out infinite;
}
@keyframes wc-ring { 70% { box-shadow: 0 0 0 16px rgba(255, 59, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 78, 0); } }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(79, 195, 247, .25); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: rgba(18, 56, 77, .95); color: #dff4ff; font-weight: 700; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--wc-panel); color: var(--wc-text); }
.leaflet-popup-content { margin: 10px 12px; font-size: .82rem; }
.leaflet-popup-content b { display: block; margin-bottom: 2px; }
.leaflet-popup-content button { margin-top: 6px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--wc-dim); }
.leaflet-control-layers { background: var(--wc-panel) !important; color: var(--wc-text); border: 1px solid var(--wc-line) !important; }
.leaflet-control-layers-toggle { filter: invert(1) hue-rotate(180deg); }
.leaflet-bar a { background: var(--wc-panel-2); color: var(--wc-text); border-color: var(--wc-line); }
.leaflet-bar a:hover { background: #202736; color: #fff; }
.leaflet-control-attribution { background: rgba(7, 9, 13, .7) !important; color: var(--wc-dim) !important; }
.leaflet-control-attribution a { color: #9fb3d1 !important; }

.wc-toast {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2000;
    background: #1d2534; color: var(--wc-text); border: 1px solid #33405a; border-radius: 10px;
    padding: 9px 14px; font-size: .88rem; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100vw - 32px);
}

/* Fullscreen: the screen fills everything. */
.wc-screen:fullscreen { border-radius: 0; }

/* ---- Narrow screens: stack ------------------------------------------------------------------------ */
@media (max-width: 991.98px) {
    .wc { grid-template-columns: minmax(0, 1fr); height: auto; padding: 10px 16px 16px; }
    .wc-screen { flex: none; aspect-ratio: 16 / 9; }
    .wc-side { height: 70vh; min-height: 420px; }
}
@media (max-width: 575.98px) {
    .wc { padding: 8px 16px 16px; gap: 10px; }
    .wc-screen { border-radius: 10px; margin: 0 -8px; }
    .wc-bar { padding: 10px; }
    .wc-btn span { display: none; }
    .wc-btn { padding: 0 11px; }
    .wc-btn-main span { display: inline; }
    .wc-controls { width: 100%; justify-content: space-between; }
    .wc-owner .wc-btn span { display: none; }
}
