/* Demo səhifələrinin karkası: üst panel + səhnə + sağ panel.
   index.html bu faylı yükləmir. */

html.one-screen,
html.one-screen body { height: 100% }

.app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  min-height: 0;
}

/* ---------- üst panel ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.home:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.brand b {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.brand span {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* seçim yolu — ui/crumbs.js doldurur */
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.crumbs button {
  background: none;
  border: 0;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--muted);
}
.crumbs button:hover {
  background: var(--accent-soft);
  color: var(--ink);
}
.crumbs .cur {
  color: var(--ink);
  font-weight: 600;
  padding: 4px 6px;
}

/* status açıqlaması */
.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.legend .free { background: var(--ok) }
.legend .hold { background: var(--hold) }
.legend .sold { background: var(--sold) }

/* ---------- gövdə: səhnə + yan panel ---------- */
.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  min-height: 0;
}

.side {
  background: var(--surface);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  min-height: 0;
}
.side-in {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.side h2 {
  margin: 2px 0 0;
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.015em;
  text-wrap: balance;
}

/* ---------- 3D səhnə ---------- */
.canvas3d {
  position: relative;
  background: var(--stage);
  min-height: 0;
  overflow: hidden;
}
.canvas3d canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* səhnə üzərindəki qatlar */
.hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(5, 15, 20, .72);
  color: var(--stage-ink);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  pointer-events: none;
  max-width: calc(100% - 24px);
}

.tip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  white-space: nowrap;
  transform: translate(14px, -50%);
  z-index: 3;
}
.tip b { font-family: var(--f-display) }

.loadmsg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stage-muted);
  font-size: 13px;
  pointer-events: none;
}

/* səhnənin sol üstündəki "geri" düyməsi */
.stage-back {
  position: absolute;
  left: 12px;
  top: 12px;
  background: var(--surface);
  color: var(--ink);
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

/* səhnənin sağ üstündəki rejim düymələri */
.viewbar {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.viewbar.left {
  left: 12px;
  right: 12px;
  justify-content: flex-start;
}
.viewbar button {
  border: 0;
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.viewbar button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.viewbar .sp { flex: 1 }

@media (max-width: 900px) {
  html.one-screen,
  html.one-screen body { height: auto }
  .app {
    height: auto;
    min-height: 100%;
  }
  .main { grid-template-columns: 1fr }
  .side {
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .top { padding: 10px 16px }
  .side-in { padding: 16px }
  .canvas3d.fill {
    height: 62vh;
    min-height: 340px;
  }
}

/* ---------- file:// xəbərdarlığı ----------
   Yalnız fayl birbaşa açılanda görünür (file-protocol.js əlavə edir). */
.file-warn {
  position: fixed;
  inset: 0;
  z-index: 100;
  margin: auto;
  width: min(560px, calc(100% - 32px));
  height: max-content;
  max-height: calc(100% - 32px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 28px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.file-warn b {
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: -.01em;
}
.file-warn p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.file-warn code {
  align-self: stretch;
  font-family: var(--f-mono);
  font-size: 13px;
  background: var(--stage);
  color: var(--stage-ink);
  border-radius: 8px;
  padding: 10px 12px;
}
.file-warn p code {
  display: inline;
  padding: 1px 5px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: inherit;
}
.file-warn .btn {
  margin-top: 6px;
}
