/* =========================================================
   1. FUENTES LOCALES (assets/fonts)
   ========================================================= */
@font-face {
  font-family: 'GoWFont';
  src: url('assets/fonts/GoW.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'CSFont';
  src: url('assets/fonts/CS.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* =========================================================
   2. VARIABLES Y TEMAS (DARK / AERO GLASS LIGHT)
   ========================================================= */
:root {
  --color-brand-blue: #0088ff;
  --color-brand-cyan: #00d4ff;
  --color-brand-orange: #ff7700;

  /* MODO OSCURO (Obsidian + Glass) */
  --bg-color: #0d1117;
  --sidebar-bg: rgba(22, 27, 34, 0.85);
  --card-bg: rgba(31, 36, 45, 0.65);
  --glass-bg: rgba(22, 27, 34, 0.65);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

  --text-color: #f0f6fc;
  --text-muted: #8b949e;
  --accent-color: #0088ff;
  --border-color: #2b3240;
  --shadow-color: rgba(0, 136, 255, 0.25);
}

body.light-theme {
  /* MODO CLARO (Celeste Sólido Windows 7 Home Basic + Aero Glass) */
  --bg-color: #cbdcf7;                  /* Celeste clásico Win7 */
  --sidebar-bg: rgba(220, 232, 248, 0.85);
  --card-bg: rgba(255, 255, 255, 0.45); /* Cristal translúcido blanco */
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.7); /* Borde de luz Aero */
  --glass-shadow: 0 8px 32px 0 rgba(0, 102, 204, 0.18);

  --text-color: #0f172a;
  --text-muted: #475569;
  --accent-color: #0066cc;               /* Azul Aero */
  --border-color: #a0c0e0;
  --shadow-color: rgba(0, 102, 204, 0.15);
}

/* =========================================================
   3. ESTILOS GENERALES
   ========================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, sans-serif;
  background-color: var(--bg-color) !important;
  color: var(--text-color);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app-window {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: var(--bg-color);
}

/* =========================================================
   4. BANNER GAMING (COMPACTO Y PROPORCIONADO)
   ========================================================= */
.hero-banner {
  width: 100%;
  padding: 0.5rem 1rem;
  position: relative;
  overflow: hidden;

  background: 
    linear-gradient(90deg, rgba(5, 11, 20, 0.85) 0%, rgba(5, 11, 20, 0.4) 50%, rgba(5, 11, 20, 0.85) 100%),
    url('assets/img/humo-azul.jpg') center/cover no-repeat;

  border-bottom: 2px solid var(--color-brand-blue);
  box-shadow: 0 4px 15px var(--shadow-color);
}

.theme-toggle-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--color-brand-blue);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-color);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  transition: all 0.3s ease;
  z-index: 10;
}

.theme-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--color-brand-cyan);
}

.theme-toggle-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.banner-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.brand-logo {
  max-width: 50px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.6));
  flex-shrink: 0;
}

