/* =========================================================
   MODO ADM + janelas (gaveta, leitura de notícia, avisos)
   ========================================================= */
[hidden] { display: none !important; }
body:not(.is-admin) .admin-only { display: none !important; }
html.no-scroll, html.no-scroll body { overflow: hidden; }

/* ---------- Botões do ADM ---------- */
.admin-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  font: 700 .82rem var(--font-body); color: var(--gold-200);
  background: rgba(212, 165, 55, .1);
  border: 1px dashed rgba(233, 194, 96, .55);
  transition: background .3s, border-color .3s, transform .3s var(--ease);
}
.admin-btn svg { width: 16px; height: 16px; }
.admin-btn:hover { background: rgba(212, 165, 55, .2); border-style: solid; transform: translateY(-1px); }
.admin-btn--block { width: 100%; height: 48px; margin-top: 8px; }
.admin-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.hero__edit {
  position: absolute; z-index: 7; top: 104px; right: 24px;
  background: rgba(5, 14, 38, .6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

.edit-btn {
  position: absolute; z-index: 4; top: 12px; right: 12px;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #1d1300;
  background: var(--gold-grad); box-shadow: var(--glow-gold);
  transition: transform .3s var(--ease);
}
.edit-btn svg { width: 18px; height: 18px; }
.edit-btn:hover { transform: scale(1.12) rotate(-8deg); }
body.is-admin .player__cat { top: 62px; }
.post .edit-btn { top: 16px; right: 16px; }

.add-card {
  aspect-ratio: 3 / 4.1; border-radius: var(--radius-lg); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  font: 700 1rem var(--font-body); color: var(--gold-200);
  background: rgba(212, 165, 55, .05);
  border: 2px dashed rgba(233, 194, 96, .45);
  transition: background .3s, border-color .3s, transform .4s var(--ease);
}
.add-card svg { width: 46px; height: 46px; padding: 10px; border-radius: 50%; color: #1d1300; background: var(--gold-grad); box-shadow: var(--glow-gold); }
.add-card:hover { background: rgba(212, 165, 55, .12); border-color: var(--gold-400); transform: translateY(-4px); }

.badge {
  position: absolute; z-index: 4; padding: 5px 11px; border-radius: 999px;
  font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.badge--muted { top: 62px; left: 14px; color: var(--text); background: rgba(3, 8, 23, .75); border: 1px solid var(--line); }
.badge--draft { top: 18px; left: 18px; color: #1d1300; background: #f0f3ff; }
.player.is-inactive .player__photo { filter: grayscale(1) brightness(.6); }
.player__photo--empty { background-size: 46% auto !important; background-position: center 38% !important; opacity: .5; }
.roster__empty, .empty { margin: 10px 0 0; padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.news-grid > .empty { grid-column: 1 / -1; }
.post { outline: none; }
.post:focus-visible { box-shadow: 0 0 0 2px var(--gold-400), var(--shadow); }

/* ---------- Barra do modo ADM ---------- */
.admin-bar {
  position: fixed; z-index: 60; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100% - 24px); padding: 8px 8px 8px 18px; border-radius: 999px;
  background: rgba(5, 14, 38, .9);
  border: 1px solid rgba(233, 194, 96, .45);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg), 0 0 30px -8px rgba(212, 165, 55, .5);
  animation: barIn .6s var(--ease);
}
@keyframes barIn { from { opacity: 0; transform: translate(-50%, 30px); } }
.admin-bar b { color: var(--gold-300); font-size: .88rem; white-space: nowrap; }
.admin-bar__dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; flex: none; }
.admin-bar__hint { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.admin-bar button {
  height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  font: 700 .8rem var(--font-body); color: var(--text);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  transition: background .3s;
}
.admin-bar button:hover { background: rgba(255, 255, 255, .14); }
.admin-bar button[data-act="sair"] { color: #1d1300; background: var(--gold-grad); border: 0; }
body.is-admin .footer { padding-bottom: 90px; }

/* ---------- Camadas: fundo escurecido ---------- */
.layer { position: fixed; inset: 0; z-index: 100; }
.layer__backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 6, 18, .6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .4s var(--ease);
}
.layer.is-open .layer__backdrop { opacity: 1; }
.layer__panel {
  position: absolute; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(170deg, #0d1f4a, var(--navy-900) 45%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .1);
  transition: transform .45s var(--ease), opacity .45s var(--ease);
}

/* gaveta lateral */
.layer--drawer .layer__panel {
  top: 10px; right: 10px; bottom: 10px; width: min(480px, calc(100% - 20px));
  border-radius: 26px; transform: translateX(calc(100% + 20px));
}
.layer--drawer.is-open .layer__panel { transform: none; }
.drawer__head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 22px 16px;
  background: linear-gradient(180deg, #0d1f4a 70%, rgba(13, 31, 74, 0));
}
.drawer__head h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; letter-spacing: .03em; color: var(--white); }
.drawer__body { padding: 4px 22px 24px; }

/* janela central */
.layer--modal .layer__panel, .layer--dialog .layer__panel {
  left: 50%; top: 50%; width: min(560px, calc(100% - 24px)); max-height: calc(100% - 40px);
  border-radius: 28px; transform: translate(-50%, -46%) scale(.96); opacity: 0;
}
.layer--modal.is-open .layer__panel, .layer--dialog.is-open .layer__panel { transform: translate(-50%, -50%); opacity: 1; }
.layer__panel.sm { width: min(420px, calc(100% - 24px)); }
.layer__panel.lg { width: min(820px, calc(100% - 24px)); }
.layer--dialog .layer__panel { width: min(400px, calc(100% - 24px)); padding: 26px; }
.layer--dialog p { margin: 0 0 20px; color: var(--text); font-weight: 600; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; }

.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: var(--text);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  transition: background .3s, color .3s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--gold-grad); color: #1d1300; border-color: transparent; }
.modal__x { position: absolute; z-index: 3; top: 14px; right: 14px; background: rgba(3, 8, 23, .6); }

/* ---------- Formulários ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 14px;
  font: 500 .95rem/1.5 var(--font-body); color: var(--white);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .3);
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.field textarea { resize: vertical; }
.field select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--gold-400) 50%), linear-gradient(135deg, var(--gold-400) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field select option { background: var(--navy-900); color: var(--white); }
.field input::placeholder, .field textarea::placeholder { color: rgba(154, 168, 204, .55); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold-400); background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 4px rgba(233, 194, 96, .15), inset 0 2px 6px rgba(0, 0, 0, .3);
}
.field.is-error input, .field.is-error textarea { border-color: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .15); }
.field-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.hint { margin-top: -8px; font-size: .76rem; color: var(--muted); }
.field .hint { margin-top: 0; }
.muted { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.note { margin: 4px 0 0; font-size: .76rem; color: var(--muted); text-align: center; }

/* envio de foto */
.drop {
  position: relative; display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 16px;
  padding: 12px; border-radius: 18px; cursor: pointer;
  background: rgba(255, 255, 255, .03);
  border: 1.5px dashed rgba(233, 194, 96, .4);
  transition: background .3s, border-color .3s;
}
.drop:hover, .drop.is-over { background: rgba(212, 165, 55, .08); border-color: var(--gold-400); border-style: solid; }
.drop__preview {
  aspect-ratio: 3 / 4.1; border-radius: 12px;
  background: var(--img) center / cover no-repeat, rgba(255, 255, 255, .05);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .6);
}
.drop--noticia { grid-template-columns: 140px 1fr; }
.drop--noticia .drop__preview { aspect-ratio: 16 / 10; }
.drop--destaque { grid-template-columns: 1fr; }
.drop--destaque .drop__preview { aspect-ratio: 16 / 9; }
.drop__preview[data-empty] { background: rgba(255, 255, 255, .05) url("../img/titas-escudo.png") center / 40% auto no-repeat; opacity: .5; }
.drop__text { display: flex; flex-direction: column; gap: 3px; }
.drop__text svg { width: 22px; height: 22px; color: var(--gold-400); margin-bottom: 4px; }
.drop__text b { color: var(--white); font-size: .95rem; }
.drop__text small { color: var(--muted); font-size: .78rem; }
.drop.is-loading { pointer-events: none; }
.drop.is-loading .drop__preview { animation: shimmer 1s infinite; }
@keyframes shimmer { 50% { opacity: .4; } }

/* chave liga/desliga */
.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i {
  position: relative; flex: none; width: 50px; height: 28px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); border: 1px solid var(--line); transition: background .3s;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .35s var(--ease);
}
.switch input:checked + i { background: var(--gold-grad); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(22px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px rgba(233, 194, 96, .25); }
.switch span { display: flex; flex-direction: column; font-weight: 700; color: var(--white); font-size: .92rem; }
.switch small { font-weight: 500; color: var(--muted); font-size: .76rem; }

/* escolha Publicada / Rascunho */
.seg { display: flex; gap: 6px; padding: 5px; margin: 0; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .04); }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.seg label { flex: 1; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px; border-radius: 999px; text-align: center; font-weight: 700; font-size: .88rem; color: var(--muted); transition: all .3s; }
.seg input:checked + span { color: #1d1300; background: var(--gold-grad); box-shadow: var(--glow-gold); }
.seg input:focus-visible + span { outline: 2px solid var(--gold-300); }

.form__actions {
  position: sticky; bottom: -24px; z-index: 2;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 8px -22px -24px; padding: 18px 22px 22px;
  background: linear-gradient(0deg, var(--navy-900) 70%, rgba(5, 14, 38, 0));
}
.spacer { flex: 1; }
.btn--danger { color: #fff; background: linear-gradient(135deg, #f87171, #b91c1c); box-shadow: 0 10px 30px -10px rgba(220, 38, 38, .7); }
.btn--danger-ghost { color: #fca5a5; background: transparent; border: 1px solid rgba(248, 113, 113, .4); }
.btn--danger-ghost:hover { background: rgba(248, 113, 113, .12); }

/* listas dentro das gavetas */
.adm-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.adm-list li {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.adm-list li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-list b { color: var(--white); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-list small { color: var(--muted); font-size: .76rem; }
.thumb { flex: none; width: 64px; aspect-ratio: 16 / 10; border-radius: 10px; background: var(--img) center / cover no-repeat, rgba(255, 255, 255, .06); }
.adm-list--wide .thumb { width: 84px; aspect-ratio: 16 / 9; }
.adm-list--thumbs li { padding-left: 10px; }

/* login do ADM */
.adm-login { display: flex; flex-direction: column; gap: 14px; padding: 34px 28px 26px; }
.adm-login h3 { margin: 4px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 2.2rem; letter-spacing: .03em; color: var(--white); }
.adm-login .muted { margin: 0 0 4px; }
.footer__adm { display: inline !important; padding: 0 !important; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Leitura da notícia ---------- */
.reader__cover { aspect-ratio: 16 / 8; background: var(--img) center / cover no-repeat; border-radius: 28px 28px 0 0; position: relative; }
.reader__cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--navy-900), transparent 60%); }
.reader__body { padding: 0 clamp(22px, 5vw, 48px) 40px; margin-top: -40px; position: relative; }
.reader__body h2 { margin: 14px 0 6px; font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); line-height: 1; color: var(--white); }
.reader__body time { font-size: .82rem; font-weight: 600; color: var(--muted); }
.reader__lead { font-size: 1.12rem; color: var(--white); font-weight: 600; }
.reader__body p { color: rgba(230, 236, 255, .85); font-size: 1.02rem; line-height: 1.75; }

/* ---------- Avisos ---------- */
.toast {
  position: fixed; z-index: 200; left: 50%; top: 18px;
  max-width: calc(100% - 32px); padding: 13px 22px; border-radius: 999px;
  font-weight: 700; font-size: .9rem; color: #1d1300;
  background: var(--gold-grad); box-shadow: var(--glow-gold), var(--shadow);
  transform: translate(-50%, -20px); opacity: 0;
  transition: transform .45s var(--ease), opacity .45s var(--ease);
}
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }
.toast--err { color: #fff; background: linear-gradient(135deg, #f87171, #b91c1c); box-shadow: 0 10px 30px -10px rgba(220, 38, 38, .8); border-radius: 18px; }

@media (max-width: 640px) {
  .admin-bar { gap: 8px; padding-left: 14px; bottom: 12px; }
  .admin-bar__hint { display: none; }
  .admin-bar button { padding: 0 11px; font-size: .74rem; }
  .admin-tools { margin-left: 0; }
  .hero__edit { top: 88px; right: 16px; height: 36px; padding: 0 12px; }
  .field-row { grid-template-columns: 1fr; }
  .drop, .drop--noticia { grid-template-columns: 84px 1fr; }
  .drop--noticia .drop__preview { aspect-ratio: 3 / 4.1; }
  .edit-btn { width: 34px; height: 34px; top: 8px; right: 8px; }
  body.is-admin .player__cat { top: 48px; right: 8px; }
  .layer--drawer .layer__panel { top: 6px; right: 6px; bottom: 6px; width: calc(100% - 12px); border-radius: 22px; }
}
