/* Democracia Please - Estilos principales */
/* Inspirado en Papers Please con estetica retro chilena */

:root {
  --bg-dark: #1a1a2e;
  --bg-medium: #16213e;
  --bg-light: #0f3460;
  --accent-red: #e94560;
  --accent-blue: #0077b6;
  --accent-white: #edf2f4;
  --text-primary: #edf2f4;
  --text-secondary: #8d99ae;
  --success: #2d6a4f;
  --error: #9d0208;
  --warning: #ffb703;
  --vote-valid: #40916c;
  --vote-null: #d62828;
  --vote-blank: #6c757d;
  --vote-marked: #f77f00;
}

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

body {
  font-family: 'VT323', monospace;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

/* Contenedor principal */
#game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Pantallas */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 100%);
}

.screen.active {
  display: flex;
}

/* Pantalla de inicio */
#start-screen {
  text-align: center;
}

.title-container {
  margin-bottom: 40px;
}

.game-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 3rem;
  color: var(--accent-red);
  text-shadow:
    4px 4px 0 var(--bg-dark),
    8px 8px 0 rgba(233, 69, 96, 0.3);
  letter-spacing: 4px;
  line-height: 1.4;
  animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-top: 20px;
}

.servel-badge {
  display: inline-block;
  background: var(--accent-blue);
  color: white;
  padding: 8px 16px;
  margin-top: 15px;
  font-size: 1rem;
  border: 2px solid var(--accent-white);
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.menu-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 1rem;
  padding: 15px 40px;
  background: var(--bg-light);
  color: var(--text-primary);
  border: 3px solid var(--accent-red);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.menu-btn:hover {
  background: var(--accent-red);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

.footer-text {
  position: absolute;
  bottom: 20px;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Instrucciones y creditos */
#instructions-screen,
#credits-screen {
  max-width: 800px;
  margin: 0 auto;
}

.instructions-content,
.credits-content {
  background: var(--bg-medium);
  padding: 30px;
  border: 2px solid var(--accent-blue);
  margin: 20px 0;
  max-height: 60vh;
  overflow-y: auto;
  text-align: left;
  font-size: 1.2rem;
  line-height: 1.6;
}

.instruction-section {
  margin-bottom: 25px;
}

.instruction-section h3 {
  color: var(--accent-red);
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.instruction-section ul,
.instruction-section ol {
  margin-left: 20px;
}

.instruction-section li {
  margin: 8px 0;
}

.vote-valid {
  color: var(--vote-valid);
  font-weight: bold;
}
.vote-null {
  color: var(--vote-null);
  font-weight: bold;
}
.vote-blank {
  color: var(--vote-blank);
  font-weight: bold;
}
.vote-marked {
  color: var(--vote-marked);
  font-weight: bold;
}

.disclaimer {
  color: var(--text-secondary);
  font-style: italic;
}

/* Constitucion de mesa */
#constitution-screen {
  justify-content: flex-start;
  padding-top: 50px;
}

.day-header {
  text-align: center;
  margin-bottom: 30px;
}

.day-label {
  background: var(--accent-blue);
  padding: 8px 20px;
  font-size: 1rem;
}

.day-header h2 {
  margin-top: 15px;
  font-size: 2rem;
  color: var(--accent-red);
}

.constitution-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  width: 100%;
  max-width: 600px;
}

.mesa-info {
  background: var(--bg-medium);
  padding: 20px 40px;
  border: 2px solid var(--accent-white);
  text-align: center;
  font-size: 1.3rem;
}

.mesa-info p {
  margin: 8px 0;
}

.vocales-present {
  width: 100%;
  text-align: center;
}

.vocales-present h3 {
  margin-bottom: 15px;
}

#vocales-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.vocal-badge {
  background: var(--bg-light);
  padding: 10px 15px;
  border: 1px solid var(--text-secondary);
  font-size: 1rem;
}

.cargo-selection {
  text-align: center;
}

.cargo-selection h3 {
  margin-bottom: 10px;
}

.hint {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 15px;
}

.cargo-options {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.cargo-btn {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  padding: 15px 25px;
  background: var(--bg-light);
  color: var(--text-primary);
  border: 2px solid var(--accent-blue);
  cursor: pointer;
  transition: all 0.2s;
}

.cargo-btn:hover {
  background: var(--accent-blue);
  transform: translateY(-3px);
}

/* Pantalla de votacion */
#voting-screen {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: var(--bg-medium);
  border-bottom: 3px solid var(--accent-red);
  width: 100%;
}

.time-display {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.5rem;
  color: var(--accent-red);
}

.time-label {
  font-size: 0.8rem;
  margin-left: 5px;
}

.stats-display {
  display: flex;
  gap: 30px;
}

.stat {
  font-size: 1.2rem;
}

.stat-label {
  color: var(--text-secondary);
}

