/**
 * TETRIS CLÁSICO ESTILO WINDOWS 90s
 * retro-win90.css - Sistema de diseño fiel a Microsoft Windows 95 / Windows 3.1
 * Bordes biselados 3D, barra de títulos degradada, menús contextuales y controles de sistema.
 */

/* ==========================================================================
   VARIABLES Y COLORES CORPORATIVOS RETRO
   ========================================================================== */
:root {
  --win-gray: #c0c0c0;
  --win-light: #ffffff;
  --win-dark: #808080;
  --win-black: #000000;
  --win-title-start: #000080; /* Azul marino clásico activo */
  --win-title-end: #1084d0;
  --win-title-inactive: #808080;
  --win-text: #000000;
  --win-highlight: #000080;
  --win-highlight-text: #ffffff;
  --win-desktop-teal: #008080; /* Verde azulado clásico de escritorio Windows 95 */
  --font-retro: "MS Sans Serif", Tahoma, "Segoe UI", Geneva, sans-serif;
  --font-mono: "Courier New", Courier, monospace;
}

/* ==========================================================================
   BISELES 3D (OUTSET E INSET)
   ========================================================================== */
.win-outset {
  background-color: var(--win-gray);
  border-top: 2px solid var(--win-light);
  border-left: 2px solid var(--win-light);
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  box-shadow: 1px 1px 0px var(--win-black);
}

.win-inset {
  background-color: var(--win-gray);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-light);
  border-bottom: 2px solid var(--win-light);
  box-shadow: inset 1px 1px 0px var(--win-black);
}

.win-inset-deep {
  background-color: #000000;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-light);
  border-bottom: 2px solid var(--win-light);
  box-shadow: inset 2px 2px 0px #000000;
}

/* ==========================================================================
   VENTANA PRINCIPAL DE WINDOWS
   ========================================================================== */
.win-window {
  background-color: var(--win-gray);
  border-top: 2px solid var(--win-light);
  border-left: 2px solid var(--win-light);
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  box-shadow: 2px 2px 0px var(--win-black);
  padding: 3px;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* Barra de título clásica */
.win-titlebar {
  background: linear-gradient(90deg, var(--win-title-start), var(--win-title-end));
  color: #ffffff;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-retro);
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 0.3px;
  height: 24px;
  box-sizing: border-box;
}

.win-title-left {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}

.win-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.win-title-text {
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.4);
}

.win-title-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.win-btn-control {
  width: 16px;
  height: 14px;
  background-color: var(--win-gray);
  border-top: 1px solid var(--win-light);
  border-left: 1px solid var(--win-light);
  border-right: 1px solid var(--win-dark);
  border-bottom: 1px solid var(--win-dark);
  color: var(--win-black);
  font-size: 10px;
  font-family: var(--font-retro);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.win-btn-control:active:not(:disabled) {
  border-top: 1px solid var(--win-dark);
  border-left: 1px solid var(--win-dark);
  border-right: 1px solid var(--win-light);
  border-bottom: 1px solid var(--win-light);
  padding-top: 1px;
  padding-left: 1px;
}

.win-btn-control:disabled {
  color: var(--win-dark);
  text-shadow: 1px 1px 0px var(--win-light);
  cursor: default;
}

/* ==========================================================================
   BARRA DE MENÚS SUPERIOR (Juego, Opciones, Récords, Ayuda)
   ========================================================================== */
.win-menubar {
  display: flex;
  align-items: center;
  background-color: var(--win-gray);
  padding: 2px 2px;
  border-bottom: 1px solid var(--win-dark);
  margin-bottom: 4px;
  font-family: var(--font-retro);
  font-size: 12px;
}

.menu-item {
  position: relative;
}

.menu-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 2px 8px;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  color: var(--win-black);
}

.menu-btn:hover,
.menu-item.active .menu-btn {
  background-color: var(--win-highlight);
  color: var(--win-highlight-text);
}

.menu-btn u {
  text-decoration: underline;
}

/* Desplegable del menú */
.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--win-gray);
  border-top: 2px solid var(--win-light);
  border-left: 2px solid var(--win-light);
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  box-shadow: 2px 2px 0px var(--win-black);
  min-width: 170px;
  z-index: 1000;
  padding: 2px;
}

.menu-item.active .menu-dropdown {
  display: block;
}

.menu-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 12px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  color: var(--win-black);
}

.menu-dropdown-item:hover {
  background-color: var(--win-highlight);
  color: var(--win-highlight-text);
}

