/* TIRIDRO Reels v1.0.0
   Scoped under .trs- so nothing here can reach Core's own reel styles. */

.trs-studio {
  --trs-line: rgba(15, 23, 42, .12);
  --trs-ink: #0f172a;
  --trs-muted: #64748b;
  --trs-accent: #0f766e;
  --trs-accent-ink: #fff;
  --trs-bg: #fff;
  --trs-soft: #f8fafc;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  color: var(--trs-ink);
  font-size: 15px;
  line-height: 1.6;
}

.trs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.trs-head h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.2; }
.trs-head p { margin: 0; color: var(--trs-muted); }

.trs-notice {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 14px;
}
.trs-notice-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.trs-notice-info  { background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; }

/* Steps -------------------------------------------------------------- */

.trs-rail {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.trs-rail li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--trs-muted);
  border-top: 3px solid var(--trs-line);
  padding-top: 8px;
  min-width: 0;
}
.trs-rail li span {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  background: var(--trs-line);
  color: var(--trs-ink);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trs-rail li.is-current,
.trs-rail li.is-done { color: var(--trs-accent); border-top-color: var(--trs-accent); }
.trs-rail li.is-current span,
.trs-rail li.is-done span { background: var(--trs-accent); color: var(--trs-accent-ink); }

/* Layout ------------------------------------------------------------- */

.trs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.trs-preview-col { position: sticky; top: 20px; }

.trs-phone {
  border: 1px solid var(--trs-line);
  border-radius: 20px;
  padding: 8px;
  background: var(--trs-bg);
}

.trs-stage {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trs-stage img,
.trs-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.trs-empty {
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
  padding: 0 20px;
}
.trs-overlay-text {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 44px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .75);
  word-break: break-word;
}
.trs-music-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .75);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.trs-music-bar::before { content: "\266A  "; }

.trs-preview-note { margin: 8px 0 0; }

/* Panels ------------------------------------------------------------- */

.trs-step h2 { margin: 0 0 14px; font-size: 19px; }
.trs-field { margin: 0 0 16px; }
.trs-field > label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.trs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.trs-row > label { margin: 0; flex: 0 0 auto; }
.trs-row input[type="range"] { flex: 1; min-width: 140px; }
.trs-row output { font-weight: 600; min-width: 44px; }

.trs-studio input[type="text"],
.trs-studio select,
.trs-studio textarea {
  width: 100%;
  border: 1px solid var(--trs-line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: var(--trs-bg);
}
.trs-studio textarea { resize: vertical; }
.trs-studio input[type="text"]:focus,
.trs-studio select:focus,
.trs-studio textarea:focus {
  outline: 2px solid var(--trs-accent);
  outline-offset: 1px;
  border-color: transparent;
}

.trs-hint {
  color: var(--trs-muted);
  font-size: 13px;
  margin: 6px 0 0;
}

/* Source ------------------------------------------------------------- */

.trs-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.trs-choice-btn {
  text-align: left;
  border: 1px solid var(--trs-line);
  background: var(--trs-bg);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.trs-choice-btn strong { display: block; font-size: 15px; }
.trs-choice-btn span { display: block; color: var(--trs-muted); font-size: 13px; }
.trs-choice-btn.is-active {
  border-color: var(--trs-accent);
  box-shadow: inset 0 0 0 1px var(--trs-accent);
}

.trs-drop {
  border: 2px dashed var(--trs-line);
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  background: var(--trs-soft);
}
.trs-drop.is-over { border-color: var(--trs-accent); background: #ecfdf5; }
.trs-drop p { margin: 0 0 10px; color: var(--trs-muted); font-size: 14px; }
.trs-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.trs-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
}
.trs-thumb {
  position: relative;
  width: 78px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--trs-line);
  background: var(--trs-soft);
}
.trs-thumb img { width: 100%; height: 104px; object-fit: cover; display: block; }
.trs-thumb-video {
  width: 100%;
  padding: 14px;
  font-size: 14px;
  border-radius: 10px;
}
.trs-thumb em {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--trs-accent);
  color: var(--trs-accent-ink);
  font-size: 10px;
  font-style: normal;
  border-radius: 5px;
  padding: 1px 5px;
}
.trs-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, .75);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  font-size: 12px;
  padding: 0;
}
.trs-thumb-move {
  display: flex;
  border-top: 1px solid var(--trs-line);
}
.trs-thumb-move button {
  flex: 1;
  border: 0;
  background: var(--trs-bg);
  padding: 4px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--trs-muted);
}
.trs-thumb-move button:hover { background: var(--trs-soft); color: var(--trs-ink); }

