/* UrbanSo demo — light theme, sidebar + phone player (variant look). */
:root {
  --accent: #4361EE;         /* set per role by JS */
  --ink: #2D3142;
  --canvas: #FAFAFA;
  --page: #EDEDF0;
  --surface: #FFFFFF;
  --line: rgba(45,49,66,0.10);
  --line-soft: rgba(45,49,66,0.06);
  --muted: rgba(45,49,66,0.62);
  --syne: 'Syne', system-ui, sans-serif;
  --inter: 'Inter', system-ui, sans-serif;
  --sidebar-w: 250px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--inter);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.app { display: flex; height: 100vh; }

/* ============================= SIDEBAR ============================= */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  gap: 26px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 13px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: var(--syne); font-weight: 800; font-size: 24px;
}
.brand .name { font-family: var(--syne); font-weight: 800; font-size: 20px; }
.brand .name small { display: block; font-family: var(--inter); font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: 0.2px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav .nav-label {
  font-family: var(--syne); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: #9aa0b0;
  padding: 6px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--inter); font-size: 15px; font-weight: 500; color: var(--ink);
  padding: 12px 14px; border-radius: 14px; text-align: left;
  transition: background 140ms ease, color 140ms ease;
}
.nav-item .ic { font-size: 18px; width: 22px; text-align: center; }
.nav-item:hover { background: var(--page); }
.nav-item.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-weight: 600;
}
.nav .spacer { flex: 1; }
.sidebar .foot { font-size: 11.5px; color: var(--muted); line-height: 1.6; padding: 0 8px; }
.sidebar .foot kbd {
  font-family: var(--inter); font-size: 11px;
  background: var(--page); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}

/* ============================= CONTENT ============================= */
.content { flex: 1; position: relative; overflow: hidden; }

/* --- player stage --- */
.stage {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  padding: 18px 20px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(67,97,238,0.06), transparent 60%),
    var(--page);
}
.stage[hidden] { display: none; }

/* player row: phone centered, controls floated on the right */
.player-row {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* phone — fills the available height, keeps portrait aspect */
.phone-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.frame {
  position: relative;
  height: 100%;
  max-height: 940px;
  max-width: 100%;
  aspect-ratio: 1080 / 2340;
  background: #0b0c12;
  border-radius: 36px;
  padding: 6px;
  box-shadow: 0 26px 60px rgba(45,49,66,0.28);
}
.layer {
  position: absolute; inset: 6px;
  border-radius: 30px;
  overflow: hidden;
  background: #fff;
  opacity: 0;
  transition: opacity 380ms ease;
}
.layer.active { opacity: 1; }
.layer .dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(45,49,66,0.05) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none; z-index: 1;
}
.shot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; object-position: center;
  opacity: 0; transition: opacity 160ms ease; z-index: 2;
}
.layer.has-img .shot { opacity: 1; }
.layer.has-img .placeholder { display: none; }
.layer.has-img .dots { display: none; }

/* faux phone status bar (time + signal) */
.statusbar {
  position: absolute;
  top: 6px; left: 6px; right: 6px;
  height: 32px;
  z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 22px 0;
  background: #fff;
  border-top-left-radius: 30px; border-top-right-radius: 30px;
  font-family: var(--syne); font-weight: 700; font-size: 13px; color: var(--ink);
  pointer-events: none;
  transition: opacity 300ms ease;
}
.statusbar svg { width: 16px; height: 16px; fill: var(--ink); }
.frame.on-card .statusbar { opacity: 0; }