.menu-shortcut {
  color: var(--win-dark);
  margin-left: 16px;
  font-size: 11px;
}

.menu-dropdown-item:hover .menu-shortcut {
  color: #d0d0ff;
}

.menu-separator {
  height: 0;
  border-top: 1px solid var(--win-dark);
  border-bottom: 1px solid var(--win-light);
  margin: 3px 2px;
}

/* ==========================================================================
   BOTONES CLÁSICOS DE WINDOWS
   ========================================================================== */
.win-btn {
  background-color: var(--win-gray);
  border-top: 2px solid var(--win-light);
  border-left: 2px solid var(--win-light);
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  box-shadow: 1px 1px 0px var(--win-black);
  padding: 4px 14px;
  font-family: var(--font-retro);
  font-size: 12px;
  font-weight: 500;
  color: var(--win-black);
  cursor: pointer;
  text-align: center;
  outline: none;
}

.win-btn:active {
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-light);
  border-bottom: 2px solid var(--win-light);
  box-shadow: none;
  padding: 5px 13px 3px 15px; /* Efecto de empuje */
}

.win-btn:focus-visible {
  outline: 1px dotted var(--win-black);
  outline-offset: -4px;
}

.win-btn-primary {
  font-weight: bold;
}

/* ==========================================================================
   PANELES Y CAJAS DEL JUEGO (HUD & DISPLAY)
   ========================================================================== */
.group-box {
  border: 2px groove var(--win-light);
  padding: 8px 6px 6px 6px;
  margin-bottom: 8px;
  position: relative;
}

.group-box-title {
  position: absolute;
  top: -8px;
  left: 10px;
  background-color: var(--win-gray);
  padding: 0 4px;
  font-family: var(--font-retro);
  font-size: 11px;
  font-weight: bold;
  color: var(--win-black);
}

/* Pantallas digitales de 7 segmentos / retro LED */
.digital-lcd {
  background-color: #000000;
  color: #00ff00;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 3px 6px;
  text-align: right;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-light);
  border-bottom: 2px solid var(--win-light);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.digital-lcd-small {
  font-size: 14px;
  color: #ffcc00;
  letter-spacing: 1px;
}

/* ==========================================================================
   BARRA DE ESTADO INFERIOR (STATUS BAR)
   ========================================================================== */
.win-statusbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 2px 1px 2px;
  font-family: var(--font-retro);
  font-size: 11px;
  color: var(--win-black);
}

.status-panel {
  padding: 2px 6px;
  border-top: 1px solid var(--win-dark);
  border-left: 1px solid var(--win-dark);
  border-right: 1px solid var(--win-light);
  border-bottom: 1px solid var(--win-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-panel-main {
  flex-grow: 1;
}

.status-panel-indicator {
  min-width: 100px;
  text-align: center;
}

.status-online {
  color: #006600;
  font-weight: bold;
}

/* ==========================================================================
   VENTANAS DE DIÁLOGO MODALES (POP-UPS CLÁSICOS)
   ========================================================================== */
.win-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.win-modal-backdrop.hidden {
  display: none !important;
}

.win-modal-dialog {
  min-width: 320px;
  max-width: 90vw;
  animation: modalPop 0.1s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.97); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.win-modal-body {
  padding: 12px;
  font-family: var(--font-retro);
  font-size: 12px;
}

.win-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Tablas retro para récords */
.win-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-retro);
  font-size: 12px;
  background-color: #ffffff;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-light);
  border-bottom: 2px solid var(--win-light);
}

.win-table th {
  background-color: var(--win-gray);
  border: 1px solid var(--win-dark);
  padding: 3px 6px;
  font-weight: bold;
  text-align: left;
}

.win-table td {
  padding: 3px 6px;
  border: 1px solid #e0e0e0;
}

.win-table tr:nth-child(even) {
  background-color: #f5f5f5;
}

.win-table tr.rank-first {
  background-color: #ffffcc;
  font-weight: bold;
}

.col-rank { width: 30px; text-align: center; }
.col-name { font-weight: bold; }
.col-score { text-align: right; color: #000080; }
.col-lines { text-align: right; }

/* Entradas de texto estilo Windows 95 */
.win-input {
  background-color: #ffffff;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-light);
  border-bottom: 2px solid var(--win-light);
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.win-input:focus {
  outline: 1px dotted var(--win-black);
}

.win-select {
  background-color: #ffffff;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-light);
  border-bottom: 2px solid var(--win-light);
  padding: 3px;
  font-family: var(--font-retro);
  font-size: 12px;
}
