@font-face {
  font-family: 'PressStart2P';
  src: url('../assets/fonts/PressStart2P.ttf') format('truetype');
}
@font-face {
  font-family: 'CabinBold';
  src: url('../assets/art/fonts/Cabin-Bold.ttf') format('truetype');
}

:root {
  --crimson: #dc1e2d;
  --ruby: #f83a4b;
  --gold: #f8c028;
  --bg-color: #06070a;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: 'CabinBold', sans-serif;
  color: #ffffff;
}

/* BACKGROUND EXACTO AJR */
#screen-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  background-image: url('../assets/art/bg.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
}

/* TOP HEADER FADE & LOGO */
.es-topbar {
  width: 100%;
  height: 140px;
  background: url('../assets/art/top_fade.png') no-repeat top center;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 40px;
  position: relative;
  border-bottom: 3px solid var(--crimson);
  z-index: 20;
}

.system-header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.system-logo-header {
  height: 75px;
  object-fit: contain;
  image-rendering: pixelated;
}

.system-title-image {
  height: 50px;
  object-fit: contain;
}

.system-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.brand-emblem {
  height: 48px;
  object-fit: contain;
}

.brand-title-text {
  font-family: 'PressStart2P', monospace;
  font-size: 14px;
  color: #8e95a5;
  letter-spacing: 1px;
}

/* VISTA PRINCIPAL: CARRUSEL DE SISTEMAS ESTILO EMULATIONSTATION */
#view-carousel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.carousel-band {
  width: 100%;
  height: 130px;
  background: rgba(6, 7, 10, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  border-top: 1px solid rgba(220, 30, 45, 0.4);
  border-bottom: 1px solid rgba(220, 30, 45, 0.4);
  position: relative;
}

.carousel-item {
  opacity: 0.4;
  transform: scale(0.85);
  transition: all 0.25s ease;
  cursor: pointer;
}

.carousel-item.active {
  opacity: 1;
  transform: scale(1.4);
  filter: drop-shadow(0 0 16px rgba(220, 30, 45, 0.8));
}

.carousel-item img {
  height: 70px;
  object-fit: contain;
}

.system-center-display {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.system-big-title {
  font-family: 'PressStart2P', monospace;
  font-size: 20px;
  color: #ffffff;
}

.system-games-count {
  font-size: 18px;
  color: var(--ruby);
}

/* VISTA DETALLADA: LISTA + DETALLES COMO RETROPIE */
#view-gamelist {
  flex: 1;
  display: none;
  padding: 20px 40px;
  gap: 40px;
  position: relative;
}

.gamelist-column-left {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding-right: 15px;
}

.gamelist-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gamelist-item {
  padding: 12px 18px;
  font-size: 20px;
  color: #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gamelist-item:hover {
  background: rgba(90, 21, 32, 0.6);
  color: #ffffff;
}

.gamelist-item.selected {
  background: #5a1520;
  color: #ffffff;
  border-left: 6px solid var(--crimson);
  box-shadow: 0 0 14px rgba(220, 30, 45, 0.4);
}

/* COLUMNA DERECHA: CARATULA + METADATOS RETROPIE */
.gamelist-column-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.panel-preview {
  width: 100%;
  height: 240px;
  background: rgba(14, 10, 18, 0.85);
  border: 2px solid rgba(220, 30, 45, 0.5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.panel-preview img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  image-rendering: pixelated;
}

.meta-title {
  font-size: 26px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
}

.meta-row {
  display: flex;
  gap: 20px;
}

.meta-label {
  color: var(--ruby);
  width: 160px;
  font-size: 17px;
}

.meta-val {
  color: #e5e7eb;
}

.meta-description {
  font-size: 15px;
  line-height: 1.5;
  color: #aeb4c2;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* BOTON DE INICIAR */
.btn-launch-es {
  margin-top: auto;
  background: var(--crimson);
  border: none;
  color: white;
  padding: 14px;
  font-family: 'PressStart2P', monospace;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 15px rgba(220, 30, 45, 0.6);
  text-align: center;
}

.btn-launch-es:hover {
  background: #ff2d3e;
  transform: translateY(-2px);
}

/* HELP BAR INFERIOR */
.es-footer-help {
  width: 100%;
  height: 60px;
  background: rgba(10, 8, 14, 0.95);
  border-top: 2px solid #2a1e28;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  font-size: 13px;
  color: #8e95a5;
  z-index: 20;
}

.help-actions {
  display: flex;
  gap: 24px;
}

.help-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-badge {
  background: #2a1e28;
  border: 1px solid rgba(220, 30, 45, 0.6);
  padding: 3px 8px;
  border-radius: 3px;
  color: white;
  font-family: 'PressStart2P', monospace;
  font-size: 10px;
}