.mesa-label {
  font-size: 1.2rem;
  background: var(--accent-blue);
  padding: 8px 15px;
}

.game-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Paneles */
.left-panel,
.right-panel {
  width: 280px;
  background: var(--bg-medium);
  border-right: 2px solid var(--bg-light);
  display: flex;
  flex-direction: column;
}

.right-panel {
  border-right: none;
  border-left: 2px solid var(--bg-light);
}

.center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-dark);
}

/* Tabs */
.panel-tabs {
  display: flex;
  border-bottom: 2px solid var(--bg-light);
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: var(--bg-dark);
  color: var(--text-secondary);
  border: none;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--bg-light);
  color: var(--text-primary);
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.tab-content.active {
  display: block;
}

/* Busqueda padron */
.search-box {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
}

.search-box input {
  flex: 1;
  padding: 10px;
  background: var(--bg-dark);
  border: 1px solid var(--text-secondary);
  color: var(--text-primary);
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
}

#search-btn {
  padding: 10px 15px;
  background: var(--accent-blue);
  border: none;
  color: white;
  font-family: 'VT323', monospace;
  cursor: pointer;
}

.padron-list {
  font-size: 1rem;
}

.padron-entry {
  padding: 10px;
  background: var(--bg-dark);
  margin-bottom: 8px;
  border-left: 3px solid var(--accent-blue);
}

.padron-entry.voted {
  border-left-color: var(--vote-valid);
  opacity: 0.7;
}

.padron-entry .entry-name {
  font-weight: bold;
}

.padron-entry .entry-rut {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.padron-entry .entry-status {
  font-size: 0.85rem;
  margin-top: 5px;
}

/* Manual */
.manual-content {
  font-size: 1.1rem;
  line-height: 1.5;
}

.manual-content h4 {
  color: var(--accent-red);
  margin: 15px 0 10px;
}

.manual-content ol,
.manual-content ul {
  margin-left: 20px;
}

.manual-content li {
  margin: 5px 0;
}

/* Notas */
#notes-area {
  width: 100%;
  height: 100%;
  min-height: 200px;
  padding: 10px;
  background: var(--bg-dark);
  border: 1px solid var(--text-secondary);
  color: var(--text-primary);
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  resize: none;
}

/* Area del votante */
#voter-area {
  width: 100%;
  max-width: 500px;
}

.no-voter-msg {
  text-align: center;
  padding: 40px;
  background: var(--bg-medium);
  border: 2px dashed var(--text-secondary);
}

.no-voter-msg p {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.action-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.9rem;
  padding: 15px 30px;
  background: var(--accent-blue);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--accent-red);
  transform: scale(1.05);
}

/* Tarjeta del votante / Cedula */
.voter-card {
  background: var(--bg-medium);
  border: 3px solid var(--accent-white);
  padding: 20px;
}

.voter-card.hidden {
  display: none;
}

.voter-photo {
  text-align: center;
  margin-bottom: 15px;
}

.photo-placeholder {
  width: 120px;
  height: 150px;
  background: var(--bg-light);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border: 2px solid var(--text-secondary);
}

.voter-cedula {
  background: #f5f5dc;
  color: #333;
  border: 2px solid #999;
}

.cedula-header {
  background: linear-gradient(90deg, #0033a0, #d52b1e);
  color: white;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.cedula-body {
  padding: 15px;
}

.cedula-field {
  margin: 10px 0;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
}

.field-value {
  font-size: 1.2rem;
  font-weight: bold;
}

/* Area de decision */
#decision-area {
  margin-top: 20px;
  text-align: center;
}

#decision-area.hidden {
  display: none;
}

.decision-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.decision-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  padding: 20px 40px;
  border: 3px solid;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.decision-btn.approve {
  background: var(--success);
  border-color: #40916c;
  color: white;
}

.decision-btn.reject {
  background: var(--error);
  border-color: #9d0208;
  color: white;
}

.decision-btn:hover {
  transform: scale(1.1);
}

.btn-icon {
  font-size: 1.5rem;
}

#reject-reasons {
  margin-top: 15px;
  padding: 15px;
  background: var(--bg-medium);
}

#reject-reasons.hidden {
  display: none;
}

.reason-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  background: var(--bg-light);
  border: 1px solid var(--error);
  color: var(--text-primary);
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  cursor: pointer;
}

.reason-btn:hover {
  background: var(--error);
}

/* Cola de votantes */
.queue-display,
.session-log {
  padding: 15px;
  flex: 1;
  overflow-y: auto;
}

.queue-display h4,
.session-log h4 {
  color: var(--accent-red);
  margin-bottom: 10px;
  font-size: 1rem;
}

#voter-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  padding: 8px 12px;
  background: var(--bg-dark);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-item .queue-number {
  background: var(--accent-blue);
  padding: 2px 8px;
  font-size: 0.8rem;
}

/* Log de acciones */
#action-log {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.9rem;
}

