/* Reset y configuración base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Contenedor principal */
.container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Folder lateral */
.folder {
  width: 280px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 1000;
}

.folder h2 {
  padding: 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  text-align: center;
  font-size: 1.5rem;
  margin: 0;
}

.options-list {
  flex: 1;
  padding: 20px 0;
  list-style: none;
}

.option-item {
  padding: 15px 30px;
  margin: 5px 20px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 2px solid transparent;
}

.option-item:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: #667eea;
  transform: translateX(5px);
}

/* Footer del folder */
.folder-footer {
  background: rgba(0, 0, 0, 0.05);
  padding: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

.footer-logo p {
  margin: 5px 0;
  font-size: 0.8rem;
  color: #666;
}

.footer-logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 5px;
}

.footer-links h3,
.footer-social h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #333;
}

.footer-links ul {
  list-style: none;
}

.footer-links a {
  color: #667eea;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-social p {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 10px;
}

.social-icons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.social-icons a {
  color: #667eea;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.social-icons a:hover {
  transform: scale(1.2);
}

/* Área de juego */
.game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 100vh;
}

.game-area h1 {
  color: white;
  font-size: 3rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.scoreboard {
  color: white;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.canvas-container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#pongCanvas {
  display: block;
  border-radius: 10px;
  background: #000;
  max-width: 100%;
  height: auto;
}

/* Controles móviles */
.controls {
  display: none;
  justify-content: space-between;
  width: 100%;
  max-width: 700px;
  margin-top: 20px;
  gap: 20px;
}

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-btn {
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.control-btn:hover,
.control-btn:active {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.control-btn:active {
  transform: translateY(0);
}

/* RESPONSIVE DESIGN */

/* Tablets en orientación portrait */
@media screen and (max-width: 1024px) and (orientation: portrait) {
  .container {
    flex-direction: column;
  }
  
  .folder {
    width: 100%;
    height: auto;
    order: 2;
  }
  
  .folder h2 {
    padding: 15px;
    font-size: 1.3rem;
  }
  
  .options-list {
    padding: 15px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .option-item {
    margin: 0;
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .footer-content {
    flex-direction: row;
    justify-content: space-around;
    text-align: center;
  }
  
  .footer-logo img {
    width: 30px;
    height: 30px;
  }
  
  .game-area {
    order: 1;
    padding: 10px;
  }
  
  .game-area h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
  }
  
  .controls {
    display: flex;
  }
}

/* Móviles en orientación portrait */
@media screen and (max-width: 768px) and (orientation: portrait) {
  .game-area h1 {
    font-size: 2rem;
    margin-bottom: 10px;
  }
  
  .scoreboard {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
  
  .canvas-container {
    padding: 5px;
  }
  
  #pongCanvas {
    width: 100%;
    max-width: 350px;
    height: 200px;
  }
  
  .controls {
    margin-top: 15px;
    gap: 15px;
  }
  
  .control-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  
  .folder {
    background: rgba(255, 255, 255, 0.98);
  }
  
  .options-list {
    padding: 10px 0;
  }
  
  .option-item {
    padding: 12px 15px;
    font-size: 0.85rem;
  }
  
  .folder-footer {
    padding: 15px;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .footer-logo p {
    font-size: 0.7rem;
  }
}

/* Móviles pequeños en orientación portrait */
@media screen and (max-width: 480px) and (orientation: portrait) {
  .game-area {
    padding: 5px;
  }
  
  .game-area h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }
  
  .scoreboard {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
  
  #pongCanvas {
    max-width: 300px;
    height: 170px;
  }
  
  .controls {
    margin-top: 10px;
    gap: 10px;
  }
  
  .control-btn {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
  
  .folder h2 {
    padding: 10px;
    font-size: 1.1rem;
  }
  
  .option-item {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
}

/* ORIENTACIÓN LANDSCAPE PARA MÓVILES */
@media screen and (max-height: 500px) and (orientation: landscape) {
  body {
    height: 100vh;
    overflow: hidden;
  }
  
  .container {
    height: 100vh;
    flex-direction: row;
  }
  
  .folder {
    width: 200px;
    font-size: 0.8rem;
  }
  
  .folder h2 {
    padding: 10px;
    font-size: 1rem;
  }
  
  .options-list {
    padding: 10px 0;
  }
  
  .option-item {
    padding: 8px 15px;
    margin: 3px 10px;
    font-size: 0.75rem;
  }
  
  .folder-footer {
    padding: 10px;
    font-size: 0.7rem;
  }
  
  .footer-content {
    gap: 5px;
  }
  
  .footer-logo img {
    width: 25px;
    height: 25px;
  }
  
  .game-area {
    padding: 10px;
    min-height: auto;
    height: 100vh;
    justify-content: center;
  }
  
  .game-area h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }
  
  .scoreboard {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
  
  #pongCanvas {
    max-width: 450px;
    height: 250px;
  }
  
  .controls {
    display: flex;
    margin-top: 10px;
    gap: 15px;
  }
  
  .control-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}

/* Tablets en landscape */
@media screen and (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
  .folder {
    width: 250px;
  }
  
  .game-area h1 {
    font-size: 2.5rem;
  }
  
  #pongCanvas {
    max-width: 600px;
    height: 350px;
  }
  
  .controls {
    display: flex;
  }
}

/* Mejoras para touch devices */
@media (hover: none) and (pointer: coarse) {
  .control-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .option-item {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .option-item:hover {
    transform: none;
  }
  
  .option-item:active {
    background: rgba(102, 126, 234, 0.3);
    transform: scale(0.98);
  }
}

/* Animaciones y transiciones mejoradas */
@media (prefers-reduced-motion: no-preference) {
  .canvas-container {
    animation: glow 2s ease-in-out infinite alternate;
  }
  
  @keyframes glow {
    from {
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    to {
      box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    }
  }
}

/* Modo oscuro automático */
@media (prefers-color-scheme: dark) {
  .folder {
    background: rgba(30, 30, 30, 0.95);
    color: white;
  }
  
  .option-item {
    background: rgba(255, 255, 255, 0.1);
    color: white;
  }
  
  .option-item:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  .folder-footer {
    background: rgba(255, 255, 255, 0.05);
    border-top-color: rgba(255, 255, 255, 0.1);
  }
  
  .footer-links h3,
  .footer-social h3 {
    color: white;
  }
}

/* Pantallas muy grandes */
@media screen and (min-width: 1440px) {
  .container {
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .folder {
    width: 320px;
  }
  
  .game-area h1 {
    font-size: 4rem;
  }
  
  #pongCanvas {
    max-width: 800px;
    height: 450px;
  }
}