.brand-text-wrapper {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.brand-title {
  font-family: 'GoWFont', serif;
  font-size: 1.4rem;
  color: #ffffff;
  letter-spacing: 1.5px;
  line-height: 1;
  text-shadow: 
    0 0 8px var(--color-brand-cyan),
    0 0 16px var(--color-brand-blue);
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--color-brand-cyan);
  margin-top: 3px;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

/* =========================================================
   5. SIDEBAR (NAVEGACIÓN AERO GLASS)
   ========================================================= */
.sidebar {
  width: 70px;
  background-color: var(--sidebar-bg);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15px;
  gap: 10px;
  z-index: 100;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.nav-item {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  color: var(--text-color);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.nav-item.active {
  background-color: rgba(0, 136, 255, 0.22);
  color: var(--accent-color);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 4px;
  height: 24px;
  background-color: var(--accent-color);
  border-radius: 0 4px 4px 0;
}

.nav-item-bottom {
  margin-top: auto;
  margin-bottom: 15px;
}

.win11-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* =========================================================
   6. CONTENIDO Y TARJETAS (EFECTO AERO GLASS)
   ========================================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.container {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.tab-content {
  display: none;
}

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

/* Tarjetas y módulos con degradado esmerilado Aero Glass */
.card {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(12px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(160%) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  color: var(--text-color);
}

.badge {
  display: inline-block;
  background-color: var(--accent-color);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

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

.hidden {
    display: none !important;
}

.label-sm { font-size: 0.85rem; }

/* =========================================================
   7. BARRA DE NAVEGACIÓN WINDOWS 7 EXPLORER (DIRECCIONES + BOTÓN 3D)
   ========================================================= */
.win7-explorer-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 15px auto;
    padding: 2px 4px;
}

/* Botón Circular Esférico 3D (Atrás Win 7) */
.win7-circle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;

    /* Gradiente esférico azul cristalino con volumen 3D */
    background: radial-gradient(circle at 50% 28%, #66beff 0%, #0066cc 65%, #002266 100%);
    border: 2px solid #001a4d;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.85),
        inset 0 -2px 4px rgba(0, 0, 0, 0.45),
        0 2px 6px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: all 0.2s ease;
}

.win7-circle-btn:hover {
    background: radial-gradient(circle at 50% 28%, #8ad0ff 0%, #1a75ff 65%, #003399 100%);
    box-shadow: 
        inset 0 2px 6px rgba(255, 255, 255, 0.95),
        0 0 12px rgba(0, 136, 255, 0.9);
    transform: scale(1.05);
}

.win7-circle-btn:active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
}

/* Flecha blanca dentro de la esfera */
.win7-circle-btn .arrow {
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    margin-right: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Barra de Dirección (Address Bar) */
.win7-address-bar {
    flex: 1;
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 3px;

    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(235, 243, 255, 0.95) 100%);
    border: 1px solid #7092be;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.6);
    
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 0.85rem;
    color: #1e293b;
    overflow: hidden;
}

/* Variante para Modo Oscuro */
body:not(.light-theme) .win7-address-bar {
    background: linear-gradient(180deg, rgba(30, 40, 55, 0.85) 0%, rgba(15, 22, 32, 0.95) 100%);
    border-color: #3b4858;
    color: #e2e8f0;
}

.address-path {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.address-icon {
    font-size: 14px;
}

.address-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.address-separator {
    opacity: 0.5;
    font-size: 9px;
}

/* =========================================================
   8. MINIJUEGO TA-TE-TI Y CHAT DE SALA
   ========================================================= */
.controls-wrapper {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.select-style {
  padding: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  color: var(--text-color);
  border: 1px solid var(--glass-border);
}

body.light-theme .select-style {
  background: rgba(255, 255, 255, 0.6);
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 270px;
  margin: 15px auto;
}

.cell {
  width: 80px;
  height: 80px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

body.light-theme .cell {
  background-color: rgba(255, 255, 255, 0.5);
}

.cell.x { color: #e74c3c; }
.cell.o { color: #3498db; }

.btn-reset {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 20px;
}

.chat-section {
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  text-align: left;
}

.chat-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--accent-color);
}

.chat-box {
  height: 100px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px;
  margin: 8px 0;
  overflow-y: auto;
  font-size: 0.85rem;
}

body.light-theme .chat-box {
  background: rgba(255, 255, 255, 0.5);
}

.chat-welcome {
  opacity: 0.6;
  font-style: italic;
}

.chat-input-wrapper {
  display: flex;
  gap: 6px;
}

.chat-input {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  color: var(--text-color);
  font-size: 0.85rem;
  outline: none;
}

body.light-theme .chat-input {
  background: rgba(255, 255, 255, 0.6);
}

.btn-send {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.copyright-text {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 20px;
}

/* =========================================================
   9. ADAPTACIÓN MÓVIL (ZÓCALO INFERIOR)
   ========================================================= */
@media (max-width: 768px) {
    .game-frame {
        height: calc(100vh - 120px);
        min-height: 600px;
    }

    .main-content {
      padding-bottom: 80px !important;
    }

    .sidebar {
      position: fixed !important;
      bottom: 0 !important;
      left: 0 !important;
      top: auto !important;
      width: 100% !important;
      height: 60px !important;
      flex-direction: row !important;
      justify-content: space-around !important;
      padding-top: 0 !important;
      border-right: none !important;
      border-top: 1px solid var(--glass-border) !important;
      background-color: var(--sidebar-bg) !important;
      z-index: 1000 !important;
    }

    .nav-item-bottom {
      margin-top: 0 !important;
      margin-bottom: 0 !important;
    }

    .nav-item.active::before {
      left: auto !important;
      bottom: 0 !important;
      top: auto !important;
      width: 24px !important;
      height: 4px !important;
      border-radius: 4px 4px 0 0 !important;
    }
}

/* =========================================================
   10. ESCRITORIO Y CAJÓN DE JUEGOS (GAMES HUB AERO GLASS)
   ========================================================= */
.main-workspace {
  position: relative;
  width: 100%;
}

.game-viewport {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* El Cajón de Juegos cubre la pantalla flotando sobre el celeste Aero */
.app-drawer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 520px;
  background: var(--glass-bg) !important;
  backdrop-filter: blur(14px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(160%) !important;
  padding: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.drawer-title {
  font-size: 1.1rem;
  color: var(--accent-color);
  margin-bottom: 15px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 15px;
  width: 100%;
}

.game-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 15px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.light-theme .game-card {
  background: rgba(255, 255, 255, 0.5);
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color);
  box-shadow: 0 0 12px var(--shadow-color);
}

.game-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.game-frame {
    width: 100%;
    height: 80vh; 
    min-height: 720px;
    border: none;
    border-radius: 8px;
    background: transparent;
}

/* Placeholder Cyan para el Nick */
#player-name::placeholder {
  color: var(--color-brand-cyan);
  opacity: 0.8;
}