.log-entry {
  padding: 5px 8px;
  border-left: 3px solid var(--text-secondary);
}

.log-entry.success {
  border-color: var(--success);
}

.log-entry.error {
  border-color: var(--error);
}

.log-entry .log-time {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Pantalla de escrutinio */
#scrutiny-screen {
  padding-top: 30px;
  align-items: flex-start;
}

.scrutiny-workspace {
  display: flex;
  gap: 40px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.ballot-area,
.count-area {
  flex: 1;
  background: var(--bg-medium);
  padding: 20px;
  border: 2px solid var(--bg-light);
}

.ballot-area h3,
.count-area h3 {
  color: var(--accent-red);
  margin-bottom: 20px;
  text-align: center;
}

/* Papeleta de voto */
.ballot {
  background: white;
  color: #333;
  padding: 20px;
  border: 3px solid #333;
  margin-bottom: 20px;
}

.ballot-header {
  text-align: center;
  font-weight: bold;
  font-size: 1rem;
  padding-bottom: 10px;
  border-bottom: 2px solid #333;
  margin-bottom: 15px;
}

.ballot-option {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  margin: 8px 0;
  background: #f9f9f9;
  border: 1px solid #ccc;
}

.option-checkbox {
  width: 30px;
  height: 30px;
  border: 2px solid #333;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.option-checkbox.marked {
  background: #333;
}

.option-checkbox.marked::after {
  content: 'X';
  color: white;
}

.option-checkbox.scribbled {
  background: linear-gradient(45deg, #333 25%, white 25%, white 50%, #333 50%, #333 75%, white 75%);
  background-size: 8px 8px;
}

.option-name {
  font-size: 1.2rem;
}

.ballot.null-ballot {
  border-color: var(--vote-null);
}

.ballot.blank-ballot .option-checkbox {
  background: white;
}

.ballot.marked-ballot {
  position: relative;
}

.ballot.marked-ballot::after {
  content: '★';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 2rem;
  color: var(--vote-marked);
}

/* Botones de clasificacion */
.ballot-classification {
  text-align: center;
}

.ballot-classification p {
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.classification-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.classify-btn {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  padding: 12px 20px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s;
}

.classify-btn.valid {
  background: var(--vote-valid);
  border-color: var(--vote-valid);
  color: white;
}

.classify-btn.null {
  background: var(--vote-null);
  border-color: var(--vote-null);
  color: white;
}

.classify-btn.blank {
  background: var(--vote-blank);
  border-color: var(--vote-blank);
  color: white;
}

.classify-btn.marked {
  background: var(--vote-marked);
  border-color: var(--vote-marked);
  color: white;
}

.classify-btn:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

#valid-candidate-select {
  margin-top: 15px;
  padding: 15px;
  background: var(--bg-dark);
}

#valid-candidate-select.hidden {
  display: none;
}

.candidate-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.candidate-btn {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  padding: 10px 20px;
  background: var(--bg-light);
  border: 1px solid var(--accent-blue);
  color: var(--text-primary);
  cursor: pointer;
}

.candidate-btn:hover {
  background: var(--accent-blue);
}

/* Area de conteo */
.count-stats {
  margin-bottom: 25px;
}

.count-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  margin: 5px 0;
  background: var(--bg-dark);
}

.count-label {
  color: var(--text-secondary);
}

.count-value {
  font-weight: bold;
  font-size: 1.3rem;
}

.count-breakdown h4 {
  color: var(--accent-blue);
  margin-bottom: 15px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  margin: 5px 0;
}

.breakdown-item.null span:last-child {
  color: var(--vote-null);
}
.breakdown-item.blank span:last-child {
  color: var(--vote-blank);
}
.breakdown-item.marked span:last-child {
  color: var(--vote-marked);
}

/* Pantalla de actas */
#acta-screen {
  padding-top: 30px;
}

.acta-workspace {
  display: flex;
  gap: 40px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.acta-form {
  flex: 2;
  background: #f5f5dc;
  color: #333;
  padding: 30px;
  border: 3px solid #333;
}

.acta-header {
  text-align: center;
  border-bottom: 2px solid #333;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.acta-header p {
  margin: 5px 0;
}

.acta-section {
  margin-bottom: 25px;
}

.acta-section h4 {
  color: #0033a0;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.acta-field {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 10px 0;
}

.acta-field label {
  flex: 1;
  font-size: 1rem;
}

.acta-input {
  width: 150px;
  padding: 8px;
  border: 1px solid #333;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  background: white;
}

.acta-actions {
  text-align: center;
  margin-top: 30px;
}

.acta-reference {
  flex: 1;
  background: var(--bg-medium);
  padding: 20px;
  border: 2px solid var(--accent-blue);
}

.acta-reference h4 {
  color: var(--accent-red);
  margin-bottom: 15px;
}

#acta-reference-data {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Pantalla de resultados */
#results-screen {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0a0a0f 100%);
}

