/* MAIN CSS V3.1 - FIXED AVATAR & FRAMES */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap');

:root { 
    --vortex-primary: #8b5cf6; 
    --vortex-secondary: #00ffcc; 
    --vortex-danger: #ff4d4d; 
    --vortex-gold: #ffd700; 
    --vortex-dark: #121212; 
    --vortex-header-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

#vortex-widget-container { display: flex; justify-content: center; align-items: center; padding: 20px; width: 100%; box-sizing: border-box; font-family: 'Inter', sans-serif; }

/* KÁRTYA TEST */
#vortex-card { 
    width: 100%; max-width: 400px; min-width: 300px; height: 750px; 
    background: #ffffff; border-radius: 24px; box-shadow: 0 15px 50px rgba(0,0,0,0.15); 
    display: flex; flex-direction: column; overflow: hidden; 
    position: relative !important; border: 1px solid #eee; transition: all 0.3s; flex-shrink: 0; 
}
@media (prefers-color-scheme: dark) { #vortex-card { background: #18181b; border-color: #333; } }

/* --- FEJLÉC --- */
#vortex-header { 
    padding: 10px 15px; height: 90px; 
    display: flex; justify-content: space-between; align-items: center; 
    color: white; position: relative; z-index: 50; 
    background: var(--vortex-header-bg); border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* --- AVATAR ALAPOK --- */
.avatar-circle, .player-mini-badge { 
    width: 50px; height: 50px; 
    border-radius: 50%; 
    background: rgba(255,255,255,0.1); 
    border: 2px solid rgba(255,255,255,0.2); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 24px; 
    line-height: 1; 
    overflow: visible !important; 
    position: relative; 
    z-index: 10;
    box-sizing: border-box;
}

.avatar-circle img, .player-mini-badge img { 
    width: 100%; height: 100%; 
    object-fit: cover; 
    border-radius: 50%; 
    display: block;
}

/* --- KERETEK (FRAMES) --- */
/* Fontos: A keret egy pszeudo-elem (::after), ami az avatar köré kerül */

/* 1. ARANY KERET */
.frame-gold { border-color: transparent !important; }
.frame-gold::after { 
    content: ""; 
    position: absolute; 
    top: -6px; left: -6px; right: -6px; bottom: -6px; 
    border-radius: 50%; 
    border: 3px dashed #ffd700; 
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: spin-slow 8s linear infinite; 
    pointer-events: none; 
    z-index: 20; 
}

/* 2. NEON KERET */
.frame-neon { border-color: transparent !important; }
.frame-neon::after { 
    content: ""; 
    position: absolute; 
    top: -5px; left: -5px; right: -5px; bottom: -5px; 
    border-radius: 50%; 
    border: 3px solid #00ffcc; 
    box-shadow: 0 0 15px #00ffcc, inset 0 0 5px #00ffcc; 
    animation: spin-neon 4s linear infinite; 
    pointer-events: none; 
    z-index: 20;
}

/* 3. TŰZ KERET */
.frame-fire { border-color: transparent !important; }
.frame-fire::after { 
    content: ""; 
    position: absolute; 
    top: -4px; left: -4px; right: -4px; bottom: -4px; 
    border-radius: 50%; 
    border: 3px solid #ff4d4d; 
    box-shadow: 0 0 20px #ff4d4d; 
    animation: shake-tiny 0.2s infinite; 
    pointer-events: none; 
    z-index: 20;
}

/* Animációk */
@keyframes spin-slow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes spin-neon { 0% { transform: rotate(0deg); filter: hue-rotate(0deg); } 100% { transform: rotate(360deg); filter: hue-rotate(360deg); } }
@keyframes shake-tiny { 0% { transform: translate(0,0); } 25% { transform: translate(1px,1px); } 75% { transform: translate(-1px,-1px); } }

/* --- TÉMÁK (Háttér override) --- */
.theme-cyber { background: linear-gradient(180deg, #020024 0%, #090979 35%, #00d4ff 100%) !important; border: 2px solid #00d4ff !important; color: white !important; }
.theme-space { background: radial-gradient(circle at center, #1b2735 0%, #090a0f 100%) !important; border: 2px solid #fff !important; color: white !important; }
.theme-lava { background: linear-gradient(135deg, #400000 0%, #800000 50%, #ff4d4d 100%) !important; border: 2px solid #ff4d4d !important; color: white !important; }
.theme-matrix { background: #000 !important; border: 2px solid #00ff00 !important; font-family: 'Courier New', monospace; color: #00ff00 !important; }

/* Téma specifikus elemek */
#vortex-card[class*="theme-"] #vortex-header { background: transparent; }
#vortex-card[class*="theme-"] #vortex-chat-area { background: rgba(0,0,0,0.4) !important; backdrop-filter: blur(5px); }
#vortex-card[class*="theme-"] .player-name { text-shadow: 0 2px 5px rgba(0,0,0,0.8); }

/* --- EGYÉB LAYOUT --- */
.side-block { display: flex; align-items: center; gap: 10px; flex: 1; }
.side-left { justify-content: flex-start; } .side-right { justify-content: flex-end; flex-direction: row-reverse; }
.center-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 80px; z-index: 10; }
.player-name { font-weight: 700; font-size: 13px; text-transform: uppercase; color: #fff; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.stat-pill { font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 6px; display: flex; align-items: center; gap: 4px; }
.stat-pill.fire { color: #ff5e00; background: rgba(0,0,0,0.3); } .stat-pill.coin { color: var(--vortex-gold); background: rgba(0,0,0,0.3); }
#shop-btn { background: var(--vortex-gold); color: #000; padding: 4px 10px; border-radius: 8px; font-size: 10px; font-weight: 900; border: none; z-index: 60; cursor:pointer; }
.vs-badge { font-weight: 900; font-size: 20px; color: rgba(255,255,255,0.2); font-style: italic; }

/* --- JAVÍTÁS: JS ÁLTAL GENERÁLT KERET --- */
.player-avatar-frame {
    width: 50px; 
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    line-height: 1;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    overflow: visible !important; /* Hogy a keret kilógjon */
}

.player-avatar-frame img {
    width: 100%; height: 100%; 
    object-fit: cover; 
    border-radius: 50%; 
    display: block;
}