/* xtool.systems Live – Zuschauerseite (CI: dunkel, Akzent Blau) */
:root {
  --bg: #0C0C10;
  --panel: #15141A;
  --panel-2: #1B1A22;
  --line: #26252F;
  --navy: #12203E;
  --blue: #2D70FF;
  --text: #FFFFFF;
  --muted: #B4B4C0;
  --dim: #7C7C8A;
  --live: #FF3B3B;
  --orange: #FF8A2D;
  --green: #2EC27E;
  --radius: 14px;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.045) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(180deg, var(--navy) 0, var(--bg) 340px);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--blue); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1320px; margin: 0 auto; padding: 18px 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand .icon { width: 36px; height: 36px; border-radius: 9px; background: var(--blue);
  display: grid; place-items: center; font-weight: 800; font-size: 17px; letter-spacing: -.5px; }
.wordmark { font-weight: 800; font-size: 19px; letter-spacing: -.3px;
  border-bottom: 2px solid var(--blue); padding-bottom: 2px; }
.wordmark .dot { color: var(--blue); }
.wordmark .sys { color: var(--muted); font-weight: 700; }
.pill { background: var(--blue); color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .14em;
  padding: 6px 11px; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }
.pill.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 10px; }

.live-badge { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; border-radius: 8px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.live-badge.on i { background: var(--live); box-shadow: 0 0 0 4px rgba(255,59,59,.25); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255,59,59,0); } }

.kicker { color: var(--blue); font-weight: 800; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }
h1 { margin: 6px 0 4px; font-size: clamp(24px, 3.2vw, 36px); letter-spacing: -.6px; line-height: 1.1; }
.sub { color: var(--muted); margin: 0; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px 40px; }

.stage { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.stage video.layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .25s ease; background: #000; }
.stage video.layer.front { opacity: 1; }
.stage .hud { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; z-index: 3; }
.stage .hud .cam-name { background: rgba(0,0,0,.55); backdrop-filter: blur(6px); padding: 6px 10px;
  border-radius: 8px; font-weight: 700; font-size: 13px; }
.stage .controls { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 3; }
.ctrl { border: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); color: #fff; cursor: pointer;
  border-radius: 10px; height: 40px; min-width: 40px; padding: 0 12px; display: inline-flex;
  align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.ctrl:hover { background: rgba(45,112,255,.85); }
.ctrl.primary { background: var(--blue); }
.ctrl svg { width: 18px; height: 18px; }
.stage .overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 2;
  background: radial-gradient(circle at 50% 40%, rgba(18,32,62,.9), rgba(12,12,16,.96)); transition: opacity .3s; }
.stage .overlay.hidden { opacity: 0; pointer-events: none; }
.stage .overlay p { color: var(--muted); margin: 8px 0 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--blue); animation: spin 0.9s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.rail-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 12px; }
.rail-title h2 { font-size: 15px; margin: 0; letter-spacing: .02em; }
.rail-title span { color: var(--dim); font-size: 13px; }
.cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cam { position: relative; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; }
.cam:hover:not(:disabled) { border-color: #3a3a48; transform: translateY(-1px); }
.cam:disabled { cursor: not-allowed; opacity: .45; }
.cam .thumb { aspect-ratio: 16/9; background: #0a0a0e center/cover no-repeat; position: relative; }
.cam .thumb .key { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.6); border-radius: 6px;
  font-size: 11px; font-weight: 800; padding: 3px 7px; color: var(--muted); }
.cam .thumb .badge { position: absolute; right: 8px; top: 8px; font-size: 11px; font-weight: 800;
  border-radius: 6px; padding: 3px 7px; background: rgba(0,0,0,.6); }
.cam .meta { padding: 10px 12px 12px; border-left: 3px solid transparent; }
.cam .meta b { display: block; font-size: 14px; }
.cam .meta small { color: var(--dim); font-size: 12px; display: block; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam.active { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 8px 26px rgba(45,112,255,.25); }
.cam.active .meta { border-left-color: var(--blue); }
.cam.auto .thumb { background: linear-gradient(135deg, var(--navy), #0c0c10); display: grid; place-items: center; }
.cam.auto .thumb svg { width: 42px; height: 42px; color: var(--blue); }
.cam .offline-label { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim);
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.foot { color: var(--dim); font-size: 12px; text-align: center; padding: 24px 20px 30px; }
.foot a { color: var(--muted); text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--orange);
  padding: 12px 16px; border-radius: 10px; transition: .25s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }

body.embed { background: #000; }
body.embed .top, body.embed .intro, body.embed .foot { display: none; }
body.embed .wrap { padding: 0; max-width: none; }
body.embed .stage { border-radius: 0; border: 0; }
body.embed .cams { padding: 10px; }

@media (max-width: 640px) {
  .top { padding: 14px 16px; }
  .wrap { padding: 0 16px 30px; }
  .wordmark { font-size: 16px; }
  .cams { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .cam { flex: 0 0 62%; scroll-snap-align: start; }
  .stage { border-radius: 10px; }
  .ctrl .lbl { display: none; }
}