.results-container {
  text-align: center;
  max-width: 600px;
}

.results-container h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.5rem;
  color: var(--accent-red);
  margin-bottom: 30px;
}

.final-score {
  background: var(--bg-medium);
  padding: 30px;
  border: 3px solid var(--accent-red);
  margin-bottom: 30px;
}

.score-label {
  display: block;
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.score-value {
  font-family: 'Press Start 2P', cursive;
  font-size: 3rem;
  color: var(--accent-red);
}

.performance-breakdown {
  background: var(--bg-medium);
  padding: 20px;
  margin-bottom: 30px;
  text-align: left;
}

.perf-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-light);
}

.rating {
  margin-bottom: 30px;
}

.rating p {
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.rating-value {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.5rem;
  color: var(--warning);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-medium);
  padding: 40px;
  border: 3px solid var(--accent-red);
  text-align: center;
  max-width: 400px;
}

.modal-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.modal-icon.success {
  color: var(--success);
}
.modal-icon.error {
  color: var(--error);
}

#modal-message {
  font-size: 1.3rem;
  margin-bottom: 25px;
  line-height: 1.5;
}

.modal-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  padding: 15px 30px;
  background: var(--accent-blue);
  color: white;
  border: none;
  cursor: pointer;
}

.modal-btn:hover {
  background: var(--accent-red);
}

/* Utilidades */
.hidden {
  display: none !important;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* ========================================
   MODAL DE EVENTOS DEL SISTEMA
   ======================================== */

.event-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.event-modal.active {
  display: flex;
}

.event-content {
  background: var(--bg-medium);
  padding: 40px;
  border-radius: 8px;
  border: 3px solid var(--accent-red);
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.event-modal-header {
  text-align: center;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--accent-blue);
  padding-bottom: 15px;
}

.event-modal-header h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.5rem;
  color: var(--accent-red);
  margin: 0;
}

.event-modal-body {
  margin-bottom: 30px;
}

.event-modal-body p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-primary);
  text-align: center;
}

