/* Painel admin: abas e a parte de CONTEÚDO (banners, jogos, textos, pets). O resto vem do /style.css. */

/* link com cara de botão (o .admin a do style.css pinta todo link de dourado) */
.admin a.btn {
  text-decoration: none;
}
.admin a.btn-ghost {
  color: var(--paper, #f6f0e6);
}

/* ---------- abas ---------- */
.ct-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.ct-tabs button {
  border: 1.5px solid var(--line-2, rgba(255, 240, 220, 0.18));
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper, #f6f0e6);
  border-radius: 99px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.ct-tabs button:hover {
  border-color: rgba(245, 194, 43, 0.5);
}
.ct-tabs button[aria-selected='true'] {
  border-color: var(--gold, #f5c22b);
  background: rgba(245, 194, 43, 0.14);
  color: var(--gold-hi, #ffe27a);
}
.ct-tabs button:focus-visible {
  outline: 3px solid var(--lime, #f5c22b);
  outline-offset: 3px;
}
.ct-tabs .sep {
  flex: 1;
}

.ct-section {
  display: grid;
  gap: 16px;
}
.ct-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.ct-head h2 {
  margin: 0;
}
.ct-head .admin-actions {
  flex-basis: auto;
  flex-wrap: wrap;
}
.ct-head .btn {
  white-space: nowrap;
}
.ct-empty {
  color: var(--muted, #b3a99c);
  font-size: 14px;
}

/* ---------- formulário ---------- */
.ct textarea,
.ct select,
.ct-editor textarea,
.ct-editor select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--paper, #f6f0e6);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.25));
  border: 1.5px solid var(--line-2, rgba(255, 240, 220, 0.18));
  border-radius: 12px;
  padding: 11px 12px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}
.ct textarea,
.ct-editor textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.45;
}
.ct select option,
.ct-editor select option {
  background: #1b1714;
  color: #f6f0e6;
}
.ct textarea:focus,
.ct select:focus,
.ct-editor textarea:focus,
.ct-editor select:focus {
  border-color: var(--lime, #f5c22b);
  outline: none;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.45),
    0 0 0 4px rgba(245, 194, 43, 0.14);
}
.ct-editor input,
.ct input {
  font-size: 15px;
  padding: 11px 12px;
}
.ct-editor input[type='checkbox'],
.ct input[type='checkbox'],
.ct-editor input[type='radio'] {
  width: 20px;
  height: 20px;
  padding: 0;
  accent-color: var(--gold, #f5c22b);
  box-shadow: none;
  flex: none;
}
.ct-editor input[type='range'] {
  padding: 0;
  box-shadow: none;
  background: none;
  border: 0;
  accent-color: var(--gold, #f5c22b);
}
.ct-editor input[type='file'] {
  font-size: 14px;
  padding: 9px;
}
.ct-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.ct-field-row > span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted, #b3a99c);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ct-count {
  font-size: 12px;
  color: var(--dim, #7a7166);
  font-variant-numeric: tabular-nums;
}
.ct-count.over {
  color: var(--bad, #ff5d5d);
  font-weight: 800;
}
.ct-hint {
  font-size: 12px;
  color: var(--dim, #7a7166);
  margin: 6px 0 0;
  line-height: 1.4;
}
.ct-hint b {
  color: var(--muted, #b3a99c);
}
.ct-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
  margin: 4px 0 12px;
}
.ct-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ct-chips label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line-2, rgba(255, 240, 220, 0.18));
  border-radius: 99px;
  padding: 7px 12px;
  font-weight: 700;
  cursor: pointer;
}
.ct-chips label:has(input:checked) {
  border-color: var(--gold, #f5c22b);
  background: rgba(245, 194, 43, 0.12);
}
.ct-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  .ct-row2 {
    grid-template-columns: 1fr;
  }
}
.ct-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold, #f5c22b);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ct-link:disabled {
  color: var(--dim, #7a7166);
  cursor: default;
  text-decoration: none;
}
.ct-edited {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold, #f5c22b);
  margin-left: 6px;
}

/* ---------- lista de banners / jogos ---------- */
.ct-list {
  display: grid;
  gap: 8px;
}
.ct-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid transparent;
}
.ct-item.off {
  opacity: 0.6;
}
.ct-item.drag-over {
  border-color: var(--gold, #f5c22b);
}
.ct-item.dragging {
  opacity: 0.35;
}
.ct-item .t {
  font-weight: 800;
}
.ct-item .d {
  color: var(--dim, #7a7166);
  font-size: 12px;
  margin-top: 2px;
}
.ct-item .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.ct-item .admin-actions {
  flex-basis: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ct-grip {
  cursor: grab;
  color: var(--dim, #7a7166);
  font-size: 18px;
  line-height: 1;
  padding: 4px 2px;
  user-select: none;
}
.ct-thumb {
  position: relative;
  width: 168px;
  aspect-ratio: 1920 / 800;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(110deg, #0c0907, #2a1a0a);
  display: grid;
  place-items: center;
  color: var(--dim, #7a7166);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ct-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ct-thumb.capa {
  width: 64px;
  aspect-ratio: 4 / 5;
}
.ct-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ct-arrows {
  display: grid;
  gap: 4px;
}
.ct-arrows button {
  width: 30px;
  height: 26px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.07);
  color: var(--paper, #f6f0e6);
  cursor: pointer;
  font-weight: 900;
}
.ct-arrows button:disabled {
  opacity: 0.3;
  cursor: default;
}
@media (max-width: 720px) {
  .ct-item {
    grid-template-columns: 1fr;
  }
  .ct-thumb {
    width: 100%;
  }
  .ct-thumb.capa {
    width: 96px;
  }
  .ct-item .admin-actions {
    justify-content: flex-start;
  }
}

/* interruptor liga/desliga */
.ct-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.ct-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.ct-switch i {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  transition: background 0.15s;
  flex: none;
}
.ct-switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f6f0e6;
  transition: transform 0.15s;
}
.ct-switch input:checked + i {
  background: var(--gold, #f5c22b);
}
.ct-switch input:checked + i::after {
  transform: translateX(18px);
  background: #2a1a00;
}
.ct-switch input:focus-visible + i {
  outline: 3px solid var(--lime, #f5c22b);
  outline-offset: 2px;
}

/* ---------- editor (janela) ---------- */
.ct-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.66);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ct-editor {
  position: relative;
  width: min(980px, 100%);
  max-height: 92svh;
  overflow: auto;
  border-radius: 22px;
  padding: 22px 22px 18px;
}
.ct-editor.narrow {
  width: min(560px, 100%);
}
.ct-editor h3 {
  margin: 0 0 16px;
  font-size: 22px;
  letter-spacing: -0.02em;
  padding-right: 44px;
}
.ct-editor h4 {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted, #b3a99c);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ct-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 22px;
}
@media (max-width: 820px) {
  .ct-editor-grid {
    grid-template-columns: 1fr;
  }
}
.ct-editor-foot {
  position: sticky;
  bottom: -18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 0 0;
  margin-top: 8px;
  background: linear-gradient(180deg, transparent, rgba(22, 19, 17, 0.96) 30%);
}
.ct-editor-foot .form-error {
  margin: 0 auto 0 0;
}

/* prévias do banner: PC (1920×800) e celular (o mesmo corte que a página faz: ~343×196, foco horizontal) */
.ct-prev-label > span:first-child {
  white-space: nowrap;
}
.ct-prev-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted, #b3a99c);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 10px 0 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.ct-prev {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(110deg, #0c0907 0%, #1d140c 50%, #2a1a0a 100%);
  container-type: inline-size;
  isolation: isolate;
}
.ct-prev.pc {
  aspect-ratio: 1920 / 800;
}
.ct-prev.cel {
  width: min(343px, 100%);
  height: 196px;
}
.ct-prev img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.ct-prev.pc img {
  object-position: center;
}
.ct-prev::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(8, 6, 4, 0.88) 0%, rgba(8, 6, 4, 0.62) 34%, rgba(8, 6, 4, 0) 62%);
  pointer-events: none;
}
.ct-prev .copy {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  bottom: 0;
  width: 52%;
  padding: 0 0 0 clamp(10px, 4cqi, 30px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(4px, 1.2cqi, 10px);
}
.ct-prev .tt {
  font-family: var(--display, Impact, sans-serif);
  text-transform: uppercase;
  font-size: clamp(15px, 6.4cqi, 44px);
  line-height: 0.95;
  color: #fff6e0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  overflow-wrap: anywhere;
}
.ct-prev .ss {
  font-size: clamp(10px, 2.2cqi, 16px);
  font-weight: 600;
  color: #f1e6d2;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.ct-prev .bb {
  font-size: clamp(10px, 2.2cqi, 15px);
  font-weight: 900;
  color: #2a1a00;
  background: linear-gradient(180deg, #ffe27a, #f5c22b);
  border-radius: 9px;
  padding: 0.45em 0.9em;
}
.ct-prev .safe {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 45%;
  border-left: 1.5px dashed rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.ct-prev.cel .safe {
  display: none;
}

.ct-defaults {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.ct-defaults button {
  position: relative;
  aspect-ratio: 1920 / 800;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: #1b1714;
}
.ct-defaults button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ct-defaults button.on {
  border-color: var(--gold, #f5c22b);
}
.ct-defaults button span {
  position: absolute;
  left: 4px;
  bottom: 3px;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.ct-imgbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.ct-range {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  margin: 6px 0;
}
.ct-range output {
  font-variant-numeric: tabular-nums;
  color: var(--muted, #b3a99c);
  min-width: 3ch;
  text-align: right;
}

/* capa 4:5 */
.ct-capa {
  position: relative;
  width: min(240px, 100%);
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #241f1b, #0e0c0b);
  display: grid;
  place-items: center;
  color: var(--dim, #7a7166);
  font-size: 12px;
  font-weight: 800;
}
.ct-capa img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ct-capa .nm {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 10px 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
  color: #fff6e0;
  font-family: var(--display, Impact, sans-serif);
  text-transform: uppercase;
  font-size: 22px;
  line-height: 1;
}

/* textos e pets */
.ct-group {
  margin-top: 6px;
}
.ct-group > h3 {
  margin: 6px 0 10px;
  font-size: 16px;
}
.ct-text {
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  margin-bottom: 10px;
}
.ct-text .admin-actions {
  margin-top: 8px;
}
.ct-text.dirty {
  box-shadow: inset 0 0 0 1.5px rgba(245, 194, 43, 0.55);
}
.ct-pet {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: start;
}
.ct-pet img {
  width: 84px;
  height: auto;
}
@media (max-width: 560px) {
  .ct-pet {
    grid-template-columns: 1fr;
  }
  .ct-pet img {
    width: 64px;
  }
}

/* histórico */
.ct-hist .li {
  align-items: flex-start;
}

/* confirmação */
.ct-confirm p {
  color: var(--muted, #b3a99c);
  line-height: 1.5;
  margin: 0 0 16px;
}
.ct-busy {
  pointer-events: none;
  opacity: 0.7;
}
/* botão desligado bem visível (Salvar só acende quando há mudança) */
.ct .btn:disabled,
.ct-editor .btn:disabled {
  opacity: 0.38;
}
