/* ==========================================================================
   GTA6. — Estúdio de prompts (aba Prompts + editor). Lógica em studio.js.
   Usa os tokens de ../assets/css/style.css.
   ========================================================================== */

/* ---------- como funciona ---------- */
.how { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--font-cond); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.how li { display: inline-flex; align-items: center; gap: 8px; }
.how b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--grad-cta); color: #fff; font-size: 12px; letter-spacing: 0; }

/* ---------- quadradinhos de tipo ---------- */
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; margin-bottom: 28px; }
.kind { position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 3px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--grad-card), var(--card); color: #fff; text-align: left; font: inherit; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; }
.kind i { font-style: normal; font-size: 30px; line-height: 1; margin-bottom: auto; }
.kind b { font-family: var(--font-cond); font-weight: 800; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; }
.kind span { font-size: 11.5px; color: var(--muted-2); line-height: 1.25; }
.kind:hover { transform: translateY(-3px); border-color: var(--line-pink); }
.kind.is-active { border-color: var(--pink); background: radial-gradient(120% 90% at 0% 0%, rgba(255, 45, 149, .35), transparent 60%), var(--card-2); box-shadow: 0 20px 44px -22px rgba(255, 45, 149, .9); }
.kind.is-active span { color: var(--pink-soft); }
.kind__lock { position: absolute; top: 10px; right: 10px; font-style: normal; font-size: 13px; opacity: .85; }