.event-modal-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-choice-btn {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  padding: 15px 20px;
  background: var(--bg-light);
  color: var(--text-primary);
  border: 2px solid var(--accent-blue);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.event-choice-btn:hover {
  background: var(--accent-blue);
  color: white;
  transform: translateX(5px);
  border-color: var(--accent-red);
}

.event-choice-btn:active {
  transform: translateX(2px);
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .game-workspace {
    flex-direction: column;
  }

  .left-panel,
  .right-panel {
    width: 100%;
    max-height: 200px;
  }

  .scrutiny-workspace,
  .acta-workspace {
    flex-direction: column;
  }
}

/* Mobile L (425px - 768px) */
@media (max-width: 768px) {
  /* Título principal */
  .game-title {
    font-size: 1.8rem;
    letter-spacing: 2px;
    line-height: 1.3;
  }

  .subtitle {
    font-size: 1.1rem;
  }

  .servel-badge {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  /* Botones principales - Touch optimized (min 44px) */
  .menu-btn {
    font-size: 0.75rem;
    padding: 15px 20px;
    min-height: 44px;
    width: 100%;
    max-width: 280px;
  }

  .action-btn {
    font-size: 0.75rem;
    padding: 14px 24px;
    min-height: 44px;
  }

  /* Header del juego - Stack vertical */
  .game-header {
    flex-direction: column;
    gap: 8px;
    padding: 10px 15px;
  }

  .time-display {
    font-size: 1.2rem;
  }

  .stats-display {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
  }

  .stat {
    font-size: 1rem;
  }

  .mesa-label {
    font-size: 1rem;
    padding: 6px 12px;
  }

  /* Pantallas con scroll */
  .instructions-content,
  .credits-content {
    padding: 20px;
    max-height: 70vh;
    font-size: 1.1rem;
  }

  /* Área de votación - Layout vertical */
  #voter-area {
    max-width: 100%;
    padding: 10px;
  }

  .voter-cedula {
    font-size: 0.9rem;
  }

  .photo-placeholder {
    width: 100px;
    height: 125px;
    font-size: 3rem;
  }

  /* Botones de decisión - Más grandes y verticales */
  .decision-buttons {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .decision-btn {
    font-size: 0.7rem;
    padding: 16px 20px;
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .btn-icon {
    font-size: 1.3rem;
  }

  .reason-btn {
    font-size: 1rem;
    padding: 12px;
    min-height: 44px;
  }

  /* Escrutinio - Layout vertical */
  .scrutiny-workspace {
    flex-direction: column;
    gap: 20px;
    padding: 15px;
  }

  .ballot-area,
  .count-area {
    width: 100%;
  }

  .ballot {
    padding: 15px;
  }

  .classification-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .classify-btn {
    font-size: 1rem;
    padding: 12px 15px;
    min-height: 44px;
  }

  /* Actas - Layout vertical */
  .acta-workspace {
    flex-direction: column;
    padding: 15px;
  }

  .acta-form {
    padding: 20px;
  }

  .acta-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .acta-input {
    width: 100%;
  }

  /* Modales - Ajuste móvil */
  .modal-content {
    padding: 25px;
    max-width: 90%;
    margin: 0 15px;
  }

  .modal-icon {
    font-size: 3rem;
  }

  #modal-message {
    font-size: 1.1rem;
  }

  /* Footer text */
  .footer-text {
    font-size: 0.8rem;
    bottom: 10px;
  }
}

/* Mobile M (375px - 425px) */
@media (max-width: 425px) {
  /* Título aún más pequeño */
  .game-title {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }

  .subtitle {
    font-size: 1rem;
  }

  /* Botones compactos */
  .menu-btn {
    font-size: 0.7rem;
    padding: 13px 16px;
  }

  /* Header minimalista */
  .time-display {
    font-size: 1rem;
  }

  .time-label {
    font-size: 0.7rem;
  }

  .stats-display {
    gap: 10px;
  }

  .stat {
    font-size: 0.9rem;
  }

  .stat-label {
    display: none; /* Ocultar labels, solo números */
  }

  /* Cédula más compacta */
  .cedula-body {
    padding: 10px;
  }

  .field-label {
    font-size: 0.7rem;
  }

  .field-value {
    font-size: 1rem;
  }

  /* Botones de decisión más compactos */
  .decision-btn {
    font-size: 0.65rem;
    padding: 14px 16px;
  }

  /* Clasificación en columna única */
  .classification-buttons {
    grid-template-columns: 1fr;
  }

  /* Modal más compacto */
  .modal-content {
    padding: 20px;
  }

  .modal-btn {
    font-size: 0.7rem;
    padding: 12px 20px;
  }
}

/* Mobile S (320px - 375px) */
@media (max-width: 375px) {
  /* Título super compacto */
  .game-title {
    font-size: 1.3rem;
    letter-spacing: 0.5px;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .servel-badge {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  /* Botones extra compactos */
  .menu-btn {
    font-size: 0.65rem;
    padding: 12px 14px;
  }

  /* Stats super minimalistas */
  .stats-display {
    font-size: 0.85rem;
  }

  /* Panel tabs más pequeños */
  .tab-btn {
    font-size: 0.85rem;
    padding: 10px 8px;
  }

  /* Input search compacto */
  .search-box input {
    font-size: 0.95rem;
    padding: 8px;
  }

  #search-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  /* Photo placeholder más pequeña */
  .photo-placeholder {
    width: 80px;
    height: 100px;
    font-size: 2.5rem;
  }

  /* Botones de decisión compactos */
  .decision-btn {
    font-size: 0.6rem;
    padding: 12px 14px;
  }

  .btn-icon {
    font-size: 1.1rem;
  }

  /* Ballot más compacto */
  .ballot {
    padding: 12px;
  }

  .ballot-header {
    font-size: 0.9rem;
  }

  .option-name {
    font-size: 1rem;
  }

  /* Acta compacta */
  .acta-form {
    padding: 15px;
  }

  .acta-section h4 {
    font-size: 1rem;
  }

  .acta-field label {
    font-size: 0.9rem;
  }

  .acta-input {
    font-size: 1rem;
    padding: 6px;
  }
}

/* Touch optimization - Desactivar hover en móviles */
@media (hover: none) and (pointer: coarse) {
  .menu-btn:hover,
  .action-btn:hover,
  .decision-btn:hover,
  .classify-btn:hover,
  .cargo-btn:hover {
    transform: none;
    box-shadow: none;
  }

  /* Usar :active en lugar de :hover */
  .menu-btn:active,
  .action-btn:active {
    background: var(--accent-red);
    transform: scale(0.98);
  }

  .decision-btn.approve:active {
    filter: brightness(1.2);
    transform: scale(0.98);
  }

  .decision-btn.reject:active {
    filter: brightness(1.2);
    transform: scale(0.98);
  }

  .classify-btn:active {
    filter: brightness(1.2);
    transform: scale(0.98);
  }
}

/* ========================================
   SISTEMA DE NOTIFICACIONES TOAST
   ======================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-medium);
  color: var(--text-primary);
  padding: 15px 25px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-blue);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: all;
  min-width: 200px;
  max-width: 400px;
}

.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left-color: var(--success);
  background: rgba(45, 106, 79, 0.2);
}

.toast-error {
  border-left-color: var(--error);
  background: rgba(157, 2, 8, 0.2);
}

.toast-warning {
  border-left-color: var(--warning);
  background: rgba(255, 183, 3, 0.2);
}

.toast-info {
  border-left-color: var(--accent-blue);
  background: rgba(0, 119, 182, 0.2);
}

/* ========================================
   MEJORAS AL SISTEMA DE CONFIGURACIÓN
   ======================================== */

.setting-item {
  margin-bottom: 20px;
}

.setting-item label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.setting-item label span {
  color: var(--accent-blue);
  font-weight: bold;
  float: right;
}

.setting-item input[type='range'] {
  width: 100%;
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.setting-item input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.setting-item input[type='range']::-webkit-slider-thumb:hover {
  background: var(--accent-red);
  transform: scale(1.2);
}

.setting-item input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.setting-item input[type='range']::-moz-range-thumb:hover {
  background: var(--accent-red);
  transform: scale(1.2);
}

.setting-item.checkbox {
  display: flex;
  align-items: center;
}

.setting-item.checkbox label {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  cursor: pointer;
}

.setting-item.checkbox input[type='checkbox'] {
  margin-right: 10px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* ========================================
   DESACTIVAR ANIMACIONES (ACCESIBILIDAD)
   ======================================== */

body.no-animations * {
  animation: none !important;
  transition: none !important;
}

/* ========================================
   MEJORAS DE UX - BOTONES
   ======================================== */

.menu-btn,
.action-btn,
.small-btn {
  transition: all 0.2s ease;
}

.menu-btn:hover,
.action-btn:hover,
.small-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.menu-btn:active,
.action-btn:active,
.small-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(233, 69, 96, 0.3);
}

/* ========================================
   INDICADOR DE MÚSICA ACTIVA
   ======================================== */

#music-indicator {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 15px;
  border-radius: 20px;
  color: var(--accent-blue);
  font-size: 0.9rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#music-indicator.show {
  opacity: 1;
}

#music-indicator.muted {
  color: var(--error);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

#music-indicator .icon {
  animation: pulse 2s infinite;
}

#music-indicator.muted .icon {
  animation: none;
}

/* ========================================
   SISTEMA DE DIÁLOGOS
   ======================================== */

.dialogue-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
}

.dialogue-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialogue-box {
  background: var(--bg-medium);
  border: 3px solid var(--accent-blue);
  width: 100%;
  max-width: 800px;
  padding: 0;
  box-shadow: 0 -4px 20px rgba(0, 119, 182, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.dialogue-header {
  background: var(--bg-dark);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 2px solid var(--accent-blue);
}

.dialogue-portrait {
  font-size: 3rem;
  line-height: 1;
  animation: portraitPulse 2s ease-in-out infinite;
}

@keyframes portraitPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.dialogue-character-name {
  font-size: 1.5rem;
  color: var(--accent-blue);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.dialogue-text {
  padding: 25px;
  font-size: 1.3rem;
  line-height: 1.6;
  min-height: 120px;
  color: var(--text-primary);
  font-family: 'VT323', monospace;
}

.dialogue-choices {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 2px solid var(--bg-dark);
  background: rgba(0, 0, 0, 0.2);
}

.dialogue-choice-btn {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 2px solid var(--accent-blue);
  padding: 15px 20px;
  font-size: 1.1rem;
  font-family: 'VT323', monospace;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.dialogue-choice-btn::before {
  content: '▶ ';
  opacity: 0;
  position: absolute;
  left: 5px;
  transition: all 0.2s ease;
}

.dialogue-choice-btn:hover {
  background: var(--accent-blue);
  transform: translateX(10px);
  border-color: var(--text-primary);
}

.dialogue-choice-btn:hover::before {
  opacity: 1;
}

.dialogue-choice-btn:active {
  transform: translateX(10px) scale(0.98);
}

/* ========================================
   RESPONSIVE - SISTEMA DE DIÁLOGOS
   ======================================== */

@media (max-width: 768px) {
  .dialogue-box {
    max-width: 100%;
  }

  .dialogue-text {
    font-size: 1.1rem;
    padding: 20px;
    min-height: 100px;
  }

  .dialogue-choice-btn {
    font-size: 1rem;
    padding: 12px 15px;
  }

  .dialogue-portrait {
    font-size: 2.5rem;
  }

  .dialogue-character-name {
    font-size: 1.2rem;
  }
}

/* ========================================
   RESPONSIVE - TOAST NOTIFICATIONS
   ======================================== */

@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    width: 100%;
    max-width: none;
    font-size: 1rem;
    padding: 12px 20px;
  }
}

/* ===== SISTEMA DE CAMPAÑA MULTI-ELECCIÓN ===== */

/* Pantalla de resumen mensual */
#monthly-summary-screen .summary-container {
  max-width: 900px;
  margin: 50px auto;
  padding: 40px;
  background-color: var(--bg-medium);
  border: 3px solid var(--accent-red);
}

#monthly-summary-screen h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 10px;
  color: var(--accent-white);
}

#monthly-summary-screen .summary-subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.finances-panel,
.events-panel,
.campaign-progress {
  background-color: var(--bg-dark);
  border: 2px solid var(--accent-blue);
  padding: 20px;
  margin-bottom: 20px;
}

.finances-panel h3,
.events-panel h3,
.campaign-progress h3 {
  font-size: 1.5rem;
  color: var(--accent-blue);
  margin-bottom: 15px;
  border-bottom: 2px solid var(--accent-blue);
  padding-bottom: 10px;
}

.finance-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 1.2rem;
  border-bottom: 1px dashed var(--text-secondary);
}

