/* ============================================================
   ESTILOS VINTAGE: EXPERIENCIA VALDEAVELLANO (KOMANDO ARBOLILLO)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Bebas+Neue&family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --bg-color: #0f1c12; /* Verde militar muy oscuro */
  --panel-bg: rgba(22, 38, 26, 0.85); /* Panel verde militar semitransparente */
  --border-color: rgba(230, 213, 184, 0.2); /* Pergamino translúcido */
  --color-gold: #c5a059; /* Amarillo dorado retro */
  --color-gold-glow: rgba(197, 160, 89, 0.4);
  --color-green: #2e7d32;
  --color-green-glow: rgba(46, 125, 50, 0.4);
  --color-danger: #a93226; /* Rojo lacrado */
  --text-primary: #e6d5b8; /* Pergamino claro */
  --text-muted: #a39682; /* Pergamino envejecido */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Special Elite', 'Courier New', Courier, monospace;
  background-color: var(--bg-color);
  background-image: 
    linear-gradient(rgba(15,28,18,0.88), rgba(5,10,6,0.98)),
    url('imagenes/cartel-valdeavellano.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* TÍTULOS */
h1, h2, h3, h4 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 2px;
  color: var(--color-gold);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* EFECTO CRISTAL VINTAGE (EXPEDIENTE) */
.glass {
  background: var(--panel-bg);
  border: 2px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(197, 160, 89, 0.05);
  position: relative;
}

/* Sello de lacre o adorno */
.glass::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 20px;
  width: 30px;
  height: 10px;
  background: rgba(197, 160, 89, 0.3);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.text-center { text-align: center; }
.w-100 { width: 100%; }
.uppercase { text-transform: uppercase; }

/* CONTENEDOR DE PANTALLAS */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.screen.active {
  display: flex;
}

/* TARJETA REGISTRO / LOBBY */
.card {
  width: 100%;
  margin: auto;
  padding: 35px 25px;
  border: 2px solid #5a4b36;
}

.logo-placeholder {
  font-size: 4rem;
  margin-bottom: 15px;
  filter: sepia(0.8) hue-rotate(60deg) saturate(0.5);
}

h2 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 10px;
}

p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

/* FORMULARIOS VINTAGE */
.form-group {
  margin: 15px 0;
  text-align: left;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-gold);
  margin-bottom: 6px;
  font-weight: bold;
}

input[type="text"], input[type="number"], select {
  font-family: 'Courier Prime', monospace;
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #5a4b36;
  background: rgba(15, 28, 18, 0.6);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--color-gold);
  background: rgba(15, 28, 18, 0.8);
  box-shadow: 0 0 10px var(--color-gold-glow);
}

/* CONTENEDOR DE MIEMBROS DINÁMICOS */
.members-list {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  max-height: 250px;
  overflow-y: auto;
}

.member-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
  background: rgba(230, 213, 184, 0.03);
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid var(--color-gold);
}

.member-row input {
  padding: 8px;
  font-size: 0.9rem;
}

