/* JUEBLO - PERFIL ESTILO v51 (Modales + Full Width) */

.profile-container-refined { 
    width: 100%; 
    max-width: 600px; 
    margin: 0 auto; 
    padding: 10px 15px 0px; 
}

/* Tarjetas */
.profile-card { 
    background: #ffffff; 
    border-radius: 24px; 
    padding: 35px 25px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.03); 
    border: 1px solid rgba(0,0,0,0.02); 
    margin-bottom: 20px; 
    text-align: center; 
    position: relative;
    overflow: hidden;
}

/* Avatar */
.avatar-edit-box { position: relative; width: 110px; height: 110px; margin: 0 auto 15px; cursor: pointer; }
.avatar-circle { width: 100%; height: 100%; background: #fff; border: 3px solid #f4f9f4; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 8px 20px rgba(45, 90, 39, 0.1); transition: 0.3s; }
.avatar-edit-box:hover .avatar-circle { border-color: #2d5a27; }
.icon-av { font-size: 3.5rem !important; color: #2d5a27; }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.badge-edit { position: absolute; bottom: 5px; right: 5px; background: #2d5a27; color: #fff; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; font-size: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.avatar-option { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid #eee; color: #555; font-size: 1.2rem; cursor: pointer; transition: 0.2s; }
.avatar-option:hover { border-color: #2d5a27; color: #2d5a27; transform: scale(1.1); }

/* Textos Usuario (Adaptación Dinámica FIX) */
.user-handle { 
    font-family: 'Crimson Pro', serif; 
    font-size: clamp(1.2rem, 6vw, 2rem); /* Escala dinámicamente: mínimo 1.2rem, máximo 2rem */
    color: #1a1a1a; 
    margin: 0; 
    font-weight: 800; 
    word-break: break-word; /* Fuerza a romper el nick si no cabe en pantalla */
    overflow-wrap: anywhere; 
    line-height: 1.1;
    text-align: center;
}
.user-mail { font-size: 0.95rem; color: #888; margin: 5px 0 15px; }
.user-since { display: inline-block; background: #fff8e1; color: #f39c12; font-size: 0.8rem; font-weight: 700; padding: 8px 18px; border-radius: 50px; letter-spacing: 0.5px; }

/* Etiquetas y Títulos */
.card-label-refined { font-size: 0.7rem; color: #aaa; font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 20px; display: block; }
.town-shield-pro { width: 90px; height: 90px; object-fit: contain; margin-bottom: 15px; filter: drop-shadow(0 8px 15px rgba(0,0,0,0.08)); }
.town-title-refined { font-family: 'Crimson Pro', serif; font-size: 1.6rem; color: #2d5a27; margin: 0; font-weight: 800; }
.prov-title-refined { font-size: 0.95rem; color: #777; margin: 5px 0 25px; }

/* Grid de Ajustes (Full Width) */
.settings-grid-pro { 
    display: flex; 
    flex-direction: column; 
    gap: 0; 
}

/* Tarjetas de Ajustes */
.setting-item-card { 
    padding: 35px 30px; 
    text-align: center; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-desc-refined { 
    font-size: 0.85rem; 
    color: #888; 
    line-height: 1.5; 
    margin-bottom: 20px; 
    max-width: 90%; 
}

/* Botones */
.btn-minimalist-action { background: #fff; border: 1px solid #e0e0e0; color: #555; padding: 12px 20px; border-radius: 12px; font-size: 0.8rem; font-weight: 800; cursor: pointer; transition: 0.2s; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.03); max-width: 250px; margin: 0 auto; }
.btn-minimalist-action:hover { border-color: #2d5a27; color: #2d5a27; background: #fcfdfc; }

/* Formularios Premium */
.form-compact { background: #fafafa; padding: 15px; border-radius: 15px; margin-top: 15px; border: 1px solid #eee; width: 100%; }
.input-label-pro { font-size: 0.7rem; font-weight: 800; color: #2d5a27; margin-bottom: 6px; display: block; text-align: left; letter-spacing: 0.5px; }
.form-control-pro { width: 100%; padding: 12px 15px; border-radius: 10px; border: 1px solid #ddd; background: #fff; font-size: 0.9rem; color: #333; margin-bottom: 10px; outline: none; transition: 0.3s; text-align: center; }
.form-control-pro:focus { border-color: #2d5a27; box-shadow: 0 0 0 3px rgba(45,90,39,0.1); }
.form-actions-mini { display: flex; gap: 10px; margin-top: 5px; }
.btn-save-mini { flex: 2; background: #2d5a27; color: #fff; border: none; padding: 10px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 0.8rem; }
.btn-cancel-mini { flex: 1; background: #eee; color: #666; border: none; padding: 10px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 0.7rem; }

/* Switch iOS (Ajustado para texto largo) */
.switch-container-refined { 
    display: flex; align-items: center; justify-content: space-between; 
    margin-top: 10px; 
    background: #fcfcfc; border: 1px solid #eee; padding: 12px 20px; border-radius: 15px;
    width: 100%; max-width: 320px; /* Un poco más ancho para 'Desactivado' */
}
.switch-label-status, .switch-label-status-sound { font-size: 0.85rem; font-weight: 700; color: #2d5a27; }
.switch-ios-refined { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch-ios-refined input { opacity: 0; width: 0; height: 0; }
.slider-ios-refined { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider-ios-refined:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider-ios-refined { background-color: #2d5a27; }
input:checked + .slider-ios-refined:before { transform: translateX(18px); }

/* Footer Logout Button */
.footer-logout { text-align: center; margin-top: 20px; margin-bottom: 10px; }
.btn-logout-refined { background: transparent; border: none; color: #bbb; font-size: 0.8rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn-logout-refined:hover { color: #e74c3c; }

/* Sugerencias y Modales */
#jueblo-global-suggestions { position: absolute; z-index: 10000; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border: 1px solid #eee; overflow: hidden; }
.suggest-item { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #f9f9f9; font-size: 0.9rem; text-align: left; }
.suggest-item:hover { background: #f4f9f4; color: #2d5a27; font-weight: 700; }

/* MODALES DEL PERFIL (Igualando estilo juego) */
#modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 99999;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
#modal-body {
    background: #fff; padding: 30px; border-radius: 20px;
    width: 90%; max-width: 400px; text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
}
.btn-modal-jueblo {
    width: 100%; padding: 14px; background: #2d5a27; color: white;
    border: none; border-radius: 50px; font-weight: 800;
    cursor: pointer; font-size: 0.95rem; margin-top: 10px;
}

@media (max-width: 650px) { 
    .profile-card { padding: 30px 20px; }
    .switch-container-refined { max-width: 100%; }
}