/* ---------- biblioteca ---------- */
.lib__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.lib__head h3 { margin: 0; font-size: 20px; }
.lib__head .count { font-family: var(--font-cond); font-weight: 700; font-size: 12px; letter-spacing: .1em; padding: 4px 9px; border-radius: 6px; background: rgba(255, 45, 149, .16); border: 1px solid var(--line-pink); color: var(--pink-soft); }
.seg { display: inline-flex; margin-left: auto; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; font-family: var(--font-cond); font-weight: 700; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: #fff; }
.seg button.is-active { background: var(--pink); color: #fff; }

.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.lib > .empty { grid-column: 1 / -1; }
.lib.is-blur { filter: blur(6px); pointer-events: none; user-select: none; opacity: .5; }
.lib.is-blur + .locked { margin-top: -120px; }
.pc { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 184px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--grad-card), var(--card); color: #fff; text-align: left; font: inherit; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
.pc:hover, .pc:focus-visible { transform: translateY(-3px); border-color: var(--line-pink); box-shadow: 0 24px 50px -28px rgba(255, 45, 149, .8); outline: none; }
.pc__ico { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 4px; border-radius: 12px; font-size: 24px; background: rgba(255, 45, 149, .14); border: 1px solid var(--line-pink); }
.pc__name { font-family: var(--font-cond); font-weight: 700; font-size: 16.5px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.15; }
.pc__blurb { font-size: 13px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.pc__foot { margin-top: auto; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; font-family: var(--font-cond); font-weight: 700; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }
.pc__foot i { font-style: normal; color: var(--pink-soft); padding: 3px 8px; border-radius: 6px; background: rgba(255, 45, 149, .12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.pc__foot em { font-style: normal; color: var(--muted-2); white-space: nowrap; transition: color .2s; }
.pc:hover .pc__foot em { color: #fff; }
.pc--new { justify-content: center; align-items: center; text-align: center; border-style: dashed; border-color: var(--line-pink); background: rgba(255, 45, 149, .05); }
.pc--new .pc__ico { background: var(--grad-cta); border-color: transparent; font-size: 26px; }
.pc--pack { border-color: var(--line-gold); }
.pc--pack .pc__ico { background: rgba(255, 198, 92, .14); border-color: var(--line-gold); }
.pc--pack .pc__foot i { color: var(--gold); background: rgba(255, 198, 92, .14); }
.pc__del { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: rgba(10, 8, 24, .7); color: var(--muted); font-size: 12px; cursor: pointer; }
.pc__del:hover { color: #fff; border-color: var(--red); background: rgba(255, 77, 109, .25); }

/* ---------- editor ---------- */
.ed .ed__box { position: relative; z-index: 1; width: min(1120px, 100%); height: min(800px, calc(100svh - 32px)); display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: radial-gradient(90% 50% at 70% 0%, rgba(255, 45, 149, .14), transparent 60%), linear-gradient(165deg, #1b1240, #0d081f); border: 1px solid var(--line-pink); box-shadow: 0 60px 140px -40px rgba(255, 45, 149, .6); animation: modalIn .35s cubic-bezier(.2, .8, .2, 1); outline: none; }
.ed__head { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 64px 14px 20px; border-bottom: 1px solid var(--line); }
.ed__head .modal__close { top: 50%; right: 16px; transform: translateY(-50%); }
.ed__ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; font-size: 26px; background: rgba(255, 45, 149, .14); border: 1px solid var(--line-pink); }
.ed__names { min-width: 0; }
.ed__head .eyebrow { margin: 0 0 5px; font-size: 11.5px; }
.ed .ed__head h3 { margin: 0; font-size: 30px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed__switch { display: none; }
.ed__body { flex: 1; min-height: 0; display: grid; grid-template-columns: 370px 1fr; }

.ed__side { overflow: auto; padding: 18px 20px 28px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; background: rgba(0, 0, 0, .16); overscroll-behavior: contain; }
.ed .ed__field { gap: 8px; }
.ed__field textarea, .ed .ed__field input[type="text"] { font: inherit; font-family: var(--font-body); font-size: 15px; line-height: 1.45; color: #fff; letter-spacing: 0; text-transform: none; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); outline: none; resize: vertical; transition: border-color .2s, box-shadow .2s; }
.ed__field textarea:focus, .ed .ed__field input[type="text"]:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 45, 149, .2); }
.ed__glabel { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-family: var(--font-cond); font-weight: 600; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ed__glabel b { color: var(--pink-soft); font-weight: 800; white-space: nowrap; }
.ed__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ed__chip { padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--muted); font-family: var(--font-body); font-weight: 600; font-size: 13px; line-height: 1.2; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.ed__chip:hover { color: #fff; border-color: var(--line-pink); }
.ed__chip.is-on { background: rgba(255, 45, 149, .22); border-color: var(--pink); color: #fff; }
.ed__group--grade { padding: 14px 14px 10px; border-radius: 14px; border: 1px solid var(--line-pink); background: rgba(255, 45, 149, .07); }
.ed__group--grade .ed__glabel b { font-size: 15px; color: #fff; }
.ed__range { width: 100%; margin: 4px 0 2px; accent-color: var(--pink); cursor: pointer; }
.ed__ticks { display: flex; justify-content: space-between; font-family: var(--font-cond); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.ed__note { display: grid; gap: 10px; justify-items: start; padding: 16px; border-radius: 14px; border: 1px solid var(--line-gold); background: rgba(255, 198, 92, .07); }
.ed__note b { font-family: var(--font-cond); font-size: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-2); }
.ed__note p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ed__see { display: none; }

.ed__main { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.ed__label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--font-cond); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ed__label b { color: #fff; }
.ed__label span { font-weight: 600; color: var(--muted-2); font-size: 12px; }
#edText { flex: 1; min-height: 180px; width: 100%; resize: none; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.6; color: #fff; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); outline: none; transition: border-color .2s; }
#edText:focus { border-color: var(--line-pink); }
.ed__stale { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 10px; background: rgba(255, 198, 92, .1); border: 1px solid var(--line-gold); color: var(--gold-2); font-size: 13px; }
.ed__stale .ib { flex: none; }
.ed__tip { margin: 0; font-size: 12.5px; color: var(--muted-2); line-height: 1.45; }
.ed__targets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ed__targets > span { font-family: var(--font-cond); font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin-right: 2px; }
.ed__ai { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; font-family: var(--font-cond); font-weight: 700; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; transition: border-color .15s, background .15s; }
.ed__ai:hover { border-color: var(--line-pink); background: rgba(255, 45, 149, .14); }
.ed__ai--magic { border-color: var(--line-gold); color: var(--gold-2); }
.ed__ai--magic:hover { border-color: var(--gold); background: rgba(255, 198, 92, .14); }

.ed__bar { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: rgba(10, 8, 24, .65); }
.ed__bar .grow { flex: 1; }
.ed__bar .btn { font-size: 20px; padding: 12px 22px 10px; }
.ed__mini { padding: 9px 12px; font-size: 12.5px; }

/* botão "✍️ Legenda" no player: 3 botões na barra, os secundários ficam compactos */
.player__bar .btn--ghost { font-size: 18px; padding: 13px 12px 11px; }

/* ---------- celular ---------- */
@media (max-width: 760px) {
  .kinds { grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 22px; }
  .kind { padding: 8px 6px; align-items: center; justify-content: center; text-align: center; border-radius: 14px; }
  .kind i { font-size: 24px; margin: 0 0 4px; }
  .kind b { font-size: 12.5px; letter-spacing: .03em; }
  .kind span { display: none; }
  .kind__lock { top: 5px; right: 6px; font-size: 10px; }
  .how { font-size: 11.5px; gap: 6px 14px; }
  .seg { margin-left: 0; }
  .lib__head { gap: 8px; }
  .lib__head h3 { font-size: 18px; }
  .lib { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pc { min-height: 170px; padding: 13px; }
  .pc__ico { width: 40px; height: 40px; font-size: 21px; }
  .pc__name { font-size: 15px; }
  .pc__blurb { font-size: 12.5px; }
  .pc__foot em { display: none; }
  .pc__foot i { max-width: 100%; }

  .ed { padding: 0; }
  .ed .ed__box { width: 100vw; height: 100svh; border-radius: 0; border: 0; }
  .ed__head { padding: 12px 56px 10px 14px; gap: 10px; }
  .ed__ico { width: 40px; height: 40px; font-size: 22px; border-radius: 11px; }
  .ed .ed__head h3 { font-size: 24px; }
  .ed__switch { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
  .ed__switch button { flex: 1; padding: 9px 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--muted); font-family: var(--font-cond); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
  .ed__switch button.is-active { background: rgba(255, 45, 149, .2); border-color: var(--pink); color: #fff; }
  .ed__body { grid-template-columns: 1fr; }
  .ed__side { border-right: 0; padding: 14px 14px 24px; background: none; }
  .ed[data-view="prompt"] .ed__side, .ed[data-view="side"] .ed__main { display: none; }
  .ed__see { display: inline-flex; font-size: 18px; }
  .ed__main { padding: 12px 14px; }
  #edText { font-size: 13px; padding: 13px; }
  .ed__bar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 6px; }
  .ed__bar .grow { display: none; }
  .ed__mini span { display: none; }
  .ed__mini { padding: 10px 11px; font-size: 15px; }
  .ed__bar .btn { flex: 1; min-width: 0; font-size: 17px; padding: 12px 8px 10px; }
}
