/* =========================================
   ESTILO GENERAL COMPARTIDO (index + juego)
   ========================================= */
* {
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    margin: 0;
    background: #e9eef5;
    min-height: 100vh;
}
/* --- HEADER --- */
.header {
  background: #08163b;
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
}
/* --- Navbar base --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.menu-btn {
  display: none;
  font-size: 28px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* --- Menú principal --- */
.menu-auth {
  display: flex;
  gap: 20px;
}
.menu {
  display: flex;
  gap: 20px;
  padding: 10px 0;
}

.menu a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

.menu a:hover {
  color: #00c3ff;
}

.container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 100px;
    height: auto;
    background: white;
    border: 4px solid #efefef;
    border-radius: 10px;
}

.logo h1 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.btn {
  display: inline-block;
  background-color: #0a1a44;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #142b70;
}
/* Menú de navegación */
nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: #d1d1d1;
}

/* HUD inferior */
.hud-inferior {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 15px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    animation: fadeIn .35s;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}
/* -----------------------------
   HUD SUPERIOR
------------------------------*/
.hud-superior {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    animation: fadeIn .35s;
}

.jugador-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-foca {
    width: 45px;
    animation: focaBalanceo 1s infinite alternate ease-in-out;
}

.hud-nombre {
    font-size: 1.2rem;
    color: #0a1a44;
    font-weight: bold;
}

/* Btn salir */
.btn-salir {
    padding: 8px 16px;
    background: #c62828;
    color: white;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: .2s;
    font-size: 1rem;
}

.btn-salir:hover {
    background: #8e1e1e;
    transform: scale(1.05);
}

/* Foca contenedor */
#focaContainer {
    position: absolute;
    bottom: 0;
    left: 60px;
}

#focaContainer img {
    width: 90px;
}
/* ===================================================================
   TABLA TOP 10
   =================================================================== */
.score-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 25px;
    margin-bottom: 8px;
    color: #0a1a44;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
}

.score-table th {
    background: #0a1a44;
    color: white;
    padding: 12px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.score-table td {
    padding: 12px;
    border-bottom: 1px solid #e3e6ef;
    font-size: 1rem;
    color: #333;
}

/* Primera columna más angosta */
.score-table td:first-child {
    width: 55px;
    font-weight: bold;
    color: #0a1a44;
}

/* Zebra */
.score-table tr:nth-child(even) {
    background: #f7f9fc;
}

/* Hover */
.score-table tr:hover {
    background: #e6efff;
}

/* -----------------------------------------
   PANTALLA DE INICIO (index.php)
   ----------------------------------------- */
.pantalla-inicio {
    background: #ffffff;
    padding: 40px 30px;
    width: 95%;
    max-width: 420px;
    text-align: center;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    animation: fadeIn .4s ease-out;
    margin: 80px auto 0;
}

.pantalla-inicio h1 {
    font-size: 2rem;
    color: #0a1a44;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pantalla-inicio h1 img {
    width: 55px;
    animation: focaBalanceo 1s infinite alternate ease-in-out;
}

.pantalla-inicio p {
    color: #333;
    margin-bottom: 15px;
}

.nombre-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nombre-form input {
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #bfc7dc;
    font-size: 1rem;
    outline: none;
    transition: .2s;
}

.nombre-form input:focus {
    border-color: #0a1a44;
    box-shadow: 0 0 5px rgba(10,26,68,0.3);
}

.nombre-form button {
    padding: 12px;
    border: none;
    background: #0a1a44;
    color: white;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: .25s;
}

.nombre-form button:hover {
    background: #122b66;
    transform: scale(1.04);
}

/* Animación foca del menú */
@keyframes focaBalanceo {
    from { transform: rotate(-5deg); }
    to   { transform: rotate(5deg); }
}

/* =========================================
   ÁREA DEL JUEGO (juego.php)
   ========================================= */
.game-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;   /* centra horizontal */
    justify-content: center; /* centra vertical */
    padding-bottom: 80px;  /* espacio para que el HUD inferior no tape el juego */
    box-sizing: border-box;
}

