@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

:root {
    --bg-dark: #050505;
    --glass-surface: rgba(20, 20, 25, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
}

/* --- ESTRUCTURA GENERAL RESPONSIVA --- */
body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(76, 29, 149, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    height: 100vh;
    height: 100dvh; /* Adapta mejor en navegadores móviles modernos */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* --- PANELES DE VIDRIO --- */
.glass-panel {
    background: var(--glass-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 20px;
    margin: 10px;
}

/* --- PANTALLA JUEGO (DASHBOARD) --- */
#game-screen {
    width: 100%;
    height: 100%;
    max-width: 600px; /* En PC no pasa de este ancho */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 0;
}

/* 1. Barra Superior */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    margin: 10px 15px;
    border-radius: 50px; /* Más redondeado tipo cápsula */
}
.profile-chip { font-weight: 600; font-size: 0.9rem; color: #ddd; }

/* 2. Zona Central (Batalla) */
.battle-arena {
    flex-grow: 1; /* Ocupa todo el espacio disponible */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#country-name {
    font-size: 1.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 5px;
    opacity: 0.8;
}

.score-big {
    font-size: 4rem; /* Número GIGANTE */
    font-weight: 800;
    margin: 0;
    line-height: 1;
    background: linear-gradient(to bottom, #fff, #999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* BOTÓN DE CLIC RESPONSIVO */
.click-btn-glass {
    /* En PC tamaño fijo, en Movil usa Porcentaje */
    width: 240px; 
    height: 240px;
    max-width: 70vw; /* En móvil ocupa 70% del ancho */
    max-height: 70vw; /* Mantiene proporción cuadrada */
    
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(40,40,45,1), #000);
    border: 4px solid rgba(255,255,255,0.05);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), inset 0 2px 5px rgba(255,255,255,0.1);
    
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 30px auto;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.05s;
}

.click-btn-glass:active { transform: scale(0.96); }

.click-btn-glass img {
    width: 100%; height: 100%;
    object-fit: cover; border-radius: 50%;
    pointer-events: none;
}

/* 3. Ranking Inferior */
.leaderboard-panel {
    /* Altura dinámica pero con límite */
    min-height: 150px;
    max-height: 30vh; 
    overflow-y: auto;
    margin: 0 15px 15px 15px;
    padding: 0; /* Quitamos padding para que la lista toque los bordes */
}

.leaderboard-header {
    position: sticky; top: 0;
    background: rgba(20,20,25,0.95); /* Encabezado fijo */
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem; letter-spacing: 1px;
    color: #888; text-transform: uppercase;
    z-index: 10;
}

.rank-item {
    display: flex; justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.95rem; color: #ccc;
}
.rank-score { color: #fff; font-weight: 700; }

/* --- LOGIN Y SELECCIÓN --- */
.grid-flags {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columnas en movil */
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}
/* En pantallas muy pequeñas (iPhone SE), baja a 2 columnas */
@media (max-width: 350px) {
    .grid-flags { grid-template-columns: repeat(2, 1fr); }
}

.country-card {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(255,255,255,0.03);
    border-radius: 15px; padding: 15px 5px;
    cursor: pointer; transition: 0.2s;
}
.country-card:hover { background: rgba(255,255,255,0.1); }
.country-card img { width: 50px; margin-bottom: 5px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); }

.main-btn {
    background: linear-gradient(180deg, #222, #111);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 18px 40px; color: white;
    font-weight: 600; border-radius: 50px;
    margin-top: 20px; cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

/* Partículas */
.particle {
    position: absolute; width: 8px; height: 8px;
    border-radius: 50%; pointer-events: none;
    animation: pop 0.6s ease-out forwards; z-index: 100;
}
@keyframes pop {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

.hidden { display: none !important; }