.finance-row.total {
  font-size: 1.5rem;
  font-weight: bold;
  border-bottom: 3px solid var(--accent-white);
  padding: 15px 0;
  margin-top: 10px;
}

.finance-row .positive {
  color: var(--success);
}

.finance-row .negative {
  color: var(--error);
}

.finance-row .money-display {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.3rem;
}

.events-list {
  list-style: none;
  padding: 0;
}

.events-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--text-secondary);
  font-size: 1.1rem;
}

.campaign-progress p {
  font-size: 1.2rem;
  padding: 5px 0;
}

.campaign-progress span {
  color: var(--accent-red);
  font-weight: bold;
}

/* Pantalla between elections */
#between-elections-screen .between-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 30px;
}

#between-elections-screen h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 20px;
  color: var(--accent-white);
}

#between-elections-screen .date-display {
  text-align: center;
  font-size: 1.5rem;
  color: var(--accent-blue);
  margin-bottom: 10px;
}

#between-elections-screen .context-text {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.activity-card {
  background-color: var(--bg-medium);
  border: 2px solid var(--accent-blue);
  padding: 20px;
  transition: all 0.3s ease;
}

.activity-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(233, 69, 96, 0.3);
}

.activity-card h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1rem;
  color: var(--accent-white);
  margin-bottom: 15px;
  text-align: center;
}

