/* ==========================================================================
   SRB — SIMULATORS CSS (DISEÑO TÁCTIL PARA DISCAPACIDAD VISUAL)
   Réplica fiel de C:\Users\blanc\Documents\delapizdosboxer
   y C:\Users\blanc\Documents\teclado-calculadora
   SIN LÓGICA DE COLORES — 100% Accesibilidad Táctil, Alto Contraste y Relieve Háptico
   ========================================================================== */

:root {
  --sim-bg: #EAEAEA;
  --sim-chassis-bg: linear-gradient(145deg, #E0E3E8 0%, #C4C9D2 40%, #E8ECF2 100%);
  --sim-chassis-dark: linear-gradient(150deg, #24272D 0%, #17191C 100%);
  --sim-screen-bg: #F4F6F9;
  --sim-screen-border: #94A3B8;
  --sim-screen-text: #0F172A;
  --sim-key-metal: linear-gradient(145deg, #F8FAFC, #D8DFE8);
  --sim-key-dark-metal: linear-gradient(145deg, #33373F, #1F2328);
  --sim-key-border: #64748B;
  --sim-key-active-border: #F59E0B;
  --sim-key-active-glow: 0 0 14px rgba(245, 158, 11, 0.65);
  --sim-radius: 28px;
  --sim-display-font: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --sim-bg: #121316;
  --sim-chassis-bg: linear-gradient(150deg, #2A2E36 0%, #1A1C20 100%);
  --sim-screen-bg: #090B0E;
  --sim-screen-border: #334155;
  --sim-screen-text: #F8FAFC;
  --sim-key-metal: linear-gradient(145deg, #383D47, #22262E);
  --sim-key-border: #475569;
}

body.theme-high-contrast {
  --sim-chassis-bg: #000000 !important;
  --sim-screen-bg: #000000 !important;
  --sim-screen-border: #FFFFFF !important;
  --sim-screen-text: #FFFF00 !important;
  --sim-key-metal: #000000 !important;
  --sim-key-border: #FFFFFF !important;
  --sim-key-active-border: #FFFF00 !important;
  --sim-key-active-glow: 0 0 16px #FFFF00 !important;
}

/* ==========================================================================
   CHASIS UNIVERSAL DEL DISPOSITIVO FÍSICO
   ========================================================================== */
.sim-device {
  max-width: 540px;
  margin: 0 auto;
  background: var(--sim-chassis-bg);
  border-radius: var(--sim-radius);
  padding: 1.5rem;
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.25),
    0 8px 18px rgba(0, 0, 0, 0.12),
    inset 0 2px 2px rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(148, 163, 184, 0.35);
  outline: none;
  transition: all 0.25s ease;
  user-select: none;
}
.sim-device:focus-within {
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(245, 158, 11, 0.4),
    inset 0 2px 2px rgba(255, 255, 255, 0.4);
}
.sim-device-calc {
  max-width: 480px;
  background: var(--sim-chassis-dark);
  border-color: #374151;
}

/* ==========================================================================
   PANTALLA LCD INSET / VISOR TÁCTIL
   ========================================================================== */
.sim-screen {
  background: var(--sim-screen-bg);
  border: 3px solid var(--sim-screen-border);
  border-radius: 14px;
  margin-bottom: 0.85rem;
  overflow: hidden;
  box-shadow:
    inset 2px 3px 8px rgba(0, 0, 0, 0.2),
    inset -1px -1px 2px rgba(255, 255, 255, 0.6);
}

.sim-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid var(--sim-screen-border);
}
.sim-app-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.sim-screen-actions { display: flex; align-items: center; gap: 0.5rem; }
.sim-icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--sim-key-border);
  border-radius: 6px;
  padding: 0.3rem 0.4rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  display: flex;
}
.sim-icon-btn:hover {
  color: var(--text-main);
  border-color: var(--sim-key-active-border);
}

.boxer-text-output {
  font-family: var(--sim-display-font);
  font-size: 1.45rem;
  font-weight: 600;
  min-height: 80px;
  max-height: 130px;
  overflow-y: auto;
  padding: 0.75rem 1rem 0.25rem;
  color: var(--sim-screen-text);
  letter-spacing: 0.03em;
  line-height: 1.4;
  word-break: break-all;
  white-space: pre-wrap;
}

.boxer-cursor-line {
  padding: 0 1rem 0.5rem;
  height: 1.4rem;
}
.boxer-cursor {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: #F59E0B;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.boxer-mode-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.08em;
  background: #334155;
  color: #F8FAFC;
}

/* ==========================================================================
   BUFFER DE PUNTOS TÁCTIL (SIN COLORES)
   ========================================================================== */
.sim-buffer-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding: 0.4rem 0.75rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.sim-buffer-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}
.boxer-buffer-display {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex: 1;
}
.boxer-buf-placeholder {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}
.boxer-dot-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, #475569, #1E293B);
  border: 1.5px solid #94A3B8;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.boxer-preview-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.boxer-preview-label { font-size: 0.85rem; color: var(--text-muted); }
.boxer-char-preview {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  min-width: 24px;
  text-align: center;
}
.boxer-char-preview.ready {
  color: #D97706;
}

/* ==========================================================================
   DELAPIZDOS BOXER — TECLADO ERGONÓMICO DE 6 PUNTOS (Fiel a Flutter)
   6 Teclas Triangulares + Tiras de ENTER + Barras de ESPACIO Centrales
   ========================================================================== */
.delapizdos-hardware-layout {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.75rem 0.25rem;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Columnas de Teclas Triangulares */
.boxer-tri-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  flex: 2;
}

/* Teclas Triangulares Táctiles Ergonómicas (SIN COLORES) */
.boxer-triangle-key {
  position: relative;
  height: 64px;
  background: var(--sim-key-metal);
  border: 2px solid var(--sim-key-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.6);
  transition: all 0.1s ease;
  outline: none;
}
.boxer-triangle-key:hover {
  border-color: #94A3B8;
  transform: translateY(-1px);
}
.boxer-triangle-key:active,
.boxer-triangle-key.active {
  transform: scale(0.95);
  border-color: var(--sim-key-active-border);
  box-shadow: var(--sim-key-active-glow), inset 0 2px 4px rgba(0, 0, 0, 0.4);
  background: linear-gradient(145deg, #1E293B, #0F172A);
  color: #FFFFFF !important;
}

/* Forma triangular ergonómica: Columna izquierda apunta al centro */
.tri-left {
  clip-path: polygon(0% 12%, 85% 50%, 0% 88%);
  padding-right: 18px;
}
/* Columna derecha apunta al centro */
.tri-right {
  clip-path: polygon(100% 12%, 15% 50%, 100% 88%);
  padding-left: 18px;
}

.boxer-key-num {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.boxer-triangle-key:active .boxer-key-num,
.boxer-triangle-key.active .boxer-key-num {
  color: #F8FAFC;
  text-shadow: none;
}

/* Tiras Verticales de ENTER (Con 3 puntos circulares táctiles) */
.boxer-enter-strip {
  flex: 1.1;
  max-width: 52px;
  background: linear-gradient(180deg, #334155, #1E293B);
  border: 2px solid #475569;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  cursor: pointer;
  padding: 6px 0;
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: all 0.12s;
}
.boxer-enter-strip:hover {
  border-color: #94A3B8;
}
.boxer-enter-strip:active,
.boxer-enter-strip.active {
  transform: scale(0.96);
  border-color: var(--sim-key-active-border);
  box-shadow: var(--sim-key-active-glow);
}
.enter-dot-bead {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #CBD5E1, #64748B);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.4);
}
.enter-strip-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94A3B8;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* Barras de Espacio Centrales Elongadas */
.boxer-space-col {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 0.9;
}
.boxer-space-bar {
  width: 22px;
  height: 80%;
  background: linear-gradient(180deg, #1E293B, #0F172A);
  border: 2px solid #475569;
  border-radius: 12px;
  cursor: pointer;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: all 0.12s;
}
.boxer-space-bar:hover { border-color: #94A3B8; }
.boxer-space-bar:active,
.boxer-space-bar.active {
  transform: scale(0.95);
  border-color: var(--sim-key-active-border);
  box-shadow: var(--sim-key-active-glow);
}

/* Fila Inferior de Acciones (Limpiar, Copiar, Sonido, Borrar) */
.boxer-actions-bottom {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.boxer-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.4rem;
  background: var(--sim-key-metal);
  border: 1.5px solid var(--sim-key-border);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.12s;
}
.boxer-action-btn:hover {
  border-color: var(--sim-key-active-border);
}
.boxer-action-btn:active {
  transform: translateY(2px);
}
.boxer-action-btn.active {
  border-color: #F59E0B;
  color: #F59E0B;
}

/* ==========================================================================
   CALCULADORA MG-40 — HARDWARE CIENTÍFICO TÁCTIL (Fiel a Flutter)
   Barra superior de exploración + Pantalla Inset + Botones 1,2,4,5 + Confirmar
   ========================================================================== */
.mg40-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.4rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mg40-tool-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #1F2937;
  border: 1px solid #374151;
  color: #D1D5DB;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.mg40-tool-btn:hover {
  border-color: #F59E0B;
  color: #FFFFFF;
}

.mg40-display {
  background: #090B0E;
  border: 3px solid #334155;
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  box-shadow:
    inset 0 3px 10px rgba(0, 0, 0, 0.6),
    0 1px 1px rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
}
.mg40-display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1E293B;
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
}
.mg40-app-name {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #94A3B8;
}
.mg40-deg-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  background: #1E293B;
  color: #38BDF8;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.mg40-sys-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  background: #3B82F6;
  color: #FFFFFF;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.mg40-expr-line {
  font-family: var(--sim-display-font);
  font-size: 1.15rem;
  color: #94A3B8;
  min-height: 1.8rem;
  text-align: right;
  letter-spacing: 0.05em;
}
.mg40-result-line {
  font-family: var(--sim-display-font);
  font-size: 2.8rem;
  font-weight: 300;
  color: #FFFFFF;
  text-align: right;
  line-height: 1.1;
  min-height: 3.2rem;
  letter-spacing: 0.02em;
}

.mg40-buffer-dots {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  min-height: 22px;
  align-items: center;
}
.mg40-dot-chip {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #F59E0B;
  color: #000000;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cuerpo Táctil Principal Calculadora (1, 2, 4, 5 + Barra Central) */
.mg40-body-tactile {
  display: grid;
  grid-template-columns: 1fr 110px 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.5rem 0;
}
.mg40-side-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mg40-key-tri {
  width: 100%;
  height: 72px;
  background: linear-gradient(145deg, #2D333D, #1A1E24);
  border: 2px solid #3F4756;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  transition: all 0.12s;
}
.mg40-key-tri:hover {
  border-color: #64748B;
}
.mg40-key-tri:active,
.mg40-key-tri.pressed {
  transform: scale(0.94);
  border-color: #F59E0B;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
  background: #0F172A;
}
.mg40-key-tri .key-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: #E2E8F0;
}

/* Barra Vertical Central de CONFIRMAR */
.mg40-center-col {
  display: flex;
  justify-content: center;
  height: 100%;
}
.mg40-confirm-bar-btn {
  width: 100%;
  height: 154px;
  background: linear-gradient(180deg, #2D333D, #161A1F);
  border: 2.5px solid #475569;
  border-radius: 20px;
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: all 0.12s;
}
.mg40-confirm-bar-btn:hover {
  border-color: #F59E0B;
  color: #FFFFFF;
}
.mg40-confirm-bar-btn:active,
.mg40-confirm-bar-btn.pressed {
  transform: scale(0.96);
  border-color: #F59E0B;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
}

/* Fila Inferior Calculadora (C, Barra de Estado Táctil, Borrar) */
.mg40-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.mg40-round-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2D333D, #1A1E24);
  border: 2px solid #3F4756;
  color: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
  transition: all 0.12s;
}
.mg40-round-btn:hover { border-color: #F59E0B; }
.mg40-round-btn:active { transform: scale(0.94); }

.mg40-space-pill-btn {
  flex: 1;
  height: 42px;
  border-radius: 21px;
  background: linear-gradient(180deg, #1E293B, #0F172A);
  border: 2px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.12s;
}
.mg40-space-pill-btn:hover { border-color: #F59E0B; color: #FFFFFF; }
.mg40-space-pill-btn:active { transform: scale(0.98); }

@media (max-width: 480px) {
  .sim-device { padding: 1rem; border-radius: 20px; }
  .boxer-triangle-key { height: 52px; }
  .boxer-key-num { font-size: 1.15rem; }
  .mg40-key-tri { height: 60px; }
  .mg40-confirm-bar-btn { height: 130px; font-size: 0.62rem; }
  .mg40-result-line { font-size: 2.2rem; }
}

/* Guía de Referencia Rápida MG-40 */
.mg40-history-wrap {
  margin-top: 1rem;
  background: #11141B;
  border: 1px solid #28303F;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #CBD5E1;
  font-size: 0.85rem;
}
.mg40-history-wrap summary {
  cursor: pointer;
  font-weight: 700;
  color: #F59E0B;
}
.mg40-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1E293B;
}
.mg40-ref-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mg40-ref-col strong {
  color: #38BDF8;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.mg40-ref-col span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #94A3B8;
  line-height: 1.5;
}
.mg40-ref-col span b {
  color: #F8FAFC;
}