.btn-remove-member {
  background: var(--color-danger);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BOTONES VINTAGE */
.btn-primary-glow {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 2px;
  background: var(--color-gold);
  color: #122216;
  border: 1px solid #8e6e33;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition: var(--transition);
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.btn-primary-glow:hover {
  background: #ecd19a;
  box-shadow: 0 0 20px rgba(197, 160, 89, 0.6);
  transform: translateY(-1px);
}

.btn-primary-glow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 1px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(230, 213, 184, 0.05);
  border-color: var(--color-gold);
}

.btn-danger {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 1px;
  background: rgba(169, 50, 38, 0.2);
  color: #f2a69d;
  border: 1px solid rgba(169, 50, 38, 0.4);
  padding: 12px;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #fff;
}

/* CHIPS Y ETIQUETAS */
.badge-category {
  display: inline-block;
  padding: 4px 8px;
  background: #3b2c16;
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

/* ERROR MESSAGE */
.error-msg {
  background: rgba(169, 50, 38, 0.15);
  border: 1px solid var(--color-danger);
  color: #f2a69d;
  padding: 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
}

.success-msg {
  background: rgba(46, 125, 50, 0.15);
  border: 1px solid var(--color-green);
  color: #a3e2ab;
  padding: 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
}

/* VIDEOS EMBEBIDOS */
.video-wrapper {
  position: relative;
  padding-bottom: 177.77%; /* Formato vertical 9:16 para Shorts */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  background: #000;
  max-width: 320px;
  margin: 15px auto;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* CUESTIONARIO ANTI-INTRUSOS */
.question-container {
  margin-top: 25px;
  text-align: left;
  border-top: 1px dashed var(--border-color);
  padding-top: 20px;
}

/* PANTALLA JUEGO */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  margin-bottom: 20px;
  border-bottom: 2px solid #5a4b36;
  background: rgba(22, 38, 26, 0.9);
}

.header-team {
  font-weight: bold;
  font-size: 1rem;
  color: var(--color-gold);
}

.neon-timer {
  font-family: 'Courier Prime', monospace;
  font-size: 1.8rem;
  font-weight: bold;
  color: #66bb6a;
  text-shadow: 0 0 8px rgba(102, 187, 106, 0.4);
}

/* BRÚJULA Y DISTANCIA */
.navigation-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.compass-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 15px auto;
  border-radius: 50%;
  background: radial-gradient(circle, #2d382e 0%, #171d18 100%);
  border: 6px solid #4a3e2c;
  box-shadow: 
    0 8px 20px rgba(0,0,0,0.6),
    inset 0 0 15px rgba(0,0,0,0.8);
}

/* Rosa de los vientos */
.compass-rose {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background-image: 
    linear-gradient(0deg, transparent 49%, rgba(197, 160, 89, 0.15) 49%, rgba(197, 160, 89, 0.15) 51%, transparent 51%),
    linear-gradient(90deg, transparent 49%, rgba(197, 160, 89, 0.15) 49%, rgba(197, 160, 89, 0.15) 51%, transparent 51%);
}

.compass-rose::before {
  content: 'N';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--color-gold);
}

.compass-rose::after {
  content: 'S';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--color-gold);
}

/* Aguja */
.compass-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 80%;
  background: transparent;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  transition: transform 0.2s ease-out;
  pointer-events: none;
}

.compass-needle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 70px solid var(--color-danger); /* Apunta al norte en rojo */
}

.compass-needle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 70px solid var(--text-muted); /* Sur en beige */
}

.compass-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: var(--color-gold);
  border-radius: 50%;
  border: 2px solid #171d18;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.distance-display {
  font-size: 2.2rem;
  font-family: 'Bebas Neue', sans-serif;
  color: var(--color-gold);
  margin-top: 10px;
  letter-spacing: 1px;
}

.target-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-style: italic;
}

/* LAYOUT JUEGO SPLIT */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  flex: 1;
  min-height: 400px;
  margin-bottom: 20px;
}

/* CHAT DE EMERGENCIA */
.chat-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.chat-header {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  font-weight: bold;
  font-size: 0.9rem;
  color: var(--color-gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 350px;
}

.msg {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  max-width: 85%;
  line-height: 1.5;
  word-wrap: break-word;
}

.msg.system {
  background: rgba(197, 160, 89, 0.05);
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  align-self: center;
  font-size: 0.8rem;
  text-align: center;
}

.msg.player {
  background: rgba(230, 213, 184, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(230, 213, 184, 0.15);
  align-self: flex-end;
  border-bottom-right-radius: 1px;
}

.msg.hq {
  background: rgba(197, 160, 89, 0.12);
  color: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 1px;
  border-left: 3px solid var(--color-gold);
}

.chat-input-area {
  display: flex;
  padding: 10px;
  border-top: 1px solid var(--border-color);
  gap: 8px;
}

.chat-input-area input {
  font-family: 'Courier Prime', monospace;
}

.chat-input-area button {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 1px;
  font-size: 1.1rem;
}

/* BYPASS OVERRIDE FORM */
.override-container {
  margin-top: 15px;
  padding: 15px;
  background: rgba(169, 50, 38, 0.05);
  border: 1px dashed rgba(169, 50, 38, 0.3);
  border-radius: 6px;
  text-align: center;
}

.override-inputs {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.override-inputs input {
  padding: 8px;
  font-size: 0.9rem;
  text-align: center;
}

/* RESPONSIVIDAD */
@media (max-width: 768px) {
  .game-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .chat-section {
    height: 300px;
  }
}