.activity-card p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
  text-align: center;
}

.activity-effects {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  padding: 10px;
  background-color: var(--bg-dark);
  border: 1px solid var(--text-secondary);
}

.activity-effects span {
  font-size: 1rem;
  padding: 5px;
}

.activity-effects .positive {
  color: var(--success);
}

.activity-effects .negative {
  color: var(--error);
}

.activity-effects .neutral {
  color: var(--text-secondary);
}

.activity-btn {
  width: 100%;
  padding: 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9rem;
  background-color: var(--accent-blue);
  color: var(--text-primary);
  border: 2px solid var(--accent-white);
  cursor: pointer;
  transition: all 0.2s ease;
}

.activity-btn:hover {
  background-color: var(--accent-red);
  transform: scale(1.05);
}

.activity-btn:active {
  transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
  #monthly-summary-screen .summary-container {
    padding: 20px;
    margin: 20px;
  }

  #monthly-summary-screen h2 {
    font-size: 1.5rem;
  }

  .finance-row {
    font-size: 1rem;
  }

  .activities-grid {
    grid-template-columns: 1fr;
  }

  .activity-card h3 {
    font-size: 0.8rem;
  }
}

/* ========================================
   ENDINGS Y ACHIEVEMENTS SYSTEM
   ======================================== */

#ending-screen {
  overflow-y: auto;
  justify-content: flex-start;
  padding: 40px 20px;
}

.ending-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.ending-title {
  text-align: center;
  margin-bottom: 40px;
}

.ending-title h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

#ending-name {
  font-family: 'Press Start 2P', cursive;
  font-size: 2rem;
  color: var(--accent-red);
  text-shadow: 4px 4px 0 rgba(0,0,0,0.5);
  line-height: 1.5;
}

#ending-text {
  margin-top: 30px;
}

.ending-scene {
  margin-bottom: 50px;
  padding: 30px;
  background: rgba(0,0,0,0.3);
  border-left: 5px solid var(--accent-red);
  border-radius: 5px;
}

.scene-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.3rem;
  color: var(--accent-red);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.scene-text {
  font-size: 1.2rem;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.ending-stats,
.ending-unlocks {
  margin-top: 40px;
  padding: 25px;
  background: rgba(0,0,0,0.5);
  border: 3px solid var(--accent-blue);
  border-radius: 5px;
}

.ending-stats h3,
.ending-unlocks h3 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.1rem;
  color: var(--accent-blue);
  margin-bottom: 20px;
  text-align: center;
}

.ending-stats ul,
.ending-unlocks ul {
  list-style: none;
  padding: 0;
}

