html, body {
  margin: 0;
  padding: 0;
  background: #000;
  overflow: hidden;
}

.hidden { display: none; }

/* full-screen black overlay that vanishes on click */
.black {
  z-index: 4;
  position: fixed;
  inset: 0;
  background: #000;
}

/* background gif (visible after click) */
.backg {
  z-index: 0;
  background-image: url(naggars.gif);
  background-repeat: repeat;
  background-size: 300px auto;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* video container (visible after click) */
.centain {
  display: flex;
  justify-content: center;
  align-items: center;
}
.center {
  z-index: 1;
  position: fixed;
  left: 50%;
  top: 50%;
  height: 40%;
  width: 40%;
  transform: translate(-50%, -50%);
}

/* ---------- VESC Tool desktop-app look ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  background: #16181d;
  color: #e6e9ee;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  cursor: default;
  user-select: none;
}

/* window title bar */
.titlebar {
  height: 44px;
  background: #1d2026;
  border-bottom: 1px solid #2a2e36;
  color: #b7bec9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}
.tb-btns i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 6px;
  background: #3a3f48;
  border-radius: 50%;
}

/* main area: sidebar + content */
.app {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar {
  width: 220px;
  flex: 0 0 auto;
  background: #1d2026;
  border-right: 1px solid #2a2e36;
  padding: 10px 8px;
  overflow-y: auto;
}

.side-section {
  padding: 14px 12px 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5d646e;
}

.side-item {
  padding: 9px 12px 9px 20px;
  font-size: 13px;
  color: #b7bec9;
  border-radius: 8px;
}
.side-item:hover { background: #262a31; color: #e6e9ee; }
.side-item.active {
  background: rgba(41, 151, 255, 0.16);
  color: #5aabff;
  font-weight: 600;
}

.content {
  flex: 1 1 auto;
  padding: 28px;
  overflow-y: auto;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(41, 151, 255, 0.07), transparent),
    #16181d;
}

.panel {
  max-width: 560px;
  background: #1d2026;
  border: 1px solid #2a2e36;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.panel-head {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #e6e9ee;
  border-bottom: 1px solid #2a2e36;
}

.panel-body {
  padding: 20px 18px;
}

.conn-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #b7bec9;
  margin-bottom: 12px;
}
.conn-status .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff5252;
  box-shadow: 0 0 8px rgba(255, 82, 82, 0.8);
}

.conn-info {
  color: #79828d;
  line-height: 1.6;
  margin-bottom: 18px;
}

table.meta {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin-bottom: 22px;
  font-size: 12px;
  color: #9aa3ad;
  border: 1px solid #2a2e36;
  border-radius: 10px;
  overflow: hidden;
}
table.meta td {
  padding: 8px 14px;
  border-bottom: 1px solid #2a2e36;
}
table.meta tr:last-child td { border-bottom: none; }
table.meta td:first-child { color: #6d7580; }
table.meta td:last-child { color: #cdd4dc; }

/* the trigger button, modern rounded */
.connect {
  width: 100%;
  padding: 13px 26px;
  background: linear-gradient(180deg, #2f9dff 0%, #1e7fe0 100%);
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(41, 151, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.connect:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(41, 151, 255, 0.45);
}
.connect:active { transform: translateY(0); filter: brightness(0.95); }

/* bottom status bar */
.statusbar {
  flex: 0 0 auto;
  height: 28px;
  background: #1d2026;
  border-top: 1px solid #2a2e36;
  color: #6d7580;
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 0 14px;
  font-size: 11px;
}

/* ---------- splash screen ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #16181d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: splashOut 0.4s ease 1.6s forwards;
}
.splash-logo {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #e6e9ee;
}
.splash-version { font-size: 12px; color: #6d7580; }
.splash-bar {
  width: 220px;
  height: 5px;
  border-radius: 3px;
  background: #2a2e36;
  overflow: hidden;
  margin-top: 14px;
}
.splash-fill {
  height: 100%;
  width: 40%;
  border-radius: 3px;
  background: linear-gradient(90deg, #2f9dff, #5aabff);
  animation: splashLoad 1.6s ease forwards;
}
.splash-text {
  font-size: 12px;
  color: #79828d;
}
@keyframes splashLoad {
  0%   { width: 5%; }
  70%  { width: 70%; }
  100% { width: 100%; }
}
@keyframes splashOut {
  to { opacity: 0; visibility: hidden; }
}

/* mouseover trap at bottom of viewport */
.trap {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 130px;
  z-index: 1;
  background: transparent;
}

/* ---------- mobile / handy ---------- */
@media (max-width: 720px) {
  .titlebar { height: 40px; padding: 0 12px; font-size: 12px; }

  .app { flex-direction: column; }

  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    overflow-x: auto;
    padding: 6px;
    gap: 4px;
    border-right: none;
    border-bottom: 1px solid #2a2e36;
    -webkit-overflow-scrolling: touch;
  }
  .side-section { display: none; }
  .side-item {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 12px;
    white-space: nowrap;
  }
  .sidebar .side-item:nth-child(n+5) { display: none; } /* only key items on phone */

  .content { padding: 14px; }

  .panel {
    max-width: 100%;
    border-radius: 14px;
  }
  .panel-head { padding: 12px 14px; font-size: 13px; }
  .panel-body { padding: 14px; }

  .conn-info { font-size: 13px; }

  .connect {
    padding: 16px 26px;
    font-size: 16px;
    border-radius: 14px;
  }

  .statusbar { height: 26px; font-size: 10px; gap: 14px; }

  /* media after the click, phone-sized */
  .center {
    width: 100vw;
    height: 70vh;
    left: 50%;
    top: 50%;
  }
}
