/* 3D -> PNG Turntable — extends css/style.css (same palette / glass look) */

.tt-main { max-width: 1900px; }

.tt-hero { padding: 22px 30px; border-radius: 22px; }
.tt-hero h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 6px; }
.tt-hero p { font-size: 1rem; }

.tt-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1250px) {
  .tt-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .tt-layout > .tt-col:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
  .tt-layout > .tt-col:last-child > .tt-panel { margin: 0; }
}
@media (max-width: 800px) {
  .tt-layout { grid-template-columns: minmax(0, 1fr); }
}

.tt-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.tt-panel {
  padding: 18px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}
.tt-panel h3 {
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8ec5ff;
  margin-bottom: 14px;
}
.tt-panel .form-label { margin-bottom: 3px; color: var(--text); }

.tt-names { font-size: .82rem; color: var(--muted); word-break: break-all; }
.tt-names b { color: var(--text); }

.tt-status { list-style: none; padding: 0; margin: 0; font-size: .86rem; }
.tt-status li { padding: 2px 0; }
.tt-status .ok { color: #6ee7a1; }
.tt-status .err { color: #ff7b7b; }
.tt-status .run { color: #ffd479; }
.tt-status .warn { color: #ffd479; }

.tt-texture-info { display: flex; gap: 12px; align-items: center; }
.tt-thumb {
  width: 96px; height: 96px; flex: none;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: #111827;
  image-rendering: auto;
}

.tt-designs { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow-y: auto; }
.tt-design {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(0, 0, 0, .18);
  color: var(--text);
  font-size: .78rem;
  text-align: left;
  word-break: break-all;
}
.tt-design img { width: 28px; height: 28px; border-radius: 6px; flex: none; }
.tt-design.active { border-color: rgba(88, 166, 255, .9); background: rgba(88, 166, 255, .16); }
.tt-design:hover { border-color: rgba(88, 166, 255, .5); }

/* ---- center ---- */
.tt-center { min-width: 0; }
.tt-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px;
}
.tt-toolbar-sep { flex: 1; }

.tt-viewport {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 420px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, .28);
}
.tt-viewport.drag-over { border-color: var(--accent); background: rgba(88, 166, 255, .12); }

.checker, .tt-frame {
  background-color: #1b2233;
  background-image:
    linear-gradient(45deg, #2a3246 25%, transparent 25%),
    linear-gradient(-45deg, #2a3246 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a3246 75%),
    linear-gradient(-45deg, transparent 75%, #2a3246 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.tt-frame {
  position: relative;
  outline: 2px dashed rgba(142, 197, 255, .9);
  outline-offset: 2px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0); /* keep frame crisp */
}
.tt-frame canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.tt-frame canvas.dragging { cursor: grabbing; }

.tt-frame-label {
  position: absolute; top: -26px; left: 0;
  font-size: .76rem; font-weight: 700; color: #8ec5ff;
  pointer-events: none; white-space: nowrap;
}
.tt-crosshair { position: absolute; inset: 0; pointer-events: none; }
.tt-crosshair::before, .tt-crosshair::after {
  content: ""; position: absolute; background: rgba(255, 255, 255, .22);
}
.tt-crosshair::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.tt-crosshair::after { top: 50%; left: 0; right: 0; height: 1px; }

.tt-drop-hint, .tt-empty-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
  pointer-events: none;
  color: var(--muted);
  font-size: .95rem;
  padding: 20px;
}
.tt-drop-hint { display: none; background: rgba(9, 13, 24, .75); color: var(--text); font-weight: 700; }
.tt-viewport.drag-over .tt-drop-hint { display: grid; }

.tt-scrub { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.tt-scrub .form-range { flex: 1; }

/* ---- range rows ---- */
.tt-range { margin-bottom: 8px; }
.tt-range .tt-range-row { display: flex; gap: 8px; align-items: center; }
.tt-range .form-range { flex: 1; }
.tt-range .tt-num { width: 84px; flex: none; }
.tt-range.tt-hidden { display: none; }

.tt-subhead { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.tt-hidden-block { display: none !important; }

.tt-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }

/* ---- bottom ---- */
.tt-generate-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

.tt-seq-viewer { display: flex; gap: 20px; flex-wrap: wrap; }
.tt-seq-image {
  width: 360px; height: 360px; flex: none;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  display: grid; place-items: center;
  overflow: hidden;
}
.tt-seq-image img { max-width: 100%; max-height: 100%; image-rendering: auto; }
.tt-seq-stack { position: relative; display: inline-block; line-height: 0; max-width: 100%; max-height: 100%; }
.tt-seq-stack img { max-width: 360px; max-height: 360px; }
.tt-seq-stack canvas { position: absolute; left: 0; top: 0; pointer-events: none; }

.tt-sa-output { display: grid; gap: 14px; }
.tt-sa-block { border: 1px solid var(--card-border); border-radius: 14px; padding: 10px 12px; background: rgba(0, 0, 0, .2); }
.tt-sa-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 6px; }
.tt-sa-file { font-weight: 800; color: #8ec5ff; }
.tt-sa-text { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .76rem; background: #0b1020 !important; color: #d7e3ff; white-space: pre; }

.tt-seq-controls { flex: 1; min-width: 260px; max-width: 520px; }

.tt-timeline {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 6px 2px 10px;
}
.tt-tl-item {
  flex: none;
  width: 66px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, .25);
  color: var(--muted);
  font-size: .72rem;
  text-align: center;
  cursor: pointer;
}
.tt-tl-item img { width: 58px; height: 58px; object-fit: contain; display: block; margin: 0 auto 2px; border-radius: 6px; }
.tt-tl-item.active { border-color: var(--accent); color: var(--text); background: rgba(88, 166, 255, .18); }