#game {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 320px;
    background: #ffffff;
    border-radius: 12px;
    border-bottom: 5px solid #333;
    overflow: hidden;
    margin: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    animation: fadeIn .4s ease-out;
    touch-action: none;
}

/* Foca */
#foca {
    position: absolute;
    bottom: 0;
    left: 60px;
    width: 85px;
    transition: transform .12s ease-out;
}

.crouch {
    transform: scaleY(0.75);
}

/* Sombra debajo */
.sombra {
    position: absolute;
    width: 50px;
    height: 8px;
    left: 10px;
    bottom: -6px;
    background: rgba(0,0,0,0.25);
    filter: blur(2px);
    border-radius: 50%;
}

/* Obstáculos */
.obstaculo {
    position: absolute;
    bottom: 0;
}

.obstaculo img {
    width: 65px;
    user-select: none;
}

/* Hitbox debug */
.hitbox-debug {
    position: absolute;
    border: 2px dashed red;
    width: 100%;
    height: 100%;
}

.hitbox-preview {
    position: absolute;
    border: 2px solid rgba(0,200,255,0.7);
    pointer-events: none;
    z-index: 9999;
}

/* Puntaje */
#scoreBox {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 22px;
    font-weight: bold;
    color: #0a1a44;
    background: rgba(255,255,255,0.7);
    padding: 5px 12px;
    border-radius: 8px;
}

/* GAME OVER */
#gameover {
    position: absolute;
    inset: 0;
    width: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: fadeIn .3s ease-out;
    margin: auto;
}
#gameover.activo {
    display: flex;
}

#gameover h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: #d12a2a;
}

#gameover p {
    font-size: 1.2rem;
}

#gameover form button {
    margin-top: 15px;
    padding: 10px 22px;
    border: none;
    background: #0a1a44;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: .2s;
}

#gameover form button:hover {
    background: #122b66;
    transform: scale(1.05);
}

.oculto {
    display: none;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 998;
}

/* Cuando está activo */
.overlay.active {
    opacity: 1;
    pointer-events: all;
}
/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px);}
    to   { opacity: 1; transform: translateY(0);}
}

/* RESPONSIVE */
@media(max-width: 600px){
    #foca { width: 70px; left: 40px; }
    #game { height: 260px; }
    .obstaculo img { width: 50px; }
    #scoreBox { font-size: 18px; }
    #game {
        height: 220px;
    }
    #focaContainer img {
        width: 60px;
    }

    .obstaculo img {
        width: 45px;
    }

    #scoreBox {
        font-size: 16px;
        padding: 4px 8px;
    }
}

/* ======== RESPONSIVE ======== */
@media (max-width: 768px) {
  .menu-btn {
    display: block;
    position: relative;
    z-index: 1100;
  }

  .menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 250px;
    background: #0a1a44;
    flex-direction: column;
    display: flex;
    align-items: flex-start;
    padding: 80px 20px;
    gap: 25px;
    transition: right 0.4s ease;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    height: 100vh;
  }

  .menu.show {
    right: 0;
  }
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 900;
  }

  .overlay.active {
    opacity: 1;
    pointer-events: all;
    
  }

  .menu a {
    width: 100%;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 10px 0;
  }
  .layout{
    grid-template-columns: 1fr; /* ya lo tienes */
    padding: 10px;
  }

  .calendar-container{
    width: 100%;
    padding: 0;
  }

  .calendar{
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);   
    grid-auto-rows: 40px; 
    row-gap: 10px;
  }
  .calendar-grid div {
    padding: 5px;
    font-size: 0.8rem;
  }

  .menu-auth {
    margin-top: auto;     /* ← AHORA funciona */
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .menu-auth a {
    width: 100%;
    font-size: 1.1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 10px;
  }

}