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

body {
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* --- PLAYER PÚBLICO --- */
#player-container {
  width: 100%;
  max-width: 960px;
  position: relative;
}

video {
  width: 100%;
  display: block;
  background: #000;
}

#message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #888;
  font-size: 1.1rem;
  text-align: center;
  padding: 1rem;
}

#controls {
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#volumeSlider {
  width: 160px;
  accent-color: #e04040;
  cursor: pointer;
}

label[for="volumeSlider"] {
  font-size: 0.85rem;
  color: #888;
}

/* --- ADMIN --- */
.admin-body {
  background: #111;
  align-items: stretch;
  justify-content: flex-start;
}

.login-card {
  width: 100%;
  max-width: 360px;
  margin: auto;
  background: #1a1a1a;
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-card h1 {
  font-size: 1.2rem;
  color: #ccc;
  text-align: center;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: #222;
  border: 1px solid #333;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 1rem;
}

.login-card button, .btn {
  padding: 0.6rem 1.2rem;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.login-card button:hover, .btn:hover { background: #e04040; }
.btn-secondary { background: #333; }
.btn-secondary:hover { background: #444; }
.btn-warning { background: #8a6000; }
.btn-warning:hover { background: #b07d00; }

#login-error {
  color: #e04040;
  font-size: 0.85rem;
  min-height: 1.2em;
  text-align: center;
}

.admin-panel {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
}

.card h2 {
  font-size: 1rem;
  color: #aaa;
  margin-bottom: 1rem;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 0.5rem;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
}

.status-row span { color: #888; }
.status-row strong { color: #e0e0e0; }

.ok { color: #4caf50 !important; }
.err { color: #e04040 !important; }

.warning-banner {
  background: #4a3000;
  border: 1px solid #8a6000;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: #f5c842;
  font-size: 0.9rem;
  display: none;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.url-row {
  display: flex;
  gap: 0.5rem;
}

.url-row input {
  flex: 1;
  padding: 0.55rem 0.8rem;
  background: #222;
  border: 1px solid #333;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 0.9rem;
}

#admin-preview video {
  width: 320px;
  height: 180px;
  background: #000;
}

#log-area {
  font-family: monospace;
  font-size: 0.8rem;
  color: #666;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#log-area .log-line { color: #888; }
#log-area .log-line.err { color: #e04040; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- PANTALLA NAVEGADOR REMOTO --- */
.admin-panel { max-width: 1100px; }

#screenshot-wrap {
  position: relative;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  min-height: 60px;
  border: 1px solid #2a2a2a;
}

#browser-screenshot {
  width: 100%;
  display: none;          /* oculto hasta que cargue la primera imagen */
  cursor: crosshair;
  user-select: none;
  -webkit-user-drag: none;
}

#browser-screenshot.loaded {
  display: block;
}

#screenshot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 1rem;
  color: #aaa;
  font-size: 0.85rem;
  text-align: center;
}

#screenshot-ts {
  font-size: 0.7rem;
  color: #444;
  margin-top: 0.25rem;
  text-align: right;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

/* --- PREVIEW MINIATURA --- */
#preview-wrap {
  position: relative;
  display: inline-block;
}

#preview-wrap.expanded video {
  width: 640px !important;
  height: 360px !important;
}
