:root {
  --bg: #0b1220;
  --panel: #111a2e;
  --panel2: #0f1730;
  --text: #e8eefc;
  --muted: #a9b7de;
  --accent: #4ea1ff;
  --danger: #ff5a6a;

  --navW: 260px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden; /* kiosk: prevent scrollbars */
}

.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--navW) 1fr;
}

.nav {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  padding: 8px 10px 14px;
}

.navbtn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 16px 14px;
  text-align: left;
  font-size: 18px;
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.navbtn:active {
  transform: scale(0.99);
  background: rgba(78,161,255,0.20);
}

/* ===== Nested Video Navigation ===== */

.navchildren {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 6px 18px; /* indent */
  transition: all 0.25s ease;
}

.navsubbtn {
  appearance: none;
  border: 0;
  border-radius: 14px;              /* match parent */
  padding: 12px 14px;               /* slightly smaller */
  text-align: left;
  font-size: 16px;                  /* slightly smaller */
  color: var(--text);
  background: rgba(255,255,255,0.06);  /* match parent */
  opacity: 0.9;
  transition: all 0.15s ease;
}

.navsubbtn:hover {
  background: rgba(255,255,255,0.12);
}

.navsubbtn:active {
  transform: scale(0.98);
  background: rgba(78,161,255,0.20);
}

.navsubbtn.active {
  background: rgba(78,161,255,0.35);
  opacity: 1;
}

/* Optional polish: show a subtle “has children” chevron on Videos */
.navbtn[data-route="videos"]::after {
  content: "▾";
  float: right;
  opacity: 0.6;
}

.spacer { flex: 1; }

.hint {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.9;
  padding: 8px 10px;
}

.main {
  display: grid;
  grid-template-rows: 66px 1fr;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.title { font-size: 20px; font-weight: 700; }
.status { font-size: 13px; color: var(--muted); }

.view {
  padding: 18px;
  min-width: 0;
  min-height: 0;
}

/* Cards */
.card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bigbtn {
  border: 0;
  border-radius: 16px;
  padding: 18px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  background: rgba(78,161,255,0.22);
  text-align: left;
}

.bigbtn:active { transform: scale(0.99); }

.videoTile {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.videoTitle { font-size: 18px; font-weight: 700; }
.videoDesc { font-size: 14px; color: var(--muted); }

/* Player area: tiles + player below */
.playerWrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: calc(100vh - 66px - 36px); /* topbar + padding */
}

.videoSelectBar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding-bottom: 2px;
}

.videoChoice {
  flex: 0 0 auto;
}

.playerSurface {
  padding: 12px;
  min-height: 0;
}

video, iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
  background: #000;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  padding: 18px;
}

.hidden { display: none; }

.modalCard {
  width: min(520px, 100%);
  background: #0d162b;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 18px;
}

.modalTitle { font-size: 20px; font-weight: 800; }
.modalText { color: var(--muted); margin: 10px 0 14px; }

.pinInput {
  width: 100%;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 18px;
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: rgba(78,161,255,0.30);
}

.btn.ghost { background: rgba(255,255,255,0.10); }

.error {
  margin-top: 10px;
  color: var(--danger);
  font-weight: 700;
}