.ending-stats li,
.ending-unlocks li {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.ending-stats li:last-child,
.ending-unlocks li:last-child {
  border-bottom: none;
}

.ending-actions {
  margin-top: 40px;
  text-align: center;
}

.ending-actions .menu-btn {
  margin: 0 10px;
}

/* Achievements UI */
.achievement-notification {
  pointer-events: none;
}

.achievement-icon {
  animation: iconBounce 0.6s ease-out;
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Secrets UI */
.secret-notification {
  pointer-events: none;
}

/* Animaciones de fade para endings */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes secretPulse {
  0% {
    transform: translateX(-50%) scale(0.8) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: translateX(-50%) scale(1.1) rotate(2deg);
  }
  100% {
    transform: translateX(-50%) scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Responsive para endings */
@media (max-width: 768px) {
  #ending-name {
    font-size: 1.5rem;
  }

  .scene-title {
    font-size: 1rem;
  }

  .scene-text {
    font-size: 1rem;
  }

  .ending-scene {
    padding: 20px;
  }
}

/* ==========================================================================
   UI/UX POLISH - v1.0.0 Final
   Mejoras de tipografía, contraste, accesibilidad y feedback visual
   ========================================================================== */

/* Tipografía mejorada - Jerarquía visual clara */
h1, .game-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.3;
  font-weight: 600;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  line-height: 1.4;
  font-weight: 600;
}

p, .instruction-section li {
  line-height: 1.7;
  letter-spacing: 0.3px;
}

/* Mejoras de contraste WCAG AA */
:root {
  /* Mejora de contraste mínimo 4.5:1 */
  --text-primary-enhanced: #ffffff;
  --text-secondary-enhanced: #a0aec0;
  --bg-dark-enhanced: #0d0d1e;
  --accent-red-enhanced: #ff5577;
  --accent-blue-enhanced: #0099dd;
}

/* Aplicar colores mejorados */
body {
  color: var(--text-primary-enhanced);
}

.text-secondary,
.hint,
.disclaimer,
.footer-text {
  color: var(--text-secondary-enhanced);
}

/* Feedback Visual Mejorado - Estados hover/active/focus */
.menu-btn,
.cargo-btn,
.action-btn,
button:not(:disabled) {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Hover states con elevación */
.menu-btn:hover,
.cargo-btn:hover,
.action-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(233, 69, 96, 0.4),
    0 0 0 2px rgba(233, 69, 96, 0.2);
}

/* Active states (click feedback) */
.menu-btn:active,
.cargo-btn:active,
.action-btn:active {
  transform: translateY(0px) scale(0.98);
  box-shadow:
    0 2px 6px rgba(233, 69, 96, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.1s;
}

/* Focus states para navegación por teclado */
.menu-btn:focus,
.cargo-btn:focus,
.action-btn:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--accent-blue-enhanced);
  outline-offset: 3px;
}

/* Botones disabled */
button:disabled,
.menu-btn:disabled,
.cargo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Efecto ripple en clicks (micro-interaction) */
.menu-btn::after,
.cargo-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.menu-btn:active::after,
.cargo-btn:active::after {
  width: 300px;
  height: 300px;
}

/* Loading states */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 3px solid var(--accent-blue);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile Touch Targets - Mínimo 44px */
@media (max-width: 768px) {
  .menu-btn,
  .cargo-btn,
  .action-btn,
  button {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 24px;
    font-size: 1rem;
  }

  /* Táctil: aumentar área de toque */
  .menu-btn::before,
  .cargo-btn::before,
  .action-btn::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
  }
}

/* Accesibilidad - ARIA labels y screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-red);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --bg-dark: #000000;
    --text-primary: #ffffff;
    --accent-red: #ff0000;
    --accent-blue: #0000ff;
  }

  .menu-btn,
  .cargo-btn {
    border-width: 4px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode opcional (futuro) */
@media (prefers-color-scheme: light) {
  /* Por ahora mantenemos siempre dark mode */
  /* En v1.1 se implementará light mode */
}

/* Focus visible moderno (solo teclado, no mouse) */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--accent-blue-enhanced);
  outline-offset: 3px;
}

/* Mejoras de spacing consistente */
.menu-options {
  gap: clamp(12px, 2vw, 20px);
}

.constitution-content,
.ending-scene {
  gap: clamp(20px, 3vw, 40px);
  padding: clamp(20px, 4vw, 40px);
}

/* Grid system para layouts responsive */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}

/* Mejoras de scroll suave */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Custom scrollbar para mejor UX */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 6px;
  border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue-enhanced);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-blue) var(--bg-dark);
}

/* Tooltips accesibles */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 0.9rem;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  opacity: 1;
}

/* Progress indicators mejorados */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-dark);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-red));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Notificaciones toast mejoradas */
#toast-container {
  z-index: 10000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

/* Animaciones de entrada/salida toast */
@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.entering {
  animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.exiting {
  animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mejoras de print styles */
@media print {
  .menu-btn,
  .cargo-btn,
  .action-btn,
  #news-bar,
  .game-header,
  .footer-text {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .instructions-content,
  .credits-content {
    max-height: none;
    overflow: visible;
  }
}

/* ==========================================================================
   FIN DE UI/UX POLISH v1.0.0
   ========================================================================== */
