:root {
  --bg: #0d1017;
  --bg-2: #141924;
  --card: #171d2a;
  --card-2: #1c2432;
  --border: #263041;
  --text: #e7ecf3;
  --muted: #8c98ab;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --live: #ff4757;
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(59,130,246,.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(34,211,238,.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,16,23,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-gerb { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; background:#fff; padding:2px; }
.brand-title { font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; }
.header-nav { margin-left: auto; display: flex; gap: 6px; }
.hn-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 500;
}
.hn-link:hover { background: var(--card-2); color: var(--text); }
.hn-link i { font-size: 1.05rem; }
@media (max-width: 560px) { .hn-link span { display: none; } .brand-title { font-size: 1rem; } }

/* ---------- hero ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(135deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.hero-text h1 { margin: 0 0 6px; font-size: 1.7rem; }
.hero-text p { margin: 0; color: var(--muted); }
.hero-stats { display: flex; gap: 14px; }
.stat {
  min-width: 92px; text-align: center; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px;
}
.stat-num { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1; }
.stat-label { display: block; margin-top: 6px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.stat-label i { color: var(--accent-2); }
@media (max-width: 640px) { .hero { flex-direction: column; align-items: stretch; } .hero-stats { justify-content: center; } }

/* ---------- camera grid ---------- */
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.cam-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.cam-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.cam-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden;
}
.cam-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-card:hover .cam-thumb img { transform: scale(1.04); transition: transform .3s ease; }
.thumb-offline {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted);
}
.thumb-offline i { font-size: 2rem; }
.thumb-offline span { font-size: .82rem; }
.cam-card.offline { opacity: .8; }
.cam-card.offline:hover { border-color: var(--border); transform: none; }

.badge-live, .badge-360 {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .5px; color: #fff;
  padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.55);
}
.badge-live { color: #fff; }
.badge-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(255,71,87,.7); animation: pulse 1.5s infinite; }
.badge-360 { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,71,87,.6);} 70% { box-shadow: 0 0 0 7px rgba(255,71,87,0);} 100%{ box-shadow:0 0 0 0 rgba(255,71,87,0);} }

.cam-meta { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.cam-name { font-weight: 600; }
.cam-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.act {
  display: inline-flex; align-items: center; gap: 5px; font-size: .84rem; font-weight: 600;
  padding: 6px 11px; border-radius: 9px; background: var(--accent); color: #fff;
}
.act:hover { background: var(--accent-2); color: #06121f; }
.act-muted { background: var(--card-2); color: var(--text); border: 1px solid var(--border); }
.act-muted:hover { background: var(--bg-2); color: var(--text); }
.pano-card .cam-name { color: var(--accent-2); }

.empty-note {
  margin-top: 24px; text-align: center; color: var(--muted);
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 24px;
}

/* ---------- page head ---------- */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 1.4rem; flex: 1; }
.btn-back, .btn-ghost {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: .9rem;
}
.btn-back:hover, .btn-ghost:hover { background: var(--card-2); color: var(--text); border-color: var(--accent); }
.hint { color: var(--muted); margin-top: -6px; margin-bottom: 18px; }

/* ---------- player ---------- */
.player-wrap {
  position: relative; background: #000; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.player { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }
.player-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px; color: var(--muted); background: rgba(0,0,0,.6);
}
.live-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: none; cursor: pointer;
  border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06121f;
  font-weight: 700; font-size: .95rem;
}
.btn-primary:hover { filter: brightness(1.08); color: #06121f; }
.btn-primary:disabled { opacity: .6; cursor: default; }
.shot-status { color: var(--muted); font-size: .9rem; cursor: pointer; }
.shot-status.ok { color: var(--ok); }
.shot-status.warn { color: var(--warn); }

/* ---------- gallery ---------- */
.gallery-filter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.gallery-filter select {
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 10px;
}
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.photo-card { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.photo-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; transition: transform .2s; }
.photo-card:hover img { transform: scale(1.05); }
.photo-card figcaption { padding: 8px 10px; font-size: .78rem; color: var(--muted); }

/* ---------- timelapse ---------- */
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.tl-card { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tl-video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.tl-card figcaption { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; color: var(--muted); font-size: .9rem; }
.tl-card .dl { color: var(--accent); }

/* ---------- error ---------- */
.error-box { text-align: center; padding: 60px 16px; }
.error-code { font-size: 5rem; font-weight: 900; color: var(--accent); line-height: 1; }
.error-box h1 { margin: 10px 0; }
.error-box p { color: var(--muted); margin-bottom: 24px; }

/* ---------- footer ---------- */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 18px 0; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: .88rem; }
.tmr-logo img { display: block; border: 0; opacity: .8; }