/* placeholder */
.placeholder {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 22px;
  background: repeating-linear-gradient(45deg, #f4f4f7 0 14px, #eceffe 14px 28px);
  color: var(--ink);
}
.ph-inner { display: grid; gap: 10px; }
.ph-icon { font-size: 40px; }
.ph-name {
  font-family: var(--inter); font-weight: 600; font-size: 14px; color: var(--accent);
  background: #fff; border-radius: 10px; padding: 8px 12px; word-break: break-all;
  box-shadow: 0 2px 10px rgba(45,49,66,0.10);
}
.ph-hint { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }

/* intro / outro card */
.scene-card {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 34px;
  background:
    radial-gradient(700px 420px at 50% 22%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
    var(--canvas);
}
.scene-card .in { display: grid; gap: 16px; justify-items: center; animation: cardIn 600ms ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.scene-card .badge {
  width: 72px; height: 72px; border-radius: 20px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-family: var(--syne); font-weight: 800; font-size: 36px;
  box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 40%, transparent);
}
.scene-card h1 { font-family: var(--syne); font-weight: 800; font-size: 34px; letter-spacing: -0.5px; }
.scene-card p { color: var(--muted); font-size: 15px; max-width: 22ch; }
.scene-card .chip {
  font-family: var(--syne); text-transform: uppercase; letter-spacing: 2px; font-size: 11px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 6px 14px; border-radius: 999px;
}

/* caption (below phone) */
.cap-block { text-align: center; min-height: 52px; }
.cap-title { font-family: var(--syne); font-weight: 800; font-size: 22px; letter-spacing: -0.3px; }
.cap-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.cap-block.anim .cap-title { animation: capUp 420ms ease both; }
.cap-block.anim .cap-sub { animation: capUp 420ms ease 60ms both; }
@keyframes capUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* controls (vertical pill, floated to the right of the phone) */
.controls {
  position: absolute;
  right: 24px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 7px;
  box-shadow: 0 8px 24px rgba(45,49,66,0.08);
  transition: opacity 240ms ease;
  z-index: 5;
}
.ctrl {
  appearance: none; border: none; background: transparent; color: var(--ink);
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer; transition: background 140ms ease;
}
.ctrl:hover { background: var(--page); }
.ctrl.primary { background: var(--accent); color: #fff; width: 46px; height: 46px; }
.ctrl.primary:hover { filter: brightness(1.07); }
.ctrl svg { width: 20px; height: 20px; fill: currentColor; }
.ctrl .speed-label { font-family: var(--syne); font-weight: 700; font-size: 13px; }

/* progress (below controls) */
.progress { display: flex; gap: 5px; width: min(340px, 80%); transition: opacity 240ms ease; }
.seg { flex: 1; height: 4px; border-radius: 999px; background: rgba(45,49,66,0.14); cursor: pointer; overflow: hidden; }
.seg .fill { display: block; height: 100%; width: 0%; background: var(--accent); border-radius: 999px; }
.seg.done .fill, .seg.current .fill { width: 100%; }

/* auto-hide controls only in fullscreen */
.content:fullscreen { background: var(--page); }
.content:fullscreen.hide-ui .controls,
.content:fullscreen.hide-ui .progress { opacity: 0; pointer-events: none; }

/* ============================= DOWNLOAD PANEL ============================= */
.download {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 30px 20px; overflow-y: auto;
  background: var(--page);
}
.download[hidden] { display: none; }
.dl-card {
  width: 100%; max-width: 460px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 28px; padding: 34px 30px; text-align: center;
  box-shadow: 0 20px 50px rgba(45,49,66,0.10);
}
.dl-icon {
  width: 84px; height: 84px; border-radius: 22px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-family: var(--syne); font-weight: 800; font-size: 44px;
  margin: 0 auto 16px; box-shadow: 0 16px 40px rgba(67,97,238,0.35);
}
.dl-card h1 { font-family: var(--syne); font-weight: 800; font-size: 26px; }
.dl-card .sub { color: var(--muted); font-size: 15px; margin-top: 6px; }
.dl-btn {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-family: var(--syne); font-weight: 700; font-size: 17px; padding: 15px 30px; border-radius: 999px;
  box-shadow: 0 14px 32px rgba(67,97,238,0.32); transition: transform 150ms ease, filter 150ms ease;
}
.dl-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.dl-btn svg { width: 22px; height: 22px; fill: currentColor; }
.dl-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  color: var(--accent); text-decoration: none;
  font-family: var(--syne); font-weight: 700; font-size: 14px;
  border: 1.5px solid var(--accent); padding: 10px 20px; border-radius: 999px;
  transition: background 150ms ease;
}
.dl-link:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dl-meta { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.dl-meta span { background: var(--page); padding: 5px 12px; border-radius: 999px; }
.dl-qr { margin-top: 24px; display: none; }
.dl-qr.show { display: block; }
.dl-qr img { width: 168px; height: 168px; border-radius: 14px; border: 1px solid var(--line); padding: 10px; background: #fff; }
.dl-qr .qr-cap { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.dl-steps { margin-top: 26px; text-align: left; display: grid; gap: 13px; }
.dl-steps h4 { font-family: var(--syne); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.dl-step { display: flex; gap: 12px; align-items: flex-start; }
.dl-step .n {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; font-family: var(--syne);
}
.dl-step p { font-size: 14px; color: #4c5160; line-height: 1.5; }
.dl-note { margin-top: 20px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* small screens: collapse sidebar labels */
@media (max-width: 720px) {
  :root { --sidebar-w: 76px; }
  .brand .name, .nav .nav-label, .nav-item span.txt, .sidebar .foot { display: none; }
  .nav-item { justify-content: center; }
}
