/* Panel de administración — Fútbol Arcade */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #07090f;
  --panel: #10141d;
  --panel-2: #0b0e15;
  --border: #232936;
  --text: #e8eaf0;
  --muted: #8a90a0;
  --blue: #3b82f6;
  --green: #35d07f;
  --red: #ef4444;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 340px;
  text-align: center;
}
.login-card h1 { font-size: 22px; }
.login-card p { color: var(--muted); font-size: 13px; }
.login-card input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 15px;
  outline: none;
}
.login-card input:focus { border-color: var(--blue); }
.login-card button {
  background: var(--blue);
  border: none;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 8px;
  padding: 11px;
  cursor: pointer;
}
.error { color: var(--red); font-size: 13px; }

/* layout */
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.brand span { color: var(--muted); font-size: 10px; letter-spacing: 0.3em; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.nav-btn:hover { background: var(--panel-2); color: var(--text); }
.nav-btn.active { background: rgba(59, 130, 246, 0.14); color: var(--text); font-weight: 700; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.sidebar-foot a { color: var(--blue); text-decoration: none; }
#btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}

.content { padding: 28px 32px; max-width: 1100px; }
.content h2 { margin-bottom: 18px; }
.content h3 { margin: 26px 0 10px; font-size: 15px; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; max-width: 640px; }

/* dashboard */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.card .num { font-size: 26px; font-weight: 900; color: var(--blue); }
.card .lbl { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; background: var(--panel); }
tr:last-child td { border-bottom: none; }
.pill { padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.pill.on { background: rgba(53, 208, 127, 0.15); color: var(--green); }
.pill.off { background: rgba(138, 144, 160, 0.15); color: var(--muted); }

/* sponsors */
.zone-title { margin: 26px 0 12px; font-size: 15px; color: var(--muted); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.slot-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.slot-head { display: flex; justify-content: space-between; align-items: center; }
.slot-head b { font-size: 13px; }
.slot-size { color: var(--muted); font-size: 11px; }
.slot-preview {
  height: 90px;
  background: #05070c;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.slot-preview img, .slot-preview video { max-width: 80%; max-height: 76px; object-fit: contain; }
.slot-preview .none { color: #3d4354; font-size: 11px; letter-spacing: 0.1em; }
.slot-card input[type="text"], .slot-card input[type="url"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  width: 100%;
}
.slot-row { display: flex; gap: 8px; align-items: center; }
.slot-row label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.slot-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-sm {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-sm:hover { border-color: var(--blue); }
.btn-sm.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-sm.danger { color: var(--red); }
.slot-saved { color: var(--green); font-size: 12px; font-weight: 700; }
.file-input { display: none; }

/* ajustes */
.settings-grid { display: flex; flex-direction: column; gap: 16px; max-width: 460px; }
.settings-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.settings-grid input[type="number"], .settings-grid input[type="text"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.settings-grid input:focus { border-color: var(--blue); }
.settings-grid .check { flex-direction: row; align-items: center; }
.btn-save {
  background: var(--blue);
  border: none;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
}
.saved { color: var(--green); font-weight: 700; font-size: 13px; }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar nav { flex-direction: row; }
  .sidebar-foot { margin-top: 0; flex-direction: row; }
}

/* ---- vista previa de publicidad en contexto (replica la estética del juego) ---- */
.pv-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 8, 0.82);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.pv-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  width: min(760px, calc(100% - 40px));
  max-height: 90vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pv-head { display: flex; justify-content: space-between; align-items: center; }
.pv-card .hint { margin-bottom: 0; }

.pv-board {
  background: #04050a;
  border: 1px solid #262b38;
  border-radius: 14px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  position: relative;
  overflow: hidden;
}
.pv-tile {
  background: linear-gradient(180deg, #161a24 0%, #0a0c12 100%);
  border: 1px solid #262b38;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 4px 14px rgba(0, 0, 0, 0.5);
}
.pv-banner { width: 400px; height: 120px; max-width: 100%; }
.pv-square { width: 240px; height: 240px; }
.pv-tile img, .pv-tile video {
  max-width: 78%;
  max-height: 64%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.pv-modal {
  background: linear-gradient(180deg, #151926 0%, #0a0c12 100%);
  border: 1px solid #2c3242;
  border-radius: 18px;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(420px, 100%);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.pv-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #1c2230;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: pvspin 0.9s linear infinite;
}
@keyframes pvspin { to { transform: rotate(360deg); } }
.pv-loading-text { color: var(--muted); font-size: 13px; }
.pv-goal-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--blue);
  text-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
}
.pv-strip { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.pv-strip > span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.pv-media {
  width: 100%;
  min-height: 64px;
  max-height: 150px;
  background: #05070c;
  border: 1px solid #262b38;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pv-media img, .pv-media video { max-width: 80%; max-height: 140px; object-fit: contain; }
.pv-none {
  color: #3d4354;
  font-size: 11px;
  letter-spacing: 0.12em;
  border: 1px dashed #2b3040;
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
}

/* escenario del replay: cancha + letterbox */
.pv-field {
  background: radial-gradient(ellipse at center, #35853c 0%, #245c2a 70%, #14371a 100%);
  min-height: 300px;
}
.pv-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 34px;
  background: rgba(2, 3, 6, 0.9);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.pv-bar-top { top: 0; }
.pv-bar-bottom { bottom: 0; }
.pv-right { margin-left: auto; color: rgba(255, 255, 255, 0.65); font-weight: 700; font-size: 11px; }
.pv-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  animation: pvblink 1s steps(1) infinite;
}
@keyframes pvblink { 50% { opacity: 0; } }
.pv-replay-strip {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(5, 7, 12, 0.8);
  border: 1px solid #262b38;
  border-radius: 10px;
  padding: 8px 16px;
}
.pv-replay-strip > span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pv-replay-strip .pv-media {
  min-width: 140px;
  width: auto;
  min-height: 40px;
  max-height: 48px;
  background: transparent;
  border: none;
}
.pv-replay-strip .pv-media img,
.pv-replay-strip .pv-media video { max-height: 44px; max-width: 170px; }
