:root {
    --apple-bg: rgba(255, 255, 255, 0.7);
    --apple-dark: rgba(20, 20, 20, 0.8);
    --accent-color: #0071e3;
    --text-color: #f5f5f7;
    --mc-green: #34c759;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background-color: #000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    color: var(--text-color);
}

/* --- PANTALLA DE BIENVENIDA ÉPICA --- */
#welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
}

#welcome-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.epic-logo {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(180deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.3));
    margin-bottom: 10px;
    transform: scale(0.9);
    animation: logoEntrance 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    text-align: center;
}

.author-tag {
    font-size: 14px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeIn 1s ease 0.8s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes logoEntrance { to { transform: scale(1); opacity: 1; } }

.loader-bar-container {
    width: min(250px, 70%);
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loader-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
    animation: progressLoad 2s ease-in-out forwards;
}

@keyframes progressLoad {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.welcome-subtext {
    margin-top: 15px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.5);
}

/* --- BARRA ESTILO APPLE --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: var(--apple-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.brand span {
    color: rgba(255,255,255,0.4);
    font-weight: 400;
    font-size: 11px;
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-color);
    border-color: transparent;
}

.btn-primary:hover {
    background: #0077ed;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

/* --- CONTENEDOR DEL JUEGO RESPONSIVE --- 🔧 CORREGIDO --- */
#game-container {
    position: absolute;
    top: 48px;                    /* 🔧 Bajamos 48px para dejar espacio al navbar */
    left: 0;
    width: 100%;
    height: calc(100% - 48px);    /* 🔧 Restamos la altura del navbar */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #000;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    image-rendering: pixelated;   /* 🔧 Nitidez para píxeles de Minecraft */
}

/* --- NOTIFICACIÓN DE INSTAGRAM --- */
#contact-toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(15px);
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 200;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    max-width: calc(100vw - 40px);
}

#contact-toast.show {
    transform: translateX(0);
}

.instagram-icon {
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 10px;
    color: white;
    flex-shrink: 0;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--mc-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* Ajustes para móviles */
@media (max-width: 600px) {
    #navbar { padding: 0 10px; }
    .brand span { display: none; }
    .nav-actions { gap: 8px; }
    .btn { padding: 6px 10px; font-size: 11px; }
    #contact-toast { bottom: 15px; right: 15px; padding: 10px 15px; }
}