.trs-progress { margin-top: 14px; }
.trs-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--trs-line);
  overflow: hidden;
}
.trs-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--trs-accent);
  transition: width .25s ease;
}

/* Covers ------------------------------------------------------------- */

.trs-covers { display: flex; flex-wrap: wrap; gap: 8px; }
.trs-cover {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
  line-height: 0;
}
.trs-cover img { width: 56px; height: 74px; object-fit: cover; border-radius: 8px; }
.trs-cover.is-active { border-color: var(--trs-accent); }

/* Music -------------------------------------------------------------- */

.trs-moods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.trs-chip {
  border: 1px solid var(--trs-line);
  background: var(--trs-bg);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--trs-muted);
}
.trs-chip.is-active {
  background: var(--trs-accent);
  border-color: var(--trs-accent);
  color: var(--trs-accent-ink);
}

.trs-tracks { display: flex; flex-direction: column; gap: 8px; }
.trs-track {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--trs-line);
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--trs-bg);
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.trs-track.is-active { border-color: var(--trs-accent); box-shadow: inset 0 0 0 1px var(--trs-accent); }
.trs-track-pick {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.trs-track-name { display: block; font-weight: 600; font-size: 14px; }
.trs-track-meta { display: block; color: var(--trs-muted); font-size: 12px; }
.trs-track-listen,
.trs-track-start {
  flex: 0 0 auto;
  border: 1px solid var(--trs-line);
  background: var(--trs-bg);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--trs-ink);
}

/* Buttons ------------------------------------------------------------ */

.trs-btn,
.trs-studio label.trs-btn {
  display: inline-block;
  border: 1px solid var(--trs-line);
  background: var(--trs-bg);
  color: var(--trs-ink);
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.trs-btn:hover { background: var(--trs-soft); }
.trs-btn-primary {
  background: var(--trs-accent);
  border-color: var(--trs-accent);
  color: var(--trs-accent-ink);
}
.trs-btn-primary:hover { filter: brightness(1.08); background: var(--trs-accent); }
.trs-btn-small { padding: 6px 12px; font-size: 13px; margin-top: 8px; }
.trs-btn-wide { width: 100%; margin-top: 10px; text-align: center; }
.trs-btn[disabled] { opacity: .6; cursor: default; }

.trs-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--trs-line);
}
.trs-actions .trs-btn-primary { min-width: 150px; }

.trs-gate {
  max-width: 520px;
  margin: 40px auto;
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 14px;
  text-align: center;
}

/* Playback additions on Core's cards ---------------------------------- */

.trs-credit {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 4;
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
  pointer-events: none;
  max-width: 70%;
}
.trs-credit::before { content: "\266A  "; }

/* One mark on every reel, paid or not. A reel that travels off the site
   should still say where it came from. */
.tiridro-reel-card::after {
  content: "TIRIDRO";
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  font-size: 10px;
  letter-spacing: .12em;
  font-weight: 700;
  color: rgba(255, 255, 255, .78);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  pointer-events: none;
}

@media (max-width: 860px) {
  .trs-layout { grid-template-columns: minmax(0, 1fr); }
  .trs-preview-col {
    position: static;
    max-width: 240px;
    margin: 0 auto 8px;
  }
  .trs-rail li { font-size: 0; gap: 0; justify-content: center; }
  .trs-rail li span { font-size: 11px; }
  .trs-head { flex-direction: column; }
}

.trs-more{display:flex;justify-content:center;padding:20px 0 8px}
.tiridro-my-reel-item .trs-credit{font-size:10px}

/* The display rule on the preview media outranks the browser's own styling for
   the hidden attribute, so an empty <img> kept its full width and squeezed the
   placeholder into a sliver. Anything marked hidden inside the studio really
   has to be gone. */
.trs-studio [hidden] { display: none !important; }
.trs-stage img[hidden],
.trs-stage video[hidden] { display: none !important; }
.trs-stage img,
.trs-stage video { position: absolute; inset: 0